• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * This header was generated from the Linux kernel headers by update_headers.py,
3  * to provide necessary information from kernel to userspace, such as constants,
4  * structures, and macros, and thus, contains no copyrightable information.
5  */
6 #ifndef SCSI_BSG_FC_H
7 #define SCSI_BSG_FC_H
8 #define FC_DEFAULT_BSG_TIMEOUT		(10 * HZ)
9 #define FC_BSG_CLS_MASK		0xF0000000
10 #define FC_BSG_HST_MASK		0x80000000
11 #define FC_BSG_RPT_MASK		0x40000000
12 
13 #define FC_BSG_HST_ADD_RPORT		(FC_BSG_HST_MASK | 0x00000001)
14 #define FC_BSG_HST_DEL_RPORT		(FC_BSG_HST_MASK | 0x00000002)
15 #define FC_BSG_HST_ELS_NOLOGIN		(FC_BSG_HST_MASK | 0x00000003)
16 #define FC_BSG_HST_CT			(FC_BSG_HST_MASK | 0x00000004)
17 #define FC_BSG_HST_VENDOR		(FC_BSG_HST_MASK | 0x000000FF)
18 
19 #define FC_BSG_RPT_ELS			(FC_BSG_RPT_MASK | 0x00000001)
20 #define FC_BSG_RPT_CT			(FC_BSG_RPT_MASK | 0x00000002)
21 struct fc_bsg_host_add_rport {
22 	uint8_t		reserved;
23 
24 	uint8_t		port_id[3];
25 };
26 struct fc_bsg_host_del_rport {
27 	uint8_t		reserved;
28 
29 	uint8_t		port_id[3];
30 };
31 struct fc_bsg_host_els {
32 
33 	uint8_t 	command_code;
34 
35 	uint8_t		port_id[3];
36 };
37 #define FC_CTELS_STATUS_OK	0x00000000
38 #define FC_CTELS_STATUS_REJECT	0x00000001
39 #define FC_CTELS_STATUS_P_RJT	0x00000002
40 #define FC_CTELS_STATUS_F_RJT	0x00000003
41 #define FC_CTELS_STATUS_P_BSY	0x00000004
42 #define FC_CTELS_STATUS_F_BSY	0x00000006
43 struct fc_bsg_ctels_reply {
44 
45 	uint32_t	status;
46 
47 	struct	{
48 		uint8_t	action;
49 		uint8_t	reason_code;
50 		uint8_t	reason_explanation;
51 		uint8_t	vendor_unique;
52 	} rjt_data;
53 };
54 struct fc_bsg_host_ct {
55 	uint8_t		reserved;
56 
57 	uint8_t		port_id[3];
58 
59 	uint32_t	preamble_word0;
60 	uint32_t	preamble_word1;
61 	uint32_t	preamble_word2;
62 };
63 struct fc_bsg_host_vendor {
64 
65 	uint64_t vendor_id;
66 
67 	uint32_t vendor_cmd[0];
68 };
69 struct fc_bsg_host_vendor_reply {
70 
71 	uint32_t vendor_rsp[0];
72 };
73 struct fc_bsg_rport_els {
74 
75 	uint8_t els_code;
76 };
77 struct fc_bsg_rport_ct {
78 
79 	uint32_t	preamble_word0;
80 	uint32_t	preamble_word1;
81 	uint32_t	preamble_word2;
82 };
83 struct fc_bsg_request {
84 	uint32_t msgcode;
85 	union {
86 		struct fc_bsg_host_add_rport	h_addrport;
87 		struct fc_bsg_host_del_rport	h_delrport;
88 		struct fc_bsg_host_els		h_els;
89 		struct fc_bsg_host_ct		h_ct;
90 		struct fc_bsg_host_vendor	h_vendor;
91 		struct fc_bsg_rport_els		r_els;
92 		struct fc_bsg_rport_ct		r_ct;
93 	} rqst_data;
94 } __attribute__((packed));
95 struct fc_bsg_reply {
96 
97 	uint32_t result;
98 
99 	uint32_t reply_payload_rcv_len;
100 	union {
101 		struct fc_bsg_host_vendor_reply		vendor_reply;
102 		struct fc_bsg_ctels_reply		ctels_reply;
103 	} reply_data;
104 };
105 #endif
106