aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/cio/schid.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/s390/cio/schid.h')
-rw-r--r--drivers/s390/cio/schid.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/drivers/s390/cio/schid.h b/drivers/s390/cio/schid.h
new file mode 100644
index 000000000000..220d97882341
--- /dev/null
+++ b/drivers/s390/cio/schid.h
@@ -0,0 +1,25 @@
1#ifndef S390_SCHID_H
2#define S390_SCHID_H
3
4struct subchannel_id {
5 __u32 reserved:15;
6 __u32 one:1;
7 __u32 sch_no:16;
8} __attribute__ ((packed,aligned(4)));
9
10
11/* Helper function for sane state of pre-allocated subchannel_id. */
12static inline void
13init_subchannel_id(struct subchannel_id *schid)
14{
15 memset(schid, 0, sizeof(struct subchannel_id));
16 schid->one = 1;
17}
18
19static inline int
20schid_equal(struct subchannel_id *schid1, struct subchannel_id *schid2)
21{
22 return !memcmp(schid1, schid2, sizeof(struct subchannel_id));
23}
24
25#endif /* S390_SCHID_H */