blob: 5017ffa78e049f17caa116490789f68f9594ff7d [file] [log] [blame]
Cornelia Huck9d92a7e2008-07-14 09:59:05 +02001#ifndef ASM_SCHID_H
2#define ASM_SCHID_H
Cornelia Hucka8237fc2006-01-06 00:19:21 -08003
4struct subchannel_id {
Cornelia Huck9d92a7e2008-07-14 09:59:05 +02005 __u32 cssid : 8;
6 __u32 : 4;
7 __u32 m : 1;
8 __u32 ssid : 2;
9 __u32 one : 1;
10 __u32 sch_no : 16;
11} __attribute__ ((packed, aligned(4)));
Cornelia Hucka8237fc2006-01-06 00:19:21 -080012
13
14/* Helper function for sane state of pre-allocated subchannel_id. */
15static inline void
16init_subchannel_id(struct subchannel_id *schid)
17{
18 memset(schid, 0, sizeof(struct subchannel_id));
19 schid->one = 1;
20}
21
22static inline int
23schid_equal(struct subchannel_id *schid1, struct subchannel_id *schid2)
24{
25 return !memcmp(schid1, schid2, sizeof(struct subchannel_id));
26}
27
Cornelia Huck9d92a7e2008-07-14 09:59:05 +020028#endif /* ASM_SCHID_H */