schid.h 593 B

12345678910111213141516171819202122232425262728
  1. #ifndef ASM_SCHID_H
  2. #define ASM_SCHID_H
  3. struct subchannel_id {
  4. __u32 cssid : 8;
  5. __u32 : 4;
  6. __u32 m : 1;
  7. __u32 ssid : 2;
  8. __u32 one : 1;
  9. __u32 sch_no : 16;
  10. } __attribute__ ((packed, aligned(4)));
  11. /* Helper function for sane state of pre-allocated subchannel_id. */
  12. static inline void
  13. init_subchannel_id(struct subchannel_id *schid)
  14. {
  15. memset(schid, 0, sizeof(struct subchannel_id));
  16. schid->one = 1;
  17. }
  18. static inline int
  19. schid_equal(struct subchannel_id *schid1, struct subchannel_id *schid2)
  20. {
  21. return !memcmp(schid1, schid2, sizeof(struct subchannel_id));
  22. }
  23. #endif /* ASM_SCHID_H */