scsi_netlink_fc.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. /* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
  2. /*
  3. * FC Transport Netlink Interface
  4. *
  5. * Copyright (C) 2006 James Smart, Emulex Corporation
  6. */
  7. #ifndef SCSI_NETLINK_FC_H
  8. #define SCSI_NETLINK_FC_H
  9. #include <linux/types.h>
  10. #include <scsi/scsi_netlink.h>
  11. /*
  12. * This file intended to be included by both kernel and user space
  13. */
  14. /*
  15. * FC Transport Message Types
  16. */
  17. /* kernel -> user */
  18. #define FC_NL_ASYNC_EVENT 0x0100
  19. /* user -> kernel */
  20. /* none */
  21. /*
  22. * Message Structures :
  23. */
  24. /* macro to round up message lengths to 8byte boundary */
  25. #define FC_NL_MSGALIGN(len) (((len) + 7) & ~7)
  26. /*
  27. * FC Transport Broadcast Event Message :
  28. * FC_NL_ASYNC_EVENT
  29. *
  30. * Note: if Vendor Unique message, event_data_flex will be start of
  31. * vendor unique payload, and the length of the payload is
  32. * per event_datalen
  33. *
  34. * Note: When specifying vendor_id, be sure to read the Vendor Type and ID
  35. * formatting requirements specified in scsi_netlink.h
  36. */
  37. struct fc_nl_event {
  38. struct scsi_nl_hdr snlh; /* must be 1st element ! */
  39. __u64 seconds;
  40. __u64 vendor_id;
  41. __u16 host_no;
  42. __u16 event_datalen;
  43. __u32 event_num;
  44. __u32 event_code;
  45. union {
  46. __u32 event_data;
  47. __DECLARE_FLEX_ARRAY(__u8, event_data_flex);
  48. };
  49. } __attribute__((aligned(sizeof(__u64))));
  50. #endif /* SCSI_NETLINK_FC_H */