be_cmds.h 32 KB

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