be_cmds.h 33 KB

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