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