t4fw_api_stor.h 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578
  1. /*
  2. * This file is part of the Chelsio FCoE driver for Linux.
  3. *
  4. * Copyright (c) 2009-2010 Chelsio Communications, Inc. All rights reserved.
  5. *
  6. * This software is available to you under a choice of one of two
  7. * licenses. You may choose to be licensed under the terms of the GNU
  8. * General Public License (GPL) Version 2, available from the file
  9. * COPYING in the main directory of this source tree, or the
  10. * OpenIB.org BSD license below:
  11. *
  12. * Redistribution and use in source and binary forms, with or
  13. * without modification, are permitted provided that the following
  14. * conditions are met:
  15. *
  16. * - Redistributions of source code must retain the above
  17. * copyright notice, this list of conditions and the following
  18. * disclaimer.
  19. *
  20. * - Redistributions in binary form must reproduce the above
  21. * copyright notice, this list of conditions and the following
  22. * disclaimer in the documentation and/or other materials
  23. * provided with the distribution.
  24. *
  25. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  26. * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  27. * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  28. * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
  29. * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
  30. * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
  31. * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  32. * SOFTWARE.
  33. */
  34. #ifndef _T4FW_API_STOR_H_
  35. #define _T4FW_API_STOR_H_
  36. /******************************************************************************
  37. * R E T U R N V A L U E S
  38. ********************************/
  39. enum fw_retval {
  40. FW_SUCCESS = 0, /* completed sucessfully */
  41. FW_EPERM = 1, /* operation not permitted */
  42. FW_ENOENT = 2, /* no such file or directory */
  43. FW_EIO = 5, /* input/output error; hw bad */
  44. FW_ENOEXEC = 8, /* exec format error; inv microcode */
  45. FW_EAGAIN = 11, /* try again */
  46. FW_ENOMEM = 12, /* out of memory */
  47. FW_EFAULT = 14, /* bad address; fw bad */
  48. FW_EBUSY = 16, /* resource busy */
  49. FW_EEXIST = 17, /* file exists */
  50. FW_EINVAL = 22, /* invalid argument */
  51. FW_ENOSPC = 28, /* no space left on device */
  52. FW_ENOSYS = 38, /* functionality not implemented */
  53. FW_EPROTO = 71, /* protocol error */
  54. FW_EADDRINUSE = 98, /* address already in use */
  55. FW_EADDRNOTAVAIL = 99, /* cannot assigned requested address */
  56. FW_ENETDOWN = 100, /* network is down */
  57. FW_ENETUNREACH = 101, /* network is unreachable */
  58. FW_ENOBUFS = 105, /* no buffer space available */
  59. FW_ETIMEDOUT = 110, /* timeout */
  60. FW_EINPROGRESS = 115, /* fw internal */
  61. FW_SCSI_ABORT_REQUESTED = 128, /* */
  62. FW_SCSI_ABORT_TIMEDOUT = 129, /* */
  63. FW_SCSI_ABORTED = 130, /* */
  64. FW_SCSI_CLOSE_REQUESTED = 131, /* */
  65. FW_ERR_LINK_DOWN = 132, /* */
  66. FW_RDEV_NOT_READY = 133, /* */
  67. FW_ERR_RDEV_LOST = 134, /* */
  68. FW_ERR_RDEV_LOGO = 135, /* */
  69. FW_FCOE_NO_XCHG = 136, /* */
  70. FW_SCSI_RSP_ERR = 137, /* */
  71. FW_ERR_RDEV_IMPL_LOGO = 138, /* */
  72. FW_SCSI_UNDER_FLOW_ERR = 139, /* */
  73. FW_SCSI_OVER_FLOW_ERR = 140, /* */
  74. FW_SCSI_DDP_ERR = 141, /* DDP error*/
  75. FW_SCSI_TASK_ERR = 142, /* No SCSI tasks available */
  76. };
  77. enum fw_fcoe_link_sub_op {
  78. FCOE_LINK_DOWN = 0x0,
  79. FCOE_LINK_UP = 0x1,
  80. FCOE_LINK_COND = 0x2,
  81. };
  82. enum fw_fcoe_link_status {
  83. FCOE_LINKDOWN = 0x0,
  84. FCOE_LINKUP = 0x1,
  85. };
  86. enum fw_ofld_prot {
  87. PROT_FCOE = 0x1,
  88. PROT_ISCSI = 0x2,
  89. };
  90. enum rport_type_fcoe {
  91. FLOGI_VFPORT = 0x1, /* 0xfffffe */
  92. FDISC_VFPORT = 0x2, /* 0xfffffe */
  93. NS_VNPORT = 0x3, /* 0xfffffc */
  94. REG_FC4_VNPORT = 0x4, /* any FC4 type VN_PORT */
  95. REG_VNPORT = 0x5, /* 0xfffxxx - non FC4 port in switch */
  96. FDMI_VNPORT = 0x6, /* 0xfffffa */
  97. FAB_CTLR_VNPORT = 0x7, /* 0xfffffd */
  98. };
  99. enum event_cause_fcoe {
  100. PLOGI_ACC_RCVD = 0x01,
  101. PLOGI_RJT_RCVD = 0x02,
  102. PLOGI_RCVD = 0x03,
  103. PLOGO_RCVD = 0x04,
  104. PRLI_ACC_RCVD = 0x05,
  105. PRLI_RJT_RCVD = 0x06,
  106. PRLI_RCVD = 0x07,
  107. PRLO_RCVD = 0x08,
  108. NPORT_ID_CHGD = 0x09,
  109. FLOGO_RCVD = 0x0a,
  110. CLR_VIRT_LNK_RCVD = 0x0b,
  111. FLOGI_ACC_RCVD = 0x0c,
  112. FLOGI_RJT_RCVD = 0x0d,
  113. FDISC_ACC_RCVD = 0x0e,
  114. FDISC_RJT_RCVD = 0x0f,
  115. FLOGI_TMO_MAX_RETRY = 0x10,
  116. IMPL_LOGO_ADISC_ACC = 0x11,
  117. IMPL_LOGO_ADISC_RJT = 0x12,
  118. IMPL_LOGO_ADISC_CNFLT = 0x13,
  119. PRLI_TMO = 0x14,
  120. ADISC_TMO = 0x15,
  121. RSCN_DEV_LOST = 0x16,
  122. SCR_ACC_RCVD = 0x17,
  123. ADISC_RJT_RCVD = 0x18,
  124. LOGO_SNT = 0x19,
  125. PROTO_ERR_IMPL_LOGO = 0x1a,
  126. };
  127. enum fcoe_cmn_type {
  128. FCOE_ELS,
  129. FCOE_CT,
  130. FCOE_SCSI_CMD,
  131. FCOE_UNSOL_ELS,
  132. };
  133. enum fw_wr_stor_opcodes {
  134. FW_RDEV_WR = 0x38,
  135. FW_FCOE_ELS_CT_WR = 0x30,
  136. FW_SCSI_WRITE_WR = 0x31,
  137. FW_SCSI_READ_WR = 0x32,
  138. FW_SCSI_CMD_WR = 0x33,
  139. FW_SCSI_ABRT_CLS_WR = 0x34,
  140. };
  141. struct fw_rdev_wr {
  142. __be32 op_to_immdlen;
  143. __be32 alloc_to_len16;
  144. __be64 cookie;
  145. u8 protocol;
  146. u8 event_cause;
  147. u8 cur_state;
  148. u8 prev_state;
  149. __be32 flags_to_assoc_flowid;
  150. union rdev_entry {
  151. struct fcoe_rdev_entry {
  152. __be32 flowid;
  153. u8 protocol;
  154. u8 event_cause;
  155. u8 flags;
  156. u8 rjt_reason;
  157. u8 cur_login_st;
  158. u8 prev_login_st;
  159. __be16 rcv_fr_sz;
  160. u8 rd_xfer_rdy_to_rport_type;
  161. u8 vft_to_qos;
  162. u8 org_proc_assoc_to_acc_rsp_code;
  163. u8 enh_disc_to_tgt;
  164. u8 wwnn[8];
  165. u8 wwpn[8];
  166. __be16 iqid;
  167. u8 fc_oui[3];
  168. u8 r_id[3];
  169. } fcoe_rdev;
  170. struct iscsi_rdev_entry {
  171. __be32 flowid;
  172. u8 protocol;
  173. u8 event_cause;
  174. u8 flags;
  175. u8 r3;
  176. __be16 iscsi_opts;
  177. __be16 tcp_opts;
  178. __be16 ip_opts;
  179. __be16 max_rcv_len;
  180. __be16 max_snd_len;
  181. __be16 first_brst_len;
  182. __be16 max_brst_len;
  183. __be16 r4;
  184. __be16 def_time2wait;
  185. __be16 def_time2ret;
  186. __be16 nop_out_intrvl;
  187. __be16 non_scsi_to;
  188. __be16 isid;
  189. __be16 tsid;
  190. __be16 port;
  191. __be16 tpgt;
  192. u8 r5[6];
  193. __be16 iqid;
  194. } iscsi_rdev;
  195. } u;
  196. };
  197. #define FW_RDEV_WR_FLOWID_GET(x) (((x) >> 8) & 0xfffff)
  198. #define FW_RDEV_WR_ASSOC_FLOWID_GET(x) (((x) >> 0) & 0xfffff)
  199. #define FW_RDEV_WR_RPORT_TYPE_GET(x) (((x) >> 0) & 0x1f)
  200. #define FW_RDEV_WR_NPIV_GET(x) (((x) >> 6) & 0x1)
  201. #define FW_RDEV_WR_CLASS_GET(x) (((x) >> 4) & 0x3)
  202. #define FW_RDEV_WR_TASK_RETRY_ID_GET(x) (((x) >> 5) & 0x1)
  203. #define FW_RDEV_WR_RETRY_GET(x) (((x) >> 4) & 0x1)
  204. #define FW_RDEV_WR_CONF_CMPL_GET(x) (((x) >> 3) & 0x1)
  205. #define FW_RDEV_WR_INI_GET(x) (((x) >> 1) & 0x1)
  206. #define FW_RDEV_WR_TGT_GET(x) (((x) >> 0) & 0x1)
  207. struct fw_fcoe_els_ct_wr {
  208. __be32 op_immdlen;
  209. __be32 flowid_len16;
  210. u64 cookie;
  211. __be16 iqid;
  212. u8 tmo_val;
  213. u8 els_ct_type;
  214. u8 ctl_pri;
  215. u8 cp_en_class;
  216. __be16 xfer_cnt;
  217. u8 fl_to_sp;
  218. u8 l_id[3];
  219. u8 r5;
  220. u8 r_id[3];
  221. __be64 rsp_dmaaddr;
  222. __be32 rsp_dmalen;
  223. __be32 r6;
  224. };
  225. #define FW_FCOE_ELS_CT_WR_OPCODE(x) ((x) << 24)
  226. #define FW_FCOE_ELS_CT_WR_OPCODE_GET(x) (((x) >> 24) & 0xff)
  227. #define FW_FCOE_ELS_CT_WR_IMMDLEN(x) ((x) << 0)
  228. #define FW_FCOE_ELS_CT_WR_IMMDLEN_GET(x) (((x) >> 0) & 0xff)
  229. #define FW_FCOE_ELS_CT_WR_SP(x) ((x) << 0)
  230. struct fw_scsi_write_wr {
  231. __be32 op_immdlen;
  232. __be32 flowid_len16;
  233. u64 cookie;
  234. __be16 iqid;
  235. u8 tmo_val;
  236. u8 use_xfer_cnt;
  237. union fw_scsi_write_priv {
  238. struct fcoe_write_priv {
  239. u8 ctl_pri;
  240. u8 cp_en_class;
  241. u8 r3_lo[2];
  242. } fcoe;
  243. struct iscsi_write_priv {
  244. u8 r3[4];
  245. } iscsi;
  246. } u;
  247. __be32 xfer_cnt;
  248. __be32 ini_xfer_cnt;
  249. __be64 rsp_dmaaddr;
  250. __be32 rsp_dmalen;
  251. __be32 r4;
  252. };
  253. #define FW_SCSI_WRITE_WR_IMMDLEN(x) ((x) << 0)
  254. struct fw_scsi_read_wr {
  255. __be32 op_immdlen;
  256. __be32 flowid_len16;
  257. u64 cookie;
  258. __be16 iqid;
  259. u8 tmo_val;
  260. u8 use_xfer_cnt;
  261. union fw_scsi_read_priv {
  262. struct fcoe_read_priv {
  263. u8 ctl_pri;
  264. u8 cp_en_class;
  265. u8 r3_lo[2];
  266. } fcoe;
  267. struct iscsi_read_priv {
  268. u8 r3[4];
  269. } iscsi;
  270. } u;
  271. __be32 xfer_cnt;
  272. __be32 ini_xfer_cnt;
  273. __be64 rsp_dmaaddr;
  274. __be32 rsp_dmalen;
  275. __be32 r4;
  276. };
  277. #define FW_SCSI_READ_WR_IMMDLEN(x) ((x) << 0)
  278. struct fw_scsi_cmd_wr {
  279. __be32 op_immdlen;
  280. __be32 flowid_len16;
  281. u64 cookie;
  282. __be16 iqid;
  283. u8 tmo_val;
  284. u8 r3;
  285. union fw_scsi_cmd_priv {
  286. struct fcoe_cmd_priv {
  287. u8 ctl_pri;
  288. u8 cp_en_class;
  289. u8 r4_lo[2];
  290. } fcoe;
  291. struct iscsi_cmd_priv {
  292. u8 r4[4];
  293. } iscsi;
  294. } u;
  295. u8 r5[8];
  296. __be64 rsp_dmaaddr;
  297. __be32 rsp_dmalen;
  298. __be32 r6;
  299. };
  300. #define FW_SCSI_CMD_WR_IMMDLEN(x) ((x) << 0)
  301. #define SCSI_ABORT 0
  302. #define SCSI_CLOSE 1
  303. struct fw_scsi_abrt_cls_wr {
  304. __be32 op_immdlen;
  305. __be32 flowid_len16;
  306. u64 cookie;
  307. __be16 iqid;
  308. u8 tmo_val;
  309. u8 sub_opcode_to_chk_all_io;
  310. u8 r3[4];
  311. u64 t_cookie;
  312. };
  313. #define FW_SCSI_ABRT_CLS_WR_SUB_OPCODE(x) ((x) << 2)
  314. #define FW_SCSI_ABRT_CLS_WR_SUB_OPCODE_GET(x) (((x) >> 2) & 0x3f)
  315. #define FW_SCSI_ABRT_CLS_WR_CHK_ALL_IO(x) ((x) << 0)
  316. enum fw_cmd_stor_opcodes {
  317. FW_FCOE_RES_INFO_CMD = 0x31,
  318. FW_FCOE_LINK_CMD = 0x32,
  319. FW_FCOE_VNP_CMD = 0x33,
  320. FW_FCOE_SPARAMS_CMD = 0x35,
  321. FW_FCOE_STATS_CMD = 0x37,
  322. FW_FCOE_FCF_CMD = 0x38,
  323. };
  324. struct fw_fcoe_res_info_cmd {
  325. __be32 op_to_read;
  326. __be32 retval_len16;
  327. __be16 e_d_tov;
  328. __be16 r_a_tov_seq;
  329. __be16 r_a_tov_els;
  330. __be16 r_r_tov;
  331. __be32 max_xchgs;
  332. __be32 max_ssns;
  333. __be32 used_xchgs;
  334. __be32 used_ssns;
  335. __be32 max_fcfs;
  336. __be32 max_vnps;
  337. __be32 used_fcfs;
  338. __be32 used_vnps;
  339. };
  340. struct fw_fcoe_link_cmd {
  341. __be32 op_to_portid;
  342. __be32 retval_len16;
  343. __be32 sub_opcode_fcfi;
  344. u8 r3;
  345. u8 lstatus;
  346. __be16 flags;
  347. u8 r4;
  348. u8 set_vlan;
  349. __be16 vlan_id;
  350. __be32 vnpi_pkd;
  351. __be16 r6;
  352. u8 phy_mac[6];
  353. u8 vnport_wwnn[8];
  354. u8 vnport_wwpn[8];
  355. };
  356. #define FW_FCOE_LINK_CMD_PORTID(x) ((x) << 0)
  357. #define FW_FCOE_LINK_CMD_PORTID_GET(x) (((x) >> 0) & 0xf)
  358. #define FW_FCOE_LINK_CMD_SUB_OPCODE(x) ((x) << 24U)
  359. #define FW_FCOE_LINK_CMD_FCFI(x) ((x) << 0)
  360. #define FW_FCOE_LINK_CMD_FCFI_GET(x) (((x) >> 0) & 0xffffff)
  361. #define FW_FCOE_LINK_CMD_VNPI_GET(x) (((x) >> 0) & 0xfffff)
  362. struct fw_fcoe_vnp_cmd {
  363. __be32 op_to_fcfi;
  364. __be32 alloc_to_len16;
  365. __be32 gen_wwn_to_vnpi;
  366. __be32 vf_id;
  367. __be16 iqid;
  368. u8 vnport_mac[6];
  369. u8 vnport_wwnn[8];
  370. u8 vnport_wwpn[8];
  371. u8 cmn_srv_parms[16];
  372. u8 clsp_word_0_1[8];
  373. };
  374. #define FW_FCOE_VNP_CMD_FCFI(x) ((x) << 0)
  375. #define FW_FCOE_VNP_CMD_ALLOC (1U << 31)
  376. #define FW_FCOE_VNP_CMD_FREE (1U << 30)
  377. #define FW_FCOE_VNP_CMD_MODIFY (1U << 29)
  378. #define FW_FCOE_VNP_CMD_GEN_WWN (1U << 22)
  379. #define FW_FCOE_VNP_CMD_VFID_EN (1U << 20)
  380. #define FW_FCOE_VNP_CMD_VNPI(x) ((x) << 0)
  381. #define FW_FCOE_VNP_CMD_VNPI_GET(x) (((x) >> 0) & 0xfffff)
  382. struct fw_fcoe_sparams_cmd {
  383. __be32 op_to_portid;
  384. __be32 retval_len16;
  385. u8 r3[7];
  386. u8 cos;
  387. u8 lport_wwnn[8];
  388. u8 lport_wwpn[8];
  389. u8 cmn_srv_parms[16];
  390. u8 cls_srv_parms[16];
  391. };
  392. #define FW_FCOE_SPARAMS_CMD_PORTID(x) ((x) << 0)
  393. struct fw_fcoe_stats_cmd {
  394. __be32 op_to_flowid;
  395. __be32 free_to_len16;
  396. union fw_fcoe_stats {
  397. struct fw_fcoe_stats_ctl {
  398. u8 nstats_port;
  399. u8 port_valid_ix;
  400. __be16 r6;
  401. __be32 r7;
  402. __be64 stat0;
  403. __be64 stat1;
  404. __be64 stat2;
  405. __be64 stat3;
  406. __be64 stat4;
  407. __be64 stat5;
  408. } ctl;
  409. struct fw_fcoe_port_stats {
  410. __be64 tx_bcast_bytes;
  411. __be64 tx_bcast_frames;
  412. __be64 tx_mcast_bytes;
  413. __be64 tx_mcast_frames;
  414. __be64 tx_ucast_bytes;
  415. __be64 tx_ucast_frames;
  416. __be64 tx_drop_frames;
  417. __be64 tx_offload_bytes;
  418. __be64 tx_offload_frames;
  419. __be64 rx_bcast_bytes;
  420. __be64 rx_bcast_frames;
  421. __be64 rx_mcast_bytes;
  422. __be64 rx_mcast_frames;
  423. __be64 rx_ucast_bytes;
  424. __be64 rx_ucast_frames;
  425. __be64 rx_err_frames;
  426. } port_stats;
  427. struct fw_fcoe_fcf_stats {
  428. __be32 fip_tx_bytes;
  429. __be32 fip_tx_fr;
  430. __be64 fcf_ka;
  431. __be64 mcast_adv_rcvd;
  432. __be16 ucast_adv_rcvd;
  433. __be16 sol_sent;
  434. __be16 vlan_req;
  435. __be16 vlan_rpl;
  436. __be16 clr_vlink;
  437. __be16 link_down;
  438. __be16 link_up;
  439. __be16 logo;
  440. __be16 flogi_req;
  441. __be16 flogi_rpl;
  442. __be16 fdisc_req;
  443. __be16 fdisc_rpl;
  444. __be16 fka_prd_chg;
  445. __be16 fc_map_chg;
  446. __be16 vfid_chg;
  447. u8 no_fka_req;
  448. u8 no_vnp;
  449. } fcf_stats;
  450. struct fw_fcoe_pcb_stats {
  451. __be64 tx_bytes;
  452. __be64 tx_frames;
  453. __be64 rx_bytes;
  454. __be64 rx_frames;
  455. __be32 vnp_ka;
  456. __be32 unsol_els_rcvd;
  457. __be64 unsol_cmd_rcvd;
  458. __be16 implicit_logo;
  459. __be16 flogi_inv_sparm;
  460. __be16 fdisc_inv_sparm;
  461. __be16 flogi_rjt;
  462. __be16 fdisc_rjt;
  463. __be16 no_ssn;
  464. __be16 mac_flt_fail;
  465. __be16 inv_fr_rcvd;
  466. } pcb_stats;
  467. struct fw_fcoe_scb_stats {
  468. __be64 tx_bytes;
  469. __be64 tx_frames;
  470. __be64 rx_bytes;
  471. __be64 rx_frames;
  472. __be32 host_abrt_req;
  473. __be32 adap_auto_abrt;
  474. __be32 adap_abrt_rsp;
  475. __be32 host_ios_req;
  476. __be16 ssn_offl_ios;
  477. __be16 ssn_not_rdy_ios;
  478. u8 rx_data_ddp_err;
  479. u8 ddp_flt_set_err;
  480. __be16 rx_data_fr_err;
  481. u8 bad_st_abrt_req;
  482. u8 no_io_abrt_req;
  483. u8 abort_tmo;
  484. u8 abort_tmo_2;
  485. __be32 abort_req;
  486. u8 no_ppod_res_tmo;
  487. u8 bp_tmo;
  488. u8 adap_auto_cls;
  489. u8 no_io_cls_req;
  490. __be32 host_cls_req;
  491. __be64 unsol_cmd_rcvd;
  492. __be32 plogi_req_rcvd;
  493. __be32 prli_req_rcvd;
  494. __be16 logo_req_rcvd;
  495. __be16 prlo_req_rcvd;
  496. __be16 plogi_rjt_rcvd;
  497. __be16 prli_rjt_rcvd;
  498. __be32 adisc_req_rcvd;
  499. __be32 rscn_rcvd;
  500. __be32 rrq_req_rcvd;
  501. __be32 unsol_els_rcvd;
  502. u8 adisc_rjt_rcvd;
  503. u8 scr_rjt;
  504. u8 ct_rjt;
  505. u8 inval_bls_rcvd;
  506. __be32 ba_rjt_rcvd;
  507. } scb_stats;
  508. } u;
  509. };
  510. #define FW_FCOE_STATS_CMD_FLOWID(x) ((x) << 0)
  511. #define FW_FCOE_STATS_CMD_FREE (1U << 30)
  512. #define FW_FCOE_STATS_CMD_NSTATS(x) ((x) << 4)
  513. #define FW_FCOE_STATS_CMD_PORT(x) ((x) << 0)
  514. #define FW_FCOE_STATS_CMD_PORT_VALID (1U << 7)
  515. #define FW_FCOE_STATS_CMD_IX(x) ((x) << 0)
  516. struct fw_fcoe_fcf_cmd {
  517. __be32 op_to_fcfi;
  518. __be32 retval_len16;
  519. __be16 priority_pkd;
  520. u8 mac[6];
  521. u8 name_id[8];
  522. u8 fabric[8];
  523. __be16 vf_id;
  524. __be16 max_fcoe_size;
  525. u8 vlan_id;
  526. u8 fc_map[3];
  527. __be32 fka_adv;
  528. __be32 r6;
  529. u8 r7_hi;
  530. u8 fpma_to_portid;
  531. u8 spma_mac[6];
  532. __be64 r8;
  533. };
  534. #define FW_FCOE_FCF_CMD_FCFI(x) ((x) << 0)
  535. #define FW_FCOE_FCF_CMD_FCFI_GET(x) (((x) >> 0) & 0xfffff)
  536. #define FW_FCOE_FCF_CMD_PRIORITY_GET(x) (((x) >> 0) & 0xff)
  537. #define FW_FCOE_FCF_CMD_FPMA_GET(x) (((x) >> 6) & 0x1)
  538. #define FW_FCOE_FCF_CMD_SPMA_GET(x) (((x) >> 5) & 0x1)
  539. #define FW_FCOE_FCF_CMD_LOGIN_GET(x) (((x) >> 4) & 0x1)
  540. #define FW_FCOE_FCF_CMD_PORTID_GET(x) (((x) >> 0) & 0xf)
  541. #endif /* _T4FW_API_STOR_H_ */