blob: c665a800c41d46b628628bad2c4da2aa86c1b5f7 [file] [log] [blame]
Krishna Gudipatia36c61f2010-09-15 11:50:55 -07001/*
2 * Copyright (c) 2005-2010 Brocade Communications Systems, Inc.
3 * All rights reserved
4 * www.brocade.com
5 *
6 * Linux driver for Brocade Fibre Channel Host Bus Adapter.
7 *
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
11 *
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.
16 */
17
18#ifndef __BFI_MS_H__
19#define __BFI_MS_H__
20
21#include "bfi.h"
22#include "bfa_fc.h"
23#include "bfa_defs_svc.h"
24
25#pragma pack(1)
26
27enum bfi_iocfc_h2i_msgs {
28 BFI_IOCFC_H2I_CFG_REQ = 1,
29 BFI_IOCFC_H2I_SET_INTR_REQ = 2,
30 BFI_IOCFC_H2I_UPDATEQ_REQ = 3,
Krishna Gudipatia7141342011-06-24 20:23:19 -070031 BFI_IOCFC_H2I_FAA_ENABLE_REQ = 4,
32 BFI_IOCFC_H2I_FAA_DISABLE_REQ = 5,
33 BFI_IOCFC_H2I_FAA_QUERY_REQ = 6,
Krishna Gudipatia36c61f2010-09-15 11:50:55 -070034};
35
36enum bfi_iocfc_i2h_msgs {
37 BFI_IOCFC_I2H_CFG_REPLY = BFA_I2HM(1),
38 BFI_IOCFC_I2H_UPDATEQ_RSP = BFA_I2HM(3),
Krishna Gudipatia7141342011-06-24 20:23:19 -070039 BFI_IOCFC_I2H_FAA_ENABLE_RSP = BFA_I2HM(4),
40 BFI_IOCFC_I2H_FAA_DISABLE_RSP = BFA_I2HM(5),
41 BFI_IOCFC_I2H_FAA_QUERY_RSP = BFA_I2HM(6),
Krishna Gudipatia36c61f2010-09-15 11:50:55 -070042};
43
44struct bfi_iocfc_cfg_s {
45 u8 num_cqs; /* Number of CQs to be used */
46 u8 sense_buf_len; /* SCSI sense length */
47 u16 rsvd_1;
48 u32 endian_sig; /* endian signature of host */
Krishna Gudipatie2187d72011-06-13 15:53:58 -070049 __be16 num_ioim_reqs;
50 __be16 num_fwtio_reqs;
51 u8 rsvd[4];
Krishna Gudipatia36c61f2010-09-15 11:50:55 -070052
Jing Huangacdc79a2010-10-18 17:15:55 -070053 /*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -070054 * Request and response circular queue base addresses, size and
55 * shadow index pointers.
56 */
57 union bfi_addr_u req_cq_ba[BFI_IOC_MAX_CQS];
58 union bfi_addr_u req_shadow_ci[BFI_IOC_MAX_CQS];
Maggie50444a32010-11-29 18:26:32 -080059 __be16 req_cq_elems[BFI_IOC_MAX_CQS];
Krishna Gudipatia36c61f2010-09-15 11:50:55 -070060 union bfi_addr_u rsp_cq_ba[BFI_IOC_MAX_CQS];
61 union bfi_addr_u rsp_shadow_pi[BFI_IOC_MAX_CQS];
Maggie50444a32010-11-29 18:26:32 -080062 __be16 rsp_cq_elems[BFI_IOC_MAX_CQS];
Krishna Gudipatia36c61f2010-09-15 11:50:55 -070063
64 union bfi_addr_u stats_addr; /* DMA-able address for stats */
65 union bfi_addr_u cfgrsp_addr; /* config response dma address */
66 union bfi_addr_u ioim_snsbase; /* IO sense buffer base address */
67 struct bfa_iocfc_intr_attr_s intr_attr; /* IOC interrupt attributes */
68};
69
Jing Huangacdc79a2010-10-18 17:15:55 -070070/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -070071 * Boot target wwn information for this port. This contains either the stored
72 * or discovered boot target port wwns for the port.
73 */
74struct bfi_iocfc_bootwwns {
75 wwn_t wwn[BFA_BOOT_BOOTLUN_MAX];
76 u8 nwwns;
77 u8 rsvd[7];
78};
79
Krishna Gudipati11189202011-06-13 15:50:35 -070080/**
81 * Queue configuration response from firmware
82 */
83struct bfi_iocfc_qreg_s {
84 u32 cpe_q_ci_off[BFI_IOC_MAX_CQS];
85 u32 cpe_q_pi_off[BFI_IOC_MAX_CQS];
86 u32 cpe_qctl_off[BFI_IOC_MAX_CQS];
87 u32 rme_q_ci_off[BFI_IOC_MAX_CQS];
88 u32 rme_q_pi_off[BFI_IOC_MAX_CQS];
89 u32 rme_qctl_off[BFI_IOC_MAX_CQS];
90};
91
Krishna Gudipatia36c61f2010-09-15 11:50:55 -070092struct bfi_iocfc_cfgrsp_s {
93 struct bfa_iocfc_fwcfg_s fwcfg;
94 struct bfa_iocfc_intr_attr_s intr_attr;
95 struct bfi_iocfc_bootwwns bootwwns;
96 struct bfi_pbc_s pbc_cfg;
Krishna Gudipati11189202011-06-13 15:50:35 -070097 struct bfi_iocfc_qreg_s qreg;
Krishna Gudipatia36c61f2010-09-15 11:50:55 -070098};
99
Jing Huangacdc79a2010-10-18 17:15:55 -0700100/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700101 * BFI_IOCFC_H2I_CFG_REQ message
102 */
103struct bfi_iocfc_cfg_req_s {
104 struct bfi_mhdr_s mh;
105 union bfi_addr_u ioc_cfg_dma_addr;
106};
107
108
Jing Huangacdc79a2010-10-18 17:15:55 -0700109/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700110 * BFI_IOCFC_I2H_CFG_REPLY message
111 */
112struct bfi_iocfc_cfg_reply_s {
113 struct bfi_mhdr_s mh; /* Common msg header */
114 u8 cfg_success; /* cfg reply status */
115 u8 lpu_bm; /* LPUs assigned for this IOC */
116 u8 rsvd[2];
117};
118
119
Jing Huangacdc79a2010-10-18 17:15:55 -0700120/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700121 * BFI_IOCFC_H2I_SET_INTR_REQ message
122 */
123struct bfi_iocfc_set_intr_req_s {
124 struct bfi_mhdr_s mh; /* common msg header */
125 u8 coalesce; /* enable intr coalescing */
126 u8 rsvd[3];
Maggie50444a32010-11-29 18:26:32 -0800127 __be16 delay; /* delay timer 0..1125us */
128 __be16 latency; /* latency timer 0..225us */
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700129};
130
131
Jing Huangacdc79a2010-10-18 17:15:55 -0700132/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700133 * BFI_IOCFC_H2I_UPDATEQ_REQ message
134 */
135struct bfi_iocfc_updateq_req_s {
136 struct bfi_mhdr_s mh; /* common msg header */
137 u32 reqq_ba; /* reqq base addr */
138 u32 rspq_ba; /* rspq base addr */
139 u32 reqq_sci; /* reqq shadow ci */
140 u32 rspq_spi; /* rspq shadow pi */
141};
142
143
Jing Huangacdc79a2010-10-18 17:15:55 -0700144/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700145 * BFI_IOCFC_I2H_UPDATEQ_RSP message
146 */
147struct bfi_iocfc_updateq_rsp_s {
148 struct bfi_mhdr_s mh; /* common msg header */
149 u8 status; /* updateq status */
150 u8 rsvd[3];
151};
152
153
Jing Huangacdc79a2010-10-18 17:15:55 -0700154/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700155 * H2I Messages
156 */
157union bfi_iocfc_h2i_msg_u {
158 struct bfi_mhdr_s mh;
159 struct bfi_iocfc_cfg_req_s cfg_req;
160 struct bfi_iocfc_updateq_req_s updateq_req;
161 u32 mboxmsg[BFI_IOC_MSGSZ];
162};
163
164
Jing Huangacdc79a2010-10-18 17:15:55 -0700165/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700166 * I2H Messages
167 */
168union bfi_iocfc_i2h_msg_u {
169 struct bfi_mhdr_s mh;
170 struct bfi_iocfc_cfg_reply_s cfg_reply;
171 struct bfi_iocfc_updateq_rsp_s updateq_rsp;
172 u32 mboxmsg[BFI_IOC_MSGSZ];
173};
174
Krishna Gudipatia7141342011-06-24 20:23:19 -0700175/*
176 * BFI_IOCFC_H2I_FAA_ENABLE_REQ BFI_IOCFC_H2I_FAA_DISABLE_REQ message
177 */
178struct bfi_faa_en_dis_s {
179 struct bfi_mhdr_s mh; /* common msg header */
180};
181
182/*
183 * BFI_IOCFC_H2I_FAA_QUERY_REQ message
184 */
185struct bfi_faa_query_s {
186 struct bfi_mhdr_s mh; /* common msg header */
187 u8 faa_status; /* FAA status */
188 u8 addr_source; /* PWWN source */
189 u8 rsvd[2];
190 wwn_t faa; /* Fabric acquired PWWN */
191};
192
193/*
194 * BFI_IOCFC_I2H_FAA_ENABLE_RSP, BFI_IOCFC_I2H_FAA_DISABLE_RSP message
195 */
196struct bfi_faa_en_dis_rsp_s {
197 struct bfi_mhdr_s mh; /* common msg header */
198 u8 status; /* updateq status */
199 u8 rsvd[3];
200};
201
202/*
203 * BFI_IOCFC_I2H_FAA_QUERY_RSP message
204 */
205#define bfi_faa_query_rsp_t struct bfi_faa_query_s
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700206
207enum bfi_fcport_h2i {
208 BFI_FCPORT_H2I_ENABLE_REQ = (1),
209 BFI_FCPORT_H2I_DISABLE_REQ = (2),
210 BFI_FCPORT_H2I_SET_SVC_PARAMS_REQ = (3),
211 BFI_FCPORT_H2I_STATS_GET_REQ = (4),
212 BFI_FCPORT_H2I_STATS_CLEAR_REQ = (5),
213};
214
215
216enum bfi_fcport_i2h {
217 BFI_FCPORT_I2H_ENABLE_RSP = BFA_I2HM(1),
218 BFI_FCPORT_I2H_DISABLE_RSP = BFA_I2HM(2),
219 BFI_FCPORT_I2H_SET_SVC_PARAMS_RSP = BFA_I2HM(3),
220 BFI_FCPORT_I2H_STATS_GET_RSP = BFA_I2HM(4),
221 BFI_FCPORT_I2H_STATS_CLEAR_RSP = BFA_I2HM(5),
222 BFI_FCPORT_I2H_EVENT = BFA_I2HM(6),
223 BFI_FCPORT_I2H_TRUNK_SCN = BFA_I2HM(7),
224 BFI_FCPORT_I2H_ENABLE_AEN = BFA_I2HM(8),
225 BFI_FCPORT_I2H_DISABLE_AEN = BFA_I2HM(9),
226};
227
228
Jing Huangacdc79a2010-10-18 17:15:55 -0700229/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700230 * Generic REQ type
231 */
232struct bfi_fcport_req_s {
233 struct bfi_mhdr_s mh; /* msg header */
234 u32 msgtag; /* msgtag for reply */
235};
236
Jing Huangacdc79a2010-10-18 17:15:55 -0700237/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700238 * Generic RSP type
239 */
240struct bfi_fcport_rsp_s {
241 struct bfi_mhdr_s mh; /* common msg header */
242 u8 status; /* port enable status */
243 u8 rsvd[3];
Krishna Gudipatif3a060c2010-12-13 16:16:50 -0800244 struct bfa_port_cfg_s port_cfg;/* port configuration */
245 u32 msgtag; /* msgtag for reply */
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700246};
247
Jing Huangacdc79a2010-10-18 17:15:55 -0700248/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700249 * BFI_FCPORT_H2I_ENABLE_REQ
250 */
251struct bfi_fcport_enable_req_s {
252 struct bfi_mhdr_s mh; /* msg header */
253 u32 rsvd1;
254 wwn_t nwwn; /* node wwn of physical port */
255 wwn_t pwwn; /* port wwn of physical port */
256 struct bfa_port_cfg_s port_cfg; /* port configuration */
257 union bfi_addr_u stats_dma_addr; /* DMA address for stats */
258 u32 msgtag; /* msgtag for reply */
Krishna Gudipatif3a060c2010-12-13 16:16:50 -0800259 u8 use_flash_cfg; /* get prot cfg from flash */
260 u8 rsvd2[3];
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700261};
262
Jing Huangacdc79a2010-10-18 17:15:55 -0700263/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700264 * BFI_FCPORT_H2I_SET_SVC_PARAMS_REQ
265 */
266struct bfi_fcport_set_svc_params_req_s {
267 struct bfi_mhdr_s mh; /* msg header */
Maggie50444a32010-11-29 18:26:32 -0800268 __be16 tx_bbcredit; /* Tx credits */
Krishna Gudipatibe540a92011-06-13 15:53:04 -0700269 u8 bb_scn; /* BB_SC FC credit recovery */
270 u8 rsvd;
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700271};
272
Jing Huangacdc79a2010-10-18 17:15:55 -0700273/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700274 * BFI_FCPORT_I2H_EVENT
275 */
276struct bfi_fcport_event_s {
277 struct bfi_mhdr_s mh; /* common msg header */
278 struct bfa_port_link_s link_state;
279};
280
Jing Huangacdc79a2010-10-18 17:15:55 -0700281/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700282 * BFI_FCPORT_I2H_TRUNK_SCN
283 */
284struct bfi_fcport_trunk_link_s {
285 wwn_t trunk_wwn;
286 u8 fctl; /* bfa_trunk_link_fctl_t */
287 u8 state; /* bfa_trunk_link_state_t */
288 u8 speed; /* bfa_port_speed_t */
289 u8 rsvd;
Maggie50444a32010-11-29 18:26:32 -0800290 __be32 deskew;
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700291};
292
293#define BFI_FCPORT_MAX_LINKS 2
294struct bfi_fcport_trunk_scn_s {
295 struct bfi_mhdr_s mh;
296 u8 trunk_state; /* bfa_trunk_state_t */
297 u8 trunk_speed; /* bfa_port_speed_t */
298 u8 rsvd_a[2];
299 struct bfi_fcport_trunk_link_s tlink[BFI_FCPORT_MAX_LINKS];
300};
301
Jing Huangacdc79a2010-10-18 17:15:55 -0700302/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700303 * fcport H2I message
304 */
305union bfi_fcport_h2i_msg_u {
306 struct bfi_mhdr_s *mhdr;
307 struct bfi_fcport_enable_req_s *penable;
308 struct bfi_fcport_req_s *pdisable;
309 struct bfi_fcport_set_svc_params_req_s *psetsvcparams;
310 struct bfi_fcport_req_s *pstatsget;
311 struct bfi_fcport_req_s *pstatsclear;
312};
313
Jing Huangacdc79a2010-10-18 17:15:55 -0700314/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700315 * fcport I2H message
316 */
317union bfi_fcport_i2h_msg_u {
318 struct bfi_msg_s *msg;
319 struct bfi_fcport_rsp_s *penable_rsp;
320 struct bfi_fcport_rsp_s *pdisable_rsp;
321 struct bfi_fcport_rsp_s *psetsvcparams_rsp;
322 struct bfi_fcport_rsp_s *pstatsget_rsp;
323 struct bfi_fcport_rsp_s *pstatsclear_rsp;
324 struct bfi_fcport_event_s *event;
325 struct bfi_fcport_trunk_scn_s *trunk_scn;
326};
327
328enum bfi_fcxp_h2i {
329 BFI_FCXP_H2I_SEND_REQ = 1,
330};
331
332enum bfi_fcxp_i2h {
333 BFI_FCXP_I2H_SEND_RSP = BFA_I2HM(1),
334};
335
336#define BFA_FCXP_MAX_SGES 2
337
Jing Huangacdc79a2010-10-18 17:15:55 -0700338/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700339 * FCXP send request structure
340 */
341struct bfi_fcxp_send_req_s {
342 struct bfi_mhdr_s mh; /* Common msg header */
Maggie50444a32010-11-29 18:26:32 -0800343 __be16 fcxp_tag; /* driver request tag */
344 __be16 max_frmsz; /* max send frame size */
345 __be16 vf_id; /* vsan tag if applicable */
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700346 u16 rport_fw_hndl; /* FW Handle for the remote port */
347 u8 class; /* FC class used for req/rsp */
348 u8 rsp_timeout; /* timeout in secs, 0-no response */
349 u8 cts; /* continue sequence */
350 u8 lp_tag; /* lport tag */
351 struct fchs_s fchs; /* request FC header structure */
Maggie50444a32010-11-29 18:26:32 -0800352 __be32 req_len; /* request payload length */
353 __be32 rsp_maxlen; /* max response length expected */
Krishna Gudipati85ce9282011-06-13 15:39:36 -0700354 struct bfi_alen_s req_alen; /* request buffer */
355 struct bfi_alen_s rsp_alen; /* response buffer */
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700356};
357
Jing Huangacdc79a2010-10-18 17:15:55 -0700358/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700359 * FCXP send response structure
360 */
361struct bfi_fcxp_send_rsp_s {
362 struct bfi_mhdr_s mh; /* Common msg header */
Maggie50444a32010-11-29 18:26:32 -0800363 __be16 fcxp_tag; /* send request tag */
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700364 u8 req_status; /* request status */
365 u8 rsvd;
Maggie50444a32010-11-29 18:26:32 -0800366 __be32 rsp_len; /* actual response length */
367 __be32 residue_len; /* residual response length */
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700368 struct fchs_s fchs; /* response FC header structure */
369};
370
371enum bfi_uf_h2i {
372 BFI_UF_H2I_BUF_POST = 1,
373};
374
375enum bfi_uf_i2h {
376 BFI_UF_I2H_FRM_RCVD = BFA_I2HM(1),
377};
378
379#define BFA_UF_MAX_SGES 2
380
381struct bfi_uf_buf_post_s {
382 struct bfi_mhdr_s mh; /* Common msg header */
383 u16 buf_tag; /* buffer tag */
Maggie50444a32010-11-29 18:26:32 -0800384 __be16 buf_len; /* total buffer length */
Krishna Gudipati85ce9282011-06-13 15:39:36 -0700385 struct bfi_alen_s alen; /* buffer address/len pair */
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700386};
387
388struct bfi_uf_frm_rcvd_s {
389 struct bfi_mhdr_s mh; /* Common msg header */
390 u16 buf_tag; /* buffer tag */
391 u16 rsvd;
392 u16 frm_len; /* received frame length */
393 u16 xfr_len; /* tranferred length */
394};
395
396enum bfi_lps_h2i_msgs {
397 BFI_LPS_H2I_LOGIN_REQ = 1,
398 BFI_LPS_H2I_LOGOUT_REQ = 2,
Krishna Gudipatib7044952010-12-13 16:17:42 -0800399 BFI_LPS_H2I_N2N_PID_REQ = 3,
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700400};
401
402enum bfi_lps_i2h_msgs {
Krishna Gudipati43ffdf42011-06-13 15:46:21 -0700403 BFI_LPS_I2H_LOGIN_RSP = BFA_I2HM(1),
404 BFI_LPS_I2H_LOGOUT_RSP = BFA_I2HM(2),
405 BFI_LPS_I2H_CVL_EVENT = BFA_I2HM(3),
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700406};
407
408struct bfi_lps_login_req_s {
409 struct bfi_mhdr_s mh; /* common msg header */
410 u8 lp_tag;
411 u8 alpa;
Maggie50444a32010-11-29 18:26:32 -0800412 __be16 pdu_size;
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700413 wwn_t pwwn;
414 wwn_t nwwn;
415 u8 fdisc;
416 u8 auth_en;
Krishna Gudipatidd5aaf42011-06-13 15:51:24 -0700417 u8 lps_role;
Krishna Gudipatibe540a92011-06-13 15:53:04 -0700418 u8 bb_scn;
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700419};
420
421struct bfi_lps_login_rsp_s {
422 struct bfi_mhdr_s mh; /* common msg header */
423 u8 lp_tag;
424 u8 status;
425 u8 lsrjt_rsn;
426 u8 lsrjt_expl;
427 wwn_t port_name;
428 wwn_t node_name;
Maggie50444a32010-11-29 18:26:32 -0800429 __be16 bb_credit;
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700430 u8 f_port;
431 u8 npiv_en;
432 u32 lp_pid:24;
433 u32 auth_req:8;
434 mac_t lp_mac;
435 mac_t fcf_mac;
436 u8 ext_status;
437 u8 brcd_switch; /* attached peer is brcd switch */
Krishna Gudipatibe540a92011-06-13 15:53:04 -0700438 u8 bb_scn; /* atatched port's bb_scn */
439 u8 resvd;
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700440};
441
442struct bfi_lps_logout_req_s {
443 struct bfi_mhdr_s mh; /* common msg header */
444 u8 lp_tag;
445 u8 rsvd[3];
446 wwn_t port_name;
447};
448
449struct bfi_lps_logout_rsp_s {
450 struct bfi_mhdr_s mh; /* common msg header */
451 u8 lp_tag;
452 u8 status;
453 u8 rsvd[2];
454};
455
456struct bfi_lps_cvl_event_s {
457 struct bfi_mhdr_s mh; /* common msg header */
458 u8 lp_tag;
459 u8 rsvd[3];
460};
461
Krishna Gudipatib7044952010-12-13 16:17:42 -0800462struct bfi_lps_n2n_pid_req_s {
463 struct bfi_mhdr_s mh; /* common msg header */
464 u8 lp_tag;
465 u32 lp_pid:24;
466};
467
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700468union bfi_lps_h2i_msg_u {
469 struct bfi_mhdr_s *msg;
470 struct bfi_lps_login_req_s *login_req;
471 struct bfi_lps_logout_req_s *logout_req;
Krishna Gudipatib7044952010-12-13 16:17:42 -0800472 struct bfi_lps_n2n_pid_req_s *n2n_pid_req;
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700473};
474
475union bfi_lps_i2h_msg_u {
476 struct bfi_msg_s *msg;
477 struct bfi_lps_login_rsp_s *login_rsp;
478 struct bfi_lps_logout_rsp_s *logout_rsp;
479 struct bfi_lps_cvl_event_s *cvl_event;
480};
481
482enum bfi_rport_h2i_msgs {
483 BFI_RPORT_H2I_CREATE_REQ = 1,
484 BFI_RPORT_H2I_DELETE_REQ = 2,
485 BFI_RPORT_H2I_SET_SPEED_REQ = 3,
486};
487
488enum bfi_rport_i2h_msgs {
489 BFI_RPORT_I2H_CREATE_RSP = BFA_I2HM(1),
490 BFI_RPORT_I2H_DELETE_RSP = BFA_I2HM(2),
491 BFI_RPORT_I2H_QOS_SCN = BFA_I2HM(3),
492};
493
494struct bfi_rport_create_req_s {
495 struct bfi_mhdr_s mh; /* common msg header */
496 u16 bfa_handle; /* host rport handle */
Maggie50444a32010-11-29 18:26:32 -0800497 __be16 max_frmsz; /* max rcv pdu size */
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700498 u32 pid:24, /* remote port ID */
499 lp_tag:8; /* local port tag */
500 u32 local_pid:24, /* local port ID */
501 cisc:8;
502 u8 fc_class; /* supported FC classes */
503 u8 vf_en; /* virtual fabric enable */
504 u16 vf_id; /* virtual fabric ID */
505};
506
507struct bfi_rport_create_rsp_s {
508 struct bfi_mhdr_s mh; /* common msg header */
509 u8 status; /* rport creation status */
510 u8 rsvd[3];
511 u16 bfa_handle; /* host rport handle */
512 u16 fw_handle; /* firmware rport handle */
513 struct bfa_rport_qos_attr_s qos_attr; /* QoS Attributes */
514};
515
516struct bfa_rport_speed_req_s {
517 struct bfi_mhdr_s mh; /* common msg header */
518 u16 fw_handle; /* firmware rport handle */
519 u8 speed; /* rport's speed via RPSC */
520 u8 rsvd;
521};
522
523struct bfi_rport_delete_req_s {
524 struct bfi_mhdr_s mh; /* common msg header */
525 u16 fw_handle; /* firmware rport handle */
526 u16 rsvd;
527};
528
529struct bfi_rport_delete_rsp_s {
530 struct bfi_mhdr_s mh; /* common msg header */
531 u16 bfa_handle; /* host rport handle */
532 u8 status; /* rport deletion status */
533 u8 rsvd;
534};
535
536struct bfi_rport_qos_scn_s {
537 struct bfi_mhdr_s mh; /* common msg header */
538 u16 bfa_handle; /* host rport handle */
539 u16 rsvd;
540 struct bfa_rport_qos_attr_s old_qos_attr; /* Old QoS Attributes */
541 struct bfa_rport_qos_attr_s new_qos_attr; /* New QoS Attributes */
542};
543
544union bfi_rport_h2i_msg_u {
545 struct bfi_msg_s *msg;
546 struct bfi_rport_create_req_s *create_req;
547 struct bfi_rport_delete_req_s *delete_req;
548 struct bfi_rport_speed_req_s *speed_req;
549};
550
551union bfi_rport_i2h_msg_u {
552 struct bfi_msg_s *msg;
553 struct bfi_rport_create_rsp_s *create_rsp;
554 struct bfi_rport_delete_rsp_s *delete_rsp;
555 struct bfi_rport_qos_scn_s *qos_scn_evt;
556};
557
558/*
559 * Initiator mode I-T nexus interface defines.
560 */
561
Krishna Gudipatidd5aaf42011-06-13 15:51:24 -0700562enum bfi_itn_h2i {
563 BFI_ITN_H2I_CREATE_REQ = 1, /* i-t nexus creation */
564 BFI_ITN_H2I_DELETE_REQ = 2, /* i-t nexus deletion */
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700565};
566
Krishna Gudipatidd5aaf42011-06-13 15:51:24 -0700567enum bfi_itn_i2h {
568 BFI_ITN_I2H_CREATE_RSP = BFA_I2HM(1),
569 BFI_ITN_I2H_DELETE_RSP = BFA_I2HM(2),
570 BFI_ITN_I2H_SLER_EVENT = BFA_I2HM(3),
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700571};
572
Krishna Gudipatidd5aaf42011-06-13 15:51:24 -0700573struct bfi_itn_create_req_s {
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700574 struct bfi_mhdr_s mh; /* common msg header */
575 u16 fw_handle; /* f/w handle for itnim */
576 u8 class; /* FC class for IO */
577 u8 seq_rec; /* sequence recovery support */
578 u8 msg_no; /* seq id of the msg */
Krishna Gudipatidd5aaf42011-06-13 15:51:24 -0700579 u8 role;
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700580};
581
Krishna Gudipatidd5aaf42011-06-13 15:51:24 -0700582struct bfi_itn_create_rsp_s {
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700583 struct bfi_mhdr_s mh; /* common msg header */
584 u16 bfa_handle; /* bfa handle for itnim */
585 u8 status; /* fcp request status */
586 u8 seq_id; /* seq id of the msg */
587};
588
Krishna Gudipatidd5aaf42011-06-13 15:51:24 -0700589struct bfi_itn_delete_req_s {
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700590 struct bfi_mhdr_s mh; /* common msg header */
591 u16 fw_handle; /* f/w itnim handle */
592 u8 seq_id; /* seq id of the msg */
593 u8 rsvd;
594};
595
Krishna Gudipatidd5aaf42011-06-13 15:51:24 -0700596struct bfi_itn_delete_rsp_s {
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700597 struct bfi_mhdr_s mh; /* common msg header */
598 u16 bfa_handle; /* bfa handle for itnim */
599 u8 status; /* fcp request status */
600 u8 seq_id; /* seq id of the msg */
601};
602
Krishna Gudipatidd5aaf42011-06-13 15:51:24 -0700603struct bfi_itn_sler_event_s {
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700604 struct bfi_mhdr_s mh; /* common msg header */
605 u16 bfa_handle; /* bfa handle for itnim */
606 u16 rsvd;
607};
608
Krishna Gudipatidd5aaf42011-06-13 15:51:24 -0700609union bfi_itn_h2i_msg_u {
610 struct bfi_itn_create_req_s *create_req;
611 struct bfi_itn_delete_req_s *delete_req;
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700612 struct bfi_msg_s *msg;
613};
614
Krishna Gudipatidd5aaf42011-06-13 15:51:24 -0700615union bfi_itn_i2h_msg_u {
616 struct bfi_itn_create_rsp_s *create_rsp;
617 struct bfi_itn_delete_rsp_s *delete_rsp;
618 struct bfi_itn_sler_event_s *sler_event;
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700619 struct bfi_msg_s *msg;
620};
621
622/*
623 * Initiator mode IO interface defines.
624 */
625
626enum bfi_ioim_h2i {
627 BFI_IOIM_H2I_IOABORT_REQ = 1, /* IO abort request */
628 BFI_IOIM_H2I_IOCLEANUP_REQ = 2, /* IO cleanup request */
629};
630
631enum bfi_ioim_i2h {
632 BFI_IOIM_I2H_IO_RSP = BFA_I2HM(1), /* non-fp IO response */
633 BFI_IOIM_I2H_IOABORT_RSP = BFA_I2HM(2), /* ABORT rsp */
634};
635
Jing Huangacdc79a2010-10-18 17:15:55 -0700636/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700637 * IO command DIF info
638 */
639struct bfi_ioim_dif_s {
640 u32 dif_info[4];
641};
642
Jing Huangacdc79a2010-10-18 17:15:55 -0700643/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700644 * FCP IO messages overview
645 *
646 * @note
647 * - Max CDB length supported is 64 bytes.
648 * - SCSI Linked commands and SCSI bi-directional Commands not
649 * supported.
650 *
651 */
652struct bfi_ioim_req_s {
653 struct bfi_mhdr_s mh; /* Common msg header */
Maggie50444a32010-11-29 18:26:32 -0800654 __be16 io_tag; /* I/O tag */
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700655 u16 rport_hdl; /* itnim/rport firmware handle */
656 struct fcp_cmnd_s cmnd; /* IO request info */
657
Jing Huangacdc79a2010-10-18 17:15:55 -0700658 /*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700659 * SG elements array within the IO request must be double word
660 * aligned. This aligment is required to optimize SGM setup for the IO.
661 */
662 struct bfi_sge_s sges[BFI_SGE_INLINE_MAX];
663 u8 io_timeout;
664 u8 dif_en;
665 u8 rsvd_a[2];
666 struct bfi_ioim_dif_s dif;
667};
668
Jing Huangacdc79a2010-10-18 17:15:55 -0700669/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700670 * This table shows various IO status codes from firmware and their
671 * meaning. Host driver can use these status codes to further process
672 * IO completions.
673 *
674 * BFI_IOIM_STS_OK : IO completed with error free SCSI &
675 * transport status.
676 * io-tag can be reused.
677 *
678 * BFA_IOIM_STS_SCSI_ERR : IO completed with scsi error.
679 * - io-tag can be reused.
680 *
681 * BFI_IOIM_STS_HOST_ABORTED : IO was aborted successfully due to
682 * host request.
683 * - io-tag cannot be reused yet.
684 *
685 * BFI_IOIM_STS_ABORTED : IO was aborted successfully
686 * internally by f/w.
687 * - io-tag cannot be reused yet.
688 *
689 * BFI_IOIM_STS_TIMEDOUT : IO timedout and ABTS/RRQ is happening
690 * in the firmware and
691 * - io-tag cannot be reused yet.
692 *
693 * BFI_IOIM_STS_SQER_NEEDED : Firmware could not recover the IO
694 * with sequence level error
695 * logic and hence host needs to retry
696 * this IO with a different IO tag
697 * - io-tag cannot be used yet.
698 *
699 * BFI_IOIM_STS_NEXUS_ABORT : Second Level Error Recovery from host
700 * is required because 2 consecutive ABTS
701 * timedout and host needs logout and
702 * re-login with the target
703 * - io-tag cannot be used yet.
704 *
705 * BFI_IOIM_STS_UNDERRUN : IO completed with SCSI status good,
706 * but the data tranferred is less than
707 * the fcp data length in the command.
708 * ex. SCSI INQUIRY where transferred
709 * data length and residue count in FCP
710 * response accounts for total fcp-dl
711 * - io-tag can be reused.
712 *
713 * BFI_IOIM_STS_OVERRUN : IO completed with SCSI status good,
714 * but the data transerred is more than
715 * fcp data length in the command. ex.
716 * TAPE IOs where blocks can of unequal
717 * lengths.
718 * - io-tag can be reused.
719 *
720 * BFI_IOIM_STS_RES_FREE : Firmware has completed using io-tag
721 * during abort process
722 * - io-tag can be reused.
723 *
724 * BFI_IOIM_STS_PROTO_ERR : Firmware detected a protocol error.
725 * ex target sent more data than
726 * requested, or there was data frame
727 * loss and other reasons
728 * - io-tag cannot be used yet.
729 *
730 * BFI_IOIM_STS_DIF_ERR : Firwmare detected DIF error. ex: DIF
731 * CRC err or Ref Tag err or App tag err.
732 * - io-tag can be reused.
733 *
734 * BFA_IOIM_STS_TSK_MGT_ABORT : IO was aborted because of Task
735 * Management command from the host
736 * - io-tag can be reused.
737 *
738 * BFI_IOIM_STS_UTAG : Firmware does not know about this
739 * io_tag.
740 * - io-tag can be reused.
741 */
742enum bfi_ioim_status {
743 BFI_IOIM_STS_OK = 0,
744 BFI_IOIM_STS_HOST_ABORTED = 1,
745 BFI_IOIM_STS_ABORTED = 2,
746 BFI_IOIM_STS_TIMEDOUT = 3,
747 BFI_IOIM_STS_RES_FREE = 4,
748 BFI_IOIM_STS_SQER_NEEDED = 5,
749 BFI_IOIM_STS_PROTO_ERR = 6,
750 BFI_IOIM_STS_UTAG = 7,
751 BFI_IOIM_STS_PATHTOV = 8,
752};
753
754#define BFI_IOIM_SNSLEN (256)
Jing Huangacdc79a2010-10-18 17:15:55 -0700755/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700756 * I/O response message
757 */
758struct bfi_ioim_rsp_s {
759 struct bfi_mhdr_s mh; /* common msg header */
Maggie50444a32010-11-29 18:26:32 -0800760 __be16 io_tag; /* completed IO tag */
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700761 u16 bfa_rport_hndl; /* releated rport handle */
762 u8 io_status; /* IO completion status */
763 u8 reuse_io_tag; /* IO tag can be reused */
764 u16 abort_tag; /* host abort request tag */
765 u8 scsi_status; /* scsi status from target */
766 u8 sns_len; /* scsi sense length */
767 u8 resid_flags; /* IO residue flags */
768 u8 rsvd_a;
Maggie50444a32010-11-29 18:26:32 -0800769 __be32 residue; /* IO residual length in bytes */
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700770 u32 rsvd_b[3];
771};
772
773struct bfi_ioim_abort_req_s {
774 struct bfi_mhdr_s mh; /* Common msg header */
Maggie50444a32010-11-29 18:26:32 -0800775 __be16 io_tag; /* I/O tag */
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700776 u16 abort_tag; /* unique request tag */
777};
778
779/*
780 * Initiator mode task management command interface defines.
781 */
782
783enum bfi_tskim_h2i {
784 BFI_TSKIM_H2I_TM_REQ = 1, /* task-mgmt command */
785 BFI_TSKIM_H2I_ABORT_REQ = 2, /* task-mgmt command */
786};
787
788enum bfi_tskim_i2h {
789 BFI_TSKIM_I2H_TM_RSP = BFA_I2HM(1),
790};
791
792struct bfi_tskim_req_s {
793 struct bfi_mhdr_s mh; /* Common msg header */
Maggie50444a32010-11-29 18:26:32 -0800794 __be16 tsk_tag; /* task management tag */
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700795 u16 itn_fhdl; /* itn firmware handle */
Maggie Zhangf3148782010-12-09 19:11:39 -0800796 struct scsi_lun lun; /* LU number */
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700797 u8 tm_flags; /* see enum fcp_tm_cmnd */
798 u8 t_secs; /* Timeout value in seconds */
799 u8 rsvd[2];
800};
801
802struct bfi_tskim_abortreq_s {
803 struct bfi_mhdr_s mh; /* Common msg header */
Maggie50444a32010-11-29 18:26:32 -0800804 __be16 tsk_tag; /* task management tag */
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700805 u16 rsvd;
806};
807
808enum bfi_tskim_status {
809 /*
810 * Following are FCP-4 spec defined status codes,
811 * **DO NOT CHANGE THEM **
812 */
813 BFI_TSKIM_STS_OK = 0,
814 BFI_TSKIM_STS_NOT_SUPP = 4,
815 BFI_TSKIM_STS_FAILED = 5,
816
Jing Huangacdc79a2010-10-18 17:15:55 -0700817 /*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700818 * Defined by BFA
819 */
820 BFI_TSKIM_STS_TIMEOUT = 10, /* TM request timedout */
821 BFI_TSKIM_STS_ABORTED = 11, /* Aborted on host request */
822};
823
824struct bfi_tskim_rsp_s {
825 struct bfi_mhdr_s mh; /* Common msg header */
Maggie50444a32010-11-29 18:26:32 -0800826 __be16 tsk_tag; /* task mgmt cmnd tag */
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700827 u8 tsk_status; /* @ref bfi_tskim_status */
828 u8 rsvd;
829};
830
831#pragma pack()
832
Krishna Gudipati11189202011-06-13 15:50:35 -0700833/*
834 * Crossbow PCI MSI-X vector defines
835 */
836enum {
837 BFI_MSIX_CPE_QMIN_CB = 0,
838 BFI_MSIX_CPE_QMAX_CB = 7,
839 BFI_MSIX_RME_QMIN_CB = 8,
840 BFI_MSIX_RME_QMAX_CB = 15,
841 BFI_MSIX_CB_MAX = 22,
842};
843
844/*
845 * Catapult FC PCI MSI-X vector defines
846 */
847enum {
848 BFI_MSIX_LPU_ERR_CT = 0,
849 BFI_MSIX_CPE_QMIN_CT = 1,
850 BFI_MSIX_CPE_QMAX_CT = 4,
851 BFI_MSIX_RME_QMIN_CT = 5,
852 BFI_MSIX_RME_QMAX_CT = 8,
853 BFI_MSIX_CT_MAX = 9,
854};
855
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700856#endif /* __BFI_MS_H__ */