be_cmds.h 32 KB

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