blob: 6f05d1dfa10a63d40d1c016aea4372e9cd86e696 [file] [log] [blame]
Jitendra Bhivare942b7652017-03-24 14:11:48 +05301/*
Jitendra Bhivare0172dc62017-10-10 16:18:19 +05302 * Copyright 2017 Broadcom. All Rights Reserved.
Jitendra Bhivare942b7652017-03-24 14:11:48 +05303 * The term "Broadcom" refers to Broadcom Limited and/or its subsidiaries.
Jayamohan Kallickal6733b392009-09-05 07:36:35 +05304 *
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
Jitendra Bhivare942b7652017-03-24 14:11:48 +05307 * as published by the Free Software Foundation. The full GNU General
Jayamohan Kallickal6733b392009-09-05 07:36:35 +05308 * Public License is included in this distribution in the file called COPYING.
9 *
10 * Contact Information:
Jitendra Bhivare60f36e02016-08-19 15:20:24 +053011 * linux-drivers@broadcom.com
Jayamohan Kallickal6733b392009-09-05 07:36:35 +053012 *
Jayamohan Kallickal6733b392009-09-05 07:36:35 +053013 */
14
15#ifndef BEISCSI_CMDS_H
16#define BEISCSI_CMDS_H
17
18/**
19 * The driver sends configuration and managements command requests to the
20 * firmware in the BE. These requests are communicated to the processor
21 * using Work Request Blocks (WRBs) submitted to the MCC-WRB ring or via one
22 * WRB inside a MAILBOX.
Jayamohan Kallickal2f635882012-04-03 23:41:45 -050023 * The commands are serviced by the ARM processor in the OneConnect's MPU.
Jayamohan Kallickal6733b392009-09-05 07:36:35 +053024 */
25struct be_sge {
Jayamohan Kallickal39033412014-08-08 00:59:58 -040026 __le32 pa_lo;
27 __le32 pa_hi;
28 __le32 len;
Jayamohan Kallickal6733b392009-09-05 07:36:35 +053029};
30
Jayamohan Kallickal6733b392009-09-05 07:36:35 +053031struct be_mcc_wrb {
Jitendra Bhivarefa1261c2016-12-13 15:56:01 +053032 u32 emb_sgecnt_special; /* dword 0 */
33 /* bits 0 - embedded */
34 /* bits 1 - 2 reserved */
35 /* bits 3 - 7 sge count */
36 /* bits 8 - 23 reserved */
37 /* bits 24 - 31 special */
38#define MCC_WRB_EMBEDDED_MASK 1
39#define MCC_WRB_SGE_CNT_SHIFT 3
40#define MCC_WRB_SGE_CNT_MASK 0x1F
Jayamohan Kallickal6733b392009-09-05 07:36:35 +053041 u32 payload_length; /* dword 1 */
42 u32 tag0; /* dword 2 */
43 u32 tag1; /* dword 3 */
44 u32 rsvd; /* dword 4 */
45 union {
Jayamohan Kallickal843ae752013-09-28 15:35:44 -070046#define EMBED_MBX_MAX_PAYLOAD_SIZE 220
Jayamohan Kallickal6733b392009-09-05 07:36:35 +053047 u8 embedded_payload[236]; /* used by embedded cmds */
48 struct be_sge sgl[19]; /* used by non-embedded cmds */
49 } payload;
50};
51
52#define CQE_FLAGS_VALID_MASK (1 << 31)
53#define CQE_FLAGS_ASYNC_MASK (1 << 30)
Jayamohan Kallickal457ff3b2010-07-22 04:16:00 +053054#define CQE_FLAGS_COMPLETED_MASK (1 << 28)
55#define CQE_FLAGS_CONSUMED_MASK (1 << 27)
Jayamohan Kallickal6733b392009-09-05 07:36:35 +053056
57/* Completion Status */
58#define MCC_STATUS_SUCCESS 0x0
Jayamohan Kallickala8081e32013-04-05 20:38:22 -070059#define MCC_STATUS_FAILED 0x1
60#define MCC_STATUS_ILLEGAL_REQUEST 0x2
61#define MCC_STATUS_ILLEGAL_FIELD 0x3
62#define MCC_STATUS_INSUFFICIENT_BUFFER 0x4
Jitendra Bhivare66940952016-08-19 15:20:14 +053063#define MCC_STATUS_INVALID_LENGTH 0x74
Jayamohan Kallickal6733b392009-09-05 07:36:35 +053064
Jitendra Bhivare67296ad2016-02-04 15:49:10 +053065#define CQE_STATUS_COMPL_MASK 0xFFFF
66#define CQE_STATUS_COMPL_SHIFT 0 /* bits 0 - 15 */
67#define CQE_STATUS_EXTD_MASK 0xFFFF
68#define CQE_STATUS_EXTD_SHIFT 16 /* bits 31 - 16 */
John Soni Josee175def2012-10-20 04:45:40 +053069#define CQE_STATUS_ADDL_MASK 0xFF00
Jitendra Bhivare67296ad2016-02-04 15:49:10 +053070#define CQE_STATUS_ADDL_SHIFT 8
71#define CQE_STATUS_MASK 0xFF
John Soni Josee175def2012-10-20 04:45:40 +053072#define CQE_STATUS_WRB_MASK 0xFF0000
73#define CQE_STATUS_WRB_SHIFT 16
Jitendra Bhivare67296ad2016-02-04 15:49:10 +053074
John Soni Josee175def2012-10-20 04:45:40 +053075#define BEISCSI_HOST_MBX_TIMEOUT (110 * 1000)
76#define BEISCSI_FW_MBX_TIMEOUT 100
Jayamohan Kallickal6733b392009-09-05 07:36:35 +053077
John Soni Joseeaae5262012-10-20 04:43:44 +053078/* MBOX Command VER */
Jayamohan Kallickalb3c202d2014-05-05 21:41:27 -040079#define MBX_CMD_VER1 0x01
John Soni Joseeaae5262012-10-20 04:43:44 +053080#define MBX_CMD_VER2 0x02
81
Jayamohan Kallickal6733b392009-09-05 07:36:35 +053082struct be_mcc_compl {
83 u32 status; /* dword 0 */
84 u32 tag0; /* dword 1 */
85 u32 tag1; /* dword 2 */
86 u32 flags; /* dword 3 */
87};
88
89/********* Mailbox door bell *************/
90/**
91 * Used for driver communication with the FW.
92 * The software must write this register twice to post any command. First,
93 * it writes the register with hi=1 and the upper bits of the physical address
94 * for the MAILBOX structure. Software must poll the ready bit until this
95 * is acknowledged. Then, sotware writes the register with hi=0 with the lower
96 * bits in the address. It must poll the ready bit until the command is
97 * complete. Upon completion, the MAILBOX will contain a valid completion
98 * queue entry.
99 */
100#define MPU_MAILBOX_DB_OFFSET 0x160
101#define MPU_MAILBOX_DB_RDY_MASK 0x1 /* bit 0 */
102#define MPU_MAILBOX_DB_HI_MASK 0x2 /* bit 1 */
103
Jitendra Bhivare4d2ee1e2016-08-19 15:20:16 +0530104/********** MPU semphore: used for SH & BE ******************/
105#define SLIPORT_SOFTRESET_OFFSET 0x5c /* CSR BAR offset */
106#define SLIPORT_SEMAPHORE_OFFSET_BEx 0xac /* CSR BAR offset */
107#define SLIPORT_SEMAPHORE_OFFSET_SH 0x94 /* PCI-CFG offset */
108#define POST_STAGE_MASK 0x0000FFFF
109#define POST_ERROR_BIT 0x80000000
110#define POST_ERR_RECOVERY_CODE_MASK 0xF000
111
112/* Soft Reset register masks */
113#define SLIPORT_SOFTRESET_SR_MASK 0x00000080 /* SR bit */
114
115/* MPU semphore POST stage values */
116#define POST_STAGE_AWAITING_HOST_RDY 0x1 /* FW awaiting goahead from host */
117#define POST_STAGE_HOST_RDY 0x2 /* Host has given go-ahed to FW */
118#define POST_STAGE_BE_RESET 0x3 /* Host wants to reset chip */
119#define POST_STAGE_ARMFW_RDY 0xC000 /* FW is done with POST */
120#define POST_STAGE_RECOVERABLE_ERR 0xE000 /* Recoverable err detected */
Jayamohan Kallickal6733b392009-09-05 07:36:35 +0530121
122/********** MCC door bell ************/
123#define DB_MCCQ_OFFSET 0x140
Jayamohan Kallickale08b3c82014-01-29 02:16:42 -0500124#define DB_MCCQ_RING_ID_MASK 0xFFFF /* bits 0 - 15 */
Jayamohan Kallickal6733b392009-09-05 07:36:35 +0530125/* Number of entries posted */
126#define DB_MCCQ_NUM_POSTED_SHIFT 16 /* bits 16 - 29 */
127
Jayamohan Kallickal6733b392009-09-05 07:36:35 +0530128/**
129 * When the async bit of mcc_compl is set, the last 4 bytes of
130 * mcc_compl is interpreted as follows:
131 */
132#define ASYNC_TRAILER_EVENT_CODE_SHIFT 8 /* bits 8 - 15 */
133#define ASYNC_TRAILER_EVENT_CODE_MASK 0xFF
134#define ASYNC_EVENT_CODE_LINK_STATE 0x1
Jayamohan Kallickala3d313e2014-08-08 01:00:00 -0400135#define ASYNC_EVENT_CODE_ISCSI 0x4
Jitendra Bhivare53aefe22016-01-20 14:10:53 +0530136#define ASYNC_EVENT_CODE_SLI 0x11
Jayamohan Kallickala3d313e2014-08-08 01:00:00 -0400137
138#define ASYNC_TRAILER_EVENT_TYPE_SHIFT 16 /* bits 16 - 23 */
Jitendra Bhivare53aefe22016-01-20 14:10:53 +0530139#define ASYNC_TRAILER_EVENT_TYPE_MASK 0xFF
140
141/* iSCSI events */
Jayamohan Kallickala3d313e2014-08-08 01:00:00 -0400142#define ASYNC_EVENT_NEW_ISCSI_TGT_DISC 0x4
143#define ASYNC_EVENT_NEW_ISCSI_CONN 0x5
144#define ASYNC_EVENT_NEW_TCP_CONN 0x7
145
Jitendra Bhivare53aefe22016-01-20 14:10:53 +0530146/* SLI events */
147#define ASYNC_SLI_EVENT_TYPE_MISCONFIGURED 0x9
148#define ASYNC_SLI_LINK_EFFECT_VALID(le) (le & 0x80)
149#define ASYNC_SLI_LINK_EFFECT_SEV(le) ((le >> 1) & 0x03)
150#define ASYNC_SLI_LINK_EFFECT_STATE(le) (le & 0x01)
151
Jayamohan Kallickal6733b392009-09-05 07:36:35 +0530152struct be_async_event_trailer {
153 u32 code;
154};
155
156enum {
157 ASYNC_EVENT_LINK_DOWN = 0x0,
Jayamohan Kallickal6ea9b3b2013-04-05 20:38:30 -0700158 ASYNC_EVENT_LINK_UP = 0x1,
Jayamohan Kallickal6733b392009-09-05 07:36:35 +0530159};
160
161/**
162 * When the event code of an async trailer is link-state, the mcc_compl
163 * must be interpreted as follows
164 */
165struct be_async_event_link_state {
166 u8 physical_port;
167 u8 port_link_status;
Jitendra Bhivare9c4f8b02016-01-20 14:10:59 +0530168/**
169 * ASYNC_EVENT_LINK_DOWN 0x0
170 * ASYNC_EVENT_LINK_UP 0x1
171 * ASYNC_EVENT_LINK_LOGICAL_DOWN 0x2
172 * ASYNC_EVENT_LINK_LOGICAL_UP 0x3
173 */
174#define BE_ASYNC_LINK_UP_MASK 0x01
Jayamohan Kallickal6733b392009-09-05 07:36:35 +0530175 u8 port_duplex;
Jitendra Bhivare9c4f8b02016-01-20 14:10:59 +0530176 u8 port_speed;
Jitendra Bhivare048084c2016-01-20 14:10:58 +0530177/* BE2ISCSI_LINK_SPEED_ZERO 0x00 - no link */
178#define BE2ISCSI_LINK_SPEED_10MBPS 0x01
179#define BE2ISCSI_LINK_SPEED_100MBPS 0x02
180#define BE2ISCSI_LINK_SPEED_1GBPS 0x03
181#define BE2ISCSI_LINK_SPEED_10GBPS 0x04
182#define BE2ISCSI_LINK_SPEED_25GBPS 0x06
183#define BE2ISCSI_LINK_SPEED_40GBPS 0x07
Jayamohan Kallickal6733b392009-09-05 07:36:35 +0530184 u8 port_fault;
Jitendra Bhivare048084c2016-01-20 14:10:58 +0530185 u8 event_reason;
186 u16 qos_link_speed;
187 u32 event_tag;
Jayamohan Kallickal6733b392009-09-05 07:36:35 +0530188 struct be_async_event_trailer trailer;
189} __packed;
190
Jitendra Bhivare53aefe22016-01-20 14:10:53 +0530191/**
192 * When async-trailer is SLI event, mcc_compl is interpreted as
193 */
194struct be_async_event_sli {
195 u32 event_data1;
196 u32 event_data2;
197 u32 reserved;
198 u32 trailer;
199} __packed;
200
Jayamohan Kallickal6733b392009-09-05 07:36:35 +0530201struct be_mcc_mailbox {
202 struct be_mcc_wrb wrb;
203 struct be_mcc_compl compl;
204};
205
206/* Type of subsystems supported by FW */
207#define CMD_SUBSYSTEM_COMMON 0x1
208#define CMD_SUBSYSTEM_ISCSI 0x2
209#define CMD_SUBSYSTEM_ETH 0x3
210#define CMD_SUBSYSTEM_ISCSI_INI 0x6
211#define CMD_COMMON_TCP_UPLOAD 0x1
212
213/**
214 * List of common opcodes subsystem CMD_SUBSYSTEM_COMMON
215 * These opcodes are unique for each subsystem defined above
216 */
217#define OPCODE_COMMON_CQ_CREATE 12
218#define OPCODE_COMMON_EQ_CREATE 13
Jayamohan Kallickal457ff3b2010-07-22 04:16:00 +0530219#define OPCODE_COMMON_MCC_CREATE 21
Jitendra Bhivare53aefe22016-01-20 14:10:53 +0530220#define OPCODE_COMMON_MCC_CREATE_EXT 90
Jayamohan Kallickal15a90fe2013-09-28 15:35:38 -0700221#define OPCODE_COMMON_ADD_TEMPLATE_HEADER_BUFFERS 24
222#define OPCODE_COMMON_REMOVE_TEMPLATE_HEADER_BUFFERS 25
Jayamohan Kallickal457ff3b2010-07-22 04:16:00 +0530223#define OPCODE_COMMON_GET_CNTL_ATTRIBUTES 32
Jayamohan Kallickal6733b392009-09-05 07:36:35 +0530224#define OPCODE_COMMON_GET_FW_VERSION 35
225#define OPCODE_COMMON_MODIFY_EQ_DELAY 41
226#define OPCODE_COMMON_FIRMWARE_CONFIG 42
Jayamohan Kallickal457ff3b2010-07-22 04:16:00 +0530227#define OPCODE_COMMON_MCC_DESTROY 53
228#define OPCODE_COMMON_CQ_DESTROY 54
229#define OPCODE_COMMON_EQ_DESTROY 55
Jayamohan Kallickal6733b392009-09-05 07:36:35 +0530230#define OPCODE_COMMON_QUERY_FIRMWARE_CONFIG 58
231#define OPCODE_COMMON_FUNCTION_RESET 61
Jitendra Bhivare53aefe22016-01-20 14:10:53 +0530232#define OPCODE_COMMON_GET_PORT_NAME 77
Jitendra Bhivare1cb3c3f2017-10-10 16:18:17 +0530233#define OPCODE_COMMON_SET_HOST_DATA 93
Jitendra Bhivare66940952016-08-19 15:20:14 +0530234#define OPCODE_COMMON_SET_FEATURES 191
Jayamohan Kallickal6733b392009-09-05 07:36:35 +0530235
236/**
237 * LIST of opcodes that are common between Initiator and Target
238 * used by CMD_SUBSYSTEM_ISCSI
239 * These opcodes are unique for each subsystem defined above
240 */
241#define OPCODE_COMMON_ISCSI_CFG_POST_SGL_PAGES 2
242#define OPCODE_COMMON_ISCSI_CFG_REMOVE_SGL_PAGES 3
243#define OPCODE_COMMON_ISCSI_NTWK_GET_NIC_CONFIG 7
Jayamohan Kallickalc7acc5b2010-07-22 04:29:18 +0530244#define OPCODE_COMMON_ISCSI_NTWK_SET_VLAN 14
Mike Christie0e438952012-04-03 23:41:51 -0500245#define OPCODE_COMMON_ISCSI_NTWK_CONFIG_STATELESS_IP_ADDR 17
246#define OPCODE_COMMON_ISCSI_NTWK_REL_STATELESS_IP_ADDR 18
Jayamohan Kallickalc7acc5b2010-07-22 04:29:18 +0530247#define OPCODE_COMMON_ISCSI_NTWK_MODIFY_IP_ADDR 21
248#define OPCODE_COMMON_ISCSI_NTWK_GET_DEFAULT_GATEWAY 22
249#define OPCODE_COMMON_ISCSI_NTWK_MODIFY_DEFAULT_GATEWAY 23
250#define OPCODE_COMMON_ISCSI_NTWK_GET_ALL_IF_ID 24
251#define OPCODE_COMMON_ISCSI_NTWK_GET_IF_INFO 25
Jayamohan Kallickal6733b392009-09-05 07:36:35 +0530252#define OPCODE_COMMON_ISCSI_SET_FRAGNUM_BITS_FOR_SGL_CRA 61
253#define OPCODE_COMMON_ISCSI_DEFQ_CREATE 64
Jayamohan Kallickal457ff3b2010-07-22 04:16:00 +0530254#define OPCODE_COMMON_ISCSI_DEFQ_DESTROY 65
Jayamohan Kallickal6733b392009-09-05 07:36:35 +0530255#define OPCODE_COMMON_ISCSI_WRBQ_CREATE 66
Jayamohan Kallickal457ff3b2010-07-22 04:16:00 +0530256#define OPCODE_COMMON_ISCSI_WRBQ_DESTROY 67
Jayamohan Kallickal6733b392009-09-05 07:36:35 +0530257
258struct be_cmd_req_hdr {
259 u8 opcode; /* dword 0 */
260 u8 subsystem; /* dword 0 */
261 u8 port_number; /* dword 0 */
262 u8 domain; /* dword 0 */
263 u32 timeout; /* dword 1 */
264 u32 request_length; /* dword 2 */
John Soni Joseeaae5262012-10-20 04:43:44 +0530265 u8 version; /* dword 3 */
266 u8 rsvd0[3]; /* dword 3 */
Jayamohan Kallickal6733b392009-09-05 07:36:35 +0530267};
268
269struct be_cmd_resp_hdr {
270 u32 info; /* dword 0 */
271 u32 status; /* dword 1 */
272 u32 response_length; /* dword 2 */
273 u32 actual_resp_len; /* dword 3 */
274};
275
276struct phys_addr {
277 u32 lo;
278 u32 hi;
279};
280
Jayamohan Kallickal15a90fe2013-09-28 15:35:38 -0700281struct virt_addr {
282 u32 lo;
283 u32 hi;
284};
Jayamohan Kallickal6733b392009-09-05 07:36:35 +0530285/**************************
286 * BE Command definitions *
287 **************************/
288
289/**
290 * Pseudo amap definition in which each bit of the actual structure is defined
291 * as a byte - used to calculate offset/shift/mask of each field
292 */
293struct amap_eq_context {
294 u8 cidx[13]; /* dword 0 */
295 u8 rsvd0[3]; /* dword 0 */
296 u8 epidx[13]; /* dword 0 */
297 u8 valid; /* dword 0 */
298 u8 rsvd1; /* dword 0 */
299 u8 size; /* dword 0 */
300 u8 pidx[13]; /* dword 1 */
301 u8 rsvd2[3]; /* dword 1 */
302 u8 pd[10]; /* dword 1 */
303 u8 count[3]; /* dword 1 */
304 u8 solevent; /* dword 1 */
305 u8 stalled; /* dword 1 */
306 u8 armed; /* dword 1 */
307 u8 rsvd3[4]; /* dword 2 */
308 u8 func[8]; /* dword 2 */
309 u8 rsvd4; /* dword 2 */
310 u8 delaymult[10]; /* dword 2 */
311 u8 rsvd5[2]; /* dword 2 */
312 u8 phase[2]; /* dword 2 */
313 u8 nodelay; /* dword 2 */
314 u8 rsvd6[4]; /* dword 2 */
315 u8 rsvd7[32]; /* dword 3 */
316} __packed;
317
318struct be_cmd_req_eq_create {
319 struct be_cmd_req_hdr hdr; /* dw[4] */
320 u16 num_pages; /* sword */
321 u16 rsvd0; /* sword */
322 u8 context[sizeof(struct amap_eq_context) / 8]; /* dw[4] */
323 struct phys_addr pages[8];
324} __packed;
325
326struct be_cmd_resp_eq_create {
327 struct be_cmd_resp_hdr resp_hdr;
328 u16 eq_id; /* sword */
329 u16 rsvd0; /* sword */
330} __packed;
331
Jayamohan Kallickal73af08e2014-05-05 21:41:26 -0400332struct be_set_eqd {
333 u32 eq_id;
334 u32 phase;
335 u32 delay_multiplier;
336} __packed;
337
Jayamohan Kallickalc7acc5b2010-07-22 04:29:18 +0530338struct mgmt_chap_format {
339 u32 flags;
340 u8 intr_chap_name[256];
341 u8 intr_secret[16];
342 u8 target_chap_name[256];
343 u8 target_secret[16];
344 u16 intr_chap_name_length;
345 u16 intr_secret_length;
346 u16 target_chap_name_length;
347 u16 target_secret_length;
348} __packed;
349
350struct mgmt_auth_method_format {
351 u8 auth_method_type;
352 u8 padding[3];
353 struct mgmt_chap_format chap;
354} __packed;
355
John Soni Jose3f4134c2015-04-25 08:18:13 +0530356struct be_cmd_req_logout_fw_sess {
357 struct be_cmd_req_hdr hdr; /* dw[4] */
358 uint32_t session_handle;
359} __packed;
360
361struct be_cmd_resp_logout_fw_sess {
362 struct be_cmd_resp_hdr hdr; /* dw[4] */
John Soni Jose3f4134c2015-04-25 08:18:13 +0530363 uint32_t session_status;
Jitendra Bhivare50a4b822016-08-19 15:20:12 +0530364#define BE_SESS_STATUS_CLOSE 0x20
John Soni Jose3f4134c2015-04-25 08:18:13 +0530365} __packed;
366
Jayamohan Kallickalc7acc5b2010-07-22 04:29:18 +0530367struct mgmt_conn_login_options {
368 u8 flags;
369 u8 header_digest;
370 u8 data_digest;
371 u8 rsvd0;
372 u32 max_recv_datasegment_len_ini;
373 u32 max_recv_datasegment_len_tgt;
374 u32 tcp_mss;
375 u32 tcp_window_size;
376 struct mgmt_auth_method_format auth_data;
377} __packed;
378
Mike Christie0e438952012-04-03 23:41:51 -0500379struct ip_addr_format {
Jayamohan Kallickalc7acc5b2010-07-22 04:29:18 +0530380 u16 size_of_structure;
381 u8 reserved;
382 u8 ip_type;
Jitendra Bhivare290aa372016-08-19 15:20:08 +0530383#define BEISCSI_IP_TYPE_V4 0x1
384#define BEISCSI_IP_TYPE_STATIC_V4 0x3
385#define BEISCSI_IP_TYPE_DHCP_V4 0x5
386/* type v4 values < type v6 values */
387#define BEISCSI_IP_TYPE_V6 0x10
388#define BEISCSI_IP_TYPE_ROUTABLE_V6 0x30
389#define BEISCSI_IP_TYPE_LINK_LOCAL_V6 0x50
390#define BEISCSI_IP_TYPE_AUTO_V6 0x90
Mike Christie0e438952012-04-03 23:41:51 -0500391 u8 addr[16];
Jayamohan Kallickalc7acc5b2010-07-22 04:29:18 +0530392 u32 rsvd0;
393} __packed;
394
Mike Christie0e438952012-04-03 23:41:51 -0500395struct mgmt_conn_info {
Jayamohan Kallickalc7acc5b2010-07-22 04:29:18 +0530396 u32 connection_handle;
397 u32 connection_status;
398 u16 src_port;
399 u16 dest_port;
400 u16 dest_port_redirected;
401 u16 cid;
402 u32 estimated_throughput;
Mike Christie0e438952012-04-03 23:41:51 -0500403 struct ip_addr_format src_ipaddr;
404 struct ip_addr_format dest_ipaddr;
405 struct ip_addr_format dest_ipaddr_redirected;
Jayamohan Kallickalc7acc5b2010-07-22 04:29:18 +0530406 struct mgmt_conn_login_options negotiated_login_options;
407} __packed;
408
409struct mgmt_session_login_options {
410 u8 flags;
411 u8 error_recovery_level;
412 u16 rsvd0;
413 u32 first_burst_length;
414 u32 max_burst_length;
415 u16 max_connections;
416 u16 max_outstanding_r2t;
417 u16 default_time2wait;
418 u16 default_time2retain;
419} __packed;
420
421struct mgmt_session_info {
422 u32 session_handle;
423 u32 status;
424 u8 isid[6];
425 u16 tsih;
426 u32 session_flags;
427 u16 conn_count;
428 u16 pad;
429 u8 target_name[224];
430 u8 initiator_iscsiname[224];
431 struct mgmt_session_login_options negotiated_login_options;
432 struct mgmt_conn_info conn_list[1];
433} __packed;
434
Mike Christie0e438952012-04-03 23:41:51 -0500435struct be_cmd_get_session_req {
Jayamohan Kallickalc7acc5b2010-07-22 04:29:18 +0530436 struct be_cmd_req_hdr hdr;
437 u32 session_handle;
438} __packed;
439
Mike Christie0e438952012-04-03 23:41:51 -0500440struct be_cmd_get_session_resp {
Jayamohan Kallickalc7acc5b2010-07-22 04:29:18 +0530441 struct be_cmd_resp_hdr hdr;
442 struct mgmt_session_info session_info;
443} __packed;
444
Jayamohan Kallickal6733b392009-09-05 07:36:35 +0530445struct mac_addr {
Mike Christie0e438952012-04-03 23:41:51 -0500446 u16 size_of_structure;
Jayamohan Kallickal6733b392009-09-05 07:36:35 +0530447 u8 addr[ETH_ALEN];
448} __packed;
449
Mike Christie0e438952012-04-03 23:41:51 -0500450struct be_cmd_get_boot_target_req {
Jayamohan Kallickalc7acc5b2010-07-22 04:29:18 +0530451 struct be_cmd_req_hdr hdr;
452} __packed;
453
Mike Christie0e438952012-04-03 23:41:51 -0500454struct be_cmd_get_boot_target_resp {
Jayamohan Kallickalc7acc5b2010-07-22 04:29:18 +0530455 struct be_cmd_resp_hdr hdr;
Jitendra Bhivare50a4b822016-08-19 15:20:12 +0530456 u32 boot_session_count;
457 u32 boot_session_handle;
458/**
459 * FW returns 0xffffffff if it couldn't establish connection with
460 * configured boot target.
461 */
462#define BE_BOOT_INVALID_SHANDLE 0xffffffff
Jayamohan Kallickalc7acc5b2010-07-22 04:29:18 +0530463};
464
John Soni Jose9aef4202012-08-20 23:00:08 +0530465struct be_cmd_reopen_session_req {
466 struct be_cmd_req_hdr hdr;
467#define BE_REOPEN_ALL_SESSIONS 0x00
468#define BE_REOPEN_BOOT_SESSIONS 0x01
469#define BE_REOPEN_A_SESSION 0x02
470 u16 reopen_type;
471 u16 rsvd;
472 u32 session_handle;
473} __packed;
474
475struct be_cmd_reopen_session_resp {
476 struct be_cmd_resp_hdr hdr;
477 u32 rsvd;
478 u32 session_handle;
479} __packed;
480
481
Mike Christie0e438952012-04-03 23:41:51 -0500482struct be_cmd_mac_query_req {
Jayamohan Kallickal6733b392009-09-05 07:36:35 +0530483 struct be_cmd_req_hdr hdr;
484 u8 type;
485 u8 permanent;
486 u16 if_id;
487} __packed;
488
Mike Christie0e438952012-04-03 23:41:51 -0500489struct be_cmd_get_mac_resp {
Jayamohan Kallickal6733b392009-09-05 07:36:35 +0530490 struct be_cmd_resp_hdr hdr;
491 struct mac_addr mac;
492};
493
Mike Christie0e438952012-04-03 23:41:51 -0500494struct be_ip_addr_subnet_format {
495 u16 size_of_structure;
496 u8 ip_type;
497 u8 ipv6_prefix_length;
498 u8 addr[16];
499 u8 subnet_mask[16];
500 u32 rsvd0;
501} __packed;
502
503struct be_cmd_get_if_info_req {
504 struct be_cmd_req_hdr hdr;
505 u32 interface_hndl;
506 u32 ip_type;
507} __packed;
508
509struct be_cmd_get_if_info_resp {
510 struct be_cmd_req_hdr hdr;
511 u32 interface_hndl;
512 u32 vlan_priority;
513 u32 ip_addr_count;
514 u32 dhcp_state;
515 struct be_ip_addr_subnet_format ip_addr;
516} __packed;
517
518struct be_ip_addr_record {
519 u32 action;
520 u32 interface_hndl;
521 struct be_ip_addr_subnet_format ip_addr;
522 u32 status;
523} __packed;
524
525struct be_ip_addr_record_params {
526 u32 record_entry_count;
527 struct be_ip_addr_record ip_record;
528} __packed;
529
530struct be_cmd_set_ip_addr_req {
531 struct be_cmd_req_hdr hdr;
532 struct be_ip_addr_record_params ip_params;
533} __packed;
534
535
536struct be_cmd_set_dhcp_req {
537 struct be_cmd_req_hdr hdr;
538 u32 interface_hndl;
539 u32 ip_type;
540 u32 flags;
541 u32 retry_count;
542} __packed;
543
544struct be_cmd_rel_dhcp_req {
545 struct be_cmd_req_hdr hdr;
546 u32 interface_hndl;
547 u32 ip_type;
548} __packed;
549
550struct be_cmd_set_def_gateway_req {
551 struct be_cmd_req_hdr hdr;
552 u32 action;
553 struct ip_addr_format ip_addr;
554} __packed;
555
556struct be_cmd_get_def_gateway_req {
557 struct be_cmd_req_hdr hdr;
558 u32 ip_type;
559} __packed;
560
561struct be_cmd_get_def_gateway_resp {
562 struct be_cmd_req_hdr hdr;
563 struct ip_addr_format ip_addr;
564} __packed;
565
John Soni Jose6f722382012-08-20 23:00:43 +0530566#define BEISCSI_VLAN_DISABLE 0xFFFF
567struct be_cmd_set_vlan_req {
568 struct be_cmd_req_hdr hdr;
569 u32 interface_hndl;
570 u32 vlan_priority;
571} __packed;
Jayamohan Kallickal6733b392009-09-05 07:36:35 +0530572/******************** Create CQ ***************************/
573/**
574 * Pseudo amap definition in which each bit of the actual structure is defined
575 * as a byte - used to calculate offset/shift/mask of each field
576 */
577struct amap_cq_context {
578 u8 cidx[11]; /* dword 0 */
579 u8 rsvd0; /* dword 0 */
580 u8 coalescwm[2]; /* dword 0 */
581 u8 nodelay; /* dword 0 */
582 u8 epidx[11]; /* dword 0 */
583 u8 rsvd1; /* dword 0 */
584 u8 count[2]; /* dword 0 */
585 u8 valid; /* dword 0 */
586 u8 solevent; /* dword 0 */
587 u8 eventable; /* dword 0 */
588 u8 pidx[11]; /* dword 1 */
589 u8 rsvd2; /* dword 1 */
590 u8 pd[10]; /* dword 1 */
591 u8 eqid[8]; /* dword 1 */
592 u8 stalled; /* dword 1 */
593 u8 armed; /* dword 1 */
594 u8 rsvd3[4]; /* dword 2 */
595 u8 func[8]; /* dword 2 */
596 u8 rsvd4[20]; /* dword 2 */
597 u8 rsvd5[32]; /* dword 3 */
598} __packed;
599
John Soni Joseeaae5262012-10-20 04:43:44 +0530600struct amap_cq_context_v2 {
601 u8 rsvd0[12]; /* dword 0 */
602 u8 coalescwm[2]; /* dword 0 */
603 u8 nodelay; /* dword 0 */
604 u8 rsvd1[12]; /* dword 0 */
605 u8 count[2]; /* dword 0 */
606 u8 valid; /* dword 0 */
607 u8 rsvd2; /* dword 0 */
608 u8 eventable; /* dword 0 */
609 u8 eqid[16]; /* dword 1 */
610 u8 rsvd3[15]; /* dword 1 */
611 u8 armed; /* dword 1 */
612 u8 cqecount[16];/* dword 2 */
613 u8 rsvd4[16]; /* dword 2 */
614 u8 rsvd5[32]; /* dword 3 */
615};
616
Jayamohan Kallickal6733b392009-09-05 07:36:35 +0530617struct be_cmd_req_cq_create {
618 struct be_cmd_req_hdr hdr;
619 u16 num_pages;
John Soni Joseeaae5262012-10-20 04:43:44 +0530620 u8 page_size;
621 u8 rsvd0;
Jayamohan Kallickal6733b392009-09-05 07:36:35 +0530622 u8 context[sizeof(struct amap_cq_context) / 8];
623 struct phys_addr pages[4];
624} __packed;
625
626struct be_cmd_resp_cq_create {
627 struct be_cmd_resp_hdr hdr;
628 u16 cq_id;
629 u16 rsvd0;
630} __packed;
631
632/******************** Create MCCQ ***************************/
633/**
634 * Pseudo amap definition in which each bit of the actual structure is defined
635 * as a byte - used to calculate offset/shift/mask of each field
636 */
637struct amap_mcc_context {
638 u8 con_index[14];
639 u8 rsvd0[2];
640 u8 ring_size[4];
641 u8 fetch_wrb;
642 u8 fetch_r2t;
643 u8 cq_id[10];
644 u8 prod_index[14];
645 u8 fid[8];
646 u8 pdid[9];
647 u8 valid;
648 u8 rsvd1[32];
649 u8 rsvd2[32];
650} __packed;
651
Jitendra Bhivare53aefe22016-01-20 14:10:53 +0530652struct be_cmd_req_mcc_create_ext {
Jayamohan Kallickal6733b392009-09-05 07:36:35 +0530653 struct be_cmd_req_hdr hdr;
654 u16 num_pages;
655 u16 rsvd0;
Jitendra Bhivare53aefe22016-01-20 14:10:53 +0530656 u32 async_evt_bitmap;
Jayamohan Kallickal6733b392009-09-05 07:36:35 +0530657 u8 context[sizeof(struct amap_mcc_context) / 8];
658 struct phys_addr pages[8];
659} __packed;
660
661struct be_cmd_resp_mcc_create {
662 struct be_cmd_resp_hdr hdr;
663 u16 id;
664 u16 rsvd0;
665} __packed;
666
667/******************** Q Destroy ***************************/
668/* Type of Queue to be destroyed */
669enum {
670 QTYPE_EQ = 1,
671 QTYPE_CQ,
672 QTYPE_MCCQ,
673 QTYPE_WRBQ,
674 QTYPE_DPDUQ,
675 QTYPE_SGL
676};
677
678struct be_cmd_req_q_destroy {
679 struct be_cmd_req_hdr hdr;
680 u16 id;
681 u16 bypass_flush; /* valid only for rx q destroy */
682} __packed;
683
684struct macaddr {
685 u8 byte[ETH_ALEN];
686};
687
688struct be_cmd_req_mcast_mac_config {
689 struct be_cmd_req_hdr hdr;
690 u16 num_mac;
691 u8 promiscuous;
692 u8 interface_id;
693 struct macaddr mac[32];
694} __packed;
695
696static inline void *embedded_payload(struct be_mcc_wrb *wrb)
697{
698 return wrb->payload.embedded_payload;
699}
700
701static inline struct be_sge *nonembedded_sgl(struct be_mcc_wrb *wrb)
702{
703 return &wrb->payload.sgl[0];
704}
705
706/******************** Modify EQ Delay *******************/
707struct be_cmd_req_modify_eq_delay {
708 struct be_cmd_req_hdr hdr;
Jayamohan Kallickal39033412014-08-08 00:59:58 -0400709 __le32 num_eq;
Jayamohan Kallickal6733b392009-09-05 07:36:35 +0530710 struct {
Jayamohan Kallickal39033412014-08-08 00:59:58 -0400711 __le32 eq_id;
712 __le32 phase;
713 __le32 delay_multiplier;
Jayamohan Kallickal73af08e2014-05-05 21:41:26 -0400714 } delay[MAX_CPUS];
Jayamohan Kallickal6733b392009-09-05 07:36:35 +0530715} __packed;
716
717/******************** Get MAC ADDR *******************/
718
Mike Christie0e438952012-04-03 23:41:51 -0500719struct be_cmd_get_nic_conf_resp {
Jayamohan Kallickal6733b392009-09-05 07:36:35 +0530720 struct be_cmd_resp_hdr hdr;
721 u32 nic_port_count;
722 u32 speed;
723 u32 max_speed;
724 u32 link_state;
725 u32 max_frame_size;
726 u16 size_of_structure;
Jitendra Bhivare9c4f8b02016-01-20 14:10:59 +0530727 u8 mac_address[ETH_ALEN];
728} __packed;
Jayamohan Kallickal6733b392009-09-05 07:36:35 +0530729
Jitendra Bhivare66940952016-08-19 15:20:14 +0530730/******************** Get HBA NAME *******************/
731
John Soni Jose21771992012-04-03 23:41:49 -0500732struct be_cmd_hba_name {
733 struct be_cmd_req_hdr hdr;
734 u16 flags;
735 u16 rsvd0;
736 u8 initiator_name[ISCSI_NAME_LEN];
Jitendra Bhivare480195c2016-08-19 15:20:15 +0530737#define BE_INI_ALIAS_LEN 32
738 u8 initiator_alias[BE_INI_ALIAS_LEN];
John Soni Jose21771992012-04-03 23:41:49 -0500739} __packed;
740
Jitendra Bhivare1cb3c3f2017-10-10 16:18:17 +0530741/******************** COMMON SET HOST DATA *******************/
742#define BE_CMD_SET_HOST_PARAM_ID 0x2
743#define BE_CMD_MAX_DRV_VERSION 0x30
744struct be_sethost_req {
745 u32 param_id;
746 u32 param_len;
747 u32 param_data[32];
748};
749
750struct be_sethost_resp {
751 u32 rsvd0;
752};
753
754struct be_cmd_set_host_data {
755 union {
756 struct be_cmd_req_hdr req_hdr;
757 struct be_cmd_resp_hdr resp_hdr;
758 } h;
759 union {
760 struct be_sethost_req req;
761 struct be_sethost_resp resp;
762 } param;
763} __packed;
764
Jitendra Bhivare66940952016-08-19 15:20:14 +0530765/******************** COMMON SET Features *******************/
766#define BE_CMD_SET_FEATURE_UER 0x10
767#define BE_CMD_UER_SUPP_BIT 0x1
768struct be_uer_req {
769 u32 uer;
770 u32 rsvd;
771};
772
773struct be_uer_resp {
774 u32 uer;
775 u16 ue2rp;
776 u16 ue2sr;
777};
778
779struct be_cmd_set_features {
780 union {
781 struct be_cmd_req_hdr req_hdr;
782 struct be_cmd_resp_hdr resp_hdr;
783 } h;
784 u32 feature;
785 u32 param_len;
786 union {
787 struct be_uer_req req;
788 struct be_uer_resp resp;
789 u32 rsvd[2];
790 } param;
791} __packed;
792
Jitendra Bhivare4ee1ec42016-08-19 15:20:20 +0530793int beiscsi_cmd_function_reset(struct beiscsi_hba *phba);
794
Jitendra Bhivare4d2ee1e2016-08-19 15:20:16 +0530795int beiscsi_cmd_special_wrb(struct be_ctrl_info *ctrl, u32 load);
796
797int beiscsi_check_fw_rdy(struct beiscsi_hba *phba);
798
799int beiscsi_init_sliport(struct beiscsi_hba *phba);
800
Jitendra Bhivaref79929d2016-08-19 15:20:17 +0530801int beiscsi_cmd_iscsi_cleanup(struct beiscsi_hba *phba, unsigned short ulp_num);
802
Jitendra Bhivared1d5ca82016-08-19 15:20:18 +0530803int beiscsi_detect_ue(struct beiscsi_hba *phba);
804
805int beiscsi_detect_tpe(struct beiscsi_hba *phba);
806
Jayamohan Kallickal6733b392009-09-05 07:36:35 +0530807int beiscsi_cmd_eq_create(struct be_ctrl_info *ctrl,
808 struct be_queue_info *eq, int eq_delay);
809
810int beiscsi_cmd_cq_create(struct be_ctrl_info *ctrl,
811 struct be_queue_info *cq, struct be_queue_info *eq,
812 bool sol_evts, bool no_delay,
813 int num_cqe_dma_coalesce);
814
815int beiscsi_cmd_q_destroy(struct be_ctrl_info *ctrl, struct be_queue_info *q,
816 int type);
Jayamohan Kallickal35e66012009-10-23 11:53:49 +0530817int beiscsi_cmd_mccq_create(struct beiscsi_hba *phba,
Jayamohan Kallickalbfead3b2009-10-23 11:52:33 +0530818 struct be_queue_info *mccq,
819 struct be_queue_info *cq);
820
Jitendra Bhivare090e2182016-02-04 15:49:17 +0530821void free_mcc_wrb(struct be_ctrl_info *ctrl, unsigned int tag);
John Soni Josee175def2012-10-20 04:45:40 +0530822
Jitendra Bhivare10bcd472016-08-19 15:20:13 +0530823int beiscsi_modify_eq_delay(struct beiscsi_hba *phba, struct be_set_eqd *,
Jayamohan Kallickal73af08e2014-05-05 21:41:26 -0400824 int num);
Jitendra Bhivare88840332016-02-04 15:49:12 +0530825int beiscsi_mccq_compl_wait(struct beiscsi_hba *phba,
Jitendra Bhivare50a4b822016-08-19 15:20:12 +0530826 unsigned int tag,
827 struct be_mcc_wrb **wrb,
Jitendra Bhivare88840332016-02-04 15:49:12 +0530828 struct be_dma_mem *mbx_cmd_mem);
Jitendra Bhivare50a4b822016-08-19 15:20:12 +0530829int __beiscsi_mcc_compl_status(struct beiscsi_hba *phba,
830 unsigned int tag,
831 struct be_mcc_wrb **wrb,
832 struct be_dma_mem *mbx_cmd_mem);
Jayamohan Kallickal6733b392009-09-05 07:36:35 +0530833struct be_mcc_wrb *wrb_from_mbox(struct be_dma_mem *mbox_mem);
Jitendra Bhivarecdde6682016-01-20 14:10:47 +0530834void be_mcc_notify(struct beiscsi_hba *phba, unsigned int tag);
Jitendra Bhivare090e2182016-02-04 15:49:17 +0530835struct be_mcc_wrb *alloc_mcc_wrb(struct beiscsi_hba *phba,
836 unsigned int *ref_tag);
Jitendra Bhivare53aefe22016-01-20 14:10:53 +0530837void beiscsi_process_async_event(struct beiscsi_hba *phba,
838 struct be_mcc_compl *compl);
Jitendra Bhivare2e4e8f62016-02-04 15:49:11 +0530839int beiscsi_process_mcc_compl(struct be_ctrl_info *ctrl,
840 struct be_mcc_compl *compl);
841
Jayamohan Kallickal6733b392009-09-05 07:36:35 +0530842int be_cmd_create_default_pdu_queue(struct be_ctrl_info *ctrl,
843 struct be_queue_info *cq,
844 struct be_queue_info *dq, int length,
Jayamohan Kallickal8a86e832013-09-28 15:35:45 -0700845 int entry_size, uint8_t is_header,
846 uint8_t ulp_num);
Jayamohan Kallickal6733b392009-09-05 07:36:35 +0530847
Jayamohan Kallickal15a90fe2013-09-28 15:35:38 -0700848int be_cmd_iscsi_post_template_hdr(struct be_ctrl_info *ctrl,
849 struct be_dma_mem *q_mem);
850
851int be_cmd_iscsi_remove_template_hdr(struct be_ctrl_info *ctrl);
852
Jayamohan Kallickal6733b392009-09-05 07:36:35 +0530853int be_cmd_iscsi_post_sgl_pages(struct be_ctrl_info *ctrl,
854 struct be_dma_mem *q_mem, u32 page_offset,
855 u32 num_pages);
856
857int be_cmd_wrbq_create(struct be_ctrl_info *ctrl, struct be_dma_mem *q_mem,
Jayamohan Kallickal4eea99d2013-09-28 15:35:48 -0700858 struct be_queue_info *wrbq,
859 struct hwi_wrb_context *pwrb_context,
860 uint8_t ulp_num);
Jayamohan Kallickal6733b392009-09-05 07:36:35 +0530861
John Soni Jose6f722382012-08-20 23:00:43 +0530862/* Configuration Functions */
863int be_cmd_set_vlan(struct beiscsi_hba *phba, uint16_t vlan_tag);
864
Jitendra Bhivare480195c2016-08-19 15:20:15 +0530865int beiscsi_check_supported_fw(struct be_ctrl_info *ctrl,
866 struct beiscsi_hba *phba);
867
868int beiscsi_get_fw_config(struct be_ctrl_info *ctrl, struct beiscsi_hba *phba);
869
870int beiscsi_get_port_name(struct be_ctrl_info *ctrl, struct beiscsi_hba *phba);
871
Jitendra Bhivare66940952016-08-19 15:20:14 +0530872int beiscsi_set_uer_feature(struct beiscsi_hba *phba);
Jitendra Bhivare1cb3c3f2017-10-10 16:18:17 +0530873int beiscsi_set_host_data(struct beiscsi_hba *phba);
Jitendra Bhivare66940952016-08-19 15:20:14 +0530874
Jayamohan Kallickal6733b392009-09-05 07:36:35 +0530875struct be_default_pdu_context {
876 u32 dw[4];
877} __packed;
878
879struct amap_be_default_pdu_context {
880 u8 dbuf_cindex[13]; /* dword 0 */
881 u8 rsvd0[3]; /* dword 0 */
882 u8 ring_size[4]; /* dword 0 */
883 u8 ring_state[4]; /* dword 0 */
884 u8 rsvd1[8]; /* dword 0 */
885 u8 dbuf_pindex[13]; /* dword 1 */
886 u8 rsvd2; /* dword 1 */
887 u8 pci_func_id[8]; /* dword 1 */
888 u8 rx_pdid[9]; /* dword 1 */
889 u8 rx_pdid_valid; /* dword 1 */
890 u8 default_buffer_size[16]; /* dword 2 */
891 u8 cq_id_recv[10]; /* dword 2 */
892 u8 rx_pdid_not_valid; /* dword 2 */
893 u8 rsvd3[5]; /* dword 2 */
894 u8 rsvd4[32]; /* dword 3 */
895} __packed;
896
Jayamohan Kallickalef9e1b92013-04-05 20:38:27 -0700897struct amap_default_pdu_context_ext {
898 u8 rsvd0[16]; /* dword 0 */
899 u8 ring_size[4]; /* dword 0 */
900 u8 rsvd1[12]; /* dword 0 */
901 u8 rsvd2[22]; /* dword 1 */
902 u8 rx_pdid[9]; /* dword 1 */
903 u8 rx_pdid_valid; /* dword 1 */
904 u8 default_buffer_size[16]; /* dword 2 */
905 u8 cq_id_recv[16]; /* dword 2 */
906 u8 rsvd3[32]; /* dword 3 */
907} __packed;
908
Jayamohan Kallickal6733b392009-09-05 07:36:35 +0530909struct be_defq_create_req {
910 struct be_cmd_req_hdr hdr;
911 u16 num_pages;
912 u8 ulp_num;
Jayamohan Kallickal8a86e832013-09-28 15:35:45 -0700913#define BEISCSI_DUAL_ULP_AWARE_BIT 0 /* Byte 3 - Bit 0 */
914#define BEISCSI_BIND_Q_TO_ULP_BIT 1 /* Byte 3 - Bit 1 */
915 u8 dua_feature;
Jayamohan Kallickal6733b392009-09-05 07:36:35 +0530916 struct be_default_pdu_context context;
917 struct phys_addr pages[8];
918} __packed;
919
920struct be_defq_create_resp {
921 struct be_cmd_req_hdr hdr;
922 u16 id;
Jayamohan Kallickal8a86e832013-09-28 15:35:45 -0700923 u8 rsvd0;
924 u8 ulp_num;
925 u32 doorbell_offset;
926 u16 register_set;
927 u16 doorbell_format;
Jayamohan Kallickal6733b392009-09-05 07:36:35 +0530928} __packed;
929
Jayamohan Kallickal15a90fe2013-09-28 15:35:38 -0700930struct be_post_template_pages_req {
931 struct be_cmd_req_hdr hdr;
932 u16 num_pages;
933#define BEISCSI_TEMPLATE_HDR_TYPE_ISCSI 0x1
934 u16 type;
935 struct phys_addr scratch_pa;
936 struct virt_addr scratch_va;
937 struct virt_addr pages_va;
938 struct phys_addr pages[16];
939} __packed;
940
941struct be_remove_template_pages_req {
942 struct be_cmd_req_hdr hdr;
943 u16 type;
944 u16 rsvd0;
945} __packed;
946
Jayamohan Kallickal6733b392009-09-05 07:36:35 +0530947struct be_post_sgl_pages_req {
948 struct be_cmd_req_hdr hdr;
949 u16 num_pages;
950 u16 page_offset;
951 u32 rsvd0;
952 struct phys_addr pages[26];
953 u32 rsvd1;
954} __packed;
955
956struct be_wrbq_create_req {
957 struct be_cmd_req_hdr hdr;
958 u16 num_pages;
959 u8 ulp_num;
Jayamohan Kallickal4eea99d2013-09-28 15:35:48 -0700960 u8 dua_feature;
Jayamohan Kallickal6733b392009-09-05 07:36:35 +0530961 struct phys_addr pages[8];
962} __packed;
963
964struct be_wrbq_create_resp {
965 struct be_cmd_resp_hdr resp_hdr;
966 u16 cid;
Jayamohan Kallickal4eea99d2013-09-28 15:35:48 -0700967 u8 rsvd0;
968 u8 ulp_num;
969 u32 doorbell_offset;
970 u16 register_set;
971 u16 doorbell_format;
Jayamohan Kallickal6733b392009-09-05 07:36:35 +0530972} __packed;
973
974#define SOL_CID_MASK 0x0000FFC0
975#define SOL_CODE_MASK 0x0000003F
976#define SOL_WRB_INDEX_MASK 0x00FF0000
977#define SOL_CMD_WND_MASK 0xFF000000
978#define SOL_RES_CNT_MASK 0x7FFFFFFF
979#define SOL_EXP_CMD_SN_MASK 0xFFFFFFFF
980#define SOL_HW_STS_MASK 0x000000FF
981#define SOL_STS_MASK 0x0000FF00
982#define SOL_RESP_MASK 0x00FF0000
983#define SOL_FLAGS_MASK 0x7F000000
984#define SOL_S_MASK 0x80000000
985
986struct sol_cqe {
987 u32 dw[4];
988};
989
990struct amap_sol_cqe {
991 u8 hw_sts[8]; /* dword 0 */
992 u8 i_sts[8]; /* dword 0 */
993 u8 i_resp[8]; /* dword 0 */
994 u8 i_flags[7]; /* dword 0 */
995 u8 s; /* dword 0 */
996 u8 i_exp_cmd_sn[32]; /* dword 1 */
997 u8 code[6]; /* dword 2 */
998 u8 cid[10]; /* dword 2 */
999 u8 wrb_index[8]; /* dword 2 */
1000 u8 i_cmd_wnd[8]; /* dword 2 */
1001 u8 i_res_cnt[31]; /* dword 3 */
1002 u8 valid; /* dword 3 */
1003} __packed;
1004
Jayamohan Kallickalbfead3b2009-10-23 11:52:33 +05301005#define SOL_ICD_INDEX_MASK 0x0003FFC0
1006struct amap_sol_cqe_ring {
1007 u8 hw_sts[8]; /* dword 0 */
1008 u8 i_sts[8]; /* dword 0 */
1009 u8 i_resp[8]; /* dword 0 */
1010 u8 i_flags[7]; /* dword 0 */
1011 u8 s; /* dword 0 */
1012 u8 i_exp_cmd_sn[32]; /* dword 1 */
1013 u8 code[6]; /* dword 2 */
1014 u8 icd_index[12]; /* dword 2 */
1015 u8 rsvd[6]; /* dword 2 */
1016 u8 i_cmd_wnd[8]; /* dword 2 */
1017 u8 i_res_cnt[31]; /* dword 3 */
1018 u8 valid; /* dword 3 */
1019} __packed;
1020
John Soni Jose73133262012-10-20 04:44:49 +05301021struct amap_sol_cqe_v2 {
1022 u8 hw_sts[8]; /* dword 0 */
1023 u8 i_sts[8]; /* dword 0 */
1024 u8 wrb_index[16]; /* dword 0 */
1025 u8 i_exp_cmd_sn[32]; /* dword 1 */
1026 u8 code[6]; /* dword 2 */
1027 u8 cmd_cmpl; /* dword 2 */
1028 u8 rsvd0; /* dword 2 */
1029 u8 i_cmd_wnd[8]; /* dword 2 */
1030 u8 cid[13]; /* dword 2 */
1031 u8 u; /* dword 2 */
1032 u8 o; /* dword 2 */
1033 u8 s; /* dword 2 */
1034 u8 i_res_cnt[31]; /* dword 3 */
1035 u8 valid; /* dword 3 */
1036} __packed;
1037
1038struct common_sol_cqe {
1039 u32 exp_cmdsn;
1040 u32 res_cnt;
1041 u16 wrb_index;
1042 u16 cid;
1043 u8 hw_sts;
1044 u8 cmd_wnd;
1045 u8 res_flag; /* the s feild of structure */
1046 u8 i_resp; /* for skh if cmd_complete is set then i_sts is response */
1047 u8 i_flags; /* for skh or the u and o feilds */
1048 u8 i_sts; /* for skh if cmd_complete is not-set then i_sts is status */
1049};
1050
1051/*** iSCSI ack/driver message completions ***/
1052struct amap_it_dmsg_cqe {
1053 u8 ack_num[32]; /* DWORD 0 */
1054 u8 pdu_bytes_rcvd[32]; /* DWORD 1 */
1055 u8 code[6]; /* DWORD 2 */
1056 u8 cid[10]; /* DWORD 2 */
1057 u8 wrb_idx[8]; /* DWORD 2 */
1058 u8 rsvd0[8]; /* DWORD 2*/
1059 u8 rsvd1[31]; /* DWORD 3*/
1060 u8 valid; /* DWORD 3 */
1061} __packed;
1062
1063struct amap_it_dmsg_cqe_v2 {
1064 u8 ack_num[32]; /* DWORD 0 */
1065 u8 pdu_bytes_rcvd[32]; /* DWORD 1 */
1066 u8 code[6]; /* DWORD 2 */
1067 u8 rsvd0[10]; /* DWORD 2 */
1068 u8 wrb_idx[16]; /* DWORD 2 */
1069 u8 rsvd1[16]; /* DWORD 3 */
1070 u8 cid[13]; /* DWORD 3 */
1071 u8 rsvd2[2]; /* DWORD 3 */
1072 u8 valid; /* DWORD 3 */
1073} __packed;
Jayamohan Kallickalbfead3b2009-10-23 11:52:33 +05301074
Jayamohan Kallickal6733b392009-09-05 07:36:35 +05301075
1076/**
1077 * Post WRB Queue Doorbell Register used by the host Storage
1078 * stack to notify the
1079 * controller of a posted Work Request Block
1080 */
Jayamohan Kallickalef9e1b92013-04-05 20:38:27 -07001081#define DB_WRB_POST_CID_MASK 0xFFFF /* bits 0 - 16 */
Jayamohan Kallickal6733b392009-09-05 07:36:35 +05301082#define DB_DEF_PDU_WRB_INDEX_MASK 0xFF /* bits 0 - 9 */
1083
1084#define DB_DEF_PDU_WRB_INDEX_SHIFT 16
1085#define DB_DEF_PDU_NUM_POSTED_SHIFT 24
1086
1087struct fragnum_bits_for_sgl_cra_in {
1088 struct be_cmd_req_hdr hdr;
1089 u32 num_bits;
1090} __packed;
1091
1092struct iscsi_cleanup_req {
1093 struct be_cmd_req_hdr hdr;
1094 u16 chute;
1095 u8 hdr_ring_id;
1096 u8 data_ring_id;
Jitendra Bhivaref79929d2016-08-19 15:20:17 +05301097} __packed;
Jayamohan Kallickal6733b392009-09-05 07:36:35 +05301098
Jitendra Bhivaref79929d2016-08-19 15:20:17 +05301099struct iscsi_cleanup_req_v1 {
1100 struct be_cmd_req_hdr hdr;
1101 u16 chute;
1102 u16 rsvd1;
1103 u16 hdr_ring_id;
1104 u16 rsvd2;
1105 u16 data_ring_id;
1106 u16 rsvd3;
Jayamohan Kallickal6733b392009-09-05 07:36:35 +05301107} __packed;
1108
1109struct eq_delay {
1110 u32 eq_id;
1111 u32 phase;
1112 u32 delay_multiplier;
1113} __packed;
1114
1115struct be_eq_delay_params_in {
1116 struct be_cmd_req_hdr hdr;
1117 u32 num_eq;
1118 struct eq_delay delay[8];
1119} __packed;
1120
Jayamohan Kallickal6733b392009-09-05 07:36:35 +05301121struct tcp_connect_and_offload_in {
1122 struct be_cmd_req_hdr hdr;
Mike Christie0e438952012-04-03 23:41:51 -05001123 struct ip_addr_format ip_address;
Jayamohan Kallickal6733b392009-09-05 07:36:35 +05301124 u16 tcp_port;
1125 u16 cid;
1126 u16 cq_id;
1127 u16 defq_id;
1128 struct phys_addr dataout_template_pa;
1129 u16 hdr_ring_id;
1130 u16 data_ring_id;
1131 u8 do_offload;
1132 u8 rsvd0[3];
1133} __packed;
1134
Jayamohan Kallickalb3c202d2014-05-05 21:41:27 -04001135struct tcp_connect_and_offload_in_v1 {
1136 struct be_cmd_req_hdr hdr;
1137 struct ip_addr_format ip_address;
1138 u16 tcp_port;
1139 u16 cid;
1140 u16 cq_id;
1141 u16 defq_id;
1142 struct phys_addr dataout_template_pa;
1143 u16 hdr_ring_id;
1144 u16 data_ring_id;
1145 u8 do_offload;
1146 u8 ifd_state;
1147 u8 rsvd0[2];
1148 u16 tcp_window_size;
1149 u8 tcp_window_scale_count;
1150 u8 rsvd1;
1151 u32 tcp_mss:24;
1152 u8 rsvd2;
1153} __packed;
1154
Jayamohan Kallickal6733b392009-09-05 07:36:35 +05301155struct tcp_connect_and_offload_out {
1156 struct be_cmd_resp_hdr hdr;
1157 u32 connection_handle;
1158 u16 cid;
1159 u16 rsvd0;
1160
1161} __packed;
1162
Jayamohan Kallickale08b3c82014-01-29 02:16:42 -05001163#define DB_DEF_PDU_RING_ID_MASK 0x3FFF /* bits 0 - 13 */
1164#define DB_DEF_PDU_CQPROC_MASK 0x3FFF /* bits 16 - 29 */
Jayamohan Kallickal6733b392009-09-05 07:36:35 +05301165#define DB_DEF_PDU_REARM_SHIFT 14
1166#define DB_DEF_PDU_EVENT_SHIFT 15
1167#define DB_DEF_PDU_CQPROC_SHIFT 16
1168
Jitendra Bhivare49fc5152017-03-24 14:11:41 +05301169struct be_invalidate_connection_params_in {
1170 struct be_cmd_req_hdr hdr;
1171 u32 session_handle;
1172 u16 cid;
1173 u16 unused;
1174#define BE_CLEANUP_TYPE_INVALIDATE 0x8001
1175#define BE_CLEANUP_TYPE_ISSUE_TCP_RST 0x8002
1176 u16 cleanup_type;
1177 u16 save_cfg;
Jayamohan Kallickal6733b392009-09-05 07:36:35 +05301178} __packed;
1179
Jitendra Bhivare49fc5152017-03-24 14:11:41 +05301180struct be_invalidate_connection_params_out {
1181 u32 session_handle;
1182 u16 cid;
1183 u16 unused;
1184} __packed;
1185
1186union be_invalidate_connection_params {
1187 struct be_invalidate_connection_params_in req;
1188 struct be_invalidate_connection_params_out resp;
1189} __packed;
1190
1191struct be_tcp_upload_params_in {
Jayamohan Kallickal6733b392009-09-05 07:36:35 +05301192 struct be_cmd_req_hdr hdr;
1193 u16 id;
Jitendra Bhivare49fc5152017-03-24 14:11:41 +05301194#define BE_UPLOAD_TYPE_GRACEFUL 1
1195/* abortive upload with reset */
1196#define BE_UPLOAD_TYPE_ABORT_RESET 2
1197/* abortive upload without reset */
1198#define BE_UPLOAD_TYPE_ABORT 3
1199/* abortive upload with reset, sequence number by driver */
1200#define BE_UPLOAD_TYPE_ABORT_WITH_SEQ 4
Jayamohan Kallickal6733b392009-09-05 07:36:35 +05301201 u16 upload_type;
1202 u32 reset_seq;
1203} __packed;
1204
Jitendra Bhivare49fc5152017-03-24 14:11:41 +05301205struct be_tcp_upload_params_out {
Jayamohan Kallickal6733b392009-09-05 07:36:35 +05301206 u32 dw[32];
1207} __packed;
1208
Jitendra Bhivare49fc5152017-03-24 14:11:41 +05301209union be_tcp_upload_params {
1210 struct be_tcp_upload_params_in request;
1211 struct be_tcp_upload_params_out response;
Jayamohan Kallickal6733b392009-09-05 07:36:35 +05301212} __packed;
1213
1214struct be_ulp_fw_cfg {
Jayamohan Kallickal843ae752013-09-28 15:35:44 -07001215#define BEISCSI_ULP_ISCSI_INI_MODE 0x10
Jayamohan Kallickal6733b392009-09-05 07:36:35 +05301216 u32 ulp_mode;
1217 u32 etx_base;
1218 u32 etx_count;
1219 u32 sq_base;
1220 u32 sq_count;
1221 u32 rq_base;
1222 u32 rq_count;
1223 u32 dq_base;
1224 u32 dq_count;
1225 u32 lro_base;
1226 u32 lro_count;
1227 u32 icd_base;
1228 u32 icd_count;
1229};
1230
Jayamohan Kallickal843ae752013-09-28 15:35:44 -07001231struct be_ulp_chain_icd {
1232 u32 chain_base;
1233 u32 chain_count;
1234};
1235
Jayamohan Kallickal6733b392009-09-05 07:36:35 +05301236struct be_fw_cfg {
1237 struct be_cmd_req_hdr hdr;
1238 u32 be_config_number;
1239 u32 asic_revision;
1240 u32 phys_port;
Jayamohan Kallickal843ae752013-09-28 15:35:44 -07001241#define BEISCSI_FUNC_ISCSI_INI_MODE 0x10
1242#define BEISCSI_FUNC_DUA_MODE 0x800
Jayamohan Kallickal6733b392009-09-05 07:36:35 +05301243 u32 function_mode;
1244 struct be_ulp_fw_cfg ulp[2];
1245 u32 function_caps;
Jayamohan Kallickal843ae752013-09-28 15:35:44 -07001246 u32 cqid_base;
1247 u32 cqid_count;
1248 u32 eqid_base;
1249 u32 eqid_count;
1250 struct be_ulp_chain_icd chain_icd[2];
Jayamohan Kallickal6733b392009-09-05 07:36:35 +05301251} __packed;
1252
Mike Christie0e438952012-04-03 23:41:51 -05001253struct be_cmd_get_all_if_id_req {
Jayamohan Kallickalc7acc5b2010-07-22 04:29:18 +05301254 struct be_cmd_req_hdr hdr;
1255 u32 if_count;
1256 u32 if_hndl_list[1];
1257} __packed;
1258
Jitendra Bhivare53aefe22016-01-20 14:10:53 +05301259struct be_cmd_get_port_name {
1260 union {
1261 struct be_cmd_req_hdr req_hdr;
1262 struct be_cmd_resp_hdr resp_hdr;
1263 } h;
1264 union {
1265 struct {
1266 u32 reserved;
1267 } req;
1268 struct {
1269 u32 port_names;
1270 } resp;
1271 } p;
1272} __packed;
1273
Jayamohan Kallickalc7acc5b2010-07-22 04:29:18 +05301274#define ISCSI_OPCODE_SCSI_DATA_OUT 5
John Soni Josec62eef02012-04-03 23:41:52 -05001275#define OPCODE_COMMON_NTWK_LINK_STATUS_QUERY 5
Jayamohan Kallickalc7acc5b2010-07-22 04:29:18 +05301276#define OPCODE_COMMON_MODIFY_EQ_DELAY 41
1277#define OPCODE_COMMON_ISCSI_CLEANUP 59
1278#define OPCODE_COMMON_TCP_UPLOAD 56
Jayamohan Kallickal6733b392009-09-05 07:36:35 +05301279#define OPCODE_COMMON_ISCSI_TCP_CONNECT_AND_OFFLOAD 70
Jayamohan Kallickal6733b392009-09-05 07:36:35 +05301280#define OPCODE_COMMON_ISCSI_ERROR_RECOVERY_INVALIDATE_COMMANDS 1
Jayamohan Kallickalc7acc5b2010-07-22 04:29:18 +05301281#define OPCODE_ISCSI_INI_CFG_GET_HBA_NAME 6
1282#define OPCODE_ISCSI_INI_CFG_SET_HBA_NAME 7
1283#define OPCODE_ISCSI_INI_SESSION_GET_A_SESSION 14
John Soni Jose3f4134c2015-04-25 08:18:13 +05301284#define OPCODE_ISCSI_INI_SESSION_LOGOUT_TARGET 24
John Soni Jose9aef4202012-08-20 23:00:08 +05301285#define OPCODE_ISCSI_INI_DRIVER_REOPEN_ALL_SESSIONS 36
Jayamohan Kallickalc7acc5b2010-07-22 04:29:18 +05301286#define OPCODE_ISCSI_INI_DRIVER_OFFLOAD_SESSION 41
Jayamohan Kallickal6733b392009-09-05 07:36:35 +05301287#define OPCODE_ISCSI_INI_DRIVER_INVALIDATE_CONNECTION 42
Jayamohan Kallickalc7acc5b2010-07-22 04:29:18 +05301288#define OPCODE_ISCSI_INI_BOOT_GET_BOOT_TARGET 52
Jayamohan Kallickalffce3e22012-04-03 23:41:50 -05001289#define OPCODE_COMMON_WRITE_FLASH 96
1290#define OPCODE_COMMON_READ_FLASH 97
Jayamohan Kallickalc7acc5b2010-07-22 04:29:18 +05301291
Jayamohan Kallickalc7acc5b2010-07-22 04:29:18 +05301292#define CMD_ISCSI_COMMAND_INVALIDATE 1
Jayamohan Kallickal6733b392009-09-05 07:36:35 +05301293
1294#define INI_WR_CMD 1 /* Initiator write command */
1295#define INI_TMF_CMD 2 /* Initiator TMF command */
1296#define INI_NOPOUT_CMD 3 /* Initiator; Send a NOP-OUT */
1297#define INI_RD_CMD 5 /* Initiator requesting to send
1298 * a read command
1299 */
1300#define TGT_CTX_UPDT_CMD 7 /* Target context update */
Jayamohan Kallickal6733b392009-09-05 07:36:35 +05301301#define TGT_DM_CMD 11 /* Indicates that the bhs
Jitendra Bhivare45efc9402017-10-10 16:18:18 +05301302 * prepared by driver should not
1303 * be touched.
Jayamohan Kallickal6733b392009-09-05 07:36:35 +05301304 */
Jayamohan Kallickal6733b392009-09-05 07:36:35 +05301305
Jayamohan Kallickal6733b392009-09-05 07:36:35 +05301306/* Returns the number of items in the field array. */
1307#define BE_NUMBER_OF_FIELD(_type_, _field_) \
1308 (FIELD_SIZEOF(_type_, _field_)/sizeof((((_type_ *)0)->_field_[0])))\
1309
1310/**
1311 * Different types of iSCSI completions to host driver for both initiator
1312 * and taget mode
1313 * of operation.
1314 */
1315#define SOL_CMD_COMPLETE 1 /* Solicited command completed
1316 * normally
1317 */
1318#define SOL_CMD_KILLED_DATA_DIGEST_ERR 2 /* Solicited command got
1319 * invalidated internally due
1320 * to Data Digest error
1321 */
1322#define CXN_KILLED_PDU_SIZE_EXCEEDS_DSL 3 /* Connection got invalidated
1323 * internally
Lucas De Marchi25985ed2011-03-30 22:57:33 -03001324 * due to a received PDU
Jayamohan Kallickal6733b392009-09-05 07:36:35 +05301325 * size > DSL
1326 */
1327#define CXN_KILLED_BURST_LEN_MISMATCH 4 /* Connection got invalidated
1328 * internally due ti received
1329 * PDU sequence size >
1330 * FBL/MBL.
1331 */
1332#define CXN_KILLED_AHS_RCVD 5 /* Connection got invalidated
Lucas De Marchi25985ed2011-03-30 22:57:33 -03001333 * internally due to a received
Jayamohan Kallickal6733b392009-09-05 07:36:35 +05301334 * PDU Hdr that has
1335 * AHS */
1336#define CXN_KILLED_HDR_DIGEST_ERR 6 /* Connection got invalidated
1337 * internally due to Hdr Digest
1338 * error
1339 */
1340#define CXN_KILLED_UNKNOWN_HDR 7 /* Connection got invalidated
1341 * internally
1342 * due to a bad opcode in the
1343 * pdu hdr
1344 */
1345#define CXN_KILLED_STALE_ITT_TTT_RCVD 8 /* Connection got invalidated
Lucas De Marchi25985ed2011-03-30 22:57:33 -03001346 * internally due to a received
Jayamohan Kallickal6733b392009-09-05 07:36:35 +05301347 * ITT/TTT that does not belong
1348 * to this Connection
1349 */
1350#define CXN_KILLED_INVALID_ITT_TTT_RCVD 9 /* Connection got invalidated
Lucas De Marchi25985ed2011-03-30 22:57:33 -03001351 * internally due to received
Jayamohan Kallickal6733b392009-09-05 07:36:35 +05301352 * ITT/TTT value > Max
1353 * Supported ITTs/TTTs
1354 */
1355#define CXN_KILLED_RST_RCVD 10 /* Connection got invalidated
1356 * internally due to an
1357 * incoming TCP RST
1358 */
1359#define CXN_KILLED_TIMED_OUT 11 /* Connection got invalidated
1360 * internally due to timeout on
1361 * tcp segment 12 retransmit
1362 * attempts failed
1363 */
1364#define CXN_KILLED_RST_SENT 12 /* Connection got invalidated
1365 * internally due to TCP RST
1366 * sent by the Tx side
1367 */
1368#define CXN_KILLED_FIN_RCVD 13 /* Connection got invalidated
1369 * internally due to an
1370 * incoming TCP FIN.
1371 */
1372#define CXN_KILLED_BAD_UNSOL_PDU_RCVD 14 /* Connection got invalidated
1373 * internally due to bad
1374 * unsolicited PDU Unsolicited
1375 * PDUs are PDUs with
1376 * ITT=0xffffffff
1377 */
1378#define CXN_KILLED_BAD_WRB_INDEX_ERROR 15 /* Connection got invalidated
1379 * internally due to bad WRB
1380 * index.
1381 */
1382#define CXN_KILLED_OVER_RUN_RESIDUAL 16 /* Command got invalidated
Lucas De Marchi25985ed2011-03-30 22:57:33 -03001383 * internally due to received
Jayamohan Kallickal6733b392009-09-05 07:36:35 +05301384 * command has residual
1385 * over run bytes.
1386 */
1387#define CXN_KILLED_UNDER_RUN_RESIDUAL 17 /* Command got invalidated
Lucas De Marchi25985ed2011-03-30 22:57:33 -03001388 * internally due to received
Jayamohan Kallickal6733b392009-09-05 07:36:35 +05301389 * command has residual under
1390 * run bytes.
1391 */
1392#define CMD_KILLED_INVALID_STATSN_RCVD 18 /* Command got invalidated
Lucas De Marchi25985ed2011-03-30 22:57:33 -03001393 * internally due to a received
Jayamohan Kallickal6733b392009-09-05 07:36:35 +05301394 * PDU has an invalid StatusSN
1395 */
1396#define CMD_KILLED_INVALID_R2T_RCVD 19 /* Command got invalidated
Lucas De Marchi25985ed2011-03-30 22:57:33 -03001397 * internally due to a received
Jayamohan Kallickal6733b392009-09-05 07:36:35 +05301398 * an R2T with some invalid
1399 * fields in it
1400 */
1401#define CMD_CXN_KILLED_LUN_INVALID 20 /* Command got invalidated
1402 * internally due to received
1403 * PDU has an invalid LUN.
1404 */
1405#define CMD_CXN_KILLED_ICD_INVALID 21 /* Command got invalidated
1406 * internally due to the
1407 * corresponding ICD not in a
1408 * valid state
1409 */
1410#define CMD_CXN_KILLED_ITT_INVALID 22 /* Command got invalidated due
1411 * to received PDU has an
1412 * invalid ITT.
1413 */
1414#define CMD_CXN_KILLED_SEQ_OUTOFORDER 23 /* Command got invalidated due
1415 * to received sequence buffer
1416 * offset is out of order.
1417 */
1418#define CMD_CXN_KILLED_INVALID_DATASN_RCVD 24 /* Command got invalidated
1419 * internally due to a
Lucas De Marchi25985ed2011-03-30 22:57:33 -03001420 * received PDU has an invalid
Jayamohan Kallickal6733b392009-09-05 07:36:35 +05301421 * DataSN
1422 */
1423#define CXN_INVALIDATE_NOTIFY 25 /* Connection invalidation
1424 * completion notify.
1425 */
1426#define CXN_INVALIDATE_INDEX_NOTIFY 26 /* Connection invalidation
1427 * completion
1428 * with data PDU index.
1429 */
1430#define CMD_INVALIDATED_NOTIFY 27 /* Command invalidation
1431 * completionnotifify.
1432 */
1433#define UNSOL_HDR_NOTIFY 28 /* Unsolicited header notify.*/
1434#define UNSOL_DATA_NOTIFY 29 /* Unsolicited data notify.*/
Jayamohan Kallickal457ff3b2010-07-22 04:16:00 +05301435#define UNSOL_DATA_DIGEST_ERROR_NOTIFY 30 /* Unsolicited data digest
Jayamohan Kallickal6733b392009-09-05 07:36:35 +05301436 * error notify.
1437 */
1438#define DRIVERMSG_NOTIFY 31 /* TCP acknowledge based
1439 * notification.
1440 */
1441#define CXN_KILLED_CMND_DATA_NOT_ON_SAME_CONN 32 /* Connection got invalidated
1442 * internally due to command
1443 * and data are not on same
1444 * connection.
1445 */
1446#define SOL_CMD_KILLED_DIF_ERR 33 /* Solicited command got
1447 * invalidated internally due
1448 * to DIF error
1449 */
1450#define CXN_KILLED_SYN_RCVD 34 /* Connection got invalidated
1451 * internally due to incoming
1452 * TCP SYN
1453 */
1454#define CXN_KILLED_IMM_DATA_RCVD 35 /* Connection got invalidated
1455 * internally due to an
1456 * incoming Unsolicited PDU
1457 * that has immediate data on
1458 * the cxn
1459 */
1460
Jitendra Bhivarea39e9f72017-10-10 16:18:14 +05301461void be_wrb_hdr_prepare(struct be_mcc_wrb *wrb, u32 payload_len,
Jayamohan Kallickal6733b392009-09-05 07:36:35 +05301462 bool embedded, u8 sge_cnt);
1463
1464void be_cmd_hdr_prepare(struct be_cmd_req_hdr *req_hdr,
Jitendra Bhivarea39e9f72017-10-10 16:18:14 +05301465 u8 subsystem, u8 opcode, u32 cmd_len);
Jayamohan Kallickal6733b392009-09-05 07:36:35 +05301466#endif /* !BEISCSI_CMDS_H */