[SCSI] bfa: Added support to obtain SFP info.
[linux-2.6/linux-mips.git] / drivers / scsi / bfa / bfad_bsg.h
blobfaafd35f88ae458d642946bb55a2fbb5add8a7b1
1 /*
2 * Copyright (c) 2005-2010 Brocade Communications Systems, Inc.
3 * All rights reserved
4 * www.brocade.com
6 * Linux driver for Brocade Fibre Channel Host Bus Adapter.
8 * This program is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License (GPL) Version 2 as
10 * published by the Free Software Foundation
12 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License for more details.
17 #ifndef BFAD_BSG_H
18 #define BFAD_BSG_H
20 #include "bfa_defs.h"
21 #include "bfa_defs_fcs.h"
23 /* Definitions of vendor unique structures and command codes passed in
24 * using FC_BSG_HST_VENDOR message code.
26 enum {
27 IOCMD_IOC_ENABLE = 0x1,
28 IOCMD_IOC_DISABLE,
29 IOCMD_IOC_GET_ATTR,
30 IOCMD_IOC_GET_INFO,
31 IOCMD_IOC_GET_STATS,
32 IOCMD_IOC_GET_FWSTATS,
33 IOCMD_IOCFC_GET_ATTR,
34 IOCMD_IOCFC_SET_INTR,
35 IOCMD_PORT_ENABLE,
36 IOCMD_PORT_DISABLE,
37 IOCMD_PORT_GET_ATTR,
38 IOCMD_PORT_GET_STATS,
39 IOCMD_LPORT_GET_ATTR,
40 IOCMD_LPORT_GET_RPORTS,
41 IOCMD_LPORT_GET_STATS,
42 IOCMD_LPORT_GET_IOSTATS,
43 IOCMD_RPORT_GET_ATTR,
44 IOCMD_RPORT_GET_ADDR,
45 IOCMD_RPORT_GET_STATS,
46 IOCMD_FABRIC_GET_LPORTS,
47 IOCMD_FCPIM_MODSTATS,
48 IOCMD_FCPIM_DEL_ITN_STATS,
49 IOCMD_ITNIM_GET_ATTR,
50 IOCMD_ITNIM_GET_IOSTATS,
51 IOCMD_ITNIM_GET_ITNSTATS,
52 IOCMD_IOC_PCIFN_CFG,
53 IOCMD_FCPORT_ENABLE,
54 IOCMD_FCPORT_DISABLE,
55 IOCMD_PCIFN_CREATE,
56 IOCMD_PCIFN_DELETE,
57 IOCMD_PCIFN_BW,
58 IOCMD_ADAPTER_CFG_MODE,
59 IOCMD_PORT_CFG_MODE,
60 IOCMD_FLASH_ENABLE_OPTROM,
61 IOCMD_FLASH_DISABLE_OPTROM,
62 IOCMD_FAA_ENABLE,
63 IOCMD_FAA_DISABLE,
64 IOCMD_FAA_QUERY,
65 IOCMD_CEE_GET_ATTR,
66 IOCMD_CEE_GET_STATS,
67 IOCMD_CEE_RESET_STATS,
68 IOCMD_SFP_MEDIA,
69 IOCMD_SFP_SPEED,
72 struct bfa_bsg_gen_s {
73 bfa_status_t status;
74 u16 bfad_num;
75 u16 rsvd;
78 struct bfa_bsg_ioc_info_s {
79 bfa_status_t status;
80 u16 bfad_num;
81 u16 rsvd;
82 char serialnum[64];
83 char hwpath[BFA_STRING_32];
84 char adapter_hwpath[BFA_STRING_32];
85 char guid[BFA_ADAPTER_SYM_NAME_LEN*2];
86 char name[BFA_ADAPTER_SYM_NAME_LEN];
87 char port_name[BFA_ADAPTER_SYM_NAME_LEN];
88 char eth_name[BFA_ADAPTER_SYM_NAME_LEN];
89 wwn_t pwwn;
90 wwn_t nwwn;
91 wwn_t factorypwwn;
92 wwn_t factorynwwn;
93 mac_t mac;
94 mac_t factory_mac; /* Factory mac address */
95 mac_t current_mac; /* Currently assigned mac address */
96 enum bfa_ioc_type_e ioc_type;
97 u16 pvid; /* Port vlan id */
98 u16 rsvd1;
99 u32 host;
100 u32 bandwidth; /* For PF support */
101 u32 rsvd2;
104 struct bfa_bsg_ioc_attr_s {
105 bfa_status_t status;
106 u16 bfad_num;
107 u16 rsvd;
108 struct bfa_ioc_attr_s ioc_attr;
111 struct bfa_bsg_ioc_stats_s {
112 bfa_status_t status;
113 u16 bfad_num;
114 u16 rsvd;
115 struct bfa_ioc_stats_s ioc_stats;
118 struct bfa_bsg_ioc_fwstats_s {
119 bfa_status_t status;
120 u16 bfad_num;
121 u16 rsvd;
122 u32 buf_size;
123 u32 rsvd1;
124 u64 buf_ptr;
127 struct bfa_bsg_iocfc_attr_s {
128 bfa_status_t status;
129 u16 bfad_num;
130 u16 rsvd;
131 struct bfa_iocfc_attr_s iocfc_attr;
134 struct bfa_bsg_iocfc_intr_s {
135 bfa_status_t status;
136 u16 bfad_num;
137 u16 rsvd;
138 struct bfa_iocfc_intr_attr_s attr;
141 struct bfa_bsg_port_attr_s {
142 bfa_status_t status;
143 u16 bfad_num;
144 u16 rsvd;
145 struct bfa_port_attr_s attr;
148 struct bfa_bsg_port_stats_s {
149 bfa_status_t status;
150 u16 bfad_num;
151 u16 rsvd;
152 u32 buf_size;
153 u32 rsvd1;
154 u64 buf_ptr;
157 struct bfa_bsg_lport_attr_s {
158 bfa_status_t status;
159 u16 bfad_num;
160 u16 vf_id;
161 wwn_t pwwn;
162 struct bfa_lport_attr_s port_attr;
165 struct bfa_bsg_lport_stats_s {
166 bfa_status_t status;
167 u16 bfad_num;
168 u16 vf_id;
169 wwn_t pwwn;
170 struct bfa_lport_stats_s port_stats;
173 struct bfa_bsg_lport_iostats_s {
174 bfa_status_t status;
175 u16 bfad_num;
176 u16 vf_id;
177 wwn_t pwwn;
178 struct bfa_itnim_iostats_s iostats;
181 struct bfa_bsg_lport_get_rports_s {
182 bfa_status_t status;
183 u16 bfad_num;
184 u16 vf_id;
185 wwn_t pwwn;
186 u64 rbuf_ptr;
187 u32 nrports;
188 u32 rsvd;
191 struct bfa_bsg_rport_attr_s {
192 bfa_status_t status;
193 u16 bfad_num;
194 u16 vf_id;
195 wwn_t pwwn;
196 wwn_t rpwwn;
197 struct bfa_rport_attr_s attr;
200 struct bfa_bsg_rport_stats_s {
201 bfa_status_t status;
202 u16 bfad_num;
203 u16 vf_id;
204 wwn_t pwwn;
205 wwn_t rpwwn;
206 struct bfa_rport_stats_s stats;
209 struct bfa_bsg_rport_scsi_addr_s {
210 bfa_status_t status;
211 u16 bfad_num;
212 u16 vf_id;
213 wwn_t pwwn;
214 wwn_t rpwwn;
215 u32 host;
216 u32 bus;
217 u32 target;
218 u32 lun;
221 struct bfa_bsg_fabric_get_lports_s {
222 bfa_status_t status;
223 u16 bfad_num;
224 u16 vf_id;
225 u64 buf_ptr;
226 u32 nports;
227 u32 rsvd;
230 struct bfa_bsg_fcpim_modstats_s {
231 bfa_status_t status;
232 u16 bfad_num;
233 struct bfa_itnim_iostats_s modstats;
236 struct bfa_bsg_fcpim_del_itn_stats_s {
237 bfa_status_t status;
238 u16 bfad_num;
239 struct bfa_fcpim_del_itn_stats_s modstats;
242 struct bfa_bsg_itnim_attr_s {
243 bfa_status_t status;
244 u16 bfad_num;
245 u16 vf_id;
246 wwn_t lpwwn;
247 wwn_t rpwwn;
248 struct bfa_itnim_attr_s attr;
251 struct bfa_bsg_itnim_iostats_s {
252 bfa_status_t status;
253 u16 bfad_num;
254 u16 vf_id;
255 wwn_t lpwwn;
256 wwn_t rpwwn;
257 struct bfa_itnim_iostats_s iostats;
260 struct bfa_bsg_itnim_itnstats_s {
261 bfa_status_t status;
262 u16 bfad_num;
263 u16 vf_id;
264 wwn_t lpwwn;
265 wwn_t rpwwn;
266 struct bfa_itnim_stats_s itnstats;
269 struct bfa_bsg_pcifn_cfg_s {
270 bfa_status_t status;
271 u16 bfad_num;
272 u16 rsvd;
273 struct bfa_ablk_cfg_s pcifn_cfg;
276 struct bfa_bsg_pcifn_s {
277 bfa_status_t status;
278 u16 bfad_num;
279 u16 pcifn_id;
280 u32 bandwidth;
281 u8 port;
282 enum bfi_pcifn_class pcifn_class;
283 u8 rsvd[1];
286 struct bfa_bsg_adapter_cfg_mode_s {
287 bfa_status_t status;
288 u16 bfad_num;
289 u16 rsvd;
290 struct bfa_adapter_cfg_mode_s cfg;
293 struct bfa_bsg_port_cfg_mode_s {
294 bfa_status_t status;
295 u16 bfad_num;
296 u16 instance;
297 struct bfa_port_cfg_mode_s cfg;
300 struct bfa_bsg_faa_attr_s {
301 bfa_status_t status;
302 u16 bfad_num;
303 u16 rsvd;
304 struct bfa_faa_attr_s faa_attr;
307 struct bfa_bsg_cee_attr_s {
308 bfa_status_t status;
309 u16 bfad_num;
310 u16 rsvd;
311 u32 buf_size;
312 u32 rsvd1;
313 u64 buf_ptr;
316 struct bfa_bsg_cee_stats_s {
317 bfa_status_t status;
318 u16 bfad_num;
319 u16 rsvd;
320 u32 buf_size;
321 u32 rsvd1;
322 u64 buf_ptr;
325 struct bfa_bsg_sfp_media_s {
326 bfa_status_t status;
327 u16 bfad_num;
328 u16 rsvd;
329 enum bfa_defs_sfp_media_e media;
332 struct bfa_bsg_sfp_speed_s {
333 bfa_status_t status;
334 u16 bfad_num;
335 u16 rsvd;
336 enum bfa_port_speed speed;
339 struct bfa_bsg_fcpt_s {
340 bfa_status_t status;
341 u16 vf_id;
342 wwn_t lpwwn;
343 wwn_t dpwwn;
344 u32 tsecs;
345 int cts;
346 enum fc_cos cos;
347 struct fchs_s fchs;
349 #define bfa_bsg_fcpt_t struct bfa_bsg_fcpt_s
351 struct bfa_bsg_data {
352 int payload_len;
353 void *payload;
356 #define bfad_chk_iocmd_sz(__payload_len, __hdrsz, __bufsz) \
357 (((__payload_len) != ((__hdrsz) + (__bufsz))) ? \
358 BFA_STATUS_FAILED : BFA_STATUS_OK)
360 #endif /* BFAD_BSG_H */