xref: /openbmc/linux/drivers/scsi/be2iscsi/be_cmds.h (revision b6bec26c)
1 /**
2  * Copyright (C) 2005 - 2012 Emulex
3  * All rights reserved.
4  *
5  * This program is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU General Public License version 2
7  * as published by the Free Software Foundation.  The full GNU General
8  * Public License is included in this distribution in the file called COPYING.
9  *
10  * Contact Information:
11  * linux-drivers@emulex.com
12  *
13  * Emulex
14  * 3333 Susan Street
15  * Costa Mesa, CA 92626
16  */
17 
18 #ifndef BEISCSI_CMDS_H
19 #define BEISCSI_CMDS_H
20 
21 /**
22  * The driver sends configuration and managements command requests to the
23  * firmware in the BE. These requests are communicated to the processor
24  * using Work Request Blocks (WRBs) submitted to the MCC-WRB ring or via one
25  * WRB inside a MAILBOX.
26  * The commands are serviced by the ARM processor in the OneConnect's MPU.
27  */
28 struct be_sge {
29 	u32 pa_lo;
30 	u32 pa_hi;
31 	u32 len;
32 };
33 
34 #define MCC_WRB_SGE_CNT_SHIFT 3	/* bits 3 - 7 of dword 0 */
35 #define MCC_WRB_SGE_CNT_MASK 0x1F	/* bits 3 - 7 of dword 0 */
36 struct be_mcc_wrb {
37 	u32 embedded;		/* dword 0 */
38 	u32 payload_length;	/* dword 1 */
39 	u32 tag0;		/* dword 2 */
40 	u32 tag1;		/* dword 3 */
41 	u32 rsvd;		/* dword 4 */
42 	union {
43 		u8 embedded_payload[236];	/* used by embedded cmds */
44 		struct be_sge sgl[19];	/* used by non-embedded cmds */
45 	} payload;
46 };
47 
48 #define CQE_FLAGS_VALID_MASK (1 << 31)
49 #define CQE_FLAGS_ASYNC_MASK (1 << 30)
50 #define CQE_FLAGS_COMPLETED_MASK	(1 << 28)
51 #define CQE_FLAGS_CONSUMED_MASK		(1 << 27)
52 
53 /* Completion Status */
54 #define MCC_STATUS_SUCCESS 0x0
55 
56 #define CQE_STATUS_COMPL_MASK 0xFFFF
57 #define CQE_STATUS_COMPL_SHIFT 0	/* bits 0 - 15 */
58 #define CQE_STATUS_EXTD_MASK 0xFFFF
59 #define CQE_STATUS_EXTD_SHIFT 16		/* bits 0 - 15 */
60 #define CQE_STATUS_ADDL_MASK	0xFF00
61 #define CQE_STATUS_MASK	0xFF
62 #define CQE_STATUS_ADDL_SHIFT	0x08
63 #define CQE_STATUS_WRB_MASK	0xFF0000
64 #define CQE_STATUS_WRB_SHIFT	16
65 #define BEISCSI_HOST_MBX_TIMEOUT (110 * 1000)
66 #define BEISCSI_FW_MBX_TIMEOUT	100
67 
68 /* MBOX Command VER */
69 #define MBX_CMD_VER2	0x02
70 
71 struct be_mcc_compl {
72 	u32 status;		/* dword 0 */
73 	u32 tag0;		/* dword 1 */
74 	u32 tag1;		/* dword 2 */
75 	u32 flags;		/* dword 3 */
76 };
77 
78 /********* Mailbox door bell *************/
79 /**
80  * Used for driver communication with the FW.
81  * The software must write this register twice to post any command. First,
82  * it writes the register with hi=1 and the upper bits of the physical address
83  * for the MAILBOX structure. Software must poll the ready bit until this
84  * is acknowledged. Then, sotware writes the register with hi=0 with the lower
85  * bits in the address. It must poll the ready bit until the command is
86  * complete. Upon completion, the MAILBOX will contain a valid completion
87  * queue entry.
88  */
89 #define MPU_MAILBOX_DB_OFFSET	0x160
90 #define MPU_MAILBOX_DB_RDY_MASK	0x1	/* bit 0 */
91 #define MPU_MAILBOX_DB_HI_MASK	0x2	/* bit 1 */
92 
93 /********** MPU semphore ******************/
94 #define MPU_EP_SEMAPHORE_OFFSET 0xac
95 #define EP_SEMAPHORE_POST_STAGE_MASK 0x0000FFFF
96 #define EP_SEMAPHORE_POST_ERR_MASK 0x1
97 #define EP_SEMAPHORE_POST_ERR_SHIFT 31
98 
99 /********** MCC door bell ************/
100 #define DB_MCCQ_OFFSET 0x140
101 #define DB_MCCQ_RING_ID_MASK 0x7FF		/* bits 0 - 10 */
102 /* Number of entries posted */
103 #define DB_MCCQ_NUM_POSTED_SHIFT 16		/* bits 16 - 29 */
104 
105 /* MPU semphore POST stage values */
106 #define POST_STAGE_ARMFW_RDY		0xc000	/* FW is done with POST */
107 
108 /**
109  * When the async bit of mcc_compl is set, the last 4 bytes of
110  * mcc_compl is interpreted as follows:
111  */
112 #define ASYNC_TRAILER_EVENT_CODE_SHIFT	8	/* bits 8 - 15 */
113 #define ASYNC_TRAILER_EVENT_CODE_MASK	0xFF
114 #define ASYNC_EVENT_CODE_LINK_STATE	0x1
115 struct be_async_event_trailer {
116 	u32 code;
117 };
118 
119 enum {
120 	ASYNC_EVENT_LINK_DOWN = 0x0,
121 	ASYNC_EVENT_LINK_UP = 0x1
122 };
123 
124 /**
125  * When the event code of an async trailer is link-state, the mcc_compl
126  * must be interpreted as follows
127  */
128 struct be_async_event_link_state {
129 	u8 physical_port;
130 	u8 port_link_status;
131 	u8 port_duplex;
132 	u8 port_speed;
133 	u8 port_fault;
134 	u8 rsvd0[7];
135 	struct be_async_event_trailer trailer;
136 } __packed;
137 
138 struct be_mcc_mailbox {
139 	struct be_mcc_wrb wrb;
140 	struct be_mcc_compl compl;
141 };
142 
143 /* Type of subsystems supported by FW */
144 #define CMD_SUBSYSTEM_COMMON    0x1
145 #define CMD_SUBSYSTEM_ISCSI     0x2
146 #define CMD_SUBSYSTEM_ETH       0x3
147 #define CMD_SUBSYSTEM_ISCSI_INI 0x6
148 #define CMD_COMMON_TCP_UPLOAD   0x1
149 
150 /**
151  * List of common opcodes subsystem  CMD_SUBSYSTEM_COMMON
152  * These opcodes are unique for each subsystem defined above
153  */
154 #define OPCODE_COMMON_CQ_CREATE				12
155 #define OPCODE_COMMON_EQ_CREATE				13
156 #define OPCODE_COMMON_MCC_CREATE			21
157 #define OPCODE_COMMON_GET_CNTL_ATTRIBUTES		32
158 #define OPCODE_COMMON_GET_FW_VERSION			35
159 #define OPCODE_COMMON_MODIFY_EQ_DELAY			41
160 #define OPCODE_COMMON_FIRMWARE_CONFIG			42
161 #define OPCODE_COMMON_MCC_DESTROY			53
162 #define OPCODE_COMMON_CQ_DESTROY			54
163 #define OPCODE_COMMON_EQ_DESTROY			55
164 #define OPCODE_COMMON_QUERY_FIRMWARE_CONFIG		58
165 #define OPCODE_COMMON_FUNCTION_RESET			61
166 
167 /**
168  * LIST of opcodes that are common between Initiator and Target
169  * used by CMD_SUBSYSTEM_ISCSI
170  * These opcodes are unique for each subsystem defined above
171  */
172 #define OPCODE_COMMON_ISCSI_CFG_POST_SGL_PAGES		2
173 #define OPCODE_COMMON_ISCSI_CFG_REMOVE_SGL_PAGES        3
174 #define OPCODE_COMMON_ISCSI_NTWK_GET_NIC_CONFIG		7
175 #define OPCODE_COMMON_ISCSI_NTWK_SET_VLAN		14
176 #define OPCODE_COMMON_ISCSI_NTWK_CONFIG_STATELESS_IP_ADDR	17
177 #define OPCODE_COMMON_ISCSI_NTWK_REL_STATELESS_IP_ADDR	18
178 #define OPCODE_COMMON_ISCSI_NTWK_MODIFY_IP_ADDR		21
179 #define OPCODE_COMMON_ISCSI_NTWK_GET_DEFAULT_GATEWAY	22
180 #define OPCODE_COMMON_ISCSI_NTWK_MODIFY_DEFAULT_GATEWAY 23
181 #define OPCODE_COMMON_ISCSI_NTWK_GET_ALL_IF_ID		24
182 #define OPCODE_COMMON_ISCSI_NTWK_GET_IF_INFO		25
183 #define OPCODE_COMMON_ISCSI_SET_FRAGNUM_BITS_FOR_SGL_CRA 61
184 #define OPCODE_COMMON_ISCSI_DEFQ_CREATE                 64
185 #define OPCODE_COMMON_ISCSI_DEFQ_DESTROY		65
186 #define OPCODE_COMMON_ISCSI_WRBQ_CREATE			66
187 #define OPCODE_COMMON_ISCSI_WRBQ_DESTROY		67
188 
189 struct be_cmd_req_hdr {
190 	u8 opcode;		/* dword 0 */
191 	u8 subsystem;		/* dword 0 */
192 	u8 port_number;		/* dword 0 */
193 	u8 domain;		/* dword 0 */
194 	u32 timeout;		/* dword 1 */
195 	u32 request_length;	/* dword 2 */
196 	u8 version;		/* dword 3 */
197 	u8 rsvd0[3];		/* dword 3 */
198 };
199 
200 struct be_cmd_resp_hdr {
201 	u32 info;		/* dword 0 */
202 	u32 status;		/* dword 1 */
203 	u32 response_length;	/* dword 2 */
204 	u32 actual_resp_len;	/* dword 3 */
205 };
206 
207 struct phys_addr {
208 	u32 lo;
209 	u32 hi;
210 };
211 
212 /**************************
213  * BE Command definitions *
214  **************************/
215 
216 /**
217  * Pseudo amap definition in which each bit of the actual structure is defined
218  * as a byte - used to calculate offset/shift/mask of each field
219  */
220 struct amap_eq_context {
221 	u8 cidx[13];		/* dword 0 */
222 	u8 rsvd0[3];		/* dword 0 */
223 	u8 epidx[13];		/* dword 0 */
224 	u8 valid;		/* dword 0 */
225 	u8 rsvd1;		/* dword 0 */
226 	u8 size;		/* dword 0 */
227 	u8 pidx[13];		/* dword 1 */
228 	u8 rsvd2[3];		/* dword 1 */
229 	u8 pd[10];		/* dword 1 */
230 	u8 count[3];		/* dword 1 */
231 	u8 solevent;		/* dword 1 */
232 	u8 stalled;		/* dword 1 */
233 	u8 armed;		/* dword 1 */
234 	u8 rsvd3[4];		/* dword 2 */
235 	u8 func[8];		/* dword 2 */
236 	u8 rsvd4;		/* dword 2 */
237 	u8 delaymult[10];	/* dword 2 */
238 	u8 rsvd5[2];		/* dword 2 */
239 	u8 phase[2];		/* dword 2 */
240 	u8 nodelay;		/* dword 2 */
241 	u8 rsvd6[4];		/* dword 2 */
242 	u8 rsvd7[32];		/* dword 3 */
243 } __packed;
244 
245 struct be_cmd_req_eq_create {
246 	struct be_cmd_req_hdr hdr;	/* dw[4] */
247 	u16 num_pages;		/* sword */
248 	u16 rsvd0;		/* sword */
249 	u8 context[sizeof(struct amap_eq_context) / 8];	/* dw[4] */
250 	struct phys_addr pages[8];
251 } __packed;
252 
253 struct be_cmd_resp_eq_create {
254 	struct be_cmd_resp_hdr resp_hdr;
255 	u16 eq_id;		/* sword */
256 	u16 rsvd0;		/* sword */
257 } __packed;
258 
259 struct mgmt_chap_format {
260 	u32 flags;
261 	u8  intr_chap_name[256];
262 	u8  intr_secret[16];
263 	u8  target_chap_name[256];
264 	u8  target_secret[16];
265 	u16 intr_chap_name_length;
266 	u16 intr_secret_length;
267 	u16 target_chap_name_length;
268 	u16 target_secret_length;
269 } __packed;
270 
271 struct mgmt_auth_method_format {
272 	u8	auth_method_type;
273 	u8	padding[3];
274 	struct	mgmt_chap_format chap;
275 } __packed;
276 
277 struct mgmt_conn_login_options {
278 	u8 flags;
279 	u8 header_digest;
280 	u8 data_digest;
281 	u8 rsvd0;
282 	u32 max_recv_datasegment_len_ini;
283 	u32 max_recv_datasegment_len_tgt;
284 	u32 tcp_mss;
285 	u32 tcp_window_size;
286 	struct	mgmt_auth_method_format auth_data;
287 } __packed;
288 
289 struct ip_addr_format {
290 	u16 size_of_structure;
291 	u8 reserved;
292 	u8 ip_type;
293 	u8 addr[16];
294 	u32 rsvd0;
295 } __packed;
296 
297 struct mgmt_conn_info {
298 	u32	connection_handle;
299 	u32	connection_status;
300 	u16	src_port;
301 	u16	dest_port;
302 	u16	dest_port_redirected;
303 	u16	cid;
304 	u32	estimated_throughput;
305 	struct	ip_addr_format	src_ipaddr;
306 	struct	ip_addr_format	dest_ipaddr;
307 	struct	ip_addr_format	dest_ipaddr_redirected;
308 	struct	mgmt_conn_login_options	negotiated_login_options;
309 } __packed;
310 
311 struct mgmt_session_login_options {
312 	u8	flags;
313 	u8	error_recovery_level;
314 	u16	rsvd0;
315 	u32	first_burst_length;
316 	u32	max_burst_length;
317 	u16	max_connections;
318 	u16	max_outstanding_r2t;
319 	u16	default_time2wait;
320 	u16	default_time2retain;
321 } __packed;
322 
323 struct mgmt_session_info {
324 	u32	session_handle;
325 	u32	status;
326 	u8	isid[6];
327 	u16	tsih;
328 	u32	session_flags;
329 	u16	conn_count;
330 	u16	pad;
331 	u8	target_name[224];
332 	u8	initiator_iscsiname[224];
333 	struct	mgmt_session_login_options negotiated_login_options;
334 	struct	mgmt_conn_info	conn_list[1];
335 } __packed;
336 
337 struct be_cmd_get_session_req {
338 	struct be_cmd_req_hdr hdr;
339 	u32 session_handle;
340 } __packed;
341 
342 struct be_cmd_get_session_resp {
343 	struct be_cmd_resp_hdr hdr;
344 	struct mgmt_session_info session_info;
345 } __packed;
346 
347 struct mac_addr {
348 	u16 size_of_structure;
349 	u8 addr[ETH_ALEN];
350 } __packed;
351 
352 struct be_cmd_get_boot_target_req {
353 	struct be_cmd_req_hdr hdr;
354 } __packed;
355 
356 struct be_cmd_get_boot_target_resp {
357 	struct be_cmd_resp_hdr hdr;
358 	u32  boot_session_count;
359 	int  boot_session_handle;
360 };
361 
362 struct be_cmd_reopen_session_req {
363 	struct be_cmd_req_hdr hdr;
364 #define BE_REOPEN_ALL_SESSIONS  0x00
365 #define BE_REOPEN_BOOT_SESSIONS 0x01
366 #define BE_REOPEN_A_SESSION     0x02
367 	u16 reopen_type;
368 	u16 rsvd;
369 	u32 session_handle;
370 } __packed;
371 
372 struct be_cmd_reopen_session_resp {
373 	struct be_cmd_resp_hdr hdr;
374 	u32 rsvd;
375 	u32 session_handle;
376 } __packed;
377 
378 
379 struct be_cmd_mac_query_req {
380 	struct be_cmd_req_hdr hdr;
381 	u8 type;
382 	u8 permanent;
383 	u16 if_id;
384 } __packed;
385 
386 struct be_cmd_get_mac_resp {
387 	struct be_cmd_resp_hdr hdr;
388 	struct mac_addr mac;
389 };
390 
391 struct be_ip_addr_subnet_format {
392 	u16 size_of_structure;
393 	u8 ip_type;
394 	u8 ipv6_prefix_length;
395 	u8 addr[16];
396 	u8 subnet_mask[16];
397 	u32 rsvd0;
398 } __packed;
399 
400 struct be_cmd_get_if_info_req {
401 	struct be_cmd_req_hdr hdr;
402 	u32 interface_hndl;
403 	u32 ip_type;
404 } __packed;
405 
406 struct be_cmd_get_if_info_resp {
407 	struct be_cmd_req_hdr hdr;
408 	u32 interface_hndl;
409 	u32 vlan_priority;
410 	u32 ip_addr_count;
411 	u32 dhcp_state;
412 	struct be_ip_addr_subnet_format ip_addr;
413 } __packed;
414 
415 struct be_ip_addr_record {
416 	u32 action;
417 	u32 interface_hndl;
418 	struct be_ip_addr_subnet_format ip_addr;
419 	u32 status;
420 } __packed;
421 
422 struct be_ip_addr_record_params {
423 	u32 record_entry_count;
424 	struct be_ip_addr_record ip_record;
425 } __packed;
426 
427 struct be_cmd_set_ip_addr_req {
428 	struct be_cmd_req_hdr hdr;
429 	struct be_ip_addr_record_params ip_params;
430 } __packed;
431 
432 
433 struct be_cmd_set_dhcp_req {
434 	struct be_cmd_req_hdr hdr;
435 	u32 interface_hndl;
436 	u32 ip_type;
437 	u32 flags;
438 	u32 retry_count;
439 } __packed;
440 
441 struct be_cmd_rel_dhcp_req {
442 	struct be_cmd_req_hdr hdr;
443 	u32 interface_hndl;
444 	u32 ip_type;
445 } __packed;
446 
447 struct be_cmd_set_def_gateway_req {
448 	struct be_cmd_req_hdr hdr;
449 	u32 action;
450 	struct ip_addr_format ip_addr;
451 } __packed;
452 
453 struct be_cmd_get_def_gateway_req {
454 	struct be_cmd_req_hdr hdr;
455 	u32 ip_type;
456 } __packed;
457 
458 struct be_cmd_get_def_gateway_resp {
459 	struct be_cmd_req_hdr hdr;
460 	struct ip_addr_format ip_addr;
461 } __packed;
462 
463 #define BEISCSI_VLAN_DISABLE	0xFFFF
464 struct be_cmd_set_vlan_req {
465 	struct be_cmd_req_hdr hdr;
466 	u32 interface_hndl;
467 	u32 vlan_priority;
468 } __packed;
469 /******************** Create CQ ***************************/
470 /**
471  * Pseudo amap definition in which each bit of the actual structure is defined
472  * as a byte - used to calculate offset/shift/mask of each field
473  */
474 struct amap_cq_context {
475 	u8 cidx[11];		/* dword 0 */
476 	u8 rsvd0;		/* dword 0 */
477 	u8 coalescwm[2];	/* dword 0 */
478 	u8 nodelay;		/* dword 0 */
479 	u8 epidx[11];		/* dword 0 */
480 	u8 rsvd1;		/* dword 0 */
481 	u8 count[2];		/* dword 0 */
482 	u8 valid;		/* dword 0 */
483 	u8 solevent;		/* dword 0 */
484 	u8 eventable;		/* dword 0 */
485 	u8 pidx[11];		/* dword 1 */
486 	u8 rsvd2;		/* dword 1 */
487 	u8 pd[10];		/* dword 1 */
488 	u8 eqid[8];		/* dword 1 */
489 	u8 stalled;		/* dword 1 */
490 	u8 armed;		/* dword 1 */
491 	u8 rsvd3[4];		/* dword 2 */
492 	u8 func[8];		/* dword 2 */
493 	u8 rsvd4[20];		/* dword 2 */
494 	u8 rsvd5[32];		/* dword 3 */
495 } __packed;
496 
497 struct amap_cq_context_v2 {
498 	u8 rsvd0[12];   /* dword 0 */
499 	u8 coalescwm[2];    /* dword 0 */
500 	u8 nodelay;     /* dword 0 */
501 	u8 rsvd1[12];   /* dword 0 */
502 	u8 count[2];    /* dword 0 */
503 	u8 valid;       /* dword 0 */
504 	u8 rsvd2;       /* dword 0 */
505 	u8 eventable;   /* dword 0 */
506 	u8 eqid[16];    /* dword 1 */
507 	u8 rsvd3[15];   /* dword 1 */
508 	u8 armed;       /* dword 1 */
509 	u8 cqecount[16];/* dword 2 */
510 	u8 rsvd4[16];   /* dword 2 */
511 	u8 rsvd5[32];   /* dword 3 */
512 };
513 
514 struct be_cmd_req_cq_create {
515 	struct be_cmd_req_hdr hdr;
516 	u16 num_pages;
517 	u8 page_size;
518 	u8 rsvd0;
519 	u8 context[sizeof(struct amap_cq_context) / 8];
520 	struct phys_addr pages[4];
521 } __packed;
522 
523 struct be_cmd_resp_cq_create {
524 	struct be_cmd_resp_hdr hdr;
525 	u16 cq_id;
526 	u16 rsvd0;
527 } __packed;
528 
529 /******************** Create MCCQ ***************************/
530 /**
531  * Pseudo amap definition in which each bit of the actual structure is defined
532  * as a byte - used to calculate offset/shift/mask of each field
533  */
534 struct amap_mcc_context {
535 	u8 con_index[14];
536 	u8 rsvd0[2];
537 	u8 ring_size[4];
538 	u8 fetch_wrb;
539 	u8 fetch_r2t;
540 	u8 cq_id[10];
541 	u8 prod_index[14];
542 	u8 fid[8];
543 	u8 pdid[9];
544 	u8 valid;
545 	u8 rsvd1[32];
546 	u8 rsvd2[32];
547 } __packed;
548 
549 struct be_cmd_req_mcc_create {
550 	struct be_cmd_req_hdr hdr;
551 	u16 num_pages;
552 	u16 rsvd0;
553 	u8 context[sizeof(struct amap_mcc_context) / 8];
554 	struct phys_addr pages[8];
555 } __packed;
556 
557 struct be_cmd_resp_mcc_create {
558 	struct be_cmd_resp_hdr hdr;
559 	u16 id;
560 	u16 rsvd0;
561 } __packed;
562 
563 /******************** Q Destroy  ***************************/
564 /* Type of Queue to be destroyed */
565 enum {
566 	QTYPE_EQ = 1,
567 	QTYPE_CQ,
568 	QTYPE_MCCQ,
569 	QTYPE_WRBQ,
570 	QTYPE_DPDUQ,
571 	QTYPE_SGL
572 };
573 
574 struct be_cmd_req_q_destroy {
575 	struct be_cmd_req_hdr hdr;
576 	u16 id;
577 	u16 bypass_flush;	/* valid only for rx q destroy */
578 } __packed;
579 
580 struct macaddr {
581 	u8 byte[ETH_ALEN];
582 };
583 
584 struct be_cmd_req_mcast_mac_config {
585 	struct be_cmd_req_hdr hdr;
586 	u16 num_mac;
587 	u8 promiscuous;
588 	u8 interface_id;
589 	struct macaddr mac[32];
590 } __packed;
591 
592 static inline void *embedded_payload(struct be_mcc_wrb *wrb)
593 {
594 	return wrb->payload.embedded_payload;
595 }
596 
597 static inline struct be_sge *nonembedded_sgl(struct be_mcc_wrb *wrb)
598 {
599 	return &wrb->payload.sgl[0];
600 }
601 
602 /******************** Modify EQ Delay *******************/
603 struct be_cmd_req_modify_eq_delay {
604 	struct be_cmd_req_hdr hdr;
605 	u32 num_eq;
606 	struct {
607 		u32 eq_id;
608 		u32 phase;
609 		u32 delay_multiplier;
610 	} delay[8];
611 } __packed;
612 
613 /******************** Get MAC ADDR *******************/
614 
615 #define ETH_ALEN	6
616 
617 struct be_cmd_get_nic_conf_req {
618 	struct be_cmd_req_hdr hdr;
619 	u32 nic_port_count;
620 	u32 speed;
621 	u32 max_speed;
622 	u32 link_state;
623 	u32 max_frame_size;
624 	u16 size_of_structure;
625 	u8 mac_address[ETH_ALEN];
626 	u32 rsvd[23];
627 };
628 
629 struct be_cmd_get_nic_conf_resp {
630 	struct be_cmd_resp_hdr hdr;
631 	u32 nic_port_count;
632 	u32 speed;
633 	u32 max_speed;
634 	u32 link_state;
635 	u32 max_frame_size;
636 	u16 size_of_structure;
637 	u8 mac_address[6];
638 	u32 rsvd[23];
639 };
640 
641 #define BEISCSI_ALIAS_LEN 32
642 
643 struct be_cmd_hba_name {
644 	struct be_cmd_req_hdr hdr;
645 	u16 flags;
646 	u16 rsvd0;
647 	u8 initiator_name[ISCSI_NAME_LEN];
648 	u8 initiator_alias[BEISCSI_ALIAS_LEN];
649 } __packed;
650 
651 struct be_cmd_ntwk_link_status_req {
652 	struct be_cmd_req_hdr hdr;
653 	u32 rsvd0;
654 } __packed;
655 
656 /*** Port Speed Values ***/
657 #define BE2ISCSI_LINK_SPEED_ZERO	0x00
658 #define BE2ISCSI_LINK_SPEED_10MBPS	0x01
659 #define BE2ISCSI_LINK_SPEED_100MBPS	0x02
660 #define BE2ISCSI_LINK_SPEED_1GBPS	0x03
661 #define BE2ISCSI_LINK_SPEED_10GBPS	0x04
662 struct be_cmd_ntwk_link_status_resp {
663 	struct be_cmd_resp_hdr hdr;
664 	u8 phys_port;
665 	u8 mac_duplex;
666 	u8 mac_speed;
667 	u8 mac_fault;
668 	u8 mgmt_mac_duplex;
669 	u8 mgmt_mac_speed;
670 	u16 qos_link_speed;
671 	u32 logical_link_speed;
672 } __packed;
673 
674 int beiscsi_cmd_eq_create(struct be_ctrl_info *ctrl,
675 			  struct be_queue_info *eq, int eq_delay);
676 
677 int beiscsi_cmd_cq_create(struct be_ctrl_info *ctrl,
678 			  struct be_queue_info *cq, struct be_queue_info *eq,
679 			  bool sol_evts, bool no_delay,
680 			  int num_cqe_dma_coalesce);
681 
682 int beiscsi_cmd_q_destroy(struct be_ctrl_info *ctrl, struct be_queue_info *q,
683 			  int type);
684 int beiscsi_cmd_mccq_create(struct beiscsi_hba *phba,
685 			struct be_queue_info *mccq,
686 			struct be_queue_info *cq);
687 
688 int be_poll_mcc(struct be_ctrl_info *ctrl);
689 int mgmt_check_supported_fw(struct be_ctrl_info *ctrl,
690 				      struct beiscsi_hba *phba);
691 unsigned int be_cmd_get_initname(struct beiscsi_hba *phba);
692 unsigned int be_cmd_get_port_speed(struct beiscsi_hba *phba);
693 
694 void free_mcc_tag(struct be_ctrl_info *ctrl, unsigned int tag);
695 
696 int beiscsi_mccq_compl(struct beiscsi_hba *phba,
697 			uint32_t tag, struct be_mcc_wrb **wrb, void *cmd_va);
698 /*ISCSI Functuions */
699 int be_cmd_fw_initialize(struct be_ctrl_info *ctrl);
700 
701 struct be_mcc_wrb *wrb_from_mbox(struct be_dma_mem *mbox_mem);
702 struct be_mcc_wrb *wrb_from_mccq(struct beiscsi_hba *phba);
703 int be_mcc_notify_wait(struct beiscsi_hba *phba);
704 void be_mcc_notify(struct beiscsi_hba *phba);
705 unsigned int alloc_mcc_tag(struct beiscsi_hba *phba);
706 void beiscsi_async_link_state_process(struct beiscsi_hba *phba,
707 		struct be_async_event_link_state *evt);
708 int be_mcc_compl_process_isr(struct be_ctrl_info *ctrl,
709 				    struct be_mcc_compl *compl);
710 
711 int be_mbox_notify(struct be_ctrl_info *ctrl);
712 
713 int be_cmd_create_default_pdu_queue(struct be_ctrl_info *ctrl,
714 				    struct be_queue_info *cq,
715 				    struct be_queue_info *dq, int length,
716 				    int entry_size);
717 
718 int be_cmd_iscsi_post_sgl_pages(struct be_ctrl_info *ctrl,
719 				struct be_dma_mem *q_mem, u32 page_offset,
720 				u32 num_pages);
721 
722 int beiscsi_cmd_reset_function(struct beiscsi_hba *phba);
723 
724 int be_cmd_wrbq_create(struct be_ctrl_info *ctrl, struct be_dma_mem *q_mem,
725 		       struct be_queue_info *wrbq);
726 
727 bool is_link_state_evt(u32 trailer);
728 
729 /* Configuration Functions */
730 int be_cmd_set_vlan(struct beiscsi_hba *phba, uint16_t vlan_tag);
731 
732 struct be_default_pdu_context {
733 	u32 dw[4];
734 } __packed;
735 
736 struct amap_be_default_pdu_context {
737 	u8 dbuf_cindex[13];	/* dword 0 */
738 	u8 rsvd0[3];		/* dword 0 */
739 	u8 ring_size[4];	/* dword 0 */
740 	u8 ring_state[4];	/* dword 0 */
741 	u8 rsvd1[8];		/* dword 0 */
742 	u8 dbuf_pindex[13];	/* dword 1 */
743 	u8 rsvd2;		/* dword 1 */
744 	u8 pci_func_id[8];	/* dword 1 */
745 	u8 rx_pdid[9];		/* dword 1 */
746 	u8 rx_pdid_valid;	/* dword 1 */
747 	u8 default_buffer_size[16];	/* dword 2 */
748 	u8 cq_id_recv[10];	/* dword 2 */
749 	u8 rx_pdid_not_valid;	/* dword 2 */
750 	u8 rsvd3[5];		/* dword 2 */
751 	u8 rsvd4[32];		/* dword 3 */
752 } __packed;
753 
754 struct be_defq_create_req {
755 	struct be_cmd_req_hdr hdr;
756 	u16 num_pages;
757 	u8 ulp_num;
758 	u8 rsvd0;
759 	struct be_default_pdu_context context;
760 	struct phys_addr pages[8];
761 } __packed;
762 
763 struct be_defq_create_resp {
764 	struct be_cmd_req_hdr hdr;
765 	u16 id;
766 	u16 rsvd0;
767 } __packed;
768 
769 struct be_post_sgl_pages_req {
770 	struct be_cmd_req_hdr hdr;
771 	u16 num_pages;
772 	u16 page_offset;
773 	u32 rsvd0;
774 	struct phys_addr pages[26];
775 	u32 rsvd1;
776 } __packed;
777 
778 struct be_wrbq_create_req {
779 	struct be_cmd_req_hdr hdr;
780 	u16 num_pages;
781 	u8 ulp_num;
782 	u8 rsvd0;
783 	struct phys_addr pages[8];
784 } __packed;
785 
786 struct be_wrbq_create_resp {
787 	struct be_cmd_resp_hdr resp_hdr;
788 	u16 cid;
789 	u16 rsvd0;
790 } __packed;
791 
792 #define SOL_CID_MASK		0x0000FFC0
793 #define SOL_CODE_MASK		0x0000003F
794 #define SOL_WRB_INDEX_MASK	0x00FF0000
795 #define SOL_CMD_WND_MASK	0xFF000000
796 #define SOL_RES_CNT_MASK	0x7FFFFFFF
797 #define SOL_EXP_CMD_SN_MASK	0xFFFFFFFF
798 #define SOL_HW_STS_MASK		0x000000FF
799 #define SOL_STS_MASK		0x0000FF00
800 #define SOL_RESP_MASK		0x00FF0000
801 #define SOL_FLAGS_MASK		0x7F000000
802 #define SOL_S_MASK		0x80000000
803 
804 struct sol_cqe {
805 	u32 dw[4];
806 };
807 
808 struct amap_sol_cqe {
809 	u8 hw_sts[8];		/* dword 0 */
810 	u8 i_sts[8];		/* dword 0 */
811 	u8 i_resp[8];		/* dword 0 */
812 	u8 i_flags[7];		/* dword 0 */
813 	u8 s;			/* dword 0 */
814 	u8 i_exp_cmd_sn[32];	/* dword 1 */
815 	u8 code[6];		/* dword 2 */
816 	u8 cid[10];		/* dword 2 */
817 	u8 wrb_index[8];	/* dword 2 */
818 	u8 i_cmd_wnd[8];	/* dword 2 */
819 	u8 i_res_cnt[31];	/* dword 3 */
820 	u8 valid;		/* dword 3 */
821 } __packed;
822 
823 #define SOL_ICD_INDEX_MASK	0x0003FFC0
824 struct amap_sol_cqe_ring {
825 	u8 hw_sts[8];		/* dword 0 */
826 	u8 i_sts[8];		/* dword 0 */
827 	u8 i_resp[8];		/* dword 0 */
828 	u8 i_flags[7];		/* dword 0 */
829 	u8 s;			/* dword 0 */
830 	u8 i_exp_cmd_sn[32];	/* dword 1 */
831 	u8 code[6];		/* dword 2 */
832 	u8 icd_index[12];	/* dword 2 */
833 	u8 rsvd[6];		/* dword 2 */
834 	u8 i_cmd_wnd[8];	/* dword 2 */
835 	u8 i_res_cnt[31];	/* dword 3 */
836 	u8 valid;		/* dword 3 */
837 } __packed;
838 
839 struct amap_sol_cqe_v2 {
840 	u8 hw_sts[8];   /* dword 0 */
841 	u8 i_sts[8];    /* dword 0 */
842 	u8 wrb_index[16];   /* dword 0 */
843 	u8 i_exp_cmd_sn[32];    /* dword 1 */
844 	u8 code[6]; /* dword 2 */
845 	u8 cmd_cmpl;    /* dword 2 */
846 	u8 rsvd0;   /* dword 2 */
847 	u8 i_cmd_wnd[8];    /* dword 2 */
848 	u8 cid[13]; /* dword 2 */
849 	u8 u;   /* dword 2 */
850 	u8 o;   /* dword 2 */
851 	u8 s;   /* dword 2 */
852 	u8 i_res_cnt[31];   /* dword 3 */
853 	u8 valid;   /* dword 3 */
854 } __packed;
855 
856 struct common_sol_cqe {
857 	u32 exp_cmdsn;
858 	u32 res_cnt;
859 	u16 wrb_index;
860 	u16 cid;
861 	u8 hw_sts;
862 	u8 cmd_wnd;
863 	u8 res_flag; /* the s feild of structure */
864 	u8 i_resp; /* for skh if cmd_complete is set then i_sts is response */
865 	u8 i_flags; /* for skh or the u and o feilds */
866 	u8 i_sts; /* for skh if cmd_complete is not-set then i_sts is status */
867 };
868 
869 /*** iSCSI ack/driver message completions ***/
870 struct amap_it_dmsg_cqe {
871 	u8 ack_num[32]; /* DWORD 0 */
872 	u8 pdu_bytes_rcvd[32];  /* DWORD 1 */
873 	u8 code[6]; /* DWORD 2 */
874 	u8 cid[10]; /* DWORD 2 */
875 	u8 wrb_idx[8];  /* DWORD 2 */
876 	u8 rsvd0[8];    /* DWORD 2*/
877 	u8 rsvd1[31];   /* DWORD 3*/
878 	u8 valid;   /* DWORD 3 */
879 } __packed;
880 
881 struct amap_it_dmsg_cqe_v2 {
882 	u8 ack_num[32]; /* DWORD 0 */
883 	u8 pdu_bytes_rcvd[32];  /* DWORD 1 */
884 	u8 code[6]; /* DWORD 2 */
885 	u8 rsvd0[10];   /* DWORD 2 */
886 	u8 wrb_idx[16]; /* DWORD 2 */
887 	u8 rsvd1[16];   /* DWORD 3 */
888 	u8 cid[13]; /* DWORD 3 */
889 	u8 rsvd2[2];    /* DWORD 3 */
890 	u8 valid;   /* DWORD 3 */
891 } __packed;
892 
893 
894 /**
895  * Post WRB Queue Doorbell Register used by the host Storage
896  * stack to notify the
897  * controller of a posted Work Request Block
898  */
899 #define DB_WRB_POST_CID_MASK		0x3FF	/* bits 0 - 9 */
900 #define DB_DEF_PDU_WRB_INDEX_MASK	0xFF	/* bits 0 - 9 */
901 
902 #define DB_DEF_PDU_WRB_INDEX_SHIFT	16
903 #define DB_DEF_PDU_NUM_POSTED_SHIFT	24
904 
905 struct fragnum_bits_for_sgl_cra_in {
906 	struct be_cmd_req_hdr hdr;
907 	u32 num_bits;
908 } __packed;
909 
910 struct iscsi_cleanup_req {
911 	struct be_cmd_req_hdr hdr;
912 	u16 chute;
913 	u8 hdr_ring_id;
914 	u8 data_ring_id;
915 
916 } __packed;
917 
918 struct eq_delay {
919 	u32 eq_id;
920 	u32 phase;
921 	u32 delay_multiplier;
922 } __packed;
923 
924 struct be_eq_delay_params_in {
925 	struct be_cmd_req_hdr hdr;
926 	u32 num_eq;
927 	struct eq_delay delay[8];
928 } __packed;
929 
930 struct tcp_connect_and_offload_in {
931 	struct be_cmd_req_hdr hdr;
932 	struct ip_addr_format ip_address;
933 	u16 tcp_port;
934 	u16 cid;
935 	u16 cq_id;
936 	u16 defq_id;
937 	struct phys_addr dataout_template_pa;
938 	u16 hdr_ring_id;
939 	u16 data_ring_id;
940 	u8 do_offload;
941 	u8 rsvd0[3];
942 } __packed;
943 
944 struct tcp_connect_and_offload_out {
945 	struct be_cmd_resp_hdr hdr;
946 	u32 connection_handle;
947 	u16 cid;
948 	u16 rsvd0;
949 
950 } __packed;
951 
952 struct be_mcc_wrb_context {
953 	struct MCC_WRB *wrb;
954 	int *users_final_status;
955 } __packed;
956 
957 #define DB_DEF_PDU_RING_ID_MASK		0x3FF	/* bits 0 - 9 */
958 #define DB_DEF_PDU_CQPROC_MASK		0x3FFF	/* bits 0 - 9 */
959 #define DB_DEF_PDU_REARM_SHIFT		14
960 #define DB_DEF_PDU_EVENT_SHIFT		15
961 #define DB_DEF_PDU_CQPROC_SHIFT		16
962 
963 struct dmsg_cqe {
964 	u32 dw[4];
965 } __packed;
966 
967 struct tcp_upload_params_in {
968 	struct be_cmd_req_hdr hdr;
969 	u16 id;
970 	u16 upload_type;
971 	u32 reset_seq;
972 } __packed;
973 
974 struct tcp_upload_params_out {
975 	u32 dw[32];
976 } __packed;
977 
978 union tcp_upload_params {
979 	struct tcp_upload_params_in request;
980 	struct tcp_upload_params_out response;
981 } __packed;
982 
983 struct be_ulp_fw_cfg {
984 	u32 ulp_mode;
985 	u32 etx_base;
986 	u32 etx_count;
987 	u32 sq_base;
988 	u32 sq_count;
989 	u32 rq_base;
990 	u32 rq_count;
991 	u32 dq_base;
992 	u32 dq_count;
993 	u32 lro_base;
994 	u32 lro_count;
995 	u32 icd_base;
996 	u32 icd_count;
997 };
998 
999 struct be_fw_cfg {
1000 	struct be_cmd_req_hdr hdr;
1001 	u32 be_config_number;
1002 	u32 asic_revision;
1003 	u32 phys_port;
1004 	u32 function_mode;
1005 	struct be_ulp_fw_cfg ulp[2];
1006 	u32 function_caps;
1007 } __packed;
1008 
1009 struct be_cmd_get_all_if_id_req {
1010 	struct be_cmd_req_hdr hdr;
1011 	u32 if_count;
1012 	u32 if_hndl_list[1];
1013 } __packed;
1014 
1015 #define ISCSI_OPCODE_SCSI_DATA_OUT		5
1016 #define OPCODE_COMMON_NTWK_LINK_STATUS_QUERY 5
1017 #define OPCODE_COMMON_MODIFY_EQ_DELAY		41
1018 #define OPCODE_COMMON_ISCSI_CLEANUP		59
1019 #define	OPCODE_COMMON_TCP_UPLOAD		56
1020 #define OPCODE_COMMON_ISCSI_TCP_CONNECT_AND_OFFLOAD 70
1021 #define OPCODE_COMMON_ISCSI_ERROR_RECOVERY_INVALIDATE_COMMANDS 1
1022 #define OPCODE_ISCSI_INI_CFG_GET_HBA_NAME	6
1023 #define OPCODE_ISCSI_INI_CFG_SET_HBA_NAME	7
1024 #define OPCODE_ISCSI_INI_SESSION_GET_A_SESSION  14
1025 #define OPCODE_ISCSI_INI_DRIVER_REOPEN_ALL_SESSIONS 36
1026 #define OPCODE_ISCSI_INI_DRIVER_OFFLOAD_SESSION 41
1027 #define OPCODE_ISCSI_INI_DRIVER_INVALIDATE_CONNECTION 42
1028 #define OPCODE_ISCSI_INI_BOOT_GET_BOOT_TARGET	52
1029 #define OPCODE_COMMON_WRITE_FLASH		96
1030 #define OPCODE_COMMON_READ_FLASH		97
1031 
1032 /* --- CMD_ISCSI_INVALIDATE_CONNECTION_TYPE --- */
1033 #define CMD_ISCSI_COMMAND_INVALIDATE		1
1034 #define CMD_ISCSI_CONNECTION_INVALIDATE		0x8001
1035 #define CMD_ISCSI_CONNECTION_ISSUE_TCP_RST	0x8002
1036 
1037 #define INI_WR_CMD			1	/* Initiator write command */
1038 #define INI_TMF_CMD			2	/* Initiator TMF command */
1039 #define INI_NOPOUT_CMD			3	/* Initiator; Send a NOP-OUT */
1040 #define INI_RD_CMD			5	/* Initiator requesting to send
1041 						 * a read command
1042 						 */
1043 #define TGT_CTX_UPDT_CMD		7	/* Target context update */
1044 #define TGT_STS_CMD			8	/* Target R2T and other BHS
1045 						 * where only the status number
1046 						 * need to be updated
1047 						 */
1048 #define TGT_DATAIN_CMD			9	/* Target Data-Ins in response
1049 						 * to read command
1050 						 */
1051 #define TGT_SOS_PDU			10	/* Target:standalone status
1052 						 * response
1053 						 */
1054 #define TGT_DM_CMD			11	/* Indicates that the bhs
1055 						 *  preparedby
1056 						 * driver should not be touched
1057 						 */
1058 /* --- CMD_CHUTE_TYPE --- */
1059 #define CMD_CONNECTION_CHUTE_0		1
1060 #define CMD_CONNECTION_CHUTE_1		2
1061 #define CMD_CONNECTION_CHUTE_2		3
1062 
1063 #define EQ_MAJOR_CODE_COMPLETION	0
1064 
1065 #define CMD_ISCSI_SESSION_DEL_CFG_FROM_FLASH 0
1066 #define CMD_ISCSI_SESSION_SAVE_CFG_ON_FLASH 1
1067 
1068 /* --- CONNECTION_UPLOAD_PARAMS --- */
1069 /* These parameters are used to define the type of upload desired.  */
1070 #define CONNECTION_UPLOAD_GRACEFUL      1	/* Graceful upload  */
1071 #define CONNECTION_UPLOAD_ABORT_RESET   2	/* Abortive upload with
1072 						 * reset
1073 						 */
1074 #define CONNECTION_UPLOAD_ABORT		3	/* Abortive upload without
1075 						 * reset
1076 						 */
1077 #define CONNECTION_UPLOAD_ABORT_WITH_SEQ 4	/* Abortive upload with reset,
1078 						 * sequence number by driver  */
1079 
1080 /* Returns the number of items in the field array. */
1081 #define BE_NUMBER_OF_FIELD(_type_, _field_)	\
1082 	(FIELD_SIZEOF(_type_, _field_)/sizeof((((_type_ *)0)->_field_[0])))\
1083 
1084 /**
1085  * Different types of iSCSI completions to host driver for both initiator
1086  * and taget mode
1087  * of operation.
1088  */
1089 #define SOL_CMD_COMPLETE		1	/* Solicited command completed
1090 						 * normally
1091 						 */
1092 #define SOL_CMD_KILLED_DATA_DIGEST_ERR  2	/* Solicited command got
1093 						 * invalidated internally due
1094 						 * to Data Digest error
1095 						 */
1096 #define CXN_KILLED_PDU_SIZE_EXCEEDS_DSL 3	/* Connection got invalidated
1097 						 * internally
1098 						 * due to a received PDU
1099 						 * size > DSL
1100 						 */
1101 #define CXN_KILLED_BURST_LEN_MISMATCH   4	/* Connection got invalidated
1102 						 * internally due ti received
1103 						 * PDU sequence size >
1104 						 * FBL/MBL.
1105 						 */
1106 #define CXN_KILLED_AHS_RCVD		5	/* Connection got invalidated
1107 						 * internally due to a received
1108 						 * PDU Hdr that has
1109 						 * AHS */
1110 #define CXN_KILLED_HDR_DIGEST_ERR	6	/* Connection got invalidated
1111 						 * internally due to Hdr Digest
1112 						 * error
1113 						 */
1114 #define CXN_KILLED_UNKNOWN_HDR		7	/* Connection got invalidated
1115 						 *  internally
1116 						 * due to a bad opcode in the
1117 						 * pdu hdr
1118 						 */
1119 #define CXN_KILLED_STALE_ITT_TTT_RCVD	8	/* Connection got invalidated
1120 						 * internally due to a received
1121 						 * ITT/TTT that does not belong
1122 						 * to this Connection
1123 						 */
1124 #define CXN_KILLED_INVALID_ITT_TTT_RCVD 9	/* Connection got invalidated
1125 						 * internally due to received
1126 						 * ITT/TTT value > Max
1127 						 * Supported ITTs/TTTs
1128 						 */
1129 #define CXN_KILLED_RST_RCVD		10	/* Connection got invalidated
1130 						 * internally due to an
1131 						 * incoming TCP RST
1132 						 */
1133 #define CXN_KILLED_TIMED_OUT		11	/* Connection got invalidated
1134 						 * internally due to timeout on
1135 						 * tcp segment 12 retransmit
1136 						 * attempts failed
1137 						 */
1138 #define CXN_KILLED_RST_SENT		12	/* Connection got invalidated
1139 						 * internally due to TCP RST
1140 						 * sent by the Tx side
1141 						 */
1142 #define CXN_KILLED_FIN_RCVD		13	/* Connection got invalidated
1143 						 * internally due to an
1144 						 * incoming TCP FIN.
1145 						 */
1146 #define CXN_KILLED_BAD_UNSOL_PDU_RCVD	14	/* Connection got invalidated
1147 						 * internally due to bad
1148 						 * unsolicited PDU Unsolicited
1149 						 * PDUs are PDUs with
1150 						 * ITT=0xffffffff
1151 						 */
1152 #define CXN_KILLED_BAD_WRB_INDEX_ERROR	15	/* Connection got invalidated
1153 						 * internally due to bad WRB
1154 						 * index.
1155 						 */
1156 #define CXN_KILLED_OVER_RUN_RESIDUAL	16	/* Command got invalidated
1157 						 * internally due to received
1158 						 * command has residual
1159 						 * over run bytes.
1160 						 */
1161 #define CXN_KILLED_UNDER_RUN_RESIDUAL	17	/* Command got invalidated
1162 						 * internally due to received
1163 						 * command has residual under
1164 						 * run bytes.
1165 						 */
1166 #define CMD_KILLED_INVALID_STATSN_RCVD	18	/* Command got invalidated
1167 						 * internally due to a received
1168 						 * PDU has an invalid StatusSN
1169 						 */
1170 #define CMD_KILLED_INVALID_R2T_RCVD	19	/* Command got invalidated
1171 						 * internally due to a received
1172 						 * an R2T with some invalid
1173 						 * fields in it
1174 						 */
1175 #define CMD_CXN_KILLED_LUN_INVALID	20	/* Command got invalidated
1176 						 * internally due to received
1177 						 * PDU has an invalid LUN.
1178 						 */
1179 #define CMD_CXN_KILLED_ICD_INVALID	21	/* Command got invalidated
1180 						 * internally due to the
1181 						 * corresponding ICD not in a
1182 						 * valid state
1183 						 */
1184 #define CMD_CXN_KILLED_ITT_INVALID	22	/* Command got invalidated due
1185 						 *  to received PDU has an
1186 						 *  invalid ITT.
1187 						 */
1188 #define CMD_CXN_KILLED_SEQ_OUTOFORDER	23	/* Command got invalidated due
1189 						 * to received sequence buffer
1190 						 * offset is out of order.
1191 						 */
1192 #define CMD_CXN_KILLED_INVALID_DATASN_RCVD 24	/* Command got invalidated
1193 						 * internally due to a
1194 						 * received PDU has an invalid
1195 						 * DataSN
1196 						 */
1197 #define CXN_INVALIDATE_NOTIFY		25	/* Connection invalidation
1198 						 * completion notify.
1199 						 */
1200 #define CXN_INVALIDATE_INDEX_NOTIFY	26	/* Connection invalidation
1201 						 * completion
1202 						 * with data PDU index.
1203 						 */
1204 #define CMD_INVALIDATED_NOTIFY		27	/* Command invalidation
1205 						 * completionnotifify.
1206 						 */
1207 #define UNSOL_HDR_NOTIFY		28	/* Unsolicited header notify.*/
1208 #define UNSOL_DATA_NOTIFY		29	/* Unsolicited data notify.*/
1209 #define UNSOL_DATA_DIGEST_ERROR_NOTIFY	30	/* Unsolicited data digest
1210 						 * error notify.
1211 						 */
1212 #define DRIVERMSG_NOTIFY		31	/* TCP acknowledge based
1213 						 * notification.
1214 						 */
1215 #define CXN_KILLED_CMND_DATA_NOT_ON_SAME_CONN 32 /* Connection got invalidated
1216 						  * internally due to command
1217 						  * and data are not on same
1218 						  * connection.
1219 						  */
1220 #define SOL_CMD_KILLED_DIF_ERR		33	/* Solicited command got
1221 						 *  invalidated internally due
1222 						 *  to DIF error
1223 						 */
1224 #define CXN_KILLED_SYN_RCVD		34	/* Connection got invalidated
1225 						 * internally due to incoming
1226 						 * TCP SYN
1227 						 */
1228 #define CXN_KILLED_IMM_DATA_RCVD	35	/* Connection got invalidated
1229 						 * internally due to an
1230 						 * incoming Unsolicited PDU
1231 						 * that has immediate data on
1232 						 * the cxn
1233 						 */
1234 
1235 int beiscsi_pci_soft_reset(struct beiscsi_hba *phba);
1236 int be_chk_reset_complete(struct beiscsi_hba *phba);
1237 
1238 void be_wrb_hdr_prepare(struct be_mcc_wrb *wrb, int payload_len,
1239 			bool embedded, u8 sge_cnt);
1240 
1241 void be_cmd_hdr_prepare(struct be_cmd_req_hdr *req_hdr,
1242 			u8 subsystem, u8 opcode, int cmd_len);
1243 
1244 #endif /* !BEISCSI_CMDS_H */
1245