bfi.h 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608
  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_ITN = 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_HBEAT = BFA_I2HM(4),
  198. };
  199. /*
  200. * BFI_IOC_H2I_GETATTR_REQ message
  201. */
  202. struct bfi_ioc_getattr_req_s {
  203. struct bfi_mhdr_s mh;
  204. union bfi_addr_u attr_addr;
  205. };
  206. struct bfi_ioc_attr_s {
  207. wwn_t mfg_pwwn; /* Mfg port wwn */
  208. wwn_t mfg_nwwn; /* Mfg node wwn */
  209. mac_t mfg_mac; /* Mfg mac */
  210. u16 rsvd_a;
  211. wwn_t pwwn;
  212. wwn_t nwwn;
  213. mac_t mac; /* PBC or Mfg mac */
  214. u16 rsvd_b;
  215. mac_t fcoe_mac;
  216. u16 rsvd_c;
  217. char brcd_serialnum[STRSZ(BFA_MFG_SERIALNUM_SIZE)];
  218. u8 pcie_gen;
  219. u8 pcie_lanes_orig;
  220. u8 pcie_lanes;
  221. u8 rx_bbcredit; /* receive buffer credits */
  222. u32 adapter_prop; /* adapter properties */
  223. u16 maxfrsize; /* max receive frame size */
  224. char asic_rev;
  225. u8 rsvd_d;
  226. char fw_version[BFA_VERSION_LEN];
  227. char optrom_version[BFA_VERSION_LEN];
  228. struct bfa_mfg_vpd_s vpd;
  229. u32 card_type; /* card type */
  230. };
  231. /*
  232. * BFI_IOC_I2H_GETATTR_REPLY message
  233. */
  234. struct bfi_ioc_getattr_reply_s {
  235. struct bfi_mhdr_s mh; /* Common msg header */
  236. u8 status; /* cfg reply status */
  237. u8 rsvd[3];
  238. };
  239. /*
  240. * Firmware memory page offsets
  241. */
  242. #define BFI_IOC_SMEM_PG0_CB (0x40)
  243. #define BFI_IOC_SMEM_PG0_CT (0x180)
  244. /*
  245. * Firmware statistic offset
  246. */
  247. #define BFI_IOC_FWSTATS_OFF (0x6B40)
  248. #define BFI_IOC_FWSTATS_SZ (4096)
  249. /*
  250. * Firmware trace offset
  251. */
  252. #define BFI_IOC_TRC_OFF (0x4b00)
  253. #define BFI_IOC_TRC_ENTS 256
  254. #define BFI_IOC_FW_SIGNATURE (0xbfadbfad)
  255. #define BFI_IOC_MD5SUM_SZ 4
  256. struct bfi_ioc_image_hdr_s {
  257. u32 signature; /* constant signature */
  258. u8 asic_gen; /* asic generation */
  259. u8 asic_mode;
  260. u8 port0_mode; /* device mode for port 0 */
  261. u8 port1_mode; /* device mode for port 1 */
  262. u32 exec; /* exec vector */
  263. u32 bootenv; /* fimware boot env */
  264. u32 rsvd_b[4];
  265. u32 md5sum[BFI_IOC_MD5SUM_SZ];
  266. };
  267. #define BFI_FWBOOT_DEVMODE_OFF 4
  268. #define BFI_FWBOOT_TYPE_OFF 8
  269. #define BFI_FWBOOT_ENV_OFF 12
  270. #define BFI_FWBOOT_DEVMODE(__asic_gen, __asic_mode, __p0_mode, __p1_mode) \
  271. (((u32)(__asic_gen)) << 24 | \
  272. ((u32)(__asic_mode)) << 16 | \
  273. ((u32)(__p0_mode)) << 8 | \
  274. ((u32)(__p1_mode)))
  275. #define BFI_FWBOOT_TYPE_NORMAL 0
  276. #define BFI_FWBOOT_TYPE_MEMTEST 1
  277. #define BFI_FWBOOT_ENV_OS 0
  278. enum bfi_port_mode {
  279. BFI_PORT_MODE_FC = 1,
  280. BFI_PORT_MODE_ETH = 2,
  281. };
  282. struct bfi_ioc_hbeat_s {
  283. struct bfi_mhdr_s mh; /* common msg header */
  284. u32 hb_count; /* current heart beat count */
  285. };
  286. /*
  287. * IOC hardware/firmware state
  288. */
  289. enum bfi_ioc_state {
  290. BFI_IOC_UNINIT = 0, /* not initialized */
  291. BFI_IOC_INITING = 1, /* h/w is being initialized */
  292. BFI_IOC_HWINIT = 2, /* h/w is initialized */
  293. BFI_IOC_CFG = 3, /* IOC configuration in progress */
  294. BFI_IOC_OP = 4, /* IOC is operational */
  295. BFI_IOC_DISABLING = 5, /* IOC is being disabled */
  296. BFI_IOC_DISABLED = 6, /* IOC is disabled */
  297. BFI_IOC_CFG_DISABLED = 7, /* IOC is being disabled;transient */
  298. BFI_IOC_FAIL = 8, /* IOC heart-beat failure */
  299. BFI_IOC_MEMTEST = 9, /* IOC is doing memtest */
  300. };
  301. #define BFI_IOC_ENDIAN_SIG 0x12345678
  302. enum {
  303. BFI_ADAPTER_TYPE_FC = 0x01, /* FC adapters */
  304. BFI_ADAPTER_TYPE_MK = 0x0f0000, /* adapter type mask */
  305. BFI_ADAPTER_TYPE_SH = 16, /* adapter type shift */
  306. BFI_ADAPTER_NPORTS_MK = 0xff00, /* number of ports mask */
  307. BFI_ADAPTER_NPORTS_SH = 8, /* number of ports shift */
  308. BFI_ADAPTER_SPEED_MK = 0xff, /* adapter speed mask */
  309. BFI_ADAPTER_SPEED_SH = 0, /* adapter speed shift */
  310. BFI_ADAPTER_PROTO = 0x100000, /* prototype adapaters */
  311. BFI_ADAPTER_TTV = 0x200000, /* TTV debug capable */
  312. BFI_ADAPTER_UNSUPP = 0x400000, /* unknown adapter type */
  313. };
  314. #define BFI_ADAPTER_GETP(__prop, __adap_prop) \
  315. (((__adap_prop) & BFI_ADAPTER_ ## __prop ## _MK) >> \
  316. BFI_ADAPTER_ ## __prop ## _SH)
  317. #define BFI_ADAPTER_SETP(__prop, __val) \
  318. ((__val) << BFI_ADAPTER_ ## __prop ## _SH)
  319. #define BFI_ADAPTER_IS_PROTO(__adap_type) \
  320. ((__adap_type) & BFI_ADAPTER_PROTO)
  321. #define BFI_ADAPTER_IS_TTV(__adap_type) \
  322. ((__adap_type) & BFI_ADAPTER_TTV)
  323. #define BFI_ADAPTER_IS_UNSUPP(__adap_type) \
  324. ((__adap_type) & BFI_ADAPTER_UNSUPP)
  325. #define BFI_ADAPTER_IS_SPECIAL(__adap_type) \
  326. ((__adap_type) & (BFI_ADAPTER_TTV | BFI_ADAPTER_PROTO | \
  327. BFI_ADAPTER_UNSUPP))
  328. /*
  329. * BFI_IOC_H2I_ENABLE_REQ & BFI_IOC_H2I_DISABLE_REQ messages
  330. */
  331. struct bfi_ioc_ctrl_req_s {
  332. struct bfi_mhdr_s mh;
  333. u16 clscode;
  334. u16 rsvd;
  335. u32 tv_sec;
  336. };
  337. #define bfi_ioc_enable_req_t struct bfi_ioc_ctrl_req_s;
  338. #define bfi_ioc_disable_req_t struct bfi_ioc_ctrl_req_s;
  339. /*
  340. * BFI_IOC_I2H_ENABLE_REPLY & BFI_IOC_I2H_DISABLE_REPLY messages
  341. */
  342. struct bfi_ioc_ctrl_reply_s {
  343. struct bfi_mhdr_s mh; /* Common msg header */
  344. u8 status; /* enable/disable status */
  345. u8 rsvd[3];
  346. };
  347. #define bfi_ioc_enable_reply_t struct bfi_ioc_ctrl_reply_s;
  348. #define bfi_ioc_disable_reply_t struct bfi_ioc_ctrl_reply_s;
  349. #define BFI_IOC_MSGSZ 8
  350. /*
  351. * H2I Messages
  352. */
  353. union bfi_ioc_h2i_msg_u {
  354. struct bfi_mhdr_s mh;
  355. struct bfi_ioc_ctrl_req_s enable_req;
  356. struct bfi_ioc_ctrl_req_s disable_req;
  357. struct bfi_ioc_getattr_req_s getattr_req;
  358. u32 mboxmsg[BFI_IOC_MSGSZ];
  359. };
  360. /*
  361. * I2H Messages
  362. */
  363. union bfi_ioc_i2h_msg_u {
  364. struct bfi_mhdr_s mh;
  365. struct bfi_ioc_ctrl_reply_s rdy_event;
  366. u32 mboxmsg[BFI_IOC_MSGSZ];
  367. };
  368. /*
  369. *----------------------------------------------------------------------
  370. * PBC
  371. *----------------------------------------------------------------------
  372. */
  373. #define BFI_PBC_MAX_BLUNS 8
  374. #define BFI_PBC_MAX_VPORTS 16
  375. #define BFI_PBC_PORT_DISABLED 2
  376. /*
  377. * PBC boot lun configuration
  378. */
  379. struct bfi_pbc_blun_s {
  380. wwn_t tgt_pwwn;
  381. struct scsi_lun tgt_lun;
  382. };
  383. /*
  384. * PBC virtual port configuration
  385. */
  386. struct bfi_pbc_vport_s {
  387. wwn_t vp_pwwn;
  388. wwn_t vp_nwwn;
  389. };
  390. /*
  391. * BFI pre-boot configuration information
  392. */
  393. struct bfi_pbc_s {
  394. u8 port_enabled;
  395. u8 boot_enabled;
  396. u8 nbluns;
  397. u8 nvports;
  398. u8 port_speed;
  399. u8 rsvd_a;
  400. u16 hss;
  401. wwn_t pbc_pwwn;
  402. wwn_t pbc_nwwn;
  403. struct bfi_pbc_blun_s blun[BFI_PBC_MAX_BLUNS];
  404. struct bfi_pbc_vport_s vport[BFI_PBC_MAX_VPORTS];
  405. };
  406. /*
  407. *----------------------------------------------------------------------
  408. * MSGQ
  409. *----------------------------------------------------------------------
  410. */
  411. #define BFI_MSGQ_FULL(_q) (((_q->pi + 1) % _q->q_depth) == _q->ci)
  412. #define BFI_MSGQ_EMPTY(_q) (_q->pi == _q->ci)
  413. #define BFI_MSGQ_UPDATE_CI(_q) (_q->ci = (_q->ci + 1) % _q->q_depth)
  414. #define BFI_MSGQ_UPDATE_PI(_q) (_q->pi = (_q->pi + 1) % _q->q_depth)
  415. /* q_depth must be power of 2 */
  416. #define BFI_MSGQ_FREE_CNT(_q) ((_q->ci - _q->pi - 1) & (_q->q_depth - 1))
  417. enum bfi_msgq_h2i_msgs_e {
  418. BFI_MSGQ_H2I_INIT_REQ = 1,
  419. BFI_MSGQ_H2I_DOORBELL = 2,
  420. BFI_MSGQ_H2I_SHUTDOWN = 3,
  421. };
  422. enum bfi_msgq_i2h_msgs_e {
  423. BFI_MSGQ_I2H_INIT_RSP = 1,
  424. BFI_MSGQ_I2H_DOORBELL = 2,
  425. };
  426. /* Messages(commands/responsed/AENS will have the following header */
  427. struct bfi_msgq_mhdr_s {
  428. u8 msg_class;
  429. u8 msg_id;
  430. u16 msg_token;
  431. u16 num_entries;
  432. u8 enet_id;
  433. u8 rsvd[1];
  434. };
  435. #define bfi_msgq_mhdr_set(_mh, _mc, _mid, _tok, _enet_id) do { \
  436. (_mh).msg_class = (_mc); \
  437. (_mh).msg_id = (_mid); \
  438. (_mh).msg_token = (_tok); \
  439. (_mh).enet_id = (_enet_id); \
  440. } while (0)
  441. /*
  442. * Mailbox for messaging interface
  443. *
  444. */
  445. #define BFI_MSGQ_CMD_ENTRY_SIZE (64) /* TBD */
  446. #define BFI_MSGQ_RSP_ENTRY_SIZE (64) /* TBD */
  447. #define BFI_MSGQ_MSG_SIZE_MAX (2048) /* TBD */
  448. struct bfi_msgq_s {
  449. union bfi_addr_u addr;
  450. u16 q_depth; /* Total num of entries in the queue */
  451. u8 rsvd[2];
  452. };
  453. /* BFI_ENET_MSGQ_CFG_REQ TBD init or cfg? */
  454. struct bfi_msgq_cfg_req_s {
  455. struct bfi_mhdr_s mh;
  456. struct bfi_msgq_s cmdq;
  457. struct bfi_msgq_s rspq;
  458. };
  459. /* BFI_ENET_MSGQ_CFG_RSP */
  460. struct bfi_msgq_cfg_rsp_s {
  461. struct bfi_mhdr_s mh;
  462. u8 cmd_status;
  463. u8 rsvd[3];
  464. };
  465. /* BFI_MSGQ_H2I_DOORBELL */
  466. struct bfi_msgq_h2i_db_s {
  467. struct bfi_mhdr_s mh;
  468. u16 cmdq_pi;
  469. u16 rspq_ci;
  470. };
  471. /* BFI_MSGQ_I2H_DOORBELL */
  472. struct bfi_msgq_i2h_db_s {
  473. struct bfi_mhdr_s mh;
  474. u16 rspq_pi;
  475. u16 cmdq_ci;
  476. };
  477. #pragma pack()
  478. /* BFI port specific */
  479. #pragma pack(1)
  480. enum bfi_port_h2i {
  481. BFI_PORT_H2I_ENABLE_REQ = (1),
  482. BFI_PORT_H2I_DISABLE_REQ = (2),
  483. BFI_PORT_H2I_GET_STATS_REQ = (3),
  484. BFI_PORT_H2I_CLEAR_STATS_REQ = (4),
  485. };
  486. enum bfi_port_i2h {
  487. BFI_PORT_I2H_ENABLE_RSP = BFA_I2HM(1),
  488. BFI_PORT_I2H_DISABLE_RSP = BFA_I2HM(2),
  489. BFI_PORT_I2H_GET_STATS_RSP = BFA_I2HM(3),
  490. BFI_PORT_I2H_CLEAR_STATS_RSP = BFA_I2HM(4),
  491. };
  492. /*
  493. * Generic REQ type
  494. */
  495. struct bfi_port_generic_req_s {
  496. struct bfi_mhdr_s mh; /* msg header */
  497. u32 msgtag; /* msgtag for reply */
  498. u32 rsvd;
  499. };
  500. /*
  501. * Generic RSP type
  502. */
  503. struct bfi_port_generic_rsp_s {
  504. struct bfi_mhdr_s mh; /* common msg header */
  505. u8 status; /* port enable status */
  506. u8 rsvd[3];
  507. u32 msgtag; /* msgtag for reply */
  508. };
  509. /*
  510. * BFI_PORT_H2I_GET_STATS_REQ
  511. */
  512. struct bfi_port_get_stats_req_s {
  513. struct bfi_mhdr_s mh; /* common msg header */
  514. union bfi_addr_u dma_addr;
  515. };
  516. union bfi_port_h2i_msg_u {
  517. struct bfi_mhdr_s mh;
  518. struct bfi_port_generic_req_s enable_req;
  519. struct bfi_port_generic_req_s disable_req;
  520. struct bfi_port_get_stats_req_s getstats_req;
  521. struct bfi_port_generic_req_s clearstats_req;
  522. };
  523. union bfi_port_i2h_msg_u {
  524. struct bfi_mhdr_s mh;
  525. struct bfi_port_generic_rsp_s enable_rsp;
  526. struct bfi_port_generic_rsp_s disable_rsp;
  527. struct bfi_port_generic_rsp_s getstats_rsp;
  528. struct bfi_port_generic_rsp_s clearstats_rsp;
  529. };
  530. #pragma pack()
  531. #endif /* __BFI_H__ */