blob: d43bf6a08a6656db7a3e278e054c044b4951b35b [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,
31};
32
33enum bfi_iocfc_i2h_msgs {
34 BFI_IOCFC_I2H_CFG_REPLY = BFA_I2HM(1),
35 BFI_IOCFC_I2H_UPDATEQ_RSP = BFA_I2HM(3),
36};
37
38struct bfi_iocfc_cfg_s {
39 u8 num_cqs; /* Number of CQs to be used */
40 u8 sense_buf_len; /* SCSI sense length */
41 u16 rsvd_1;
42 u32 endian_sig; /* endian signature of host */
43
Jing Huangacdc79a2010-10-18 17:15:55 -070044 /*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -070045 * Request and response circular queue base addresses, size and
46 * shadow index pointers.
47 */
48 union bfi_addr_u req_cq_ba[BFI_IOC_MAX_CQS];
49 union bfi_addr_u req_shadow_ci[BFI_IOC_MAX_CQS];
Maggie50444a32010-11-29 18:26:32 -080050 __be16 req_cq_elems[BFI_IOC_MAX_CQS];
Krishna Gudipatia36c61f2010-09-15 11:50:55 -070051 union bfi_addr_u rsp_cq_ba[BFI_IOC_MAX_CQS];
52 union bfi_addr_u rsp_shadow_pi[BFI_IOC_MAX_CQS];
Maggie50444a32010-11-29 18:26:32 -080053 __be16 rsp_cq_elems[BFI_IOC_MAX_CQS];
Krishna Gudipatia36c61f2010-09-15 11:50:55 -070054
55 union bfi_addr_u stats_addr; /* DMA-able address for stats */
56 union bfi_addr_u cfgrsp_addr; /* config response dma address */
57 union bfi_addr_u ioim_snsbase; /* IO sense buffer base address */
58 struct bfa_iocfc_intr_attr_s intr_attr; /* IOC interrupt attributes */
59};
60
Jing Huangacdc79a2010-10-18 17:15:55 -070061/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -070062 * Boot target wwn information for this port. This contains either the stored
63 * or discovered boot target port wwns for the port.
64 */
65struct bfi_iocfc_bootwwns {
66 wwn_t wwn[BFA_BOOT_BOOTLUN_MAX];
67 u8 nwwns;
68 u8 rsvd[7];
69};
70
Krishna Gudipati11189202011-06-13 15:50:35 -070071/**
72 * Queue configuration response from firmware
73 */
74struct bfi_iocfc_qreg_s {
75 u32 cpe_q_ci_off[BFI_IOC_MAX_CQS];
76 u32 cpe_q_pi_off[BFI_IOC_MAX_CQS];
77 u32 cpe_qctl_off[BFI_IOC_MAX_CQS];
78 u32 rme_q_ci_off[BFI_IOC_MAX_CQS];
79 u32 rme_q_pi_off[BFI_IOC_MAX_CQS];
80 u32 rme_qctl_off[BFI_IOC_MAX_CQS];
81};
82
Krishna Gudipatia36c61f2010-09-15 11:50:55 -070083struct bfi_iocfc_cfgrsp_s {
84 struct bfa_iocfc_fwcfg_s fwcfg;
85 struct bfa_iocfc_intr_attr_s intr_attr;
86 struct bfi_iocfc_bootwwns bootwwns;
87 struct bfi_pbc_s pbc_cfg;
Krishna Gudipati11189202011-06-13 15:50:35 -070088 struct bfi_iocfc_qreg_s qreg;
Krishna Gudipatia36c61f2010-09-15 11:50:55 -070089};
90
Jing Huangacdc79a2010-10-18 17:15:55 -070091/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -070092 * BFI_IOCFC_H2I_CFG_REQ message
93 */
94struct bfi_iocfc_cfg_req_s {
95 struct bfi_mhdr_s mh;
96 union bfi_addr_u ioc_cfg_dma_addr;
97};
98
99
Jing Huangacdc79a2010-10-18 17:15:55 -0700100/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700101 * BFI_IOCFC_I2H_CFG_REPLY message
102 */
103struct bfi_iocfc_cfg_reply_s {
104 struct bfi_mhdr_s mh; /* Common msg header */
105 u8 cfg_success; /* cfg reply status */
106 u8 lpu_bm; /* LPUs assigned for this IOC */
107 u8 rsvd[2];
108};
109
110
Jing Huangacdc79a2010-10-18 17:15:55 -0700111/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700112 * BFI_IOCFC_H2I_SET_INTR_REQ message
113 */
114struct bfi_iocfc_set_intr_req_s {
115 struct bfi_mhdr_s mh; /* common msg header */
116 u8 coalesce; /* enable intr coalescing */
117 u8 rsvd[3];
Maggie50444a32010-11-29 18:26:32 -0800118 __be16 delay; /* delay timer 0..1125us */
119 __be16 latency; /* latency timer 0..225us */
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700120};
121
122
Jing Huangacdc79a2010-10-18 17:15:55 -0700123/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700124 * BFI_IOCFC_H2I_UPDATEQ_REQ message
125 */
126struct bfi_iocfc_updateq_req_s {
127 struct bfi_mhdr_s mh; /* common msg header */
128 u32 reqq_ba; /* reqq base addr */
129 u32 rspq_ba; /* rspq base addr */
130 u32 reqq_sci; /* reqq shadow ci */
131 u32 rspq_spi; /* rspq shadow pi */
132};
133
134
Jing Huangacdc79a2010-10-18 17:15:55 -0700135/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700136 * BFI_IOCFC_I2H_UPDATEQ_RSP message
137 */
138struct bfi_iocfc_updateq_rsp_s {
139 struct bfi_mhdr_s mh; /* common msg header */
140 u8 status; /* updateq status */
141 u8 rsvd[3];
142};
143
144
Jing Huangacdc79a2010-10-18 17:15:55 -0700145/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700146 * H2I Messages
147 */
148union bfi_iocfc_h2i_msg_u {
149 struct bfi_mhdr_s mh;
150 struct bfi_iocfc_cfg_req_s cfg_req;
151 struct bfi_iocfc_updateq_req_s updateq_req;
152 u32 mboxmsg[BFI_IOC_MSGSZ];
153};
154
155
Jing Huangacdc79a2010-10-18 17:15:55 -0700156/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700157 * I2H Messages
158 */
159union bfi_iocfc_i2h_msg_u {
160 struct bfi_mhdr_s mh;
161 struct bfi_iocfc_cfg_reply_s cfg_reply;
162 struct bfi_iocfc_updateq_rsp_s updateq_rsp;
163 u32 mboxmsg[BFI_IOC_MSGSZ];
164};
165
166
167enum bfi_fcport_h2i {
168 BFI_FCPORT_H2I_ENABLE_REQ = (1),
169 BFI_FCPORT_H2I_DISABLE_REQ = (2),
170 BFI_FCPORT_H2I_SET_SVC_PARAMS_REQ = (3),
171 BFI_FCPORT_H2I_STATS_GET_REQ = (4),
172 BFI_FCPORT_H2I_STATS_CLEAR_REQ = (5),
173};
174
175
176enum bfi_fcport_i2h {
177 BFI_FCPORT_I2H_ENABLE_RSP = BFA_I2HM(1),
178 BFI_FCPORT_I2H_DISABLE_RSP = BFA_I2HM(2),
179 BFI_FCPORT_I2H_SET_SVC_PARAMS_RSP = BFA_I2HM(3),
180 BFI_FCPORT_I2H_STATS_GET_RSP = BFA_I2HM(4),
181 BFI_FCPORT_I2H_STATS_CLEAR_RSP = BFA_I2HM(5),
182 BFI_FCPORT_I2H_EVENT = BFA_I2HM(6),
183 BFI_FCPORT_I2H_TRUNK_SCN = BFA_I2HM(7),
184 BFI_FCPORT_I2H_ENABLE_AEN = BFA_I2HM(8),
185 BFI_FCPORT_I2H_DISABLE_AEN = BFA_I2HM(9),
186};
187
188
Jing Huangacdc79a2010-10-18 17:15:55 -0700189/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700190 * Generic REQ type
191 */
192struct bfi_fcport_req_s {
193 struct bfi_mhdr_s mh; /* msg header */
194 u32 msgtag; /* msgtag for reply */
195};
196
Jing Huangacdc79a2010-10-18 17:15:55 -0700197/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700198 * Generic RSP type
199 */
200struct bfi_fcport_rsp_s {
201 struct bfi_mhdr_s mh; /* common msg header */
202 u8 status; /* port enable status */
203 u8 rsvd[3];
Krishna Gudipatif3a060c2010-12-13 16:16:50 -0800204 struct bfa_port_cfg_s port_cfg;/* port configuration */
205 u32 msgtag; /* msgtag for reply */
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700206};
207
Jing Huangacdc79a2010-10-18 17:15:55 -0700208/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700209 * BFI_FCPORT_H2I_ENABLE_REQ
210 */
211struct bfi_fcport_enable_req_s {
212 struct bfi_mhdr_s mh; /* msg header */
213 u32 rsvd1;
214 wwn_t nwwn; /* node wwn of physical port */
215 wwn_t pwwn; /* port wwn of physical port */
216 struct bfa_port_cfg_s port_cfg; /* port configuration */
217 union bfi_addr_u stats_dma_addr; /* DMA address for stats */
218 u32 msgtag; /* msgtag for reply */
Krishna Gudipatif3a060c2010-12-13 16:16:50 -0800219 u8 use_flash_cfg; /* get prot cfg from flash */
220 u8 rsvd2[3];
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700221};
222
Jing Huangacdc79a2010-10-18 17:15:55 -0700223/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700224 * BFI_FCPORT_H2I_SET_SVC_PARAMS_REQ
225 */
226struct bfi_fcport_set_svc_params_req_s {
227 struct bfi_mhdr_s mh; /* msg header */
Maggie50444a32010-11-29 18:26:32 -0800228 __be16 tx_bbcredit; /* Tx credits */
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700229 u16 rsvd;
230};
231
Jing Huangacdc79a2010-10-18 17:15:55 -0700232/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700233 * BFI_FCPORT_I2H_EVENT
234 */
235struct bfi_fcport_event_s {
236 struct bfi_mhdr_s mh; /* common msg header */
237 struct bfa_port_link_s link_state;
238};
239
Jing Huangacdc79a2010-10-18 17:15:55 -0700240/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700241 * BFI_FCPORT_I2H_TRUNK_SCN
242 */
243struct bfi_fcport_trunk_link_s {
244 wwn_t trunk_wwn;
245 u8 fctl; /* bfa_trunk_link_fctl_t */
246 u8 state; /* bfa_trunk_link_state_t */
247 u8 speed; /* bfa_port_speed_t */
248 u8 rsvd;
Maggie50444a32010-11-29 18:26:32 -0800249 __be32 deskew;
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700250};
251
252#define BFI_FCPORT_MAX_LINKS 2
253struct bfi_fcport_trunk_scn_s {
254 struct bfi_mhdr_s mh;
255 u8 trunk_state; /* bfa_trunk_state_t */
256 u8 trunk_speed; /* bfa_port_speed_t */
257 u8 rsvd_a[2];
258 struct bfi_fcport_trunk_link_s tlink[BFI_FCPORT_MAX_LINKS];
259};
260
Jing Huangacdc79a2010-10-18 17:15:55 -0700261/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700262 * fcport H2I message
263 */
264union bfi_fcport_h2i_msg_u {
265 struct bfi_mhdr_s *mhdr;
266 struct bfi_fcport_enable_req_s *penable;
267 struct bfi_fcport_req_s *pdisable;
268 struct bfi_fcport_set_svc_params_req_s *psetsvcparams;
269 struct bfi_fcport_req_s *pstatsget;
270 struct bfi_fcport_req_s *pstatsclear;
271};
272
Jing Huangacdc79a2010-10-18 17:15:55 -0700273/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700274 * fcport I2H message
275 */
276union bfi_fcport_i2h_msg_u {
277 struct bfi_msg_s *msg;
278 struct bfi_fcport_rsp_s *penable_rsp;
279 struct bfi_fcport_rsp_s *pdisable_rsp;
280 struct bfi_fcport_rsp_s *psetsvcparams_rsp;
281 struct bfi_fcport_rsp_s *pstatsget_rsp;
282 struct bfi_fcport_rsp_s *pstatsclear_rsp;
283 struct bfi_fcport_event_s *event;
284 struct bfi_fcport_trunk_scn_s *trunk_scn;
285};
286
287enum bfi_fcxp_h2i {
288 BFI_FCXP_H2I_SEND_REQ = 1,
289};
290
291enum bfi_fcxp_i2h {
292 BFI_FCXP_I2H_SEND_RSP = BFA_I2HM(1),
293};
294
295#define BFA_FCXP_MAX_SGES 2
296
Jing Huangacdc79a2010-10-18 17:15:55 -0700297/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700298 * FCXP send request structure
299 */
300struct bfi_fcxp_send_req_s {
301 struct bfi_mhdr_s mh; /* Common msg header */
Maggie50444a32010-11-29 18:26:32 -0800302 __be16 fcxp_tag; /* driver request tag */
303 __be16 max_frmsz; /* max send frame size */
304 __be16 vf_id; /* vsan tag if applicable */
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700305 u16 rport_fw_hndl; /* FW Handle for the remote port */
306 u8 class; /* FC class used for req/rsp */
307 u8 rsp_timeout; /* timeout in secs, 0-no response */
308 u8 cts; /* continue sequence */
309 u8 lp_tag; /* lport tag */
310 struct fchs_s fchs; /* request FC header structure */
Maggie50444a32010-11-29 18:26:32 -0800311 __be32 req_len; /* request payload length */
312 __be32 rsp_maxlen; /* max response length expected */
Krishna Gudipati85ce9282011-06-13 15:39:36 -0700313 struct bfi_alen_s req_alen; /* request buffer */
314 struct bfi_alen_s rsp_alen; /* response buffer */
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700315};
316
Jing Huangacdc79a2010-10-18 17:15:55 -0700317/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700318 * FCXP send response structure
319 */
320struct bfi_fcxp_send_rsp_s {
321 struct bfi_mhdr_s mh; /* Common msg header */
Maggie50444a32010-11-29 18:26:32 -0800322 __be16 fcxp_tag; /* send request tag */
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700323 u8 req_status; /* request status */
324 u8 rsvd;
Maggie50444a32010-11-29 18:26:32 -0800325 __be32 rsp_len; /* actual response length */
326 __be32 residue_len; /* residual response length */
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700327 struct fchs_s fchs; /* response FC header structure */
328};
329
330enum bfi_uf_h2i {
331 BFI_UF_H2I_BUF_POST = 1,
332};
333
334enum bfi_uf_i2h {
335 BFI_UF_I2H_FRM_RCVD = BFA_I2HM(1),
336};
337
338#define BFA_UF_MAX_SGES 2
339
340struct bfi_uf_buf_post_s {
341 struct bfi_mhdr_s mh; /* Common msg header */
342 u16 buf_tag; /* buffer tag */
Maggie50444a32010-11-29 18:26:32 -0800343 __be16 buf_len; /* total buffer length */
Krishna Gudipati85ce9282011-06-13 15:39:36 -0700344 struct bfi_alen_s alen; /* buffer address/len pair */
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700345};
346
347struct bfi_uf_frm_rcvd_s {
348 struct bfi_mhdr_s mh; /* Common msg header */
349 u16 buf_tag; /* buffer tag */
350 u16 rsvd;
351 u16 frm_len; /* received frame length */
352 u16 xfr_len; /* tranferred length */
353};
354
355enum bfi_lps_h2i_msgs {
356 BFI_LPS_H2I_LOGIN_REQ = 1,
357 BFI_LPS_H2I_LOGOUT_REQ = 2,
Krishna Gudipatib7044952010-12-13 16:17:42 -0800358 BFI_LPS_H2I_N2N_PID_REQ = 3,
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700359};
360
361enum bfi_lps_i2h_msgs {
Krishna Gudipati43ffdf42011-06-13 15:46:21 -0700362 BFI_LPS_I2H_LOGIN_RSP = BFA_I2HM(1),
363 BFI_LPS_I2H_LOGOUT_RSP = BFA_I2HM(2),
364 BFI_LPS_I2H_CVL_EVENT = BFA_I2HM(3),
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700365};
366
367struct bfi_lps_login_req_s {
368 struct bfi_mhdr_s mh; /* common msg header */
369 u8 lp_tag;
370 u8 alpa;
Maggie50444a32010-11-29 18:26:32 -0800371 __be16 pdu_size;
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700372 wwn_t pwwn;
373 wwn_t nwwn;
374 u8 fdisc;
375 u8 auth_en;
Krishna Gudipatidd5aaf42011-06-13 15:51:24 -0700376 u8 lps_role;
377 u8 rsvd[1];
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700378};
379
380struct bfi_lps_login_rsp_s {
381 struct bfi_mhdr_s mh; /* common msg header */
382 u8 lp_tag;
383 u8 status;
384 u8 lsrjt_rsn;
385 u8 lsrjt_expl;
386 wwn_t port_name;
387 wwn_t node_name;
Maggie50444a32010-11-29 18:26:32 -0800388 __be16 bb_credit;
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700389 u8 f_port;
390 u8 npiv_en;
391 u32 lp_pid:24;
392 u32 auth_req:8;
393 mac_t lp_mac;
394 mac_t fcf_mac;
395 u8 ext_status;
396 u8 brcd_switch; /* attached peer is brcd switch */
397};
398
399struct bfi_lps_logout_req_s {
400 struct bfi_mhdr_s mh; /* common msg header */
401 u8 lp_tag;
402 u8 rsvd[3];
403 wwn_t port_name;
404};
405
406struct bfi_lps_logout_rsp_s {
407 struct bfi_mhdr_s mh; /* common msg header */
408 u8 lp_tag;
409 u8 status;
410 u8 rsvd[2];
411};
412
413struct bfi_lps_cvl_event_s {
414 struct bfi_mhdr_s mh; /* common msg header */
415 u8 lp_tag;
416 u8 rsvd[3];
417};
418
Krishna Gudipatib7044952010-12-13 16:17:42 -0800419struct bfi_lps_n2n_pid_req_s {
420 struct bfi_mhdr_s mh; /* common msg header */
421 u8 lp_tag;
422 u32 lp_pid:24;
423};
424
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700425union bfi_lps_h2i_msg_u {
426 struct bfi_mhdr_s *msg;
427 struct bfi_lps_login_req_s *login_req;
428 struct bfi_lps_logout_req_s *logout_req;
Krishna Gudipatib7044952010-12-13 16:17:42 -0800429 struct bfi_lps_n2n_pid_req_s *n2n_pid_req;
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700430};
431
432union bfi_lps_i2h_msg_u {
433 struct bfi_msg_s *msg;
434 struct bfi_lps_login_rsp_s *login_rsp;
435 struct bfi_lps_logout_rsp_s *logout_rsp;
436 struct bfi_lps_cvl_event_s *cvl_event;
437};
438
439enum bfi_rport_h2i_msgs {
440 BFI_RPORT_H2I_CREATE_REQ = 1,
441 BFI_RPORT_H2I_DELETE_REQ = 2,
442 BFI_RPORT_H2I_SET_SPEED_REQ = 3,
443};
444
445enum bfi_rport_i2h_msgs {
446 BFI_RPORT_I2H_CREATE_RSP = BFA_I2HM(1),
447 BFI_RPORT_I2H_DELETE_RSP = BFA_I2HM(2),
448 BFI_RPORT_I2H_QOS_SCN = BFA_I2HM(3),
449};
450
451struct bfi_rport_create_req_s {
452 struct bfi_mhdr_s mh; /* common msg header */
453 u16 bfa_handle; /* host rport handle */
Maggie50444a32010-11-29 18:26:32 -0800454 __be16 max_frmsz; /* max rcv pdu size */
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700455 u32 pid:24, /* remote port ID */
456 lp_tag:8; /* local port tag */
457 u32 local_pid:24, /* local port ID */
458 cisc:8;
459 u8 fc_class; /* supported FC classes */
460 u8 vf_en; /* virtual fabric enable */
461 u16 vf_id; /* virtual fabric ID */
462};
463
464struct bfi_rport_create_rsp_s {
465 struct bfi_mhdr_s mh; /* common msg header */
466 u8 status; /* rport creation status */
467 u8 rsvd[3];
468 u16 bfa_handle; /* host rport handle */
469 u16 fw_handle; /* firmware rport handle */
470 struct bfa_rport_qos_attr_s qos_attr; /* QoS Attributes */
471};
472
473struct bfa_rport_speed_req_s {
474 struct bfi_mhdr_s mh; /* common msg header */
475 u16 fw_handle; /* firmware rport handle */
476 u8 speed; /* rport's speed via RPSC */
477 u8 rsvd;
478};
479
480struct bfi_rport_delete_req_s {
481 struct bfi_mhdr_s mh; /* common msg header */
482 u16 fw_handle; /* firmware rport handle */
483 u16 rsvd;
484};
485
486struct bfi_rport_delete_rsp_s {
487 struct bfi_mhdr_s mh; /* common msg header */
488 u16 bfa_handle; /* host rport handle */
489 u8 status; /* rport deletion status */
490 u8 rsvd;
491};
492
493struct bfi_rport_qos_scn_s {
494 struct bfi_mhdr_s mh; /* common msg header */
495 u16 bfa_handle; /* host rport handle */
496 u16 rsvd;
497 struct bfa_rport_qos_attr_s old_qos_attr; /* Old QoS Attributes */
498 struct bfa_rport_qos_attr_s new_qos_attr; /* New QoS Attributes */
499};
500
501union bfi_rport_h2i_msg_u {
502 struct bfi_msg_s *msg;
503 struct bfi_rport_create_req_s *create_req;
504 struct bfi_rport_delete_req_s *delete_req;
505 struct bfi_rport_speed_req_s *speed_req;
506};
507
508union bfi_rport_i2h_msg_u {
509 struct bfi_msg_s *msg;
510 struct bfi_rport_create_rsp_s *create_rsp;
511 struct bfi_rport_delete_rsp_s *delete_rsp;
512 struct bfi_rport_qos_scn_s *qos_scn_evt;
513};
514
515/*
516 * Initiator mode I-T nexus interface defines.
517 */
518
Krishna Gudipatidd5aaf42011-06-13 15:51:24 -0700519enum bfi_itn_h2i {
520 BFI_ITN_H2I_CREATE_REQ = 1, /* i-t nexus creation */
521 BFI_ITN_H2I_DELETE_REQ = 2, /* i-t nexus deletion */
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700522};
523
Krishna Gudipatidd5aaf42011-06-13 15:51:24 -0700524enum bfi_itn_i2h {
525 BFI_ITN_I2H_CREATE_RSP = BFA_I2HM(1),
526 BFI_ITN_I2H_DELETE_RSP = BFA_I2HM(2),
527 BFI_ITN_I2H_SLER_EVENT = BFA_I2HM(3),
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700528};
529
Krishna Gudipatidd5aaf42011-06-13 15:51:24 -0700530struct bfi_itn_create_req_s {
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700531 struct bfi_mhdr_s mh; /* common msg header */
532 u16 fw_handle; /* f/w handle for itnim */
533 u8 class; /* FC class for IO */
534 u8 seq_rec; /* sequence recovery support */
535 u8 msg_no; /* seq id of the msg */
Krishna Gudipatidd5aaf42011-06-13 15:51:24 -0700536 u8 role;
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700537};
538
Krishna Gudipatidd5aaf42011-06-13 15:51:24 -0700539struct bfi_itn_create_rsp_s {
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700540 struct bfi_mhdr_s mh; /* common msg header */
541 u16 bfa_handle; /* bfa handle for itnim */
542 u8 status; /* fcp request status */
543 u8 seq_id; /* seq id of the msg */
544};
545
Krishna Gudipatidd5aaf42011-06-13 15:51:24 -0700546struct bfi_itn_delete_req_s {
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700547 struct bfi_mhdr_s mh; /* common msg header */
548 u16 fw_handle; /* f/w itnim handle */
549 u8 seq_id; /* seq id of the msg */
550 u8 rsvd;
551};
552
Krishna Gudipatidd5aaf42011-06-13 15:51:24 -0700553struct bfi_itn_delete_rsp_s {
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700554 struct bfi_mhdr_s mh; /* common msg header */
555 u16 bfa_handle; /* bfa handle for itnim */
556 u8 status; /* fcp request status */
557 u8 seq_id; /* seq id of the msg */
558};
559
Krishna Gudipatidd5aaf42011-06-13 15:51:24 -0700560struct bfi_itn_sler_event_s {
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700561 struct bfi_mhdr_s mh; /* common msg header */
562 u16 bfa_handle; /* bfa handle for itnim */
563 u16 rsvd;
564};
565
Krishna Gudipatidd5aaf42011-06-13 15:51:24 -0700566union bfi_itn_h2i_msg_u {
567 struct bfi_itn_create_req_s *create_req;
568 struct bfi_itn_delete_req_s *delete_req;
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700569 struct bfi_msg_s *msg;
570};
571
Krishna Gudipatidd5aaf42011-06-13 15:51:24 -0700572union bfi_itn_i2h_msg_u {
573 struct bfi_itn_create_rsp_s *create_rsp;
574 struct bfi_itn_delete_rsp_s *delete_rsp;
575 struct bfi_itn_sler_event_s *sler_event;
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700576 struct bfi_msg_s *msg;
577};
578
579/*
580 * Initiator mode IO interface defines.
581 */
582
583enum bfi_ioim_h2i {
584 BFI_IOIM_H2I_IOABORT_REQ = 1, /* IO abort request */
585 BFI_IOIM_H2I_IOCLEANUP_REQ = 2, /* IO cleanup request */
586};
587
588enum bfi_ioim_i2h {
589 BFI_IOIM_I2H_IO_RSP = BFA_I2HM(1), /* non-fp IO response */
590 BFI_IOIM_I2H_IOABORT_RSP = BFA_I2HM(2), /* ABORT rsp */
591};
592
Jing Huangacdc79a2010-10-18 17:15:55 -0700593/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700594 * IO command DIF info
595 */
596struct bfi_ioim_dif_s {
597 u32 dif_info[4];
598};
599
Jing Huangacdc79a2010-10-18 17:15:55 -0700600/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700601 * FCP IO messages overview
602 *
603 * @note
604 * - Max CDB length supported is 64 bytes.
605 * - SCSI Linked commands and SCSI bi-directional Commands not
606 * supported.
607 *
608 */
609struct bfi_ioim_req_s {
610 struct bfi_mhdr_s mh; /* Common msg header */
Maggie50444a32010-11-29 18:26:32 -0800611 __be16 io_tag; /* I/O tag */
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700612 u16 rport_hdl; /* itnim/rport firmware handle */
613 struct fcp_cmnd_s cmnd; /* IO request info */
614
Jing Huangacdc79a2010-10-18 17:15:55 -0700615 /*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700616 * SG elements array within the IO request must be double word
617 * aligned. This aligment is required to optimize SGM setup for the IO.
618 */
619 struct bfi_sge_s sges[BFI_SGE_INLINE_MAX];
620 u8 io_timeout;
621 u8 dif_en;
622 u8 rsvd_a[2];
623 struct bfi_ioim_dif_s dif;
624};
625
Jing Huangacdc79a2010-10-18 17:15:55 -0700626/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700627 * This table shows various IO status codes from firmware and their
628 * meaning. Host driver can use these status codes to further process
629 * IO completions.
630 *
631 * BFI_IOIM_STS_OK : IO completed with error free SCSI &
632 * transport status.
633 * io-tag can be reused.
634 *
635 * BFA_IOIM_STS_SCSI_ERR : IO completed with scsi error.
636 * - io-tag can be reused.
637 *
638 * BFI_IOIM_STS_HOST_ABORTED : IO was aborted successfully due to
639 * host request.
640 * - io-tag cannot be reused yet.
641 *
642 * BFI_IOIM_STS_ABORTED : IO was aborted successfully
643 * internally by f/w.
644 * - io-tag cannot be reused yet.
645 *
646 * BFI_IOIM_STS_TIMEDOUT : IO timedout and ABTS/RRQ is happening
647 * in the firmware and
648 * - io-tag cannot be reused yet.
649 *
650 * BFI_IOIM_STS_SQER_NEEDED : Firmware could not recover the IO
651 * with sequence level error
652 * logic and hence host needs to retry
653 * this IO with a different IO tag
654 * - io-tag cannot be used yet.
655 *
656 * BFI_IOIM_STS_NEXUS_ABORT : Second Level Error Recovery from host
657 * is required because 2 consecutive ABTS
658 * timedout and host needs logout and
659 * re-login with the target
660 * - io-tag cannot be used yet.
661 *
662 * BFI_IOIM_STS_UNDERRUN : IO completed with SCSI status good,
663 * but the data tranferred is less than
664 * the fcp data length in the command.
665 * ex. SCSI INQUIRY where transferred
666 * data length and residue count in FCP
667 * response accounts for total fcp-dl
668 * - io-tag can be reused.
669 *
670 * BFI_IOIM_STS_OVERRUN : IO completed with SCSI status good,
671 * but the data transerred is more than
672 * fcp data length in the command. ex.
673 * TAPE IOs where blocks can of unequal
674 * lengths.
675 * - io-tag can be reused.
676 *
677 * BFI_IOIM_STS_RES_FREE : Firmware has completed using io-tag
678 * during abort process
679 * - io-tag can be reused.
680 *
681 * BFI_IOIM_STS_PROTO_ERR : Firmware detected a protocol error.
682 * ex target sent more data than
683 * requested, or there was data frame
684 * loss and other reasons
685 * - io-tag cannot be used yet.
686 *
687 * BFI_IOIM_STS_DIF_ERR : Firwmare detected DIF error. ex: DIF
688 * CRC err or Ref Tag err or App tag err.
689 * - io-tag can be reused.
690 *
691 * BFA_IOIM_STS_TSK_MGT_ABORT : IO was aborted because of Task
692 * Management command from the host
693 * - io-tag can be reused.
694 *
695 * BFI_IOIM_STS_UTAG : Firmware does not know about this
696 * io_tag.
697 * - io-tag can be reused.
698 */
699enum bfi_ioim_status {
700 BFI_IOIM_STS_OK = 0,
701 BFI_IOIM_STS_HOST_ABORTED = 1,
702 BFI_IOIM_STS_ABORTED = 2,
703 BFI_IOIM_STS_TIMEDOUT = 3,
704 BFI_IOIM_STS_RES_FREE = 4,
705 BFI_IOIM_STS_SQER_NEEDED = 5,
706 BFI_IOIM_STS_PROTO_ERR = 6,
707 BFI_IOIM_STS_UTAG = 7,
708 BFI_IOIM_STS_PATHTOV = 8,
709};
710
711#define BFI_IOIM_SNSLEN (256)
Jing Huangacdc79a2010-10-18 17:15:55 -0700712/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700713 * I/O response message
714 */
715struct bfi_ioim_rsp_s {
716 struct bfi_mhdr_s mh; /* common msg header */
Maggie50444a32010-11-29 18:26:32 -0800717 __be16 io_tag; /* completed IO tag */
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700718 u16 bfa_rport_hndl; /* releated rport handle */
719 u8 io_status; /* IO completion status */
720 u8 reuse_io_tag; /* IO tag can be reused */
721 u16 abort_tag; /* host abort request tag */
722 u8 scsi_status; /* scsi status from target */
723 u8 sns_len; /* scsi sense length */
724 u8 resid_flags; /* IO residue flags */
725 u8 rsvd_a;
Maggie50444a32010-11-29 18:26:32 -0800726 __be32 residue; /* IO residual length in bytes */
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700727 u32 rsvd_b[3];
728};
729
730struct bfi_ioim_abort_req_s {
731 struct bfi_mhdr_s mh; /* Common msg header */
Maggie50444a32010-11-29 18:26:32 -0800732 __be16 io_tag; /* I/O tag */
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700733 u16 abort_tag; /* unique request tag */
734};
735
736/*
737 * Initiator mode task management command interface defines.
738 */
739
740enum bfi_tskim_h2i {
741 BFI_TSKIM_H2I_TM_REQ = 1, /* task-mgmt command */
742 BFI_TSKIM_H2I_ABORT_REQ = 2, /* task-mgmt command */
743};
744
745enum bfi_tskim_i2h {
746 BFI_TSKIM_I2H_TM_RSP = BFA_I2HM(1),
747};
748
749struct bfi_tskim_req_s {
750 struct bfi_mhdr_s mh; /* Common msg header */
Maggie50444a32010-11-29 18:26:32 -0800751 __be16 tsk_tag; /* task management tag */
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700752 u16 itn_fhdl; /* itn firmware handle */
Maggie Zhangf3148782010-12-09 19:11:39 -0800753 struct scsi_lun lun; /* LU number */
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700754 u8 tm_flags; /* see enum fcp_tm_cmnd */
755 u8 t_secs; /* Timeout value in seconds */
756 u8 rsvd[2];
757};
758
759struct bfi_tskim_abortreq_s {
760 struct bfi_mhdr_s mh; /* Common msg header */
Maggie50444a32010-11-29 18:26:32 -0800761 __be16 tsk_tag; /* task management tag */
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700762 u16 rsvd;
763};
764
765enum bfi_tskim_status {
766 /*
767 * Following are FCP-4 spec defined status codes,
768 * **DO NOT CHANGE THEM **
769 */
770 BFI_TSKIM_STS_OK = 0,
771 BFI_TSKIM_STS_NOT_SUPP = 4,
772 BFI_TSKIM_STS_FAILED = 5,
773
Jing Huangacdc79a2010-10-18 17:15:55 -0700774 /*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700775 * Defined by BFA
776 */
777 BFI_TSKIM_STS_TIMEOUT = 10, /* TM request timedout */
778 BFI_TSKIM_STS_ABORTED = 11, /* Aborted on host request */
779};
780
781struct bfi_tskim_rsp_s {
782 struct bfi_mhdr_s mh; /* Common msg header */
Maggie50444a32010-11-29 18:26:32 -0800783 __be16 tsk_tag; /* task mgmt cmnd tag */
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700784 u8 tsk_status; /* @ref bfi_tskim_status */
785 u8 rsvd;
786};
787
788#pragma pack()
789
Krishna Gudipati11189202011-06-13 15:50:35 -0700790/*
791 * Crossbow PCI MSI-X vector defines
792 */
793enum {
794 BFI_MSIX_CPE_QMIN_CB = 0,
795 BFI_MSIX_CPE_QMAX_CB = 7,
796 BFI_MSIX_RME_QMIN_CB = 8,
797 BFI_MSIX_RME_QMAX_CB = 15,
798 BFI_MSIX_CB_MAX = 22,
799};
800
801/*
802 * Catapult FC PCI MSI-X vector defines
803 */
804enum {
805 BFI_MSIX_LPU_ERR_CT = 0,
806 BFI_MSIX_CPE_QMIN_CT = 1,
807 BFI_MSIX_CPE_QMAX_CT = 4,
808 BFI_MSIX_RME_QMIN_CT = 5,
809 BFI_MSIX_RME_QMAX_CT = 8,
810 BFI_MSIX_CT_MAX = 9,
811};
812
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700813#endif /* __BFI_MS_H__ */