bfi.h 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618
  1. /*
  2. * Copyright (c) 2005-2010 Brocade Communications Systems, Inc.
  3. * All rights reserved
  4. * www.brocade.com
  5. *
  6. * Linux driver for Brocade Fibre Channel Host Bus Adapter.
  7. *
  8. * This program is free software; you can redistribute it and/or modify it
  9. * under the terms of the GNU General Public License (GPL) Version 2 as
  10. * published by the Free Software Foundation
  11. *
  12. * This program is distributed in the hope that it will be useful, but
  13. * WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  15. * General Public License for more details.
  16. */
  17. #ifndef __BFI_H__
  18. #define __BFI_H__
  19. #include "bfa_defs.h"
  20. #include "bfa_defs_svc.h"
  21. #pragma pack(1)
  22. /*
  23. * BFI FW image type
  24. */
  25. #define BFI_FLASH_CHUNK_SZ 256 /* Flash chunk size */
  26. #define BFI_FLASH_CHUNK_SZ_WORDS (BFI_FLASH_CHUNK_SZ/sizeof(u32))
  27. /*
  28. * Msg header common to all msgs
  29. */
  30. struct bfi_mhdr_s {
  31. u8 msg_class; /* @ref bfi_mclass_t */
  32. u8 msg_id; /* msg opcode with in the class */
  33. union {
  34. struct {
  35. u8 qid;
  36. u8 lpu_id; /* msg destination */
  37. } h2i;
  38. u16 i2htok; /* token in msgs to host */
  39. } mtag;
  40. };
  41. #define bfi_mhdr_2_qid(_mh) ((_mh)->mtag.h2i.qid)
  42. #define bfi_h2i_set(_mh, _mc, _op, _lpuid) do { \
  43. (_mh).msg_class = (_mc); \
  44. (_mh).msg_id = (_op); \
  45. (_mh).mtag.h2i.lpu_id = (_lpuid); \
  46. } while (0)
  47. #define bfi_i2h_set(_mh, _mc, _op, _i2htok) do { \
  48. (_mh).msg_class = (_mc); \
  49. (_mh).msg_id = (_op); \
  50. (_mh).mtag.i2htok = (_i2htok); \
  51. } while (0)
  52. /*
  53. * Message opcodes: 0-127 to firmware, 128-255 to host
  54. */
  55. #define BFI_I2H_OPCODE_BASE 128
  56. #define BFA_I2HM(_x) ((_x) + BFI_I2H_OPCODE_BASE)
  57. /*
  58. ****************************************************************************
  59. *
  60. * Scatter Gather Element and Page definition
  61. *
  62. ****************************************************************************
  63. */
  64. #define BFI_SGE_INLINE 1
  65. #define BFI_SGE_INLINE_MAX (BFI_SGE_INLINE + 1)
  66. /*
  67. * SG Flags
  68. */
  69. enum {
  70. BFI_SGE_DATA = 0, /* data address, not last */
  71. BFI_SGE_DATA_CPL = 1, /* data addr, last in current page */
  72. BFI_SGE_DATA_LAST = 3, /* data address, last */
  73. BFI_SGE_LINK = 2, /* link address */
  74. BFI_SGE_PGDLEN = 2, /* cumulative data length for page */
  75. };
  76. /*
  77. * DMA addresses
  78. */
  79. union bfi_addr_u {
  80. struct {
  81. __be32 addr_lo;
  82. __be32 addr_hi;
  83. } a32;
  84. };
  85. /*
  86. * Scatter Gather Element used for fast-path IO requests
  87. */
  88. struct bfi_sge_s {
  89. #ifdef __BIG_ENDIAN
  90. u32 flags:2,
  91. rsvd:2,
  92. sg_len:28;
  93. #else
  94. u32 sg_len:28,
  95. rsvd:2,
  96. flags:2;
  97. #endif
  98. union bfi_addr_u sga;
  99. };
  100. /**
  101. * Generic DMA addr-len pair.
  102. */
  103. struct bfi_alen_s {
  104. union bfi_addr_u al_addr; /* DMA addr of buffer */
  105. u32 al_len; /* length of buffer */
  106. };
  107. /*
  108. * Scatter Gather Page
  109. */
  110. #define BFI_SGPG_DATA_SGES 7
  111. #define BFI_SGPG_SGES_MAX (BFI_SGPG_DATA_SGES + 1)
  112. #define BFI_SGPG_RSVD_WD_LEN 8
  113. struct bfi_sgpg_s {
  114. struct bfi_sge_s sges[BFI_SGPG_SGES_MAX];
  115. u32 rsvd[BFI_SGPG_RSVD_WD_LEN];
  116. };
  117. /*
  118. * Large Message structure - 128 Bytes size Msgs
  119. */
  120. #define BFI_LMSG_SZ 128
  121. #define BFI_LMSG_PL_WSZ \
  122. ((BFI_LMSG_SZ - sizeof(struct bfi_mhdr_s)) / 4)
  123. struct bfi_msg_s {
  124. struct bfi_mhdr_s mhdr;
  125. u32 pl[BFI_LMSG_PL_WSZ];
  126. };
  127. /*
  128. * Mailbox message structure
  129. */
  130. #define BFI_MBMSG_SZ 7
  131. struct bfi_mbmsg_s {
  132. struct bfi_mhdr_s mh;
  133. u32 pl[BFI_MBMSG_SZ];
  134. };
  135. /*
  136. * Supported PCI function class codes (personality)
  137. */
  138. enum bfi_pcifn_class {
  139. BFI_PCIFN_CLASS_FC = 0x0c04,
  140. BFI_PCIFN_CLASS_ETH = 0x0200,
  141. };
  142. /*
  143. * Message Classes
  144. */
  145. enum bfi_mclass {
  146. BFI_MC_IOC = 1, /* IO Controller (IOC) */
  147. BFI_MC_FCPORT = 5, /* FC port */
  148. BFI_MC_IOCFC = 6, /* FC - IO Controller (IOC) */
  149. BFI_MC_LL = 7, /* Link Layer */
  150. BFI_MC_UF = 8, /* Unsolicited frame receive */
  151. BFI_MC_FCXP = 9, /* FC Transport */
  152. BFI_MC_LPS = 10, /* lport fc login services */
  153. BFI_MC_RPORT = 11, /* Remote port */
  154. BFI_MC_ITNIM = 12, /* I-T nexus (Initiator mode) */
  155. BFI_MC_IOIM_READ = 13, /* read IO (Initiator mode) */
  156. BFI_MC_IOIM_WRITE = 14, /* write IO (Initiator mode) */
  157. BFI_MC_IOIM_IO = 15, /* IO (Initiator mode) */
  158. BFI_MC_IOIM = 16, /* IO (Initiator mode) */
  159. BFI_MC_IOIM_IOCOM = 17, /* good IO completion */
  160. BFI_MC_TSKIM = 18, /* Initiator Task management */
  161. BFI_MC_PORT = 21, /* Physical port */
  162. BFI_MC_MAX = 32
  163. };
  164. #define BFI_IOC_MAX_CQS 4
  165. #define BFI_IOC_MAX_CQS_ASIC 8
  166. #define BFI_IOC_MSGLEN_MAX 32 /* 32 bytes */
  167. /*
  168. *----------------------------------------------------------------------
  169. * IOC
  170. *----------------------------------------------------------------------
  171. */
  172. /*
  173. * Different asic generations
  174. */
  175. enum bfi_asic_gen {
  176. BFI_ASIC_GEN_CB = 1, /* crossbow 8G FC */
  177. BFI_ASIC_GEN_CT = 2, /* catapult 8G FC or 10G CNA */
  178. BFI_ASIC_GEN_CT2 = 3, /* catapult-2 16G FC or 10G CNA */
  179. };
  180. enum bfi_asic_mode {
  181. BFI_ASIC_MODE_FC = 1, /* FC upto 8G speed */
  182. BFI_ASIC_MODE_FC16 = 2, /* FC upto 16G speed */
  183. BFI_ASIC_MODE_ETH = 3, /* Ethernet ports */
  184. BFI_ASIC_MODE_COMBO = 4, /* FC 16G and Ethernet 10G port */
  185. };
  186. enum bfi_ioc_h2i_msgs {
  187. BFI_IOC_H2I_ENABLE_REQ = 1,
  188. BFI_IOC_H2I_DISABLE_REQ = 2,
  189. BFI_IOC_H2I_GETATTR_REQ = 3,
  190. BFI_IOC_H2I_DBG_SYNC = 4,
  191. BFI_IOC_H2I_DBG_DUMP = 5,
  192. };
  193. enum bfi_ioc_i2h_msgs {
  194. BFI_IOC_I2H_ENABLE_REPLY = BFA_I2HM(1),
  195. BFI_IOC_I2H_DISABLE_REPLY = BFA_I2HM(2),
  196. BFI_IOC_I2H_GETATTR_REPLY = BFA_I2HM(3),
  197. BFI_IOC_I2H_READY_EVENT = BFA_I2HM(4),
  198. BFI_IOC_I2H_HBEAT = BFA_I2HM(5),
  199. };
  200. /*
  201. * BFI_IOC_H2I_GETATTR_REQ message
  202. */
  203. struct bfi_ioc_getattr_req_s {
  204. struct bfi_mhdr_s mh;
  205. union bfi_addr_u attr_addr;
  206. };
  207. struct bfi_ioc_attr_s {
  208. wwn_t mfg_pwwn; /* Mfg port wwn */
  209. wwn_t mfg_nwwn; /* Mfg node wwn */
  210. mac_t mfg_mac; /* Mfg mac */
  211. u16 rsvd_a;
  212. wwn_t pwwn;
  213. wwn_t nwwn;
  214. mac_t mac; /* PBC or Mfg mac */
  215. u16 rsvd_b;
  216. mac_t fcoe_mac;
  217. u16 rsvd_c;
  218. char brcd_serialnum[STRSZ(BFA_MFG_SERIALNUM_SIZE)];
  219. u8 pcie_gen;
  220. u8 pcie_lanes_orig;
  221. u8 pcie_lanes;
  222. u8 rx_bbcredit; /* receive buffer credits */
  223. u32 adapter_prop; /* adapter properties */
  224. u16 maxfrsize; /* max receive frame size */
  225. char asic_rev;
  226. u8 rsvd_d;
  227. char fw_version[BFA_VERSION_LEN];
  228. char optrom_version[BFA_VERSION_LEN];
  229. struct bfa_mfg_vpd_s vpd;
  230. u32 card_type; /* card type */
  231. };
  232. /*
  233. * BFI_IOC_I2H_GETATTR_REPLY message
  234. */
  235. struct bfi_ioc_getattr_reply_s {
  236. struct bfi_mhdr_s mh; /* Common msg header */
  237. u8 status; /* cfg reply status */
  238. u8 rsvd[3];
  239. };
  240. /*
  241. * Firmware memory page offsets
  242. */
  243. #define BFI_IOC_SMEM_PG0_CB (0x40)
  244. #define BFI_IOC_SMEM_PG0_CT (0x180)
  245. /*
  246. * Firmware statistic offset
  247. */
  248. #define BFI_IOC_FWSTATS_OFF (0x6B40)
  249. #define BFI_IOC_FWSTATS_SZ (4096)
  250. /*
  251. * Firmware trace offset
  252. */
  253. #define BFI_IOC_TRC_OFF (0x4b00)
  254. #define BFI_IOC_TRC_ENTS 256
  255. #define BFI_IOC_FW_SIGNATURE (0xbfadbfad)
  256. #define BFI_IOC_MD5SUM_SZ 4
  257. struct bfi_ioc_image_hdr_s {
  258. u32 signature; /* constant signature */
  259. u8 asic_gen; /* asic generation */
  260. u8 asic_mode;
  261. u8 port0_mode; /* device mode for port 0 */
  262. u8 port1_mode; /* device mode for port 1 */
  263. u32 exec; /* exec vector */
  264. u32 bootenv; /* fimware boot env */
  265. u32 rsvd_b[4];
  266. u32 md5sum[BFI_IOC_MD5SUM_SZ];
  267. };
  268. #define BFI_FWBOOT_DEVMODE_OFF 4
  269. #define BFI_FWBOOT_TYPE_OFF 8
  270. #define BFI_FWBOOT_ENV_OFF 12
  271. #define BFI_FWBOOT_DEVMODE(__asic_gen, __asic_mode, __p0_mode, __p1_mode) \
  272. (((u32)(__asic_gen)) << 24 | \
  273. ((u32)(__asic_mode)) << 16 | \
  274. ((u32)(__p0_mode)) << 8 | \
  275. ((u32)(__p1_mode)))
  276. #define BFI_FWBOOT_TYPE_NORMAL 0
  277. #define BFI_FWBOOT_TYPE_MEMTEST 1
  278. #define BFI_FWBOOT_ENV_OS 0
  279. enum bfi_port_mode {
  280. BFI_PORT_MODE_FC = 1,
  281. BFI_PORT_MODE_ETH = 2,
  282. };
  283. /*
  284. * BFI_IOC_I2H_READY_EVENT message
  285. */
  286. struct bfi_ioc_rdy_event_s {
  287. struct bfi_mhdr_s mh; /* common msg header */
  288. u8 init_status; /* init event status */
  289. u8 rsvd[3];
  290. };
  291. struct bfi_ioc_hbeat_s {
  292. struct bfi_mhdr_s mh; /* common msg header */
  293. u32 hb_count; /* current heart beat count */
  294. };
  295. /*
  296. * IOC hardware/firmware state
  297. */
  298. enum bfi_ioc_state {
  299. BFI_IOC_UNINIT = 0, /* not initialized */
  300. BFI_IOC_INITING = 1, /* h/w is being initialized */
  301. BFI_IOC_HWINIT = 2, /* h/w is initialized */
  302. BFI_IOC_CFG = 3, /* IOC configuration in progress */
  303. BFI_IOC_OP = 4, /* IOC is operational */
  304. BFI_IOC_DISABLING = 5, /* IOC is being disabled */
  305. BFI_IOC_DISABLED = 6, /* IOC is disabled */
  306. BFI_IOC_CFG_DISABLED = 7, /* IOC is being disabled;transient */
  307. BFI_IOC_FAIL = 8, /* IOC heart-beat failure */
  308. BFI_IOC_MEMTEST = 9, /* IOC is doing memtest */
  309. };
  310. #define BFI_IOC_ENDIAN_SIG 0x12345678
  311. enum {
  312. BFI_ADAPTER_TYPE_FC = 0x01, /* FC adapters */
  313. BFI_ADAPTER_TYPE_MK = 0x0f0000, /* adapter type mask */
  314. BFI_ADAPTER_TYPE_SH = 16, /* adapter type shift */
  315. BFI_ADAPTER_NPORTS_MK = 0xff00, /* number of ports mask */
  316. BFI_ADAPTER_NPORTS_SH = 8, /* number of ports shift */
  317. BFI_ADAPTER_SPEED_MK = 0xff, /* adapter speed mask */
  318. BFI_ADAPTER_SPEED_SH = 0, /* adapter speed shift */
  319. BFI_ADAPTER_PROTO = 0x100000, /* prototype adapaters */
  320. BFI_ADAPTER_TTV = 0x200000, /* TTV debug capable */
  321. BFI_ADAPTER_UNSUPP = 0x400000, /* unknown adapter type */
  322. };
  323. #define BFI_ADAPTER_GETP(__prop, __adap_prop) \
  324. (((__adap_prop) & BFI_ADAPTER_ ## __prop ## _MK) >> \
  325. BFI_ADAPTER_ ## __prop ## _SH)
  326. #define BFI_ADAPTER_SETP(__prop, __val) \
  327. ((__val) << BFI_ADAPTER_ ## __prop ## _SH)
  328. #define BFI_ADAPTER_IS_PROTO(__adap_type) \
  329. ((__adap_type) & BFI_ADAPTER_PROTO)
  330. #define BFI_ADAPTER_IS_TTV(__adap_type) \
  331. ((__adap_type) & BFI_ADAPTER_TTV)
  332. #define BFI_ADAPTER_IS_UNSUPP(__adap_type) \
  333. ((__adap_type) & BFI_ADAPTER_UNSUPP)
  334. #define BFI_ADAPTER_IS_SPECIAL(__adap_type) \
  335. ((__adap_type) & (BFI_ADAPTER_TTV | BFI_ADAPTER_PROTO | \
  336. BFI_ADAPTER_UNSUPP))
  337. /*
  338. * BFI_IOC_H2I_ENABLE_REQ & BFI_IOC_H2I_DISABLE_REQ messages
  339. */
  340. struct bfi_ioc_ctrl_req_s {
  341. struct bfi_mhdr_s mh;
  342. u16 clscode;
  343. u16 rsvd;
  344. u32 tv_sec;
  345. };
  346. #define bfi_ioc_enable_req_t struct bfi_ioc_ctrl_req_s;
  347. #define bfi_ioc_disable_req_t struct bfi_ioc_ctrl_req_s;
  348. /*
  349. * BFI_IOC_I2H_ENABLE_REPLY & BFI_IOC_I2H_DISABLE_REPLY messages
  350. */
  351. struct bfi_ioc_ctrl_reply_s {
  352. struct bfi_mhdr_s mh; /* Common msg header */
  353. u8 status; /* enable/disable status */
  354. u8 rsvd[3];
  355. };
  356. #define bfi_ioc_enable_reply_t struct bfi_ioc_ctrl_reply_s;
  357. #define bfi_ioc_disable_reply_t struct bfi_ioc_ctrl_reply_s;
  358. #define BFI_IOC_MSGSZ 8
  359. /*
  360. * H2I Messages
  361. */
  362. union bfi_ioc_h2i_msg_u {
  363. struct bfi_mhdr_s mh;
  364. struct bfi_ioc_ctrl_req_s enable_req;
  365. struct bfi_ioc_ctrl_req_s disable_req;
  366. struct bfi_ioc_getattr_req_s getattr_req;
  367. u32 mboxmsg[BFI_IOC_MSGSZ];
  368. };
  369. /*
  370. * I2H Messages
  371. */
  372. union bfi_ioc_i2h_msg_u {
  373. struct bfi_mhdr_s mh;
  374. struct bfi_ioc_rdy_event_s rdy_event;
  375. u32 mboxmsg[BFI_IOC_MSGSZ];
  376. };
  377. /*
  378. *----------------------------------------------------------------------
  379. * PBC
  380. *----------------------------------------------------------------------
  381. */
  382. #define BFI_PBC_MAX_BLUNS 8
  383. #define BFI_PBC_MAX_VPORTS 16
  384. #define BFI_PBC_PORT_DISABLED 2
  385. /*
  386. * PBC boot lun configuration
  387. */
  388. struct bfi_pbc_blun_s {
  389. wwn_t tgt_pwwn;
  390. struct scsi_lun tgt_lun;
  391. };
  392. /*
  393. * PBC virtual port configuration
  394. */
  395. struct bfi_pbc_vport_s {
  396. wwn_t vp_pwwn;
  397. wwn_t vp_nwwn;
  398. };
  399. /*
  400. * BFI pre-boot configuration information
  401. */
  402. struct bfi_pbc_s {
  403. u8 port_enabled;
  404. u8 boot_enabled;
  405. u8 nbluns;
  406. u8 nvports;
  407. u8 port_speed;
  408. u8 rsvd_a;
  409. u16 hss;
  410. wwn_t pbc_pwwn;
  411. wwn_t pbc_nwwn;
  412. struct bfi_pbc_blun_s blun[BFI_PBC_MAX_BLUNS];
  413. struct bfi_pbc_vport_s vport[BFI_PBC_MAX_VPORTS];
  414. };
  415. /*
  416. *----------------------------------------------------------------------
  417. * MSGQ
  418. *----------------------------------------------------------------------
  419. */
  420. #define BFI_MSGQ_FULL(_q) (((_q->pi + 1) % _q->q_depth) == _q->ci)
  421. #define BFI_MSGQ_EMPTY(_q) (_q->pi == _q->ci)
  422. #define BFI_MSGQ_UPDATE_CI(_q) (_q->ci = (_q->ci + 1) % _q->q_depth)
  423. #define BFI_MSGQ_UPDATE_PI(_q) (_q->pi = (_q->pi + 1) % _q->q_depth)
  424. /* q_depth must be power of 2 */
  425. #define BFI_MSGQ_FREE_CNT(_q) ((_q->ci - _q->pi - 1) & (_q->q_depth - 1))
  426. enum bfi_msgq_h2i_msgs_e {
  427. BFI_MSGQ_H2I_INIT_REQ = 1,
  428. BFI_MSGQ_H2I_DOORBELL = 2,
  429. BFI_MSGQ_H2I_SHUTDOWN = 3,
  430. };
  431. enum bfi_msgq_i2h_msgs_e {
  432. BFI_MSGQ_I2H_INIT_RSP = 1,
  433. BFI_MSGQ_I2H_DOORBELL = 2,
  434. };
  435. /* Messages(commands/responsed/AENS will have the following header */
  436. struct bfi_msgq_mhdr_s {
  437. u8 msg_class;
  438. u8 msg_id;
  439. u16 msg_token;
  440. u16 num_entries;
  441. u8 enet_id;
  442. u8 rsvd[1];
  443. };
  444. #define bfi_msgq_mhdr_set(_mh, _mc, _mid, _tok, _enet_id) do { \
  445. (_mh).msg_class = (_mc); \
  446. (_mh).msg_id = (_mid); \
  447. (_mh).msg_token = (_tok); \
  448. (_mh).enet_id = (_enet_id); \
  449. } while (0)
  450. /*
  451. * Mailbox for messaging interface
  452. *
  453. */
  454. #define BFI_MSGQ_CMD_ENTRY_SIZE (64) /* TBD */
  455. #define BFI_MSGQ_RSP_ENTRY_SIZE (64) /* TBD */
  456. #define BFI_MSGQ_MSG_SIZE_MAX (2048) /* TBD */
  457. struct bfi_msgq_s {
  458. union bfi_addr_u addr;
  459. u16 q_depth; /* Total num of entries in the queue */
  460. u8 rsvd[2];
  461. };
  462. /* BFI_ENET_MSGQ_CFG_REQ TBD init or cfg? */
  463. struct bfi_msgq_cfg_req_s {
  464. struct bfi_mhdr_s mh;
  465. struct bfi_msgq_s cmdq;
  466. struct bfi_msgq_s rspq;
  467. };
  468. /* BFI_ENET_MSGQ_CFG_RSP */
  469. struct bfi_msgq_cfg_rsp_s {
  470. struct bfi_mhdr_s mh;
  471. u8 cmd_status;
  472. u8 rsvd[3];
  473. };
  474. /* BFI_MSGQ_H2I_DOORBELL */
  475. struct bfi_msgq_h2i_db_s {
  476. struct bfi_mhdr_s mh;
  477. u16 cmdq_pi;
  478. u16 rspq_ci;
  479. };
  480. /* BFI_MSGQ_I2H_DOORBELL */
  481. struct bfi_msgq_i2h_db_s {
  482. struct bfi_mhdr_s mh;
  483. u16 rspq_pi;
  484. u16 cmdq_ci;
  485. };
  486. #pragma pack()
  487. /* BFI port specific */
  488. #pragma pack(1)
  489. enum bfi_port_h2i {
  490. BFI_PORT_H2I_ENABLE_REQ = (1),
  491. BFI_PORT_H2I_DISABLE_REQ = (2),
  492. BFI_PORT_H2I_GET_STATS_REQ = (3),
  493. BFI_PORT_H2I_CLEAR_STATS_REQ = (4),
  494. };
  495. enum bfi_port_i2h {
  496. BFI_PORT_I2H_ENABLE_RSP = BFA_I2HM(1),
  497. BFI_PORT_I2H_DISABLE_RSP = BFA_I2HM(2),
  498. BFI_PORT_I2H_GET_STATS_RSP = BFA_I2HM(3),
  499. BFI_PORT_I2H_CLEAR_STATS_RSP = BFA_I2HM(4),
  500. };
  501. /*
  502. * Generic REQ type
  503. */
  504. struct bfi_port_generic_req_s {
  505. struct bfi_mhdr_s mh; /* msg header */
  506. u32 msgtag; /* msgtag for reply */
  507. u32 rsvd;
  508. };
  509. /*
  510. * Generic RSP type
  511. */
  512. struct bfi_port_generic_rsp_s {
  513. struct bfi_mhdr_s mh; /* common msg header */
  514. u8 status; /* port enable status */
  515. u8 rsvd[3];
  516. u32 msgtag; /* msgtag for reply */
  517. };
  518. /*
  519. * BFI_PORT_H2I_GET_STATS_REQ
  520. */
  521. struct bfi_port_get_stats_req_s {
  522. struct bfi_mhdr_s mh; /* common msg header */
  523. union bfi_addr_u dma_addr;
  524. };
  525. union bfi_port_h2i_msg_u {
  526. struct bfi_mhdr_s mh;
  527. struct bfi_port_generic_req_s enable_req;
  528. struct bfi_port_generic_req_s disable_req;
  529. struct bfi_port_get_stats_req_s getstats_req;
  530. struct bfi_port_generic_req_s clearstats_req;
  531. };
  532. union bfi_port_i2h_msg_u {
  533. struct bfi_mhdr_s mh;
  534. struct bfi_port_generic_rsp_s enable_rsp;
  535. struct bfi_port_generic_rsp_s disable_rsp;
  536. struct bfi_port_generic_rsp_s getstats_rsp;
  537. struct bfi_port_generic_rsp_s clearstats_rsp;
  538. };
  539. #pragma pack()
  540. #endif /* __BFI_H__ */