123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308 |
- #ifndef SCSI_BSG_FC_H
- #define SCSI_BSG_FC_H
- #include <linux/types.h>
- #define FC_DEFAULT_BSG_TIMEOUT (10 * HZ)
- #define FC_BSG_CLS_MASK 0xF0000000
- #define FC_BSG_HST_MASK 0x80000000
- #define FC_BSG_RPT_MASK 0x40000000
-
- #define FC_BSG_HST_ADD_RPORT (FC_BSG_HST_MASK | 0x00000001)
- #define FC_BSG_HST_DEL_RPORT (FC_BSG_HST_MASK | 0x00000002)
- #define FC_BSG_HST_ELS_NOLOGIN (FC_BSG_HST_MASK | 0x00000003)
- #define FC_BSG_HST_CT (FC_BSG_HST_MASK | 0x00000004)
- #define FC_BSG_HST_VENDOR (FC_BSG_HST_MASK | 0x000000FF)
-
- #define FC_BSG_RPT_ELS (FC_BSG_RPT_MASK | 0x00000001)
- #define FC_BSG_RPT_CT (FC_BSG_RPT_MASK | 0x00000002)
- struct fc_bsg_host_add_rport {
- __u8 reserved;
-
- __u8 port_id[3];
- };
- struct fc_bsg_host_del_rport {
- __u8 reserved;
-
- __u8 port_id[3];
- };
- struct fc_bsg_host_els {
-
- __u8 command_code;
-
- __u8 port_id[3];
- };
- #define FC_CTELS_STATUS_OK 0x00000000
- #define FC_CTELS_STATUS_REJECT 0x00000001
- #define FC_CTELS_STATUS_P_RJT 0x00000002
- #define FC_CTELS_STATUS_F_RJT 0x00000003
- #define FC_CTELS_STATUS_P_BSY 0x00000004
- #define FC_CTELS_STATUS_F_BSY 0x00000006
- struct fc_bsg_ctels_reply {
-
- __u32 status;
-
- struct {
- __u8 action;
- __u8 reason_code;
- __u8 reason_explanation;
- __u8 vendor_unique;
- } rjt_data;
- };
- struct fc_bsg_host_ct {
- __u8 reserved;
-
- __u8 port_id[3];
-
- __u32 preamble_word0;
- __u32 preamble_word1;
- __u32 preamble_word2;
- };
- struct fc_bsg_host_vendor {
-
- __u64 vendor_id;
-
- __u32 vendor_cmd[];
- };
- struct fc_bsg_host_vendor_reply {
-
- __DECLARE_FLEX_ARRAY(__u32, vendor_rsp);
- };
- struct fc_bsg_rport_els {
-
- __u8 els_code;
- };
- struct fc_bsg_rport_ct {
-
- __u32 preamble_word0;
- __u32 preamble_word1;
- __u32 preamble_word2;
- };
- struct fc_bsg_request {
- __u32 msgcode;
- union {
- struct fc_bsg_host_add_rport h_addrport;
- struct fc_bsg_host_del_rport h_delrport;
- struct fc_bsg_host_els h_els;
- struct fc_bsg_host_ct h_ct;
- struct fc_bsg_host_vendor h_vendor;
- struct fc_bsg_rport_els r_els;
- struct fc_bsg_rport_ct r_ct;
- } rqst_data;
- } __attribute__((packed));
- struct fc_bsg_reply {
-
- __u32 result;
-
- __u32 reply_payload_rcv_len;
- union {
- struct fc_bsg_host_vendor_reply vendor_reply;
- struct fc_bsg_ctels_reply ctels_reply;
- } reply_data;
- };
- #endif
|