Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 1 | /**************************************************************************** |
| 2 | **************************************************************************** |
| 3 | *** |
| 4 | *** This header was automatically generated from a Linux kernel header |
| 5 | *** of the same name, to make information necessary for userspace to |
| 6 | *** call into the kernel available to libc. It contains only constants, |
| 7 | *** structures, and macros generated from the original header, and thus, |
| 8 | *** contains no copyrightable information. |
| 9 | *** |
| 10 | *** To edit the content of this header, modify the corresponding |
| 11 | *** source file (e.g. under external/kernel-headers/original/) then |
| 12 | *** run bionic/libc/kernel/tools/update_all.py |
| 13 | *** |
| 14 | *** Any manual change here will be lost the next time this script will |
| 15 | *** be run. You've been warned! |
| 16 | *** |
| 17 | **************************************************************************** |
| 18 | ****************************************************************************/ |
| 19 | #ifndef SCSI_BSG_FC_H |
| 20 | #define SCSI_BSG_FC_H |
Christopher Ferris | 9584fa4 | 2019-12-09 15:36:13 -0800 | [diff] [blame] | 21 | #include <linux/types.h> |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 22 | #define FC_DEFAULT_BSG_TIMEOUT (10 * HZ) |
| 23 | #define FC_BSG_CLS_MASK 0xF0000000 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 24 | #define FC_BSG_HST_MASK 0x80000000 |
| 25 | #define FC_BSG_RPT_MASK 0x40000000 |
| 26 | #define FC_BSG_HST_ADD_RPORT (FC_BSG_HST_MASK | 0x00000001) |
| 27 | #define FC_BSG_HST_DEL_RPORT (FC_BSG_HST_MASK | 0x00000002) |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 28 | #define FC_BSG_HST_ELS_NOLOGIN (FC_BSG_HST_MASK | 0x00000003) |
| 29 | #define FC_BSG_HST_CT (FC_BSG_HST_MASK | 0x00000004) |
| 30 | #define FC_BSG_HST_VENDOR (FC_BSG_HST_MASK | 0x000000FF) |
| 31 | #define FC_BSG_RPT_ELS (FC_BSG_RPT_MASK | 0x00000001) |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 32 | #define FC_BSG_RPT_CT (FC_BSG_RPT_MASK | 0x00000002) |
| 33 | struct fc_bsg_host_add_rport { |
Christopher Ferris | 9584fa4 | 2019-12-09 15:36:13 -0800 | [diff] [blame] | 34 | __u8 reserved; |
| 35 | __u8 port_id[3]; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 36 | }; |
| 37 | struct fc_bsg_host_del_rport { |
Christopher Ferris | 9584fa4 | 2019-12-09 15:36:13 -0800 | [diff] [blame] | 38 | __u8 reserved; |
| 39 | __u8 port_id[3]; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 40 | }; |
| 41 | struct fc_bsg_host_els { |
Christopher Ferris | 9584fa4 | 2019-12-09 15:36:13 -0800 | [diff] [blame] | 42 | __u8 command_code; |
| 43 | __u8 port_id[3]; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 44 | }; |
| 45 | #define FC_CTELS_STATUS_OK 0x00000000 |
| 46 | #define FC_CTELS_STATUS_REJECT 0x00000001 |
| 47 | #define FC_CTELS_STATUS_P_RJT 0x00000002 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 48 | #define FC_CTELS_STATUS_F_RJT 0x00000003 |
| 49 | #define FC_CTELS_STATUS_P_BSY 0x00000004 |
| 50 | #define FC_CTELS_STATUS_F_BSY 0x00000006 |
| 51 | struct fc_bsg_ctels_reply { |
Christopher Ferris | 9584fa4 | 2019-12-09 15:36:13 -0800 | [diff] [blame] | 52 | __u32 status; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 53 | struct { |
Christopher Ferris | 9584fa4 | 2019-12-09 15:36:13 -0800 | [diff] [blame] | 54 | __u8 action; |
| 55 | __u8 reason_code; |
| 56 | __u8 reason_explanation; |
| 57 | __u8 vendor_unique; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 58 | } rjt_data; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 59 | }; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 60 | struct fc_bsg_host_ct { |
Christopher Ferris | 9584fa4 | 2019-12-09 15:36:13 -0800 | [diff] [blame] | 61 | __u8 reserved; |
| 62 | __u8 port_id[3]; |
| 63 | __u32 preamble_word0; |
| 64 | __u32 preamble_word1; |
| 65 | __u32 preamble_word2; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 66 | }; |
| 67 | struct fc_bsg_host_vendor { |
Christopher Ferris | 9584fa4 | 2019-12-09 15:36:13 -0800 | [diff] [blame] | 68 | __u64 vendor_id; |
Christopher Ferris | 7447a1c | 2022-10-04 18:24:44 -0700 | [diff] [blame] | 69 | __u32 vendor_cmd[]; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 70 | }; |
| 71 | struct fc_bsg_host_vendor_reply { |
Christopher Ferris | b7cef6d | 2023-05-09 19:04:15 +0000 | [diff] [blame^] | 72 | __DECLARE_FLEX_ARRAY(__u32, vendor_rsp); |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 73 | }; |
| 74 | struct fc_bsg_rport_els { |
Christopher Ferris | 9584fa4 | 2019-12-09 15:36:13 -0800 | [diff] [blame] | 75 | __u8 els_code; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 76 | }; |
| 77 | struct fc_bsg_rport_ct { |
Christopher Ferris | 9584fa4 | 2019-12-09 15:36:13 -0800 | [diff] [blame] | 78 | __u32 preamble_word0; |
| 79 | __u32 preamble_word1; |
| 80 | __u32 preamble_word2; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 81 | }; |
| 82 | struct fc_bsg_request { |
Christopher Ferris | 9584fa4 | 2019-12-09 15:36:13 -0800 | [diff] [blame] | 83 | __u32 msgcode; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 84 | union { |
| 85 | struct fc_bsg_host_add_rport h_addrport; |
| 86 | struct fc_bsg_host_del_rport h_delrport; |
| 87 | struct fc_bsg_host_els h_els; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 88 | struct fc_bsg_host_ct h_ct; |
| 89 | struct fc_bsg_host_vendor h_vendor; |
| 90 | struct fc_bsg_rport_els r_els; |
| 91 | struct fc_bsg_rport_ct r_ct; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 92 | } rqst_data; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 93 | } __attribute__((packed)); |
| 94 | struct fc_bsg_reply { |
Christopher Ferris | 9584fa4 | 2019-12-09 15:36:13 -0800 | [diff] [blame] | 95 | __u32 result; |
| 96 | __u32 reply_payload_rcv_len; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 97 | union { |
| 98 | struct fc_bsg_host_vendor_reply vendor_reply; |
| 99 | struct fc_bsg_ctels_reply ctels_reply; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 100 | } reply_data; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 101 | }; |
| 102 | #endif |