blob: 953c354c4d9783c404f3e860c93e4dfd7d17b31b [file] [log] [blame]
Jayamohan Kallickal6733b392009-09-05 07:36:35 +05301/**
Jayamohan Kallickal255fa9a2011-03-25 14:23:57 -07002 * Copyright (C) 2005 - 2011 Emulex
Jayamohan Kallickal6733b392009-09-05 07:36:35 +05303 * 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:
Jayamohan Kallickal255fa9a2011-03-25 14:23:57 -070011 * linux-drivers@emulex.com
Jayamohan Kallickal6733b392009-09-05 07:36:35 +053012 *
Jayamohan Kallickal255fa9a2011-03-25 14:23:57 -070013 * Emulex
14 * 3333 Susan Street
15 * Costa Mesa, CA 92626
Jayamohan Kallickal6733b392009-09-05 07:36:35 +053016 */
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.
Jayamohan Kallickal2f635882012-04-03 23:41:45 -050026 * The commands are serviced by the ARM processor in the OneConnect's MPU.
Jayamohan Kallickal6733b392009-09-05 07:36:35 +053027 */
28struct 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 */
36struct 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)
Jayamohan Kallickal457ff3b2010-07-22 04:16:00 +053050#define CQE_FLAGS_COMPLETED_MASK (1 << 28)
51#define CQE_FLAGS_CONSUMED_MASK (1 << 27)
Jayamohan Kallickal6733b392009-09-05 07:36:35 +053052
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
Jayamohan Kallickalb38c1e82010-07-22 04:28:13 +053059#define CQE_STATUS_EXTD_SHIFT 16 /* bits 0 - 15 */
Jayamohan Kallickal6733b392009-09-05 07:36:35 +053060
61struct be_mcc_compl {
62 u32 status; /* dword 0 */
63 u32 tag0; /* dword 1 */
64 u32 tag1; /* dword 2 */
65 u32 flags; /* dword 3 */
66};
67
68/********* Mailbox door bell *************/
69/**
70 * Used for driver communication with the FW.
71 * The software must write this register twice to post any command. First,
72 * it writes the register with hi=1 and the upper bits of the physical address
73 * for the MAILBOX structure. Software must poll the ready bit until this
74 * is acknowledged. Then, sotware writes the register with hi=0 with the lower
75 * bits in the address. It must poll the ready bit until the command is
76 * complete. Upon completion, the MAILBOX will contain a valid completion
77 * queue entry.
78 */
79#define MPU_MAILBOX_DB_OFFSET 0x160
80#define MPU_MAILBOX_DB_RDY_MASK 0x1 /* bit 0 */
81#define MPU_MAILBOX_DB_HI_MASK 0x2 /* bit 1 */
82
83/********** MPU semphore ******************/
84#define MPU_EP_SEMAPHORE_OFFSET 0xac
85#define EP_SEMAPHORE_POST_STAGE_MASK 0x0000FFFF
86#define EP_SEMAPHORE_POST_ERR_MASK 0x1
87#define EP_SEMAPHORE_POST_ERR_SHIFT 31
88
89/********** MCC door bell ************/
90#define DB_MCCQ_OFFSET 0x140
91#define DB_MCCQ_RING_ID_MASK 0x7FF /* bits 0 - 10 */
92/* Number of entries posted */
93#define DB_MCCQ_NUM_POSTED_SHIFT 16 /* bits 16 - 29 */
94
95/* MPU semphore POST stage values */
96#define POST_STAGE_ARMFW_RDY 0xc000 /* FW is done with POST */
97
98/**
99 * When the async bit of mcc_compl is set, the last 4 bytes of
100 * mcc_compl is interpreted as follows:
101 */
102#define ASYNC_TRAILER_EVENT_CODE_SHIFT 8 /* bits 8 - 15 */
103#define ASYNC_TRAILER_EVENT_CODE_MASK 0xFF
104#define ASYNC_EVENT_CODE_LINK_STATE 0x1
105struct be_async_event_trailer {
106 u32 code;
107};
108
109enum {
110 ASYNC_EVENT_LINK_DOWN = 0x0,
111 ASYNC_EVENT_LINK_UP = 0x1
112};
113
114/**
115 * When the event code of an async trailer is link-state, the mcc_compl
116 * must be interpreted as follows
117 */
118struct be_async_event_link_state {
119 u8 physical_port;
120 u8 port_link_status;
121 u8 port_duplex;
122 u8 port_speed;
123 u8 port_fault;
124 u8 rsvd0[7];
125 struct be_async_event_trailer trailer;
126} __packed;
127
128struct be_mcc_mailbox {
129 struct be_mcc_wrb wrb;
130 struct be_mcc_compl compl;
131};
132
133/* Type of subsystems supported by FW */
134#define CMD_SUBSYSTEM_COMMON 0x1
135#define CMD_SUBSYSTEM_ISCSI 0x2
136#define CMD_SUBSYSTEM_ETH 0x3
137#define CMD_SUBSYSTEM_ISCSI_INI 0x6
138#define CMD_COMMON_TCP_UPLOAD 0x1
139
140/**
141 * List of common opcodes subsystem CMD_SUBSYSTEM_COMMON
142 * These opcodes are unique for each subsystem defined above
143 */
144#define OPCODE_COMMON_CQ_CREATE 12
145#define OPCODE_COMMON_EQ_CREATE 13
Jayamohan Kallickal457ff3b2010-07-22 04:16:00 +0530146#define OPCODE_COMMON_MCC_CREATE 21
147#define OPCODE_COMMON_GET_CNTL_ATTRIBUTES 32
Jayamohan Kallickal6733b392009-09-05 07:36:35 +0530148#define OPCODE_COMMON_GET_FW_VERSION 35
149#define OPCODE_COMMON_MODIFY_EQ_DELAY 41
150#define OPCODE_COMMON_FIRMWARE_CONFIG 42
Jayamohan Kallickal457ff3b2010-07-22 04:16:00 +0530151#define OPCODE_COMMON_MCC_DESTROY 53
152#define OPCODE_COMMON_CQ_DESTROY 54
153#define OPCODE_COMMON_EQ_DESTROY 55
Jayamohan Kallickal6733b392009-09-05 07:36:35 +0530154#define OPCODE_COMMON_QUERY_FIRMWARE_CONFIG 58
155#define OPCODE_COMMON_FUNCTION_RESET 61
156
157/**
158 * LIST of opcodes that are common between Initiator and Target
159 * used by CMD_SUBSYSTEM_ISCSI
160 * These opcodes are unique for each subsystem defined above
161 */
162#define OPCODE_COMMON_ISCSI_CFG_POST_SGL_PAGES 2
163#define OPCODE_COMMON_ISCSI_CFG_REMOVE_SGL_PAGES 3
164#define OPCODE_COMMON_ISCSI_NTWK_GET_NIC_CONFIG 7
Jayamohan Kallickalc7acc5b2010-07-22 04:29:18 +0530165#define OPCODE_COMMON_ISCSI_NTWK_SET_VLAN 14
Mike Christie0e438952012-04-03 23:41:51 -0500166#define OPCODE_COMMON_ISCSI_NTWK_CONFIG_STATELESS_IP_ADDR 17
167#define OPCODE_COMMON_ISCSI_NTWK_REL_STATELESS_IP_ADDR 18
Jayamohan Kallickalc7acc5b2010-07-22 04:29:18 +0530168#define OPCODE_COMMON_ISCSI_NTWK_MODIFY_IP_ADDR 21
169#define OPCODE_COMMON_ISCSI_NTWK_GET_DEFAULT_GATEWAY 22
170#define OPCODE_COMMON_ISCSI_NTWK_MODIFY_DEFAULT_GATEWAY 23
171#define OPCODE_COMMON_ISCSI_NTWK_GET_ALL_IF_ID 24
172#define OPCODE_COMMON_ISCSI_NTWK_GET_IF_INFO 25
Jayamohan Kallickal6733b392009-09-05 07:36:35 +0530173#define OPCODE_COMMON_ISCSI_SET_FRAGNUM_BITS_FOR_SGL_CRA 61
174#define OPCODE_COMMON_ISCSI_DEFQ_CREATE 64
Jayamohan Kallickal457ff3b2010-07-22 04:16:00 +0530175#define OPCODE_COMMON_ISCSI_DEFQ_DESTROY 65
Jayamohan Kallickal6733b392009-09-05 07:36:35 +0530176#define OPCODE_COMMON_ISCSI_WRBQ_CREATE 66
Jayamohan Kallickal457ff3b2010-07-22 04:16:00 +0530177#define OPCODE_COMMON_ISCSI_WRBQ_DESTROY 67
Jayamohan Kallickal6733b392009-09-05 07:36:35 +0530178
179struct be_cmd_req_hdr {
180 u8 opcode; /* dword 0 */
181 u8 subsystem; /* dword 0 */
182 u8 port_number; /* dword 0 */
183 u8 domain; /* dword 0 */
184 u32 timeout; /* dword 1 */
185 u32 request_length; /* dword 2 */
Jayamohan Kallickalbfead3b2009-10-23 11:52:33 +0530186 u32 rsvd0; /* dword 3 */
Jayamohan Kallickal6733b392009-09-05 07:36:35 +0530187};
188
189struct be_cmd_resp_hdr {
190 u32 info; /* dword 0 */
191 u32 status; /* dword 1 */
192 u32 response_length; /* dword 2 */
193 u32 actual_resp_len; /* dword 3 */
194};
195
196struct phys_addr {
197 u32 lo;
198 u32 hi;
199};
200
201/**************************
202 * BE Command definitions *
203 **************************/
204
205/**
206 * Pseudo amap definition in which each bit of the actual structure is defined
207 * as a byte - used to calculate offset/shift/mask of each field
208 */
209struct amap_eq_context {
210 u8 cidx[13]; /* dword 0 */
211 u8 rsvd0[3]; /* dword 0 */
212 u8 epidx[13]; /* dword 0 */
213 u8 valid; /* dword 0 */
214 u8 rsvd1; /* dword 0 */
215 u8 size; /* dword 0 */
216 u8 pidx[13]; /* dword 1 */
217 u8 rsvd2[3]; /* dword 1 */
218 u8 pd[10]; /* dword 1 */
219 u8 count[3]; /* dword 1 */
220 u8 solevent; /* dword 1 */
221 u8 stalled; /* dword 1 */
222 u8 armed; /* dword 1 */
223 u8 rsvd3[4]; /* dword 2 */
224 u8 func[8]; /* dword 2 */
225 u8 rsvd4; /* dword 2 */
226 u8 delaymult[10]; /* dword 2 */
227 u8 rsvd5[2]; /* dword 2 */
228 u8 phase[2]; /* dword 2 */
229 u8 nodelay; /* dword 2 */
230 u8 rsvd6[4]; /* dword 2 */
231 u8 rsvd7[32]; /* dword 3 */
232} __packed;
233
234struct be_cmd_req_eq_create {
235 struct be_cmd_req_hdr hdr; /* dw[4] */
236 u16 num_pages; /* sword */
237 u16 rsvd0; /* sword */
238 u8 context[sizeof(struct amap_eq_context) / 8]; /* dw[4] */
239 struct phys_addr pages[8];
240} __packed;
241
242struct be_cmd_resp_eq_create {
243 struct be_cmd_resp_hdr resp_hdr;
244 u16 eq_id; /* sword */
245 u16 rsvd0; /* sword */
246} __packed;
247
Jayamohan Kallickalc7acc5b2010-07-22 04:29:18 +0530248struct mgmt_chap_format {
249 u32 flags;
250 u8 intr_chap_name[256];
251 u8 intr_secret[16];
252 u8 target_chap_name[256];
253 u8 target_secret[16];
254 u16 intr_chap_name_length;
255 u16 intr_secret_length;
256 u16 target_chap_name_length;
257 u16 target_secret_length;
258} __packed;
259
260struct mgmt_auth_method_format {
261 u8 auth_method_type;
262 u8 padding[3];
263 struct mgmt_chap_format chap;
264} __packed;
265
266struct mgmt_conn_login_options {
267 u8 flags;
268 u8 header_digest;
269 u8 data_digest;
270 u8 rsvd0;
271 u32 max_recv_datasegment_len_ini;
272 u32 max_recv_datasegment_len_tgt;
273 u32 tcp_mss;
274 u32 tcp_window_size;
275 struct mgmt_auth_method_format auth_data;
276} __packed;
277
Mike Christie0e438952012-04-03 23:41:51 -0500278struct ip_addr_format {
Jayamohan Kallickalc7acc5b2010-07-22 04:29:18 +0530279 u16 size_of_structure;
280 u8 reserved;
281 u8 ip_type;
Mike Christie0e438952012-04-03 23:41:51 -0500282 u8 addr[16];
Jayamohan Kallickalc7acc5b2010-07-22 04:29:18 +0530283 u32 rsvd0;
284} __packed;
285
Mike Christie0e438952012-04-03 23:41:51 -0500286struct mgmt_conn_info {
Jayamohan Kallickalc7acc5b2010-07-22 04:29:18 +0530287 u32 connection_handle;
288 u32 connection_status;
289 u16 src_port;
290 u16 dest_port;
291 u16 dest_port_redirected;
292 u16 cid;
293 u32 estimated_throughput;
Mike Christie0e438952012-04-03 23:41:51 -0500294 struct ip_addr_format src_ipaddr;
295 struct ip_addr_format dest_ipaddr;
296 struct ip_addr_format dest_ipaddr_redirected;
Jayamohan Kallickalc7acc5b2010-07-22 04:29:18 +0530297 struct mgmt_conn_login_options negotiated_login_options;
298} __packed;
299
300struct mgmt_session_login_options {
301 u8 flags;
302 u8 error_recovery_level;
303 u16 rsvd0;
304 u32 first_burst_length;
305 u32 max_burst_length;
306 u16 max_connections;
307 u16 max_outstanding_r2t;
308 u16 default_time2wait;
309 u16 default_time2retain;
310} __packed;
311
312struct mgmt_session_info {
313 u32 session_handle;
314 u32 status;
315 u8 isid[6];
316 u16 tsih;
317 u32 session_flags;
318 u16 conn_count;
319 u16 pad;
320 u8 target_name[224];
321 u8 initiator_iscsiname[224];
322 struct mgmt_session_login_options negotiated_login_options;
323 struct mgmt_conn_info conn_list[1];
324} __packed;
325
Mike Christie0e438952012-04-03 23:41:51 -0500326struct be_cmd_get_session_req {
Jayamohan Kallickalc7acc5b2010-07-22 04:29:18 +0530327 struct be_cmd_req_hdr hdr;
328 u32 session_handle;
329} __packed;
330
Mike Christie0e438952012-04-03 23:41:51 -0500331struct be_cmd_get_session_resp {
Jayamohan Kallickalc7acc5b2010-07-22 04:29:18 +0530332 struct be_cmd_resp_hdr hdr;
333 struct mgmt_session_info session_info;
334} __packed;
335
Jayamohan Kallickal6733b392009-09-05 07:36:35 +0530336struct mac_addr {
Mike Christie0e438952012-04-03 23:41:51 -0500337 u16 size_of_structure;
Jayamohan Kallickal6733b392009-09-05 07:36:35 +0530338 u8 addr[ETH_ALEN];
339} __packed;
340
Mike Christie0e438952012-04-03 23:41:51 -0500341struct be_cmd_get_boot_target_req {
Jayamohan Kallickalc7acc5b2010-07-22 04:29:18 +0530342 struct be_cmd_req_hdr hdr;
343} __packed;
344
Mike Christie0e438952012-04-03 23:41:51 -0500345struct be_cmd_get_boot_target_resp {
Jayamohan Kallickalc7acc5b2010-07-22 04:29:18 +0530346 struct be_cmd_resp_hdr hdr;
347 u32 boot_session_count;
348 int boot_session_handle;
349};
350
John Soni Jose9aef4202012-08-20 23:00:08 +0530351struct be_cmd_reopen_session_req {
352 struct be_cmd_req_hdr hdr;
353#define BE_REOPEN_ALL_SESSIONS 0x00
354#define BE_REOPEN_BOOT_SESSIONS 0x01
355#define BE_REOPEN_A_SESSION 0x02
356 u16 reopen_type;
357 u16 rsvd;
358 u32 session_handle;
359} __packed;
360
361struct be_cmd_reopen_session_resp {
362 struct be_cmd_resp_hdr hdr;
363 u32 rsvd;
364 u32 session_handle;
365} __packed;
366
367
Mike Christie0e438952012-04-03 23:41:51 -0500368struct be_cmd_mac_query_req {
Jayamohan Kallickal6733b392009-09-05 07:36:35 +0530369 struct be_cmd_req_hdr hdr;
370 u8 type;
371 u8 permanent;
372 u16 if_id;
373} __packed;
374
Mike Christie0e438952012-04-03 23:41:51 -0500375struct be_cmd_get_mac_resp {
Jayamohan Kallickal6733b392009-09-05 07:36:35 +0530376 struct be_cmd_resp_hdr hdr;
377 struct mac_addr mac;
378};
379
Mike Christie0e438952012-04-03 23:41:51 -0500380struct be_ip_addr_subnet_format {
381 u16 size_of_structure;
382 u8 ip_type;
383 u8 ipv6_prefix_length;
384 u8 addr[16];
385 u8 subnet_mask[16];
386 u32 rsvd0;
387} __packed;
388
389struct be_cmd_get_if_info_req {
390 struct be_cmd_req_hdr hdr;
391 u32 interface_hndl;
392 u32 ip_type;
393} __packed;
394
395struct be_cmd_get_if_info_resp {
396 struct be_cmd_req_hdr hdr;
397 u32 interface_hndl;
398 u32 vlan_priority;
399 u32 ip_addr_count;
400 u32 dhcp_state;
401 struct be_ip_addr_subnet_format ip_addr;
402} __packed;
403
404struct be_ip_addr_record {
405 u32 action;
406 u32 interface_hndl;
407 struct be_ip_addr_subnet_format ip_addr;
408 u32 status;
409} __packed;
410
411struct be_ip_addr_record_params {
412 u32 record_entry_count;
413 struct be_ip_addr_record ip_record;
414} __packed;
415
416struct be_cmd_set_ip_addr_req {
417 struct be_cmd_req_hdr hdr;
418 struct be_ip_addr_record_params ip_params;
419} __packed;
420
421
422struct be_cmd_set_dhcp_req {
423 struct be_cmd_req_hdr hdr;
424 u32 interface_hndl;
425 u32 ip_type;
426 u32 flags;
427 u32 retry_count;
428} __packed;
429
430struct be_cmd_rel_dhcp_req {
431 struct be_cmd_req_hdr hdr;
432 u32 interface_hndl;
433 u32 ip_type;
434} __packed;
435
436struct be_cmd_set_def_gateway_req {
437 struct be_cmd_req_hdr hdr;
438 u32 action;
439 struct ip_addr_format ip_addr;
440} __packed;
441
442struct be_cmd_get_def_gateway_req {
443 struct be_cmd_req_hdr hdr;
444 u32 ip_type;
445} __packed;
446
447struct be_cmd_get_def_gateway_resp {
448 struct be_cmd_req_hdr hdr;
449 struct ip_addr_format ip_addr;
450} __packed;
451
Jayamohan Kallickal6733b392009-09-05 07:36:35 +0530452/******************** Create CQ ***************************/
453/**
454 * Pseudo amap definition in which each bit of the actual structure is defined
455 * as a byte - used to calculate offset/shift/mask of each field
456 */
457struct amap_cq_context {
458 u8 cidx[11]; /* dword 0 */
459 u8 rsvd0; /* dword 0 */
460 u8 coalescwm[2]; /* dword 0 */
461 u8 nodelay; /* dword 0 */
462 u8 epidx[11]; /* dword 0 */
463 u8 rsvd1; /* dword 0 */
464 u8 count[2]; /* dword 0 */
465 u8 valid; /* dword 0 */
466 u8 solevent; /* dword 0 */
467 u8 eventable; /* dword 0 */
468 u8 pidx[11]; /* dword 1 */
469 u8 rsvd2; /* dword 1 */
470 u8 pd[10]; /* dword 1 */
471 u8 eqid[8]; /* dword 1 */
472 u8 stalled; /* dword 1 */
473 u8 armed; /* dword 1 */
474 u8 rsvd3[4]; /* dword 2 */
475 u8 func[8]; /* dword 2 */
476 u8 rsvd4[20]; /* dword 2 */
477 u8 rsvd5[32]; /* dword 3 */
478} __packed;
479
480struct be_cmd_req_cq_create {
481 struct be_cmd_req_hdr hdr;
482 u16 num_pages;
483 u16 rsvd0;
484 u8 context[sizeof(struct amap_cq_context) / 8];
485 struct phys_addr pages[4];
486} __packed;
487
488struct be_cmd_resp_cq_create {
489 struct be_cmd_resp_hdr hdr;
490 u16 cq_id;
491 u16 rsvd0;
492} __packed;
493
494/******************** Create MCCQ ***************************/
495/**
496 * Pseudo amap definition in which each bit of the actual structure is defined
497 * as a byte - used to calculate offset/shift/mask of each field
498 */
499struct amap_mcc_context {
500 u8 con_index[14];
501 u8 rsvd0[2];
502 u8 ring_size[4];
503 u8 fetch_wrb;
504 u8 fetch_r2t;
505 u8 cq_id[10];
506 u8 prod_index[14];
507 u8 fid[8];
508 u8 pdid[9];
509 u8 valid;
510 u8 rsvd1[32];
511 u8 rsvd2[32];
512} __packed;
513
514struct be_cmd_req_mcc_create {
515 struct be_cmd_req_hdr hdr;
516 u16 num_pages;
517 u16 rsvd0;
518 u8 context[sizeof(struct amap_mcc_context) / 8];
519 struct phys_addr pages[8];
520} __packed;
521
522struct be_cmd_resp_mcc_create {
523 struct be_cmd_resp_hdr hdr;
524 u16 id;
525 u16 rsvd0;
526} __packed;
527
528/******************** Q Destroy ***************************/
529/* Type of Queue to be destroyed */
530enum {
531 QTYPE_EQ = 1,
532 QTYPE_CQ,
533 QTYPE_MCCQ,
534 QTYPE_WRBQ,
535 QTYPE_DPDUQ,
536 QTYPE_SGL
537};
538
539struct be_cmd_req_q_destroy {
540 struct be_cmd_req_hdr hdr;
541 u16 id;
542 u16 bypass_flush; /* valid only for rx q destroy */
543} __packed;
544
545struct macaddr {
546 u8 byte[ETH_ALEN];
547};
548
549struct be_cmd_req_mcast_mac_config {
550 struct be_cmd_req_hdr hdr;
551 u16 num_mac;
552 u8 promiscuous;
553 u8 interface_id;
554 struct macaddr mac[32];
555} __packed;
556
557static inline void *embedded_payload(struct be_mcc_wrb *wrb)
558{
559 return wrb->payload.embedded_payload;
560}
561
562static inline struct be_sge *nonembedded_sgl(struct be_mcc_wrb *wrb)
563{
564 return &wrb->payload.sgl[0];
565}
566
567/******************** Modify EQ Delay *******************/
568struct be_cmd_req_modify_eq_delay {
569 struct be_cmd_req_hdr hdr;
570 u32 num_eq;
571 struct {
572 u32 eq_id;
573 u32 phase;
574 u32 delay_multiplier;
575 } delay[8];
576} __packed;
577
578/******************** Get MAC ADDR *******************/
579
580#define ETH_ALEN 6
581
Mike Christie0e438952012-04-03 23:41:51 -0500582struct be_cmd_get_nic_conf_req {
Jayamohan Kallickal6733b392009-09-05 07:36:35 +0530583 struct be_cmd_req_hdr hdr;
584 u32 nic_port_count;
585 u32 speed;
586 u32 max_speed;
587 u32 link_state;
588 u32 max_frame_size;
589 u16 size_of_structure;
590 u8 mac_address[ETH_ALEN];
591 u32 rsvd[23];
592};
593
Mike Christie0e438952012-04-03 23:41:51 -0500594struct be_cmd_get_nic_conf_resp {
Jayamohan Kallickal6733b392009-09-05 07:36:35 +0530595 struct be_cmd_resp_hdr hdr;
596 u32 nic_port_count;
597 u32 speed;
598 u32 max_speed;
599 u32 link_state;
600 u32 max_frame_size;
601 u16 size_of_structure;
602 u8 mac_address[6];
603 u32 rsvd[23];
604};
605
John Soni Jose21771992012-04-03 23:41:49 -0500606#define BEISCSI_ALIAS_LEN 32
607
608struct be_cmd_hba_name {
609 struct be_cmd_req_hdr hdr;
610 u16 flags;
611 u16 rsvd0;
612 u8 initiator_name[ISCSI_NAME_LEN];
613 u8 initiator_alias[BEISCSI_ALIAS_LEN];
614} __packed;
615
John Soni Josec62eef02012-04-03 23:41:52 -0500616struct be_cmd_ntwk_link_status_req {
617 struct be_cmd_req_hdr hdr;
618 u32 rsvd0;
619} __packed;
620
621/*** Port Speed Values ***/
622#define BE2ISCSI_LINK_SPEED_ZERO 0x00
623#define BE2ISCSI_LINK_SPEED_10MBPS 0x01
624#define BE2ISCSI_LINK_SPEED_100MBPS 0x02
625#define BE2ISCSI_LINK_SPEED_1GBPS 0x03
626#define BE2ISCSI_LINK_SPEED_10GBPS 0x04
627struct be_cmd_ntwk_link_status_resp {
628 struct be_cmd_resp_hdr hdr;
629 u8 phys_port;
630 u8 mac_duplex;
631 u8 mac_speed;
632 u8 mac_fault;
633 u8 mgmt_mac_duplex;
634 u8 mgmt_mac_speed;
635 u16 qos_link_speed;
636 u32 logical_link_speed;
637} __packed;
John Soni Jose21771992012-04-03 23:41:49 -0500638
Jayamohan Kallickal6733b392009-09-05 07:36:35 +0530639int beiscsi_cmd_eq_create(struct be_ctrl_info *ctrl,
640 struct be_queue_info *eq, int eq_delay);
641
642int beiscsi_cmd_cq_create(struct be_ctrl_info *ctrl,
643 struct be_queue_info *cq, struct be_queue_info *eq,
644 bool sol_evts, bool no_delay,
645 int num_cqe_dma_coalesce);
646
647int beiscsi_cmd_q_destroy(struct be_ctrl_info *ctrl, struct be_queue_info *q,
648 int type);
Jayamohan Kallickal35e66012009-10-23 11:53:49 +0530649int beiscsi_cmd_mccq_create(struct beiscsi_hba *phba,
Jayamohan Kallickalbfead3b2009-10-23 11:52:33 +0530650 struct be_queue_info *mccq,
651 struct be_queue_info *cq);
652
Jayamohan Kallickal6733b392009-09-05 07:36:35 +0530653int be_poll_mcc(struct be_ctrl_info *ctrl);
Jayamohan Kallickal03a12312010-07-22 04:17:16 +0530654int mgmt_check_supported_fw(struct be_ctrl_info *ctrl,
Jayamohan Kallickalbfead3b2009-10-23 11:52:33 +0530655 struct beiscsi_hba *phba);
John Soni Jose21771992012-04-03 23:41:49 -0500656unsigned int be_cmd_get_initname(struct beiscsi_hba *phba);
John Soni Josec62eef02012-04-03 23:41:52 -0500657unsigned int be_cmd_get_port_speed(struct beiscsi_hba *phba);
Jayamohan Kallickalc7acc5b2010-07-22 04:29:18 +0530658
Jayamohan Kallickal756d29c2010-01-05 05:10:46 +0530659void free_mcc_tag(struct be_ctrl_info *ctrl, unsigned int tag);
Jayamohan Kallickal6733b392009-09-05 07:36:35 +0530660/*ISCSI Functuions */
661int be_cmd_fw_initialize(struct be_ctrl_info *ctrl);
662
663struct be_mcc_wrb *wrb_from_mbox(struct be_dma_mem *mbox_mem);
Jayamohan Kallickalbfead3b2009-10-23 11:52:33 +0530664struct be_mcc_wrb *wrb_from_mccq(struct beiscsi_hba *phba);
665int be_mcc_notify_wait(struct beiscsi_hba *phba);
Jayamohan Kallickal756d29c2010-01-05 05:10:46 +0530666void be_mcc_notify(struct beiscsi_hba *phba);
667unsigned int alloc_mcc_tag(struct beiscsi_hba *phba);
668void beiscsi_async_link_state_process(struct beiscsi_hba *phba,
669 struct be_async_event_link_state *evt);
670int be_mcc_compl_process_isr(struct be_ctrl_info *ctrl,
671 struct be_mcc_compl *compl);
Jayamohan Kallickal6733b392009-09-05 07:36:35 +0530672
673int be_mbox_notify(struct be_ctrl_info *ctrl);
674
675int be_cmd_create_default_pdu_queue(struct be_ctrl_info *ctrl,
676 struct be_queue_info *cq,
677 struct be_queue_info *dq, int length,
678 int entry_size);
679
680int be_cmd_iscsi_post_sgl_pages(struct be_ctrl_info *ctrl,
681 struct be_dma_mem *q_mem, u32 page_offset,
682 u32 num_pages);
683
Jayamohan Kallickale5285862011-10-07 19:31:08 -0500684int beiscsi_cmd_reset_function(struct beiscsi_hba *phba);
685
Jayamohan Kallickal6733b392009-09-05 07:36:35 +0530686int be_cmd_wrbq_create(struct be_ctrl_info *ctrl, struct be_dma_mem *q_mem,
687 struct be_queue_info *wrbq);
688
Jayamohan Kallickal756d29c2010-01-05 05:10:46 +0530689bool is_link_state_evt(u32 trailer);
690
Jayamohan Kallickal6733b392009-09-05 07:36:35 +0530691struct be_default_pdu_context {
692 u32 dw[4];
693} __packed;
694
695struct amap_be_default_pdu_context {
696 u8 dbuf_cindex[13]; /* dword 0 */
697 u8 rsvd0[3]; /* dword 0 */
698 u8 ring_size[4]; /* dword 0 */
699 u8 ring_state[4]; /* dword 0 */
700 u8 rsvd1[8]; /* dword 0 */
701 u8 dbuf_pindex[13]; /* dword 1 */
702 u8 rsvd2; /* dword 1 */
703 u8 pci_func_id[8]; /* dword 1 */
704 u8 rx_pdid[9]; /* dword 1 */
705 u8 rx_pdid_valid; /* dword 1 */
706 u8 default_buffer_size[16]; /* dword 2 */
707 u8 cq_id_recv[10]; /* dword 2 */
708 u8 rx_pdid_not_valid; /* dword 2 */
709 u8 rsvd3[5]; /* dword 2 */
710 u8 rsvd4[32]; /* dword 3 */
711} __packed;
712
713struct be_defq_create_req {
714 struct be_cmd_req_hdr hdr;
715 u16 num_pages;
716 u8 ulp_num;
717 u8 rsvd0;
718 struct be_default_pdu_context context;
719 struct phys_addr pages[8];
720} __packed;
721
722struct be_defq_create_resp {
723 struct be_cmd_req_hdr hdr;
724 u16 id;
725 u16 rsvd0;
726} __packed;
727
728struct be_post_sgl_pages_req {
729 struct be_cmd_req_hdr hdr;
730 u16 num_pages;
731 u16 page_offset;
732 u32 rsvd0;
733 struct phys_addr pages[26];
734 u32 rsvd1;
735} __packed;
736
737struct be_wrbq_create_req {
738 struct be_cmd_req_hdr hdr;
739 u16 num_pages;
740 u8 ulp_num;
741 u8 rsvd0;
742 struct phys_addr pages[8];
743} __packed;
744
745struct be_wrbq_create_resp {
746 struct be_cmd_resp_hdr resp_hdr;
747 u16 cid;
748 u16 rsvd0;
749} __packed;
750
751#define SOL_CID_MASK 0x0000FFC0
752#define SOL_CODE_MASK 0x0000003F
753#define SOL_WRB_INDEX_MASK 0x00FF0000
754#define SOL_CMD_WND_MASK 0xFF000000
755#define SOL_RES_CNT_MASK 0x7FFFFFFF
756#define SOL_EXP_CMD_SN_MASK 0xFFFFFFFF
757#define SOL_HW_STS_MASK 0x000000FF
758#define SOL_STS_MASK 0x0000FF00
759#define SOL_RESP_MASK 0x00FF0000
760#define SOL_FLAGS_MASK 0x7F000000
761#define SOL_S_MASK 0x80000000
762
763struct sol_cqe {
764 u32 dw[4];
765};
766
767struct amap_sol_cqe {
768 u8 hw_sts[8]; /* dword 0 */
769 u8 i_sts[8]; /* dword 0 */
770 u8 i_resp[8]; /* dword 0 */
771 u8 i_flags[7]; /* dword 0 */
772 u8 s; /* dword 0 */
773 u8 i_exp_cmd_sn[32]; /* dword 1 */
774 u8 code[6]; /* dword 2 */
775 u8 cid[10]; /* dword 2 */
776 u8 wrb_index[8]; /* dword 2 */
777 u8 i_cmd_wnd[8]; /* dword 2 */
778 u8 i_res_cnt[31]; /* dword 3 */
779 u8 valid; /* dword 3 */
780} __packed;
781
Jayamohan Kallickalbfead3b2009-10-23 11:52:33 +0530782#define SOL_ICD_INDEX_MASK 0x0003FFC0
783struct amap_sol_cqe_ring {
784 u8 hw_sts[8]; /* dword 0 */
785 u8 i_sts[8]; /* dword 0 */
786 u8 i_resp[8]; /* dword 0 */
787 u8 i_flags[7]; /* dword 0 */
788 u8 s; /* dword 0 */
789 u8 i_exp_cmd_sn[32]; /* dword 1 */
790 u8 code[6]; /* dword 2 */
791 u8 icd_index[12]; /* dword 2 */
792 u8 rsvd[6]; /* dword 2 */
793 u8 i_cmd_wnd[8]; /* dword 2 */
794 u8 i_res_cnt[31]; /* dword 3 */
795 u8 valid; /* dword 3 */
796} __packed;
797
798
Jayamohan Kallickal6733b392009-09-05 07:36:35 +0530799
800/**
801 * Post WRB Queue Doorbell Register used by the host Storage
802 * stack to notify the
803 * controller of a posted Work Request Block
804 */
805#define DB_WRB_POST_CID_MASK 0x3FF /* bits 0 - 9 */
806#define DB_DEF_PDU_WRB_INDEX_MASK 0xFF /* bits 0 - 9 */
807
808#define DB_DEF_PDU_WRB_INDEX_SHIFT 16
809#define DB_DEF_PDU_NUM_POSTED_SHIFT 24
810
811struct fragnum_bits_for_sgl_cra_in {
812 struct be_cmd_req_hdr hdr;
813 u32 num_bits;
814} __packed;
815
816struct iscsi_cleanup_req {
817 struct be_cmd_req_hdr hdr;
818 u16 chute;
819 u8 hdr_ring_id;
820 u8 data_ring_id;
821
822} __packed;
823
824struct eq_delay {
825 u32 eq_id;
826 u32 phase;
827 u32 delay_multiplier;
828} __packed;
829
830struct be_eq_delay_params_in {
831 struct be_cmd_req_hdr hdr;
832 u32 num_eq;
833 struct eq_delay delay[8];
834} __packed;
835
Jayamohan Kallickal6733b392009-09-05 07:36:35 +0530836struct tcp_connect_and_offload_in {
837 struct be_cmd_req_hdr hdr;
Mike Christie0e438952012-04-03 23:41:51 -0500838 struct ip_addr_format ip_address;
Jayamohan Kallickal6733b392009-09-05 07:36:35 +0530839 u16 tcp_port;
840 u16 cid;
841 u16 cq_id;
842 u16 defq_id;
843 struct phys_addr dataout_template_pa;
844 u16 hdr_ring_id;
845 u16 data_ring_id;
846 u8 do_offload;
847 u8 rsvd0[3];
848} __packed;
849
850struct tcp_connect_and_offload_out {
851 struct be_cmd_resp_hdr hdr;
852 u32 connection_handle;
853 u16 cid;
854 u16 rsvd0;
855
856} __packed;
857
858struct be_mcc_wrb_context {
859 struct MCC_WRB *wrb;
860 int *users_final_status;
861} __packed;
862
863#define DB_DEF_PDU_RING_ID_MASK 0x3FF /* bits 0 - 9 */
864#define DB_DEF_PDU_CQPROC_MASK 0x3FFF /* bits 0 - 9 */
865#define DB_DEF_PDU_REARM_SHIFT 14
866#define DB_DEF_PDU_EVENT_SHIFT 15
867#define DB_DEF_PDU_CQPROC_SHIFT 16
868
869struct dmsg_cqe {
870 u32 dw[4];
871} __packed;
872
873struct tcp_upload_params_in {
874 struct be_cmd_req_hdr hdr;
875 u16 id;
876 u16 upload_type;
877 u32 reset_seq;
878} __packed;
879
880struct tcp_upload_params_out {
881 u32 dw[32];
882} __packed;
883
884union tcp_upload_params {
885 struct tcp_upload_params_in request;
886 struct tcp_upload_params_out response;
887} __packed;
888
889struct be_ulp_fw_cfg {
890 u32 ulp_mode;
891 u32 etx_base;
892 u32 etx_count;
893 u32 sq_base;
894 u32 sq_count;
895 u32 rq_base;
896 u32 rq_count;
897 u32 dq_base;
898 u32 dq_count;
899 u32 lro_base;
900 u32 lro_count;
901 u32 icd_base;
902 u32 icd_count;
903};
904
905struct be_fw_cfg {
906 struct be_cmd_req_hdr hdr;
907 u32 be_config_number;
908 u32 asic_revision;
909 u32 phys_port;
910 u32 function_mode;
911 struct be_ulp_fw_cfg ulp[2];
912 u32 function_caps;
913} __packed;
914
Mike Christie0e438952012-04-03 23:41:51 -0500915struct be_cmd_get_all_if_id_req {
Jayamohan Kallickalc7acc5b2010-07-22 04:29:18 +0530916 struct be_cmd_req_hdr hdr;
917 u32 if_count;
918 u32 if_hndl_list[1];
919} __packed;
920
921#define ISCSI_OPCODE_SCSI_DATA_OUT 5
John Soni Josec62eef02012-04-03 23:41:52 -0500922#define OPCODE_COMMON_NTWK_LINK_STATUS_QUERY 5
Jayamohan Kallickalc7acc5b2010-07-22 04:29:18 +0530923#define OPCODE_COMMON_MODIFY_EQ_DELAY 41
924#define OPCODE_COMMON_ISCSI_CLEANUP 59
925#define OPCODE_COMMON_TCP_UPLOAD 56
Jayamohan Kallickal6733b392009-09-05 07:36:35 +0530926#define OPCODE_COMMON_ISCSI_TCP_CONNECT_AND_OFFLOAD 70
Jayamohan Kallickal6733b392009-09-05 07:36:35 +0530927#define OPCODE_COMMON_ISCSI_ERROR_RECOVERY_INVALIDATE_COMMANDS 1
Jayamohan Kallickalc7acc5b2010-07-22 04:29:18 +0530928#define OPCODE_ISCSI_INI_CFG_GET_HBA_NAME 6
929#define OPCODE_ISCSI_INI_CFG_SET_HBA_NAME 7
930#define OPCODE_ISCSI_INI_SESSION_GET_A_SESSION 14
John Soni Jose9aef4202012-08-20 23:00:08 +0530931#define OPCODE_ISCSI_INI_DRIVER_REOPEN_ALL_SESSIONS 36
Jayamohan Kallickalc7acc5b2010-07-22 04:29:18 +0530932#define OPCODE_ISCSI_INI_DRIVER_OFFLOAD_SESSION 41
Jayamohan Kallickal6733b392009-09-05 07:36:35 +0530933#define OPCODE_ISCSI_INI_DRIVER_INVALIDATE_CONNECTION 42
Jayamohan Kallickalc7acc5b2010-07-22 04:29:18 +0530934#define OPCODE_ISCSI_INI_BOOT_GET_BOOT_TARGET 52
Jayamohan Kallickalffce3e22012-04-03 23:41:50 -0500935#define OPCODE_COMMON_WRITE_FLASH 96
936#define OPCODE_COMMON_READ_FLASH 97
Jayamohan Kallickalc7acc5b2010-07-22 04:29:18 +0530937
938/* --- CMD_ISCSI_INVALIDATE_CONNECTION_TYPE --- */
939#define CMD_ISCSI_COMMAND_INVALIDATE 1
940#define CMD_ISCSI_CONNECTION_INVALIDATE 0x8001
941#define CMD_ISCSI_CONNECTION_ISSUE_TCP_RST 0x8002
Jayamohan Kallickal6733b392009-09-05 07:36:35 +0530942
943#define INI_WR_CMD 1 /* Initiator write command */
944#define INI_TMF_CMD 2 /* Initiator TMF command */
945#define INI_NOPOUT_CMD 3 /* Initiator; Send a NOP-OUT */
946#define INI_RD_CMD 5 /* Initiator requesting to send
947 * a read command
948 */
949#define TGT_CTX_UPDT_CMD 7 /* Target context update */
950#define TGT_STS_CMD 8 /* Target R2T and other BHS
951 * where only the status number
952 * need to be updated
953 */
954#define TGT_DATAIN_CMD 9 /* Target Data-Ins in response
955 * to read command
956 */
957#define TGT_SOS_PDU 10 /* Target:standalone status
958 * response
959 */
960#define TGT_DM_CMD 11 /* Indicates that the bhs
961 * preparedby
962 * driver should not be touched
963 */
964/* --- CMD_CHUTE_TYPE --- */
965#define CMD_CONNECTION_CHUTE_0 1
966#define CMD_CONNECTION_CHUTE_1 2
967#define CMD_CONNECTION_CHUTE_2 3
968
969#define EQ_MAJOR_CODE_COMPLETION 0
970
971#define CMD_ISCSI_SESSION_DEL_CFG_FROM_FLASH 0
972#define CMD_ISCSI_SESSION_SAVE_CFG_ON_FLASH 1
973
974/* --- CONNECTION_UPLOAD_PARAMS --- */
975/* These parameters are used to define the type of upload desired. */
976#define CONNECTION_UPLOAD_GRACEFUL 1 /* Graceful upload */
977#define CONNECTION_UPLOAD_ABORT_RESET 2 /* Abortive upload with
978 * reset
979 */
980#define CONNECTION_UPLOAD_ABORT 3 /* Abortive upload without
981 * reset
982 */
983#define CONNECTION_UPLOAD_ABORT_WITH_SEQ 4 /* Abortive upload with reset,
984 * sequence number by driver */
985
986/* Returns byte size of given field with a structure. */
987
988/* Returns the number of items in the field array. */
989#define BE_NUMBER_OF_FIELD(_type_, _field_) \
990 (FIELD_SIZEOF(_type_, _field_)/sizeof((((_type_ *)0)->_field_[0])))\
991
992/**
993 * Different types of iSCSI completions to host driver for both initiator
994 * and taget mode
995 * of operation.
996 */
997#define SOL_CMD_COMPLETE 1 /* Solicited command completed
998 * normally
999 */
1000#define SOL_CMD_KILLED_DATA_DIGEST_ERR 2 /* Solicited command got
1001 * invalidated internally due
1002 * to Data Digest error
1003 */
1004#define CXN_KILLED_PDU_SIZE_EXCEEDS_DSL 3 /* Connection got invalidated
1005 * internally
Lucas De Marchi25985ed2011-03-30 22:57:33 -03001006 * due to a received PDU
Jayamohan Kallickal6733b392009-09-05 07:36:35 +05301007 * size > DSL
1008 */
1009#define CXN_KILLED_BURST_LEN_MISMATCH 4 /* Connection got invalidated
1010 * internally due ti received
1011 * PDU sequence size >
1012 * FBL/MBL.
1013 */
1014#define CXN_KILLED_AHS_RCVD 5 /* Connection got invalidated
Lucas De Marchi25985ed2011-03-30 22:57:33 -03001015 * internally due to a received
Jayamohan Kallickal6733b392009-09-05 07:36:35 +05301016 * PDU Hdr that has
1017 * AHS */
1018#define CXN_KILLED_HDR_DIGEST_ERR 6 /* Connection got invalidated
1019 * internally due to Hdr Digest
1020 * error
1021 */
1022#define CXN_KILLED_UNKNOWN_HDR 7 /* Connection got invalidated
1023 * internally
1024 * due to a bad opcode in the
1025 * pdu hdr
1026 */
1027#define CXN_KILLED_STALE_ITT_TTT_RCVD 8 /* Connection got invalidated
Lucas De Marchi25985ed2011-03-30 22:57:33 -03001028 * internally due to a received
Jayamohan Kallickal6733b392009-09-05 07:36:35 +05301029 * ITT/TTT that does not belong
1030 * to this Connection
1031 */
1032#define CXN_KILLED_INVALID_ITT_TTT_RCVD 9 /* Connection got invalidated
Lucas De Marchi25985ed2011-03-30 22:57:33 -03001033 * internally due to received
Jayamohan Kallickal6733b392009-09-05 07:36:35 +05301034 * ITT/TTT value > Max
1035 * Supported ITTs/TTTs
1036 */
1037#define CXN_KILLED_RST_RCVD 10 /* Connection got invalidated
1038 * internally due to an
1039 * incoming TCP RST
1040 */
1041#define CXN_KILLED_TIMED_OUT 11 /* Connection got invalidated
1042 * internally due to timeout on
1043 * tcp segment 12 retransmit
1044 * attempts failed
1045 */
1046#define CXN_KILLED_RST_SENT 12 /* Connection got invalidated
1047 * internally due to TCP RST
1048 * sent by the Tx side
1049 */
1050#define CXN_KILLED_FIN_RCVD 13 /* Connection got invalidated
1051 * internally due to an
1052 * incoming TCP FIN.
1053 */
1054#define CXN_KILLED_BAD_UNSOL_PDU_RCVD 14 /* Connection got invalidated
1055 * internally due to bad
1056 * unsolicited PDU Unsolicited
1057 * PDUs are PDUs with
1058 * ITT=0xffffffff
1059 */
1060#define CXN_KILLED_BAD_WRB_INDEX_ERROR 15 /* Connection got invalidated
1061 * internally due to bad WRB
1062 * index.
1063 */
1064#define CXN_KILLED_OVER_RUN_RESIDUAL 16 /* Command got invalidated
Lucas De Marchi25985ed2011-03-30 22:57:33 -03001065 * internally due to received
Jayamohan Kallickal6733b392009-09-05 07:36:35 +05301066 * command has residual
1067 * over run bytes.
1068 */
1069#define CXN_KILLED_UNDER_RUN_RESIDUAL 17 /* Command got invalidated
Lucas De Marchi25985ed2011-03-30 22:57:33 -03001070 * internally due to received
Jayamohan Kallickal6733b392009-09-05 07:36:35 +05301071 * command has residual under
1072 * run bytes.
1073 */
1074#define CMD_KILLED_INVALID_STATSN_RCVD 18 /* Command got invalidated
Lucas De Marchi25985ed2011-03-30 22:57:33 -03001075 * internally due to a received
Jayamohan Kallickal6733b392009-09-05 07:36:35 +05301076 * PDU has an invalid StatusSN
1077 */
1078#define CMD_KILLED_INVALID_R2T_RCVD 19 /* Command got invalidated
Lucas De Marchi25985ed2011-03-30 22:57:33 -03001079 * internally due to a received
Jayamohan Kallickal6733b392009-09-05 07:36:35 +05301080 * an R2T with some invalid
1081 * fields in it
1082 */
1083#define CMD_CXN_KILLED_LUN_INVALID 20 /* Command got invalidated
1084 * internally due to received
1085 * PDU has an invalid LUN.
1086 */
1087#define CMD_CXN_KILLED_ICD_INVALID 21 /* Command got invalidated
1088 * internally due to the
1089 * corresponding ICD not in a
1090 * valid state
1091 */
1092#define CMD_CXN_KILLED_ITT_INVALID 22 /* Command got invalidated due
1093 * to received PDU has an
1094 * invalid ITT.
1095 */
1096#define CMD_CXN_KILLED_SEQ_OUTOFORDER 23 /* Command got invalidated due
1097 * to received sequence buffer
1098 * offset is out of order.
1099 */
1100#define CMD_CXN_KILLED_INVALID_DATASN_RCVD 24 /* Command got invalidated
1101 * internally due to a
Lucas De Marchi25985ed2011-03-30 22:57:33 -03001102 * received PDU has an invalid
Jayamohan Kallickal6733b392009-09-05 07:36:35 +05301103 * DataSN
1104 */
1105#define CXN_INVALIDATE_NOTIFY 25 /* Connection invalidation
1106 * completion notify.
1107 */
1108#define CXN_INVALIDATE_INDEX_NOTIFY 26 /* Connection invalidation
1109 * completion
1110 * with data PDU index.
1111 */
1112#define CMD_INVALIDATED_NOTIFY 27 /* Command invalidation
1113 * completionnotifify.
1114 */
1115#define UNSOL_HDR_NOTIFY 28 /* Unsolicited header notify.*/
1116#define UNSOL_DATA_NOTIFY 29 /* Unsolicited data notify.*/
Jayamohan Kallickal457ff3b2010-07-22 04:16:00 +05301117#define UNSOL_DATA_DIGEST_ERROR_NOTIFY 30 /* Unsolicited data digest
Jayamohan Kallickal6733b392009-09-05 07:36:35 +05301118 * error notify.
1119 */
1120#define DRIVERMSG_NOTIFY 31 /* TCP acknowledge based
1121 * notification.
1122 */
1123#define CXN_KILLED_CMND_DATA_NOT_ON_SAME_CONN 32 /* Connection got invalidated
1124 * internally due to command
1125 * and data are not on same
1126 * connection.
1127 */
1128#define SOL_CMD_KILLED_DIF_ERR 33 /* Solicited command got
1129 * invalidated internally due
1130 * to DIF error
1131 */
1132#define CXN_KILLED_SYN_RCVD 34 /* Connection got invalidated
1133 * internally due to incoming
1134 * TCP SYN
1135 */
1136#define CXN_KILLED_IMM_DATA_RCVD 35 /* Connection got invalidated
1137 * internally due to an
1138 * incoming Unsolicited PDU
1139 * that has immediate data on
1140 * the cxn
1141 */
1142
Jayamohan Kallickale9b91192010-07-22 04:24:53 +05301143int beiscsi_pci_soft_reset(struct beiscsi_hba *phba);
1144int be_chk_reset_complete(struct beiscsi_hba *phba);
1145
Jayamohan Kallickal6733b392009-09-05 07:36:35 +05301146void be_wrb_hdr_prepare(struct be_mcc_wrb *wrb, int payload_len,
1147 bool embedded, u8 sge_cnt);
1148
1149void be_cmd_hdr_prepare(struct be_cmd_req_hdr *req_hdr,
1150 u8 subsystem, u8 opcode, int cmd_len);
1151
1152#endif /* !BEISCSI_CMDS_H */