scsi_netlink_fc.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. /*
  2. * FC Transport Netlink Interface
  3. *
  4. * Copyright (C) 2006 James Smart, Emulex Corporation
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation; either version 2 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with this program; if not, write to the Free Software
  18. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  19. *
  20. */
  21. #ifndef SCSI_NETLINK_FC_H
  22. #define SCSI_NETLINK_FC_H
  23. #include <scsi/scsi_netlink.h>
  24. /*
  25. * This file intended to be included by both kernel and user space
  26. */
  27. /*
  28. * FC Transport Message Types
  29. */
  30. /* kernel -> user */
  31. #define FC_NL_ASYNC_EVENT 0x0100
  32. /* user -> kernel */
  33. /* none */
  34. /*
  35. * Message Structures :
  36. */
  37. /* macro to round up message lengths to 8byte boundary */
  38. #define FC_NL_MSGALIGN(len) (((len) + 7) & ~7)
  39. /*
  40. * FC Transport Broadcast Event Message :
  41. * FC_NL_ASYNC_EVENT
  42. *
  43. * Note: if Vendor Unique message, &event_data will be start of
  44. * vendor unique payload, and the length of the payload is
  45. * per event_datalen
  46. *
  47. * Note: When specifying vendor_id, be sure to read the Vendor Type and ID
  48. * formatting requirements specified in scsi_netlink.h
  49. */
  50. struct fc_nl_event {
  51. struct scsi_nl_hdr snlh; /* must be 1st element ! */
  52. uint64_t seconds;
  53. uint64_t vendor_id;
  54. uint16_t host_no;
  55. uint16_t event_datalen;
  56. uint32_t event_num;
  57. uint32_t event_code;
  58. uint32_t event_data;
  59. } __attribute__((aligned(sizeof(uint64_t))));
  60. #endif /* SCSI_NETLINK_FC_H */