be_cmds.h 32 KB

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