blob: 7bdc0fe15691df26c41722e574817c449bb9f65f [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
Adrian Bunk626f3112008-07-17 17:16:42 +020013#ifdef __KERNEL__
Cornelia Hucka8237fc2006-01-06 00:19:21 -080014
15/* Helper function for sane state of pre-allocated subchannel_id. */
16static inline void
17init_subchannel_id(struct subchannel_id *schid)
18{
19 memset(schid, 0, sizeof(struct subchannel_id));
20 schid->one = 1;
21}
22
23static inline int
24schid_equal(struct subchannel_id *schid1, struct subchannel_id *schid2)
25{
26 return !memcmp(schid1, schid2, sizeof(struct subchannel_id));
27}
28
Adrian Bunk626f3112008-07-17 17:16:42 +020029#endif /* __KERNEL__ */
30
Cornelia Huck9d92a7e2008-07-14 09:59:05 +020031#endif /* ASM_SCHID_H */