Elliott Hughes | 180edef | 2023-11-02 00:08:05 +0000 | [diff] [blame] | 1 | /* |
| 2 | * This file is auto-generated. Modifications will be lost. |
| 3 | * |
| 4 | * See https://android.googlesource.com/platform/bionic/+/master/libc/kernel/ |
| 5 | * for more information. |
| 6 | */ |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 7 | #ifndef SCSI_BSG_FC_H |
| 8 | #define SCSI_BSG_FC_H |
Christopher Ferris | 9584fa4 | 2019-12-09 15:36:13 -0800 | [diff] [blame] | 9 | #include <linux/types.h> |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 10 | #define FC_DEFAULT_BSG_TIMEOUT (10 * HZ) |
| 11 | #define FC_BSG_CLS_MASK 0xF0000000 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 12 | #define FC_BSG_HST_MASK 0x80000000 |
| 13 | #define FC_BSG_RPT_MASK 0x40000000 |
| 14 | #define FC_BSG_HST_ADD_RPORT (FC_BSG_HST_MASK | 0x00000001) |
| 15 | #define FC_BSG_HST_DEL_RPORT (FC_BSG_HST_MASK | 0x00000002) |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 16 | #define FC_BSG_HST_ELS_NOLOGIN (FC_BSG_HST_MASK | 0x00000003) |
| 17 | #define FC_BSG_HST_CT (FC_BSG_HST_MASK | 0x00000004) |
| 18 | #define FC_BSG_HST_VENDOR (FC_BSG_HST_MASK | 0x000000FF) |
| 19 | #define FC_BSG_RPT_ELS (FC_BSG_RPT_MASK | 0x00000001) |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 20 | #define FC_BSG_RPT_CT (FC_BSG_RPT_MASK | 0x00000002) |
| 21 | struct fc_bsg_host_add_rport { |
Christopher Ferris | 9584fa4 | 2019-12-09 15:36:13 -0800 | [diff] [blame] | 22 | __u8 reserved; |
| 23 | __u8 port_id[3]; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 24 | }; |
| 25 | struct fc_bsg_host_del_rport { |
Christopher Ferris | 9584fa4 | 2019-12-09 15:36:13 -0800 | [diff] [blame] | 26 | __u8 reserved; |
| 27 | __u8 port_id[3]; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 28 | }; |
| 29 | struct fc_bsg_host_els { |
Christopher Ferris | 9584fa4 | 2019-12-09 15:36:13 -0800 | [diff] [blame] | 30 | __u8 command_code; |
| 31 | __u8 port_id[3]; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 32 | }; |
| 33 | #define FC_CTELS_STATUS_OK 0x00000000 |
| 34 | #define FC_CTELS_STATUS_REJECT 0x00000001 |
| 35 | #define FC_CTELS_STATUS_P_RJT 0x00000002 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 36 | #define FC_CTELS_STATUS_F_RJT 0x00000003 |
| 37 | #define FC_CTELS_STATUS_P_BSY 0x00000004 |
| 38 | #define FC_CTELS_STATUS_F_BSY 0x00000006 |
| 39 | struct fc_bsg_ctels_reply { |
Christopher Ferris | 9584fa4 | 2019-12-09 15:36:13 -0800 | [diff] [blame] | 40 | __u32 status; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 41 | struct { |
Christopher Ferris | 9584fa4 | 2019-12-09 15:36:13 -0800 | [diff] [blame] | 42 | __u8 action; |
| 43 | __u8 reason_code; |
| 44 | __u8 reason_explanation; |
| 45 | __u8 vendor_unique; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 46 | } rjt_data; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 47 | }; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 48 | struct fc_bsg_host_ct { |
Christopher Ferris | 9584fa4 | 2019-12-09 15:36:13 -0800 | [diff] [blame] | 49 | __u8 reserved; |
| 50 | __u8 port_id[3]; |
| 51 | __u32 preamble_word0; |
| 52 | __u32 preamble_word1; |
| 53 | __u32 preamble_word2; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 54 | }; |
| 55 | struct fc_bsg_host_vendor { |
Christopher Ferris | 9584fa4 | 2019-12-09 15:36:13 -0800 | [diff] [blame] | 56 | __u64 vendor_id; |
Christopher Ferris | 7447a1c | 2022-10-04 18:24:44 -0700 | [diff] [blame] | 57 | __u32 vendor_cmd[]; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 58 | }; |
| 59 | struct fc_bsg_host_vendor_reply { |
Christopher Ferris | b7cef6d | 2023-05-09 19:04:15 +0000 | [diff] [blame] | 60 | __DECLARE_FLEX_ARRAY(__u32, vendor_rsp); |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 61 | }; |
| 62 | struct fc_bsg_rport_els { |
Christopher Ferris | 9584fa4 | 2019-12-09 15:36:13 -0800 | [diff] [blame] | 63 | __u8 els_code; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 64 | }; |
| 65 | struct fc_bsg_rport_ct { |
Christopher Ferris | 9584fa4 | 2019-12-09 15:36:13 -0800 | [diff] [blame] | 66 | __u32 preamble_word0; |
| 67 | __u32 preamble_word1; |
| 68 | __u32 preamble_word2; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 69 | }; |
| 70 | struct fc_bsg_request { |
Christopher Ferris | 9584fa4 | 2019-12-09 15:36:13 -0800 | [diff] [blame] | 71 | __u32 msgcode; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 72 | union { |
| 73 | struct fc_bsg_host_add_rport h_addrport; |
| 74 | struct fc_bsg_host_del_rport h_delrport; |
| 75 | struct fc_bsg_host_els h_els; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 76 | struct fc_bsg_host_ct h_ct; |
| 77 | struct fc_bsg_host_vendor h_vendor; |
| 78 | struct fc_bsg_rport_els r_els; |
| 79 | struct fc_bsg_rport_ct r_ct; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 80 | } rqst_data; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 81 | } __attribute__((packed)); |
| 82 | struct fc_bsg_reply { |
Christopher Ferris | 9584fa4 | 2019-12-09 15:36:13 -0800 | [diff] [blame] | 83 | __u32 result; |
| 84 | __u32 reply_payload_rcv_len; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 85 | union { |
| 86 | struct fc_bsg_host_vendor_reply vendor_reply; |
| 87 | struct fc_bsg_ctels_reply ctels_reply; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 88 | } reply_data; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 89 | }; |
| 90 | #endif |