blob: 825503cf3dc2fa6f97a92b927debf3ed71add376 [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 Huck1378ee92008-08-01 16:39:21 +020014#include <linux/string.h>
Cornelia Hucka8237fc2006-01-06 00:19:21 -080015
16/* Helper function for sane state of pre-allocated subchannel_id. */
17static inline void
18init_subchannel_id(struct subchannel_id *schid)
19{
20 memset(schid, 0, sizeof(struct subchannel_id));
21 schid->one = 1;
22}
23
24static inline int
25schid_equal(struct subchannel_id *schid1, struct subchannel_id *schid2)
26{
27 return !memcmp(schid1, schid2, sizeof(struct subchannel_id));
28}
29
Adrian Bunk626f3112008-07-17 17:16:42 +020030#endif /* __KERNEL__ */
31
Cornelia Huck9d92a7e2008-07-14 09:59:05 +020032#endif /* ASM_SCHID_H */