bfi.h 27 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174
  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. /* Per dma segment max size */
  23. #define BFI_MEM_DMA_SEG_SZ (131072)
  24. /* Get number of dma segments required */
  25. #define BFI_MEM_DMA_NSEGS(_num_reqs, _req_sz) \
  26. ((u16)(((((_num_reqs) * (_req_sz)) + BFI_MEM_DMA_SEG_SZ - 1) & \
  27. ~(BFI_MEM_DMA_SEG_SZ - 1)) / BFI_MEM_DMA_SEG_SZ))
  28. /* Get num dma reqs - that fit in a segment */
  29. #define BFI_MEM_NREQS_SEG(_rqsz) (BFI_MEM_DMA_SEG_SZ / (_rqsz))
  30. /* Get segment num from tag */
  31. #define BFI_MEM_SEG_FROM_TAG(_tag, _rqsz) ((_tag) / BFI_MEM_NREQS_SEG(_rqsz))
  32. /* Get dma req offset in a segment */
  33. #define BFI_MEM_SEG_REQ_OFFSET(_tag, _sz) \
  34. ((_tag) - (BFI_MEM_SEG_FROM_TAG(_tag, _sz) * BFI_MEM_NREQS_SEG(_sz)))
  35. /*
  36. * BFI FW image type
  37. */
  38. #define BFI_FLASH_CHUNK_SZ 256 /* Flash chunk size */
  39. #define BFI_FLASH_CHUNK_SZ_WORDS (BFI_FLASH_CHUNK_SZ/sizeof(u32))
  40. /*
  41. * Msg header common to all msgs
  42. */
  43. struct bfi_mhdr_s {
  44. u8 msg_class; /* @ref bfi_mclass_t */
  45. u8 msg_id; /* msg opcode with in the class */
  46. union {
  47. struct {
  48. u8 qid;
  49. u8 fn_lpu; /* msg destination */
  50. } h2i;
  51. u16 i2htok; /* token in msgs to host */
  52. } mtag;
  53. };
  54. #define bfi_fn_lpu(__fn, __lpu) ((__fn) << 1 | (__lpu))
  55. #define bfi_mhdr_2_fn(_mh) ((_mh)->mtag.h2i.fn_lpu >> 1)
  56. #define bfi_h2i_set(_mh, _mc, _op, _fn_lpu) do { \
  57. (_mh).msg_class = (_mc); \
  58. (_mh).msg_id = (_op); \
  59. (_mh).mtag.h2i.fn_lpu = (_fn_lpu); \
  60. } while (0)
  61. #define bfi_i2h_set(_mh, _mc, _op, _i2htok) do { \
  62. (_mh).msg_class = (_mc); \
  63. (_mh).msg_id = (_op); \
  64. (_mh).mtag.i2htok = (_i2htok); \
  65. } while (0)
  66. /*
  67. * Message opcodes: 0-127 to firmware, 128-255 to host
  68. */
  69. #define BFI_I2H_OPCODE_BASE 128
  70. #define BFA_I2HM(_x) ((_x) + BFI_I2H_OPCODE_BASE)
  71. /*
  72. ****************************************************************************
  73. *
  74. * Scatter Gather Element and Page definition
  75. *
  76. ****************************************************************************
  77. */
  78. #define BFI_SGE_INLINE 1
  79. #define BFI_SGE_INLINE_MAX (BFI_SGE_INLINE + 1)
  80. /*
  81. * SG Flags
  82. */
  83. enum {
  84. BFI_SGE_DATA = 0, /* data address, not last */
  85. BFI_SGE_DATA_CPL = 1, /* data addr, last in current page */
  86. BFI_SGE_DATA_LAST = 3, /* data address, last */
  87. BFI_SGE_LINK = 2, /* link address */
  88. BFI_SGE_PGDLEN = 2, /* cumulative data length for page */
  89. };
  90. /*
  91. * DMA addresses
  92. */
  93. union bfi_addr_u {
  94. struct {
  95. __be32 addr_lo;
  96. __be32 addr_hi;
  97. } a32;
  98. };
  99. /*
  100. * Scatter Gather Element used for fast-path IO requests
  101. */
  102. struct bfi_sge_s {
  103. #ifdef __BIG_ENDIAN
  104. u32 flags:2,
  105. rsvd:2,
  106. sg_len:28;
  107. #else
  108. u32 sg_len:28,
  109. rsvd:2,
  110. flags:2;
  111. #endif
  112. union bfi_addr_u sga;
  113. };
  114. /**
  115. * Generic DMA addr-len pair.
  116. */
  117. struct bfi_alen_s {
  118. union bfi_addr_u al_addr; /* DMA addr of buffer */
  119. u32 al_len; /* length of buffer */
  120. };
  121. /*
  122. * Scatter Gather Page
  123. */
  124. #define BFI_SGPG_DATA_SGES 7
  125. #define BFI_SGPG_SGES_MAX (BFI_SGPG_DATA_SGES + 1)
  126. #define BFI_SGPG_RSVD_WD_LEN 8
  127. struct bfi_sgpg_s {
  128. struct bfi_sge_s sges[BFI_SGPG_SGES_MAX];
  129. u32 rsvd[BFI_SGPG_RSVD_WD_LEN];
  130. };
  131. /* FCP module definitions */
  132. #define BFI_IO_MAX (2000)
  133. #define BFI_IOIM_SNSLEN (256)
  134. #define BFI_IOIM_SNSBUF_SEGS \
  135. BFI_MEM_DMA_NSEGS(BFI_IO_MAX, BFI_IOIM_SNSLEN)
  136. /*
  137. * Large Message structure - 128 Bytes size Msgs
  138. */
  139. #define BFI_LMSG_SZ 128
  140. #define BFI_LMSG_PL_WSZ \
  141. ((BFI_LMSG_SZ - sizeof(struct bfi_mhdr_s)) / 4)
  142. struct bfi_msg_s {
  143. struct bfi_mhdr_s mhdr;
  144. u32 pl[BFI_LMSG_PL_WSZ];
  145. };
  146. /*
  147. * Mailbox message structure
  148. */
  149. #define BFI_MBMSG_SZ 7
  150. struct bfi_mbmsg_s {
  151. struct bfi_mhdr_s mh;
  152. u32 pl[BFI_MBMSG_SZ];
  153. };
  154. /*
  155. * Supported PCI function class codes (personality)
  156. */
  157. enum bfi_pcifn_class {
  158. BFI_PCIFN_CLASS_FC = 0x0c04,
  159. BFI_PCIFN_CLASS_ETH = 0x0200,
  160. };
  161. /*
  162. * Message Classes
  163. */
  164. enum bfi_mclass {
  165. BFI_MC_IOC = 1, /* IO Controller (IOC) */
  166. BFI_MC_DIAG = 2, /* Diagnostic Msgs */
  167. BFI_MC_FLASH = 3, /* Flash message class */
  168. BFI_MC_CEE = 4, /* CEE */
  169. BFI_MC_FCPORT = 5, /* FC port */
  170. BFI_MC_IOCFC = 6, /* FC - IO Controller (IOC) */
  171. BFI_MC_ABLK = 7, /* ASIC block configuration */
  172. BFI_MC_UF = 8, /* Unsolicited frame receive */
  173. BFI_MC_FCXP = 9, /* FC Transport */
  174. BFI_MC_LPS = 10, /* lport fc login services */
  175. BFI_MC_RPORT = 11, /* Remote port */
  176. BFI_MC_ITN = 12, /* I-T nexus (Initiator mode) */
  177. BFI_MC_IOIM_READ = 13, /* read IO (Initiator mode) */
  178. BFI_MC_IOIM_WRITE = 14, /* write IO (Initiator mode) */
  179. BFI_MC_IOIM_IO = 15, /* IO (Initiator mode) */
  180. BFI_MC_IOIM = 16, /* IO (Initiator mode) */
  181. BFI_MC_IOIM_IOCOM = 17, /* good IO completion */
  182. BFI_MC_TSKIM = 18, /* Initiator Task management */
  183. BFI_MC_PORT = 21, /* Physical port */
  184. BFI_MC_SFP = 22, /* SFP module */
  185. BFI_MC_PHY = 25, /* External PHY message class */
  186. BFI_MC_MAX = 32
  187. };
  188. #define BFI_IOC_MAX_CQS 4
  189. #define BFI_IOC_MAX_CQS_ASIC 8
  190. #define BFI_IOC_MSGLEN_MAX 32 /* 32 bytes */
  191. /*
  192. *----------------------------------------------------------------------
  193. * IOC
  194. *----------------------------------------------------------------------
  195. */
  196. /*
  197. * Different asic generations
  198. */
  199. enum bfi_asic_gen {
  200. BFI_ASIC_GEN_CB = 1, /* crossbow 8G FC */
  201. BFI_ASIC_GEN_CT = 2, /* catapult 8G FC or 10G CNA */
  202. BFI_ASIC_GEN_CT2 = 3, /* catapult-2 16G FC or 10G CNA */
  203. };
  204. enum bfi_asic_mode {
  205. BFI_ASIC_MODE_FC = 1, /* FC upto 8G speed */
  206. BFI_ASIC_MODE_FC16 = 2, /* FC upto 16G speed */
  207. BFI_ASIC_MODE_ETH = 3, /* Ethernet ports */
  208. BFI_ASIC_MODE_COMBO = 4, /* FC 16G and Ethernet 10G port */
  209. };
  210. enum bfi_ioc_h2i_msgs {
  211. BFI_IOC_H2I_ENABLE_REQ = 1,
  212. BFI_IOC_H2I_DISABLE_REQ = 2,
  213. BFI_IOC_H2I_GETATTR_REQ = 3,
  214. BFI_IOC_H2I_DBG_SYNC = 4,
  215. BFI_IOC_H2I_DBG_DUMP = 5,
  216. };
  217. enum bfi_ioc_i2h_msgs {
  218. BFI_IOC_I2H_ENABLE_REPLY = BFA_I2HM(1),
  219. BFI_IOC_I2H_DISABLE_REPLY = BFA_I2HM(2),
  220. BFI_IOC_I2H_GETATTR_REPLY = BFA_I2HM(3),
  221. BFI_IOC_I2H_HBEAT = BFA_I2HM(4),
  222. BFI_IOC_I2H_ACQ_ADDR_REPLY = BFA_I2HM(5),
  223. };
  224. /*
  225. * BFI_IOC_H2I_GETATTR_REQ message
  226. */
  227. struct bfi_ioc_getattr_req_s {
  228. struct bfi_mhdr_s mh;
  229. union bfi_addr_u attr_addr;
  230. };
  231. struct bfi_ioc_attr_s {
  232. wwn_t mfg_pwwn; /* Mfg port wwn */
  233. wwn_t mfg_nwwn; /* Mfg node wwn */
  234. mac_t mfg_mac; /* Mfg mac */
  235. u8 port_mode; /* bfi_port_mode */
  236. u8 rsvd_a;
  237. wwn_t pwwn;
  238. wwn_t nwwn;
  239. mac_t mac; /* PBC or Mfg mac */
  240. u16 rsvd_b;
  241. mac_t fcoe_mac;
  242. u16 rsvd_c;
  243. char brcd_serialnum[STRSZ(BFA_MFG_SERIALNUM_SIZE)];
  244. u8 pcie_gen;
  245. u8 pcie_lanes_orig;
  246. u8 pcie_lanes;
  247. u8 rx_bbcredit; /* receive buffer credits */
  248. u32 adapter_prop; /* adapter properties */
  249. u16 maxfrsize; /* max receive frame size */
  250. char asic_rev;
  251. u8 rsvd_d;
  252. char fw_version[BFA_VERSION_LEN];
  253. char optrom_version[BFA_VERSION_LEN];
  254. struct bfa_mfg_vpd_s vpd;
  255. u32 card_type; /* card type */
  256. u8 mfg_day; /* manufacturing day */
  257. u8 mfg_month; /* manufacturing month */
  258. u16 mfg_year; /* manufacturing year */
  259. };
  260. /*
  261. * BFI_IOC_I2H_GETATTR_REPLY message
  262. */
  263. struct bfi_ioc_getattr_reply_s {
  264. struct bfi_mhdr_s mh; /* Common msg header */
  265. u8 status; /* cfg reply status */
  266. u8 rsvd[3];
  267. };
  268. /*
  269. * Firmware memory page offsets
  270. */
  271. #define BFI_IOC_SMEM_PG0_CB (0x40)
  272. #define BFI_IOC_SMEM_PG0_CT (0x180)
  273. /*
  274. * Firmware statistic offset
  275. */
  276. #define BFI_IOC_FWSTATS_OFF (0x6B40)
  277. #define BFI_IOC_FWSTATS_SZ (4096)
  278. /*
  279. * Firmware trace offset
  280. */
  281. #define BFI_IOC_TRC_OFF (0x4b00)
  282. #define BFI_IOC_TRC_ENTS 256
  283. #define BFI_IOC_FW_SIGNATURE (0xbfadbfad)
  284. #define BFI_IOC_MD5SUM_SZ 4
  285. struct bfi_ioc_image_hdr_s {
  286. u32 signature; /* constant signature */
  287. u8 asic_gen; /* asic generation */
  288. u8 asic_mode;
  289. u8 port0_mode; /* device mode for port 0 */
  290. u8 port1_mode; /* device mode for port 1 */
  291. u32 exec; /* exec vector */
  292. u32 bootenv; /* fimware boot env */
  293. u32 rsvd_b[4];
  294. u32 md5sum[BFI_IOC_MD5SUM_SZ];
  295. };
  296. #define BFI_FWBOOT_DEVMODE_OFF 4
  297. #define BFI_FWBOOT_TYPE_OFF 8
  298. #define BFI_FWBOOT_ENV_OFF 12
  299. #define BFI_FWBOOT_DEVMODE(__asic_gen, __asic_mode, __p0_mode, __p1_mode) \
  300. (((u32)(__asic_gen)) << 24 | \
  301. ((u32)(__asic_mode)) << 16 | \
  302. ((u32)(__p0_mode)) << 8 | \
  303. ((u32)(__p1_mode)))
  304. #define BFI_FWBOOT_TYPE_NORMAL 0
  305. #define BFI_FWBOOT_TYPE_MEMTEST 2
  306. #define BFI_FWBOOT_ENV_OS 0
  307. enum bfi_port_mode {
  308. BFI_PORT_MODE_FC = 1,
  309. BFI_PORT_MODE_ETH = 2,
  310. };
  311. struct bfi_ioc_hbeat_s {
  312. struct bfi_mhdr_s mh; /* common msg header */
  313. u32 hb_count; /* current heart beat count */
  314. };
  315. /*
  316. * IOC hardware/firmware state
  317. */
  318. enum bfi_ioc_state {
  319. BFI_IOC_UNINIT = 0, /* not initialized */
  320. BFI_IOC_INITING = 1, /* h/w is being initialized */
  321. BFI_IOC_HWINIT = 2, /* h/w is initialized */
  322. BFI_IOC_CFG = 3, /* IOC configuration in progress */
  323. BFI_IOC_OP = 4, /* IOC is operational */
  324. BFI_IOC_DISABLING = 5, /* IOC is being disabled */
  325. BFI_IOC_DISABLED = 6, /* IOC is disabled */
  326. BFI_IOC_CFG_DISABLED = 7, /* IOC is being disabled;transient */
  327. BFI_IOC_FAIL = 8, /* IOC heart-beat failure */
  328. BFI_IOC_MEMTEST = 9, /* IOC is doing memtest */
  329. };
  330. #define BFI_IOC_ENDIAN_SIG 0x12345678
  331. enum {
  332. BFI_ADAPTER_TYPE_FC = 0x01, /* FC adapters */
  333. BFI_ADAPTER_TYPE_MK = 0x0f0000, /* adapter type mask */
  334. BFI_ADAPTER_TYPE_SH = 16, /* adapter type shift */
  335. BFI_ADAPTER_NPORTS_MK = 0xff00, /* number of ports mask */
  336. BFI_ADAPTER_NPORTS_SH = 8, /* number of ports shift */
  337. BFI_ADAPTER_SPEED_MK = 0xff, /* adapter speed mask */
  338. BFI_ADAPTER_SPEED_SH = 0, /* adapter speed shift */
  339. BFI_ADAPTER_PROTO = 0x100000, /* prototype adapaters */
  340. BFI_ADAPTER_TTV = 0x200000, /* TTV debug capable */
  341. BFI_ADAPTER_UNSUPP = 0x400000, /* unknown adapter type */
  342. };
  343. #define BFI_ADAPTER_GETP(__prop, __adap_prop) \
  344. (((__adap_prop) & BFI_ADAPTER_ ## __prop ## _MK) >> \
  345. BFI_ADAPTER_ ## __prop ## _SH)
  346. #define BFI_ADAPTER_SETP(__prop, __val) \
  347. ((__val) << BFI_ADAPTER_ ## __prop ## _SH)
  348. #define BFI_ADAPTER_IS_PROTO(__adap_type) \
  349. ((__adap_type) & BFI_ADAPTER_PROTO)
  350. #define BFI_ADAPTER_IS_TTV(__adap_type) \
  351. ((__adap_type) & BFI_ADAPTER_TTV)
  352. #define BFI_ADAPTER_IS_UNSUPP(__adap_type) \
  353. ((__adap_type) & BFI_ADAPTER_UNSUPP)
  354. #define BFI_ADAPTER_IS_SPECIAL(__adap_type) \
  355. ((__adap_type) & (BFI_ADAPTER_TTV | BFI_ADAPTER_PROTO | \
  356. BFI_ADAPTER_UNSUPP))
  357. /*
  358. * BFI_IOC_H2I_ENABLE_REQ & BFI_IOC_H2I_DISABLE_REQ messages
  359. */
  360. struct bfi_ioc_ctrl_req_s {
  361. struct bfi_mhdr_s mh;
  362. u16 clscode;
  363. u16 rsvd;
  364. u32 tv_sec;
  365. };
  366. #define bfi_ioc_enable_req_t struct bfi_ioc_ctrl_req_s;
  367. #define bfi_ioc_disable_req_t struct bfi_ioc_ctrl_req_s;
  368. /*
  369. * BFI_IOC_I2H_ENABLE_REPLY & BFI_IOC_I2H_DISABLE_REPLY messages
  370. */
  371. struct bfi_ioc_ctrl_reply_s {
  372. struct bfi_mhdr_s mh; /* Common msg header */
  373. u8 status; /* enable/disable status */
  374. u8 port_mode; /* bfa_mode_s */
  375. u8 cap_bm; /* capability bit mask */
  376. u8 rsvd;
  377. };
  378. #define bfi_ioc_enable_reply_t struct bfi_ioc_ctrl_reply_s;
  379. #define bfi_ioc_disable_reply_t struct bfi_ioc_ctrl_reply_s;
  380. #define BFI_IOC_MSGSZ 8
  381. /*
  382. * H2I Messages
  383. */
  384. union bfi_ioc_h2i_msg_u {
  385. struct bfi_mhdr_s mh;
  386. struct bfi_ioc_ctrl_req_s enable_req;
  387. struct bfi_ioc_ctrl_req_s disable_req;
  388. struct bfi_ioc_getattr_req_s getattr_req;
  389. u32 mboxmsg[BFI_IOC_MSGSZ];
  390. };
  391. /*
  392. * I2H Messages
  393. */
  394. union bfi_ioc_i2h_msg_u {
  395. struct bfi_mhdr_s mh;
  396. struct bfi_ioc_ctrl_reply_s fw_event;
  397. u32 mboxmsg[BFI_IOC_MSGSZ];
  398. };
  399. /*
  400. *----------------------------------------------------------------------
  401. * PBC
  402. *----------------------------------------------------------------------
  403. */
  404. #define BFI_PBC_MAX_BLUNS 8
  405. #define BFI_PBC_MAX_VPORTS 16
  406. #define BFI_PBC_PORT_DISABLED 2
  407. /*
  408. * PBC boot lun configuration
  409. */
  410. struct bfi_pbc_blun_s {
  411. wwn_t tgt_pwwn;
  412. struct scsi_lun tgt_lun;
  413. };
  414. /*
  415. * PBC virtual port configuration
  416. */
  417. struct bfi_pbc_vport_s {
  418. wwn_t vp_pwwn;
  419. wwn_t vp_nwwn;
  420. };
  421. /*
  422. * BFI pre-boot configuration information
  423. */
  424. struct bfi_pbc_s {
  425. u8 port_enabled;
  426. u8 boot_enabled;
  427. u8 nbluns;
  428. u8 nvports;
  429. u8 port_speed;
  430. u8 rsvd_a;
  431. u16 hss;
  432. wwn_t pbc_pwwn;
  433. wwn_t pbc_nwwn;
  434. struct bfi_pbc_blun_s blun[BFI_PBC_MAX_BLUNS];
  435. struct bfi_pbc_vport_s vport[BFI_PBC_MAX_VPORTS];
  436. };
  437. /*
  438. *----------------------------------------------------------------------
  439. * MSGQ
  440. *----------------------------------------------------------------------
  441. */
  442. #define BFI_MSGQ_FULL(_q) (((_q->pi + 1) % _q->q_depth) == _q->ci)
  443. #define BFI_MSGQ_EMPTY(_q) (_q->pi == _q->ci)
  444. #define BFI_MSGQ_UPDATE_CI(_q) (_q->ci = (_q->ci + 1) % _q->q_depth)
  445. #define BFI_MSGQ_UPDATE_PI(_q) (_q->pi = (_q->pi + 1) % _q->q_depth)
  446. /* q_depth must be power of 2 */
  447. #define BFI_MSGQ_FREE_CNT(_q) ((_q->ci - _q->pi - 1) & (_q->q_depth - 1))
  448. enum bfi_msgq_h2i_msgs_e {
  449. BFI_MSGQ_H2I_INIT_REQ = 1,
  450. BFI_MSGQ_H2I_DOORBELL = 2,
  451. BFI_MSGQ_H2I_SHUTDOWN = 3,
  452. };
  453. enum bfi_msgq_i2h_msgs_e {
  454. BFI_MSGQ_I2H_INIT_RSP = 1,
  455. BFI_MSGQ_I2H_DOORBELL = 2,
  456. };
  457. /* Messages(commands/responsed/AENS will have the following header */
  458. struct bfi_msgq_mhdr_s {
  459. u8 msg_class;
  460. u8 msg_id;
  461. u16 msg_token;
  462. u16 num_entries;
  463. u8 enet_id;
  464. u8 rsvd[1];
  465. };
  466. #define bfi_msgq_mhdr_set(_mh, _mc, _mid, _tok, _enet_id) do { \
  467. (_mh).msg_class = (_mc); \
  468. (_mh).msg_id = (_mid); \
  469. (_mh).msg_token = (_tok); \
  470. (_mh).enet_id = (_enet_id); \
  471. } while (0)
  472. /*
  473. * Mailbox for messaging interface
  474. *
  475. */
  476. #define BFI_MSGQ_CMD_ENTRY_SIZE (64) /* TBD */
  477. #define BFI_MSGQ_RSP_ENTRY_SIZE (64) /* TBD */
  478. #define BFI_MSGQ_MSG_SIZE_MAX (2048) /* TBD */
  479. struct bfi_msgq_s {
  480. union bfi_addr_u addr;
  481. u16 q_depth; /* Total num of entries in the queue */
  482. u8 rsvd[2];
  483. };
  484. /* BFI_ENET_MSGQ_CFG_REQ TBD init or cfg? */
  485. struct bfi_msgq_cfg_req_s {
  486. struct bfi_mhdr_s mh;
  487. struct bfi_msgq_s cmdq;
  488. struct bfi_msgq_s rspq;
  489. };
  490. /* BFI_ENET_MSGQ_CFG_RSP */
  491. struct bfi_msgq_cfg_rsp_s {
  492. struct bfi_mhdr_s mh;
  493. u8 cmd_status;
  494. u8 rsvd[3];
  495. };
  496. /* BFI_MSGQ_H2I_DOORBELL */
  497. struct bfi_msgq_h2i_db_s {
  498. struct bfi_mhdr_s mh;
  499. u16 cmdq_pi;
  500. u16 rspq_ci;
  501. };
  502. /* BFI_MSGQ_I2H_DOORBELL */
  503. struct bfi_msgq_i2h_db_s {
  504. struct bfi_mhdr_s mh;
  505. u16 rspq_pi;
  506. u16 cmdq_ci;
  507. };
  508. #pragma pack()
  509. /* BFI port specific */
  510. #pragma pack(1)
  511. enum bfi_port_h2i {
  512. BFI_PORT_H2I_ENABLE_REQ = (1),
  513. BFI_PORT_H2I_DISABLE_REQ = (2),
  514. BFI_PORT_H2I_GET_STATS_REQ = (3),
  515. BFI_PORT_H2I_CLEAR_STATS_REQ = (4),
  516. };
  517. enum bfi_port_i2h {
  518. BFI_PORT_I2H_ENABLE_RSP = BFA_I2HM(1),
  519. BFI_PORT_I2H_DISABLE_RSP = BFA_I2HM(2),
  520. BFI_PORT_I2H_GET_STATS_RSP = BFA_I2HM(3),
  521. BFI_PORT_I2H_CLEAR_STATS_RSP = BFA_I2HM(4),
  522. };
  523. /*
  524. * Generic REQ type
  525. */
  526. struct bfi_port_generic_req_s {
  527. struct bfi_mhdr_s mh; /* msg header */
  528. u32 msgtag; /* msgtag for reply */
  529. u32 rsvd;
  530. };
  531. /*
  532. * Generic RSP type
  533. */
  534. struct bfi_port_generic_rsp_s {
  535. struct bfi_mhdr_s mh; /* common msg header */
  536. u8 status; /* port enable status */
  537. u8 rsvd[3];
  538. u32 msgtag; /* msgtag for reply */
  539. };
  540. /*
  541. * BFI_PORT_H2I_GET_STATS_REQ
  542. */
  543. struct bfi_port_get_stats_req_s {
  544. struct bfi_mhdr_s mh; /* common msg header */
  545. union bfi_addr_u dma_addr;
  546. };
  547. union bfi_port_h2i_msg_u {
  548. struct bfi_mhdr_s mh;
  549. struct bfi_port_generic_req_s enable_req;
  550. struct bfi_port_generic_req_s disable_req;
  551. struct bfi_port_get_stats_req_s getstats_req;
  552. struct bfi_port_generic_req_s clearstats_req;
  553. };
  554. union bfi_port_i2h_msg_u {
  555. struct bfi_mhdr_s mh;
  556. struct bfi_port_generic_rsp_s enable_rsp;
  557. struct bfi_port_generic_rsp_s disable_rsp;
  558. struct bfi_port_generic_rsp_s getstats_rsp;
  559. struct bfi_port_generic_rsp_s clearstats_rsp;
  560. };
  561. /*
  562. *----------------------------------------------------------------------
  563. * ABLK
  564. *----------------------------------------------------------------------
  565. */
  566. enum bfi_ablk_h2i_msgs_e {
  567. BFI_ABLK_H2I_QUERY = 1,
  568. BFI_ABLK_H2I_ADPT_CONFIG = 2,
  569. BFI_ABLK_H2I_PORT_CONFIG = 3,
  570. BFI_ABLK_H2I_PF_CREATE = 4,
  571. BFI_ABLK_H2I_PF_DELETE = 5,
  572. BFI_ABLK_H2I_PF_UPDATE = 6,
  573. BFI_ABLK_H2I_OPTROM_ENABLE = 7,
  574. BFI_ABLK_H2I_OPTROM_DISABLE = 8,
  575. };
  576. enum bfi_ablk_i2h_msgs_e {
  577. BFI_ABLK_I2H_QUERY = BFA_I2HM(BFI_ABLK_H2I_QUERY),
  578. BFI_ABLK_I2H_ADPT_CONFIG = BFA_I2HM(BFI_ABLK_H2I_ADPT_CONFIG),
  579. BFI_ABLK_I2H_PORT_CONFIG = BFA_I2HM(BFI_ABLK_H2I_PORT_CONFIG),
  580. BFI_ABLK_I2H_PF_CREATE = BFA_I2HM(BFI_ABLK_H2I_PF_CREATE),
  581. BFI_ABLK_I2H_PF_DELETE = BFA_I2HM(BFI_ABLK_H2I_PF_DELETE),
  582. BFI_ABLK_I2H_PF_UPDATE = BFA_I2HM(BFI_ABLK_H2I_PF_UPDATE),
  583. BFI_ABLK_I2H_OPTROM_ENABLE = BFA_I2HM(BFI_ABLK_H2I_OPTROM_ENABLE),
  584. BFI_ABLK_I2H_OPTROM_DISABLE = BFA_I2HM(BFI_ABLK_H2I_OPTROM_DISABLE),
  585. };
  586. /* BFI_ABLK_H2I_QUERY */
  587. struct bfi_ablk_h2i_query_s {
  588. struct bfi_mhdr_s mh;
  589. union bfi_addr_u addr;
  590. };
  591. /* BFI_ABL_H2I_ADPT_CONFIG, BFI_ABLK_H2I_PORT_CONFIG */
  592. struct bfi_ablk_h2i_cfg_req_s {
  593. struct bfi_mhdr_s mh;
  594. u8 mode;
  595. u8 port;
  596. u8 max_pf;
  597. u8 max_vf;
  598. };
  599. /*
  600. * BFI_ABLK_H2I_PF_CREATE, BFI_ABLK_H2I_PF_DELETE,
  601. */
  602. struct bfi_ablk_h2i_pf_req_s {
  603. struct bfi_mhdr_s mh;
  604. u8 pcifn;
  605. u8 port;
  606. u16 pers;
  607. u32 bw;
  608. };
  609. /* BFI_ABLK_H2I_OPTROM_ENABLE, BFI_ABLK_H2I_OPTROM_DISABLE */
  610. struct bfi_ablk_h2i_optrom_s {
  611. struct bfi_mhdr_s mh;
  612. };
  613. /*
  614. * BFI_ABLK_I2H_QUERY
  615. * BFI_ABLK_I2H_PORT_CONFIG
  616. * BFI_ABLK_I2H_PF_CREATE
  617. * BFI_ABLK_I2H_PF_DELETE
  618. * BFI_ABLK_I2H_PF_UPDATE
  619. * BFI_ABLK_I2H_OPTROM_ENABLE
  620. * BFI_ABLK_I2H_OPTROM_DISABLE
  621. */
  622. struct bfi_ablk_i2h_rsp_s {
  623. struct bfi_mhdr_s mh;
  624. u8 status;
  625. u8 pcifn;
  626. u8 port_mode;
  627. };
  628. /*
  629. * CEE module specific messages
  630. */
  631. /* Mailbox commands from host to firmware */
  632. enum bfi_cee_h2i_msgs_e {
  633. BFI_CEE_H2I_GET_CFG_REQ = 1,
  634. BFI_CEE_H2I_RESET_STATS = 2,
  635. BFI_CEE_H2I_GET_STATS_REQ = 3,
  636. };
  637. enum bfi_cee_i2h_msgs_e {
  638. BFI_CEE_I2H_GET_CFG_RSP = BFA_I2HM(1),
  639. BFI_CEE_I2H_RESET_STATS_RSP = BFA_I2HM(2),
  640. BFI_CEE_I2H_GET_STATS_RSP = BFA_I2HM(3),
  641. };
  642. /*
  643. * H2I command structure for resetting the stats
  644. */
  645. struct bfi_cee_reset_stats_s {
  646. struct bfi_mhdr_s mh;
  647. };
  648. /*
  649. * Get configuration command from host
  650. */
  651. struct bfi_cee_get_req_s {
  652. struct bfi_mhdr_s mh;
  653. union bfi_addr_u dma_addr;
  654. };
  655. /*
  656. * Reply message from firmware
  657. */
  658. struct bfi_cee_get_rsp_s {
  659. struct bfi_mhdr_s mh;
  660. u8 cmd_status;
  661. u8 rsvd[3];
  662. };
  663. /*
  664. * Reply message from firmware
  665. */
  666. struct bfi_cee_stats_rsp_s {
  667. struct bfi_mhdr_s mh;
  668. u8 cmd_status;
  669. u8 rsvd[3];
  670. };
  671. /* Mailbox message structures from firmware to host */
  672. union bfi_cee_i2h_msg_u {
  673. struct bfi_mhdr_s mh;
  674. struct bfi_cee_get_rsp_s get_rsp;
  675. struct bfi_cee_stats_rsp_s stats_rsp;
  676. };
  677. /*
  678. * SFP related
  679. */
  680. enum bfi_sfp_h2i_e {
  681. BFI_SFP_H2I_SHOW = 1,
  682. BFI_SFP_H2I_SCN = 2,
  683. };
  684. enum bfi_sfp_i2h_e {
  685. BFI_SFP_I2H_SHOW = BFA_I2HM(BFI_SFP_H2I_SHOW),
  686. BFI_SFP_I2H_SCN = BFA_I2HM(BFI_SFP_H2I_SCN),
  687. };
  688. /*
  689. * SFP state change notification
  690. */
  691. struct bfi_sfp_scn_s {
  692. struct bfi_mhdr_s mhr; /* host msg header */
  693. u8 event;
  694. u8 sfpid;
  695. u8 pomlvl; /* pom level: normal/warning/alarm */
  696. u8 is_elb; /* e-loopback */
  697. };
  698. /*
  699. * SFP state
  700. */
  701. enum bfa_sfp_stat_e {
  702. BFA_SFP_STATE_INIT = 0, /* SFP state is uninit */
  703. BFA_SFP_STATE_REMOVED = 1, /* SFP is removed */
  704. BFA_SFP_STATE_INSERTED = 2, /* SFP is inserted */
  705. BFA_SFP_STATE_VALID = 3, /* SFP is valid */
  706. BFA_SFP_STATE_UNSUPPORT = 4, /* SFP is unsupport */
  707. BFA_SFP_STATE_FAILED = 5, /* SFP i2c read fail */
  708. };
  709. /*
  710. * SFP memory access type
  711. */
  712. enum bfi_sfp_mem_e {
  713. BFI_SFP_MEM_ALL = 0x1, /* access all data field */
  714. BFI_SFP_MEM_DIAGEXT = 0x2, /* access diag ext data field only */
  715. };
  716. struct bfi_sfp_req_s {
  717. struct bfi_mhdr_s mh;
  718. u8 memtype;
  719. u8 rsvd[3];
  720. struct bfi_alen_s alen;
  721. };
  722. struct bfi_sfp_rsp_s {
  723. struct bfi_mhdr_s mh;
  724. u8 status;
  725. u8 state;
  726. u8 rsvd[2];
  727. };
  728. /*
  729. * FLASH module specific
  730. */
  731. enum bfi_flash_h2i_msgs {
  732. BFI_FLASH_H2I_QUERY_REQ = 1,
  733. BFI_FLASH_H2I_ERASE_REQ = 2,
  734. BFI_FLASH_H2I_WRITE_REQ = 3,
  735. BFI_FLASH_H2I_READ_REQ = 4,
  736. BFI_FLASH_H2I_BOOT_VER_REQ = 5,
  737. };
  738. enum bfi_flash_i2h_msgs {
  739. BFI_FLASH_I2H_QUERY_RSP = BFA_I2HM(1),
  740. BFI_FLASH_I2H_ERASE_RSP = BFA_I2HM(2),
  741. BFI_FLASH_I2H_WRITE_RSP = BFA_I2HM(3),
  742. BFI_FLASH_I2H_READ_RSP = BFA_I2HM(4),
  743. BFI_FLASH_I2H_BOOT_VER_RSP = BFA_I2HM(5),
  744. BFI_FLASH_I2H_EVENT = BFA_I2HM(127),
  745. };
  746. /*
  747. * Flash query request
  748. */
  749. struct bfi_flash_query_req_s {
  750. struct bfi_mhdr_s mh; /* Common msg header */
  751. struct bfi_alen_s alen;
  752. };
  753. /*
  754. * Flash erase request
  755. */
  756. struct bfi_flash_erase_req_s {
  757. struct bfi_mhdr_s mh; /* Common msg header */
  758. u32 type; /* partition type */
  759. u8 instance; /* partition instance */
  760. u8 rsv[3];
  761. };
  762. /*
  763. * Flash write request
  764. */
  765. struct bfi_flash_write_req_s {
  766. struct bfi_mhdr_s mh; /* Common msg header */
  767. struct bfi_alen_s alen;
  768. u32 type; /* partition type */
  769. u8 instance; /* partition instance */
  770. u8 last;
  771. u8 rsv[2];
  772. u32 offset;
  773. u32 length;
  774. };
  775. /*
  776. * Flash read request
  777. */
  778. struct bfi_flash_read_req_s {
  779. struct bfi_mhdr_s mh; /* Common msg header */
  780. u32 type; /* partition type */
  781. u8 instance; /* partition instance */
  782. u8 rsv[3];
  783. u32 offset;
  784. u32 length;
  785. struct bfi_alen_s alen;
  786. };
  787. /*
  788. * Flash query response
  789. */
  790. struct bfi_flash_query_rsp_s {
  791. struct bfi_mhdr_s mh; /* Common msg header */
  792. u32 status;
  793. };
  794. /*
  795. * Flash read response
  796. */
  797. struct bfi_flash_read_rsp_s {
  798. struct bfi_mhdr_s mh; /* Common msg header */
  799. u32 type; /* partition type */
  800. u8 instance; /* partition instance */
  801. u8 rsv[3];
  802. u32 status;
  803. u32 length;
  804. };
  805. /*
  806. * Flash write response
  807. */
  808. struct bfi_flash_write_rsp_s {
  809. struct bfi_mhdr_s mh; /* Common msg header */
  810. u32 type; /* partition type */
  811. u8 instance; /* partition instance */
  812. u8 rsv[3];
  813. u32 status;
  814. u32 length;
  815. };
  816. /*
  817. * Flash erase response
  818. */
  819. struct bfi_flash_erase_rsp_s {
  820. struct bfi_mhdr_s mh; /* Common msg header */
  821. u32 type; /* partition type */
  822. u8 instance; /* partition instance */
  823. u8 rsv[3];
  824. u32 status;
  825. };
  826. /*
  827. * Flash event notification
  828. */
  829. struct bfi_flash_event_s {
  830. struct bfi_mhdr_s mh; /* Common msg header */
  831. bfa_status_t status;
  832. u32 param;
  833. };
  834. /*
  835. *----------------------------------------------------------------------
  836. * DIAG
  837. *----------------------------------------------------------------------
  838. */
  839. enum bfi_diag_h2i {
  840. BFI_DIAG_H2I_PORTBEACON = 1,
  841. BFI_DIAG_H2I_LOOPBACK = 2,
  842. BFI_DIAG_H2I_FWPING = 3,
  843. BFI_DIAG_H2I_TEMPSENSOR = 4,
  844. BFI_DIAG_H2I_LEDTEST = 5,
  845. BFI_DIAG_H2I_QTEST = 6,
  846. BFI_DIAG_H2I_DPORT = 7,
  847. };
  848. enum bfi_diag_i2h {
  849. BFI_DIAG_I2H_PORTBEACON = BFA_I2HM(BFI_DIAG_H2I_PORTBEACON),
  850. BFI_DIAG_I2H_LOOPBACK = BFA_I2HM(BFI_DIAG_H2I_LOOPBACK),
  851. BFI_DIAG_I2H_FWPING = BFA_I2HM(BFI_DIAG_H2I_FWPING),
  852. BFI_DIAG_I2H_TEMPSENSOR = BFA_I2HM(BFI_DIAG_H2I_TEMPSENSOR),
  853. BFI_DIAG_I2H_LEDTEST = BFA_I2HM(BFI_DIAG_H2I_LEDTEST),
  854. BFI_DIAG_I2H_QTEST = BFA_I2HM(BFI_DIAG_H2I_QTEST),
  855. BFI_DIAG_I2H_DPORT = BFA_I2HM(BFI_DIAG_H2I_DPORT),
  856. };
  857. #define BFI_DIAG_MAX_SGES 2
  858. #define BFI_DIAG_DMA_BUF_SZ (2 * 1024)
  859. #define BFI_BOOT_MEMTEST_RES_ADDR 0x900
  860. #define BFI_BOOT_MEMTEST_RES_SIG 0xA0A1A2A3
  861. struct bfi_diag_lb_req_s {
  862. struct bfi_mhdr_s mh;
  863. u32 loopcnt;
  864. u32 pattern;
  865. u8 lb_mode; /*!< bfa_port_opmode_t */
  866. u8 speed; /*!< bfa_port_speed_t */
  867. u8 rsvd[2];
  868. };
  869. struct bfi_diag_lb_rsp_s {
  870. struct bfi_mhdr_s mh; /* 4 bytes */
  871. struct bfa_diag_loopback_result_s res; /* 16 bytes */
  872. };
  873. struct bfi_diag_fwping_req_s {
  874. struct bfi_mhdr_s mh; /* 4 bytes */
  875. struct bfi_alen_s alen; /* 12 bytes */
  876. u32 data; /* user input data pattern */
  877. u32 count; /* user input dma count */
  878. u8 qtag; /* track CPE vc */
  879. u8 rsv[3];
  880. };
  881. struct bfi_diag_fwping_rsp_s {
  882. struct bfi_mhdr_s mh; /* 4 bytes */
  883. u32 data; /* user input data pattern */
  884. u8 qtag; /* track CPE vc */
  885. u8 dma_status; /* dma status */
  886. u8 rsv[2];
  887. };
  888. /*
  889. * Temperature Sensor
  890. */
  891. struct bfi_diag_ts_req_s {
  892. struct bfi_mhdr_s mh; /* 4 bytes */
  893. u16 temp; /* 10-bit A/D value */
  894. u16 brd_temp; /* 9-bit board temp */
  895. u8 status;
  896. u8 ts_junc; /* show junction tempsensor */
  897. u8 ts_brd; /* show board tempsensor */
  898. u8 rsv;
  899. };
  900. #define bfi_diag_ts_rsp_t struct bfi_diag_ts_req_s
  901. struct bfi_diag_ledtest_req_s {
  902. struct bfi_mhdr_s mh; /* 4 bytes */
  903. u8 cmd;
  904. u8 color;
  905. u8 portid;
  906. u8 led; /* bitmap of LEDs to be tested */
  907. u16 freq; /* no. of blinks every 10 secs */
  908. u8 rsv[2];
  909. };
  910. /* notify host led operation is done */
  911. struct bfi_diag_ledtest_rsp_s {
  912. struct bfi_mhdr_s mh; /* 4 bytes */
  913. };
  914. struct bfi_diag_portbeacon_req_s {
  915. struct bfi_mhdr_s mh; /* 4 bytes */
  916. u32 period; /* beaconing period */
  917. u8 beacon; /* 1: beacon on */
  918. u8 rsvd[3];
  919. };
  920. /* notify host the beacon is off */
  921. struct bfi_diag_portbeacon_rsp_s {
  922. struct bfi_mhdr_s mh; /* 4 bytes */
  923. };
  924. struct bfi_diag_qtest_req_s {
  925. struct bfi_mhdr_s mh; /* 4 bytes */
  926. u32 data[BFI_LMSG_PL_WSZ]; /* fill up tcm prefetch area */
  927. };
  928. #define bfi_diag_qtest_rsp_t struct bfi_diag_qtest_req_s
  929. /*
  930. * D-port test
  931. */
  932. enum bfi_dport_req {
  933. BFI_DPORT_DISABLE = 0, /* disable dport request */
  934. BFI_DPORT_ENABLE = 1, /* enable dport request */
  935. };
  936. struct bfi_diag_dport_req_s {
  937. struct bfi_mhdr_s mh; /* 4 bytes */
  938. u8 req; /* request 1: enable 0: disable */
  939. u8 status; /* reply status */
  940. u8 rsvd[2];
  941. u32 msgtag; /* msgtag for reply */
  942. };
  943. #define bfi_diag_dport_rsp_t struct bfi_diag_dport_req_s
  944. /*
  945. * PHY module specific
  946. */
  947. enum bfi_phy_h2i_msgs_e {
  948. BFI_PHY_H2I_QUERY_REQ = 1,
  949. BFI_PHY_H2I_STATS_REQ = 2,
  950. BFI_PHY_H2I_WRITE_REQ = 3,
  951. BFI_PHY_H2I_READ_REQ = 4,
  952. };
  953. enum bfi_phy_i2h_msgs_e {
  954. BFI_PHY_I2H_QUERY_RSP = BFA_I2HM(1),
  955. BFI_PHY_I2H_STATS_RSP = BFA_I2HM(2),
  956. BFI_PHY_I2H_WRITE_RSP = BFA_I2HM(3),
  957. BFI_PHY_I2H_READ_RSP = BFA_I2HM(4),
  958. };
  959. /*
  960. * External PHY query request
  961. */
  962. struct bfi_phy_query_req_s {
  963. struct bfi_mhdr_s mh; /* Common msg header */
  964. u8 instance;
  965. u8 rsv[3];
  966. struct bfi_alen_s alen;
  967. };
  968. /*
  969. * External PHY stats request
  970. */
  971. struct bfi_phy_stats_req_s {
  972. struct bfi_mhdr_s mh; /* Common msg header */
  973. u8 instance;
  974. u8 rsv[3];
  975. struct bfi_alen_s alen;
  976. };
  977. /*
  978. * External PHY write request
  979. */
  980. struct bfi_phy_write_req_s {
  981. struct bfi_mhdr_s mh; /* Common msg header */
  982. u8 instance;
  983. u8 last;
  984. u8 rsv[2];
  985. u32 offset;
  986. u32 length;
  987. struct bfi_alen_s alen;
  988. };
  989. /*
  990. * External PHY read request
  991. */
  992. struct bfi_phy_read_req_s {
  993. struct bfi_mhdr_s mh; /* Common msg header */
  994. u8 instance;
  995. u8 rsv[3];
  996. u32 offset;
  997. u32 length;
  998. struct bfi_alen_s alen;
  999. };
  1000. /*
  1001. * External PHY query response
  1002. */
  1003. struct bfi_phy_query_rsp_s {
  1004. struct bfi_mhdr_s mh; /* Common msg header */
  1005. u32 status;
  1006. };
  1007. /*
  1008. * External PHY stats response
  1009. */
  1010. struct bfi_phy_stats_rsp_s {
  1011. struct bfi_mhdr_s mh; /* Common msg header */
  1012. u32 status;
  1013. };
  1014. /*
  1015. * External PHY read response
  1016. */
  1017. struct bfi_phy_read_rsp_s {
  1018. struct bfi_mhdr_s mh; /* Common msg header */
  1019. u32 status;
  1020. u32 length;
  1021. };
  1022. /*
  1023. * External PHY write response
  1024. */
  1025. struct bfi_phy_write_rsp_s {
  1026. struct bfi_mhdr_s mh; /* Common msg header */
  1027. u32 status;
  1028. u32 length;
  1029. };
  1030. #pragma pack()
  1031. #endif /* __BFI_H__ */