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 21 #include <linux/types.h> 22 #define FC_DEFAULT_BSG_TIMEOUT (10 * HZ) 23 #define FC_BSG_CLS_MASK 0xF0000000 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) 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) 32 #define FC_BSG_RPT_CT (FC_BSG_RPT_MASK | 0x00000002) 33 struct fc_bsg_host_add_rport { 34 __u8 reserved; 35 __u8 port_id[3]; 36 }; 37 struct fc_bsg_host_del_rport { 38 __u8 reserved; 39 __u8 port_id[3]; 40 }; 41 struct fc_bsg_host_els { 42 __u8 command_code; 43 __u8 port_id[3]; 44 }; 45 #define FC_CTELS_STATUS_OK 0x00000000 46 #define FC_CTELS_STATUS_REJECT 0x00000001 47 #define FC_CTELS_STATUS_P_RJT 0x00000002 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 { 52 __u32 status; 53 struct { 54 __u8 action; 55 __u8 reason_code; 56 __u8 reason_explanation; 57 __u8 vendor_unique; 58 } rjt_data; 59 }; 60 struct fc_bsg_host_ct { 61 __u8 reserved; 62 __u8 port_id[3]; 63 __u32 preamble_word0; 64 __u32 preamble_word1; 65 __u32 preamble_word2; 66 }; 67 struct fc_bsg_host_vendor { 68 __u64 vendor_id; 69 __u32 vendor_cmd[0]; 70 }; 71 struct fc_bsg_host_vendor_reply { 72 __u32 vendor_rsp[0]; 73 }; 74 struct fc_bsg_rport_els { 75 __u8 els_code; 76 }; 77 struct fc_bsg_rport_ct { 78 __u32 preamble_word0; 79 __u32 preamble_word1; 80 __u32 preamble_word2; 81 }; 82 struct fc_bsg_request { 83 __u32 msgcode; 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; 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; 92 } rqst_data; 93 } __attribute__((packed)); 94 struct fc_bsg_reply { 95 __u32 result; 96 __u32 reply_payload_rcv_len; 97 union { 98 struct fc_bsg_host_vendor_reply vendor_reply; 99 struct fc_bsg_ctels_reply ctels_reply; 100 } reply_data; 101 }; 102 #endif 103