scsi_netlink_fc.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. //
  2. // Copyright 2026 Aarav Ravindra Kharade
  3. //
  4. // Licensed under the Apache License, Version 2.0 (the "License");
  5. // you may not use this file except in compliance with the License.
  6. // You may obtain a copy of the License at
  7. //
  8. // http://www.apache.org/licenses/LICENSE-2.0
  9. //
  10. // Unless required by applicable law or agreed to in writing, software
  11. // distributed under the License is distributed on an "AS IS" BASIS,
  12. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. // See the License for the specific language governing permissions and
  14. // limitations under the License.
  15. //
  16. /* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
  17. /*
  18. * FC Transport Netlink Interface
  19. *
  20. * Copyright (C) 2006 James Smart, Emulex Corporation
  21. */
  22. #ifndef SCSI_NETLINK_FC_H
  23. #define SCSI_NETLINK_FC_H
  24. #include <linux/types.h>
  25. #include <scsi/scsi_netlink.h>
  26. /*
  27. * This file intended to be included by both kernel and user space
  28. */
  29. /*
  30. * FC Transport Message Types
  31. */
  32. /* kernel -> user */
  33. #define FC_NL_ASYNC_EVENT 0x0100
  34. /* user -> kernel */
  35. /* none */
  36. /*
  37. * Message Structures :
  38. */
  39. /* macro to round up message lengths to 8byte boundary */
  40. #define FC_NL_MSGALIGN(len) (((len) + 7) & ~7)
  41. /*
  42. * FC Transport Broadcast Event Message :
  43. * FC_NL_ASYNC_EVENT
  44. *
  45. * Note: if Vendor Unique message, event_data_flex will be start of
  46. * vendor unique payload, and the length of the payload is
  47. * per event_datalen
  48. *
  49. * Note: When specifying vendor_id, be sure to read the Vendor Type and ID
  50. * formatting requirements specified in scsi_netlink.h
  51. */
  52. struct fc_nl_event {
  53. struct scsi_nl_hdr snlh; /* must be 1st element ! */
  54. __u64 seconds;
  55. __u64 vendor_id;
  56. __u16 host_no;
  57. __u16 event_datalen;
  58. __u32 event_num;
  59. __u32 event_code;
  60. union {
  61. __u32 event_data;
  62. __DECLARE_FLEX_ARRAY(__u8, event_data_flex);
  63. };
  64. } __attribute__((aligned(sizeof(__u64))));
  65. #endif /* SCSI_NETLINK_FC_H */