blob: c9c8e8da5bd1cb3b29e992bef072ed2d2aee2bbf [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;
376 u8 rsvd[2];
377};
378
379struct bfi_lps_login_rsp_s {
380 struct bfi_mhdr_s mh; /* common msg header */
381 u8 lp_tag;
382 u8 status;
383 u8 lsrjt_rsn;
384 u8 lsrjt_expl;
385 wwn_t port_name;
386 wwn_t node_name;
Maggie50444a32010-11-29 18:26:32 -0800387 __be16 bb_credit;
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700388 u8 f_port;
389 u8 npiv_en;
390 u32 lp_pid:24;
391 u32 auth_req:8;
392 mac_t lp_mac;
393 mac_t fcf_mac;
394 u8 ext_status;
395 u8 brcd_switch; /* attached peer is brcd switch */
396};
397
398struct bfi_lps_logout_req_s {
399 struct bfi_mhdr_s mh; /* common msg header */
400 u8 lp_tag;
401 u8 rsvd[3];
402 wwn_t port_name;
403};
404
405struct bfi_lps_logout_rsp_s {
406 struct bfi_mhdr_s mh; /* common msg header */
407 u8 lp_tag;
408 u8 status;
409 u8 rsvd[2];
410};
411
412struct bfi_lps_cvl_event_s {
413 struct bfi_mhdr_s mh; /* common msg header */
414 u8 lp_tag;
415 u8 rsvd[3];
416};
417
Krishna Gudipatib7044952010-12-13 16:17:42 -0800418struct bfi_lps_n2n_pid_req_s {
419 struct bfi_mhdr_s mh; /* common msg header */
420 u8 lp_tag;
421 u32 lp_pid:24;
422};
423
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700424union bfi_lps_h2i_msg_u {
425 struct bfi_mhdr_s *msg;
426 struct bfi_lps_login_req_s *login_req;
427 struct bfi_lps_logout_req_s *logout_req;
Krishna Gudipatib7044952010-12-13 16:17:42 -0800428 struct bfi_lps_n2n_pid_req_s *n2n_pid_req;
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700429};
430
431union bfi_lps_i2h_msg_u {
432 struct bfi_msg_s *msg;
433 struct bfi_lps_login_rsp_s *login_rsp;
434 struct bfi_lps_logout_rsp_s *logout_rsp;
435 struct bfi_lps_cvl_event_s *cvl_event;
436};
437
438enum bfi_rport_h2i_msgs {
439 BFI_RPORT_H2I_CREATE_REQ = 1,
440 BFI_RPORT_H2I_DELETE_REQ = 2,
441 BFI_RPORT_H2I_SET_SPEED_REQ = 3,
442};
443
444enum bfi_rport_i2h_msgs {
445 BFI_RPORT_I2H_CREATE_RSP = BFA_I2HM(1),
446 BFI_RPORT_I2H_DELETE_RSP = BFA_I2HM(2),
447 BFI_RPORT_I2H_QOS_SCN = BFA_I2HM(3),
448};
449
450struct bfi_rport_create_req_s {
451 struct bfi_mhdr_s mh; /* common msg header */
452 u16 bfa_handle; /* host rport handle */
Maggie50444a32010-11-29 18:26:32 -0800453 __be16 max_frmsz; /* max rcv pdu size */
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700454 u32 pid:24, /* remote port ID */
455 lp_tag:8; /* local port tag */
456 u32 local_pid:24, /* local port ID */
457 cisc:8;
458 u8 fc_class; /* supported FC classes */
459 u8 vf_en; /* virtual fabric enable */
460 u16 vf_id; /* virtual fabric ID */
461};
462
463struct bfi_rport_create_rsp_s {
464 struct bfi_mhdr_s mh; /* common msg header */
465 u8 status; /* rport creation status */
466 u8 rsvd[3];
467 u16 bfa_handle; /* host rport handle */
468 u16 fw_handle; /* firmware rport handle */
469 struct bfa_rport_qos_attr_s qos_attr; /* QoS Attributes */
470};
471
472struct bfa_rport_speed_req_s {
473 struct bfi_mhdr_s mh; /* common msg header */
474 u16 fw_handle; /* firmware rport handle */
475 u8 speed; /* rport's speed via RPSC */
476 u8 rsvd;
477};
478
479struct bfi_rport_delete_req_s {
480 struct bfi_mhdr_s mh; /* common msg header */
481 u16 fw_handle; /* firmware rport handle */
482 u16 rsvd;
483};
484
485struct bfi_rport_delete_rsp_s {
486 struct bfi_mhdr_s mh; /* common msg header */
487 u16 bfa_handle; /* host rport handle */
488 u8 status; /* rport deletion status */
489 u8 rsvd;
490};
491
492struct bfi_rport_qos_scn_s {
493 struct bfi_mhdr_s mh; /* common msg header */
494 u16 bfa_handle; /* host rport handle */
495 u16 rsvd;
496 struct bfa_rport_qos_attr_s old_qos_attr; /* Old QoS Attributes */
497 struct bfa_rport_qos_attr_s new_qos_attr; /* New QoS Attributes */
498};
499
500union bfi_rport_h2i_msg_u {
501 struct bfi_msg_s *msg;
502 struct bfi_rport_create_req_s *create_req;
503 struct bfi_rport_delete_req_s *delete_req;
504 struct bfi_rport_speed_req_s *speed_req;
505};
506
507union bfi_rport_i2h_msg_u {
508 struct bfi_msg_s *msg;
509 struct bfi_rport_create_rsp_s *create_rsp;
510 struct bfi_rport_delete_rsp_s *delete_rsp;
511 struct bfi_rport_qos_scn_s *qos_scn_evt;
512};
513
514/*
515 * Initiator mode I-T nexus interface defines.
516 */
517
518enum bfi_itnim_h2i {
519 BFI_ITNIM_H2I_CREATE_REQ = 1, /* i-t nexus creation */
520 BFI_ITNIM_H2I_DELETE_REQ = 2, /* i-t nexus deletion */
521};
522
523enum bfi_itnim_i2h {
524 BFI_ITNIM_I2H_CREATE_RSP = BFA_I2HM(1),
525 BFI_ITNIM_I2H_DELETE_RSP = BFA_I2HM(2),
526 BFI_ITNIM_I2H_SLER_EVENT = BFA_I2HM(3),
527};
528
529struct bfi_itnim_create_req_s {
530 struct bfi_mhdr_s mh; /* common msg header */
531 u16 fw_handle; /* f/w handle for itnim */
532 u8 class; /* FC class for IO */
533 u8 seq_rec; /* sequence recovery support */
534 u8 msg_no; /* seq id of the msg */
535};
536
537struct bfi_itnim_create_rsp_s {
538 struct bfi_mhdr_s mh; /* common msg header */
539 u16 bfa_handle; /* bfa handle for itnim */
540 u8 status; /* fcp request status */
541 u8 seq_id; /* seq id of the msg */
542};
543
544struct bfi_itnim_delete_req_s {
545 struct bfi_mhdr_s mh; /* common msg header */
546 u16 fw_handle; /* f/w itnim handle */
547 u8 seq_id; /* seq id of the msg */
548 u8 rsvd;
549};
550
551struct bfi_itnim_delete_rsp_s {
552 struct bfi_mhdr_s mh; /* common msg header */
553 u16 bfa_handle; /* bfa handle for itnim */
554 u8 status; /* fcp request status */
555 u8 seq_id; /* seq id of the msg */
556};
557
558struct bfi_itnim_sler_event_s {
559 struct bfi_mhdr_s mh; /* common msg header */
560 u16 bfa_handle; /* bfa handle for itnim */
561 u16 rsvd;
562};
563
564union bfi_itnim_h2i_msg_u {
565 struct bfi_itnim_create_req_s *create_req;
566 struct bfi_itnim_delete_req_s *delete_req;
567 struct bfi_msg_s *msg;
568};
569
570union bfi_itnim_i2h_msg_u {
571 struct bfi_itnim_create_rsp_s *create_rsp;
572 struct bfi_itnim_delete_rsp_s *delete_rsp;
573 struct bfi_itnim_sler_event_s *sler_event;
574 struct bfi_msg_s *msg;
575};
576
577/*
578 * Initiator mode IO interface defines.
579 */
580
581enum bfi_ioim_h2i {
582 BFI_IOIM_H2I_IOABORT_REQ = 1, /* IO abort request */
583 BFI_IOIM_H2I_IOCLEANUP_REQ = 2, /* IO cleanup request */
584};
585
586enum bfi_ioim_i2h {
587 BFI_IOIM_I2H_IO_RSP = BFA_I2HM(1), /* non-fp IO response */
588 BFI_IOIM_I2H_IOABORT_RSP = BFA_I2HM(2), /* ABORT rsp */
589};
590
Jing Huangacdc79a2010-10-18 17:15:55 -0700591/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700592 * IO command DIF info
593 */
594struct bfi_ioim_dif_s {
595 u32 dif_info[4];
596};
597
Jing Huangacdc79a2010-10-18 17:15:55 -0700598/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700599 * FCP IO messages overview
600 *
601 * @note
602 * - Max CDB length supported is 64 bytes.
603 * - SCSI Linked commands and SCSI bi-directional Commands not
604 * supported.
605 *
606 */
607struct bfi_ioim_req_s {
608 struct bfi_mhdr_s mh; /* Common msg header */
Maggie50444a32010-11-29 18:26:32 -0800609 __be16 io_tag; /* I/O tag */
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700610 u16 rport_hdl; /* itnim/rport firmware handle */
611 struct fcp_cmnd_s cmnd; /* IO request info */
612
Jing Huangacdc79a2010-10-18 17:15:55 -0700613 /*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700614 * SG elements array within the IO request must be double word
615 * aligned. This aligment is required to optimize SGM setup for the IO.
616 */
617 struct bfi_sge_s sges[BFI_SGE_INLINE_MAX];
618 u8 io_timeout;
619 u8 dif_en;
620 u8 rsvd_a[2];
621 struct bfi_ioim_dif_s dif;
622};
623
Jing Huangacdc79a2010-10-18 17:15:55 -0700624/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700625 * This table shows various IO status codes from firmware and their
626 * meaning. Host driver can use these status codes to further process
627 * IO completions.
628 *
629 * BFI_IOIM_STS_OK : IO completed with error free SCSI &
630 * transport status.
631 * io-tag can be reused.
632 *
633 * BFA_IOIM_STS_SCSI_ERR : IO completed with scsi error.
634 * - io-tag can be reused.
635 *
636 * BFI_IOIM_STS_HOST_ABORTED : IO was aborted successfully due to
637 * host request.
638 * - io-tag cannot be reused yet.
639 *
640 * BFI_IOIM_STS_ABORTED : IO was aborted successfully
641 * internally by f/w.
642 * - io-tag cannot be reused yet.
643 *
644 * BFI_IOIM_STS_TIMEDOUT : IO timedout and ABTS/RRQ is happening
645 * in the firmware and
646 * - io-tag cannot be reused yet.
647 *
648 * BFI_IOIM_STS_SQER_NEEDED : Firmware could not recover the IO
649 * with sequence level error
650 * logic and hence host needs to retry
651 * this IO with a different IO tag
652 * - io-tag cannot be used yet.
653 *
654 * BFI_IOIM_STS_NEXUS_ABORT : Second Level Error Recovery from host
655 * is required because 2 consecutive ABTS
656 * timedout and host needs logout and
657 * re-login with the target
658 * - io-tag cannot be used yet.
659 *
660 * BFI_IOIM_STS_UNDERRUN : IO completed with SCSI status good,
661 * but the data tranferred is less than
662 * the fcp data length in the command.
663 * ex. SCSI INQUIRY where transferred
664 * data length and residue count in FCP
665 * response accounts for total fcp-dl
666 * - io-tag can be reused.
667 *
668 * BFI_IOIM_STS_OVERRUN : IO completed with SCSI status good,
669 * but the data transerred is more than
670 * fcp data length in the command. ex.
671 * TAPE IOs where blocks can of unequal
672 * lengths.
673 * - io-tag can be reused.
674 *
675 * BFI_IOIM_STS_RES_FREE : Firmware has completed using io-tag
676 * during abort process
677 * - io-tag can be reused.
678 *
679 * BFI_IOIM_STS_PROTO_ERR : Firmware detected a protocol error.
680 * ex target sent more data than
681 * requested, or there was data frame
682 * loss and other reasons
683 * - io-tag cannot be used yet.
684 *
685 * BFI_IOIM_STS_DIF_ERR : Firwmare detected DIF error. ex: DIF
686 * CRC err or Ref Tag err or App tag err.
687 * - io-tag can be reused.
688 *
689 * BFA_IOIM_STS_TSK_MGT_ABORT : IO was aborted because of Task
690 * Management command from the host
691 * - io-tag can be reused.
692 *
693 * BFI_IOIM_STS_UTAG : Firmware does not know about this
694 * io_tag.
695 * - io-tag can be reused.
696 */
697enum bfi_ioim_status {
698 BFI_IOIM_STS_OK = 0,
699 BFI_IOIM_STS_HOST_ABORTED = 1,
700 BFI_IOIM_STS_ABORTED = 2,
701 BFI_IOIM_STS_TIMEDOUT = 3,
702 BFI_IOIM_STS_RES_FREE = 4,
703 BFI_IOIM_STS_SQER_NEEDED = 5,
704 BFI_IOIM_STS_PROTO_ERR = 6,
705 BFI_IOIM_STS_UTAG = 7,
706 BFI_IOIM_STS_PATHTOV = 8,
707};
708
709#define BFI_IOIM_SNSLEN (256)
Jing Huangacdc79a2010-10-18 17:15:55 -0700710/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700711 * I/O response message
712 */
713struct bfi_ioim_rsp_s {
714 struct bfi_mhdr_s mh; /* common msg header */
Maggie50444a32010-11-29 18:26:32 -0800715 __be16 io_tag; /* completed IO tag */
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700716 u16 bfa_rport_hndl; /* releated rport handle */
717 u8 io_status; /* IO completion status */
718 u8 reuse_io_tag; /* IO tag can be reused */
719 u16 abort_tag; /* host abort request tag */
720 u8 scsi_status; /* scsi status from target */
721 u8 sns_len; /* scsi sense length */
722 u8 resid_flags; /* IO residue flags */
723 u8 rsvd_a;
Maggie50444a32010-11-29 18:26:32 -0800724 __be32 residue; /* IO residual length in bytes */
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700725 u32 rsvd_b[3];
726};
727
728struct bfi_ioim_abort_req_s {
729 struct bfi_mhdr_s mh; /* Common msg header */
Maggie50444a32010-11-29 18:26:32 -0800730 __be16 io_tag; /* I/O tag */
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700731 u16 abort_tag; /* unique request tag */
732};
733
734/*
735 * Initiator mode task management command interface defines.
736 */
737
738enum bfi_tskim_h2i {
739 BFI_TSKIM_H2I_TM_REQ = 1, /* task-mgmt command */
740 BFI_TSKIM_H2I_ABORT_REQ = 2, /* task-mgmt command */
741};
742
743enum bfi_tskim_i2h {
744 BFI_TSKIM_I2H_TM_RSP = BFA_I2HM(1),
745};
746
747struct bfi_tskim_req_s {
748 struct bfi_mhdr_s mh; /* Common msg header */
Maggie50444a32010-11-29 18:26:32 -0800749 __be16 tsk_tag; /* task management tag */
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700750 u16 itn_fhdl; /* itn firmware handle */
Maggie Zhangf3148782010-12-09 19:11:39 -0800751 struct scsi_lun lun; /* LU number */
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700752 u8 tm_flags; /* see enum fcp_tm_cmnd */
753 u8 t_secs; /* Timeout value in seconds */
754 u8 rsvd[2];
755};
756
757struct bfi_tskim_abortreq_s {
758 struct bfi_mhdr_s mh; /* Common msg header */
Maggie50444a32010-11-29 18:26:32 -0800759 __be16 tsk_tag; /* task management tag */
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700760 u16 rsvd;
761};
762
763enum bfi_tskim_status {
764 /*
765 * Following are FCP-4 spec defined status codes,
766 * **DO NOT CHANGE THEM **
767 */
768 BFI_TSKIM_STS_OK = 0,
769 BFI_TSKIM_STS_NOT_SUPP = 4,
770 BFI_TSKIM_STS_FAILED = 5,
771
Jing Huangacdc79a2010-10-18 17:15:55 -0700772 /*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700773 * Defined by BFA
774 */
775 BFI_TSKIM_STS_TIMEOUT = 10, /* TM request timedout */
776 BFI_TSKIM_STS_ABORTED = 11, /* Aborted on host request */
777};
778
779struct bfi_tskim_rsp_s {
780 struct bfi_mhdr_s mh; /* Common msg header */
Maggie50444a32010-11-29 18:26:32 -0800781 __be16 tsk_tag; /* task mgmt cmnd tag */
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700782 u8 tsk_status; /* @ref bfi_tskim_status */
783 u8 rsvd;
784};
785
786#pragma pack()
787
Krishna Gudipati11189202011-06-13 15:50:35 -0700788/*
789 * Crossbow PCI MSI-X vector defines
790 */
791enum {
792 BFI_MSIX_CPE_QMIN_CB = 0,
793 BFI_MSIX_CPE_QMAX_CB = 7,
794 BFI_MSIX_RME_QMIN_CB = 8,
795 BFI_MSIX_RME_QMAX_CB = 15,
796 BFI_MSIX_CB_MAX = 22,
797};
798
799/*
800 * Catapult FC PCI MSI-X vector defines
801 */
802enum {
803 BFI_MSIX_LPU_ERR_CT = 0,
804 BFI_MSIX_CPE_QMIN_CT = 1,
805 BFI_MSIX_CPE_QMAX_CT = 4,
806 BFI_MSIX_RME_QMIN_CT = 5,
807 BFI_MSIX_RME_QMAX_CT = 8,
808 BFI_MSIX_CT_MAX = 9,
809};
810
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700811#endif /* __BFI_MS_H__ */