bfi.h 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * Linux network driver for QLogic BR-series Converged Network Adapter.
  4. */
  5. /*
  6. * Copyright (c) 2005-2014 Brocade Communications Systems, Inc.
  7. * Copyright (c) 2014-2015 QLogic Corporation
  8. * All rights reserved
  9. * www.qlogic.com
  10. */
  11. #ifndef __BFI_H__
  12. #define __BFI_H__
  13. #include "bfa_defs.h"
  14. /* BFI FW image type */
  15. #define BFI_FLASH_CHUNK_SZ 256 /*!< Flash chunk size */
  16. #define BFI_FLASH_CHUNK_SZ_WORDS (BFI_FLASH_CHUNK_SZ/sizeof(u32))
  17. #define BFI_FLASH_IMAGE_SZ 0x100000
  18. /* Msg header common to all msgs */
  19. struct bfi_mhdr {
  20. u8 msg_class; /*!< @ref enum bfi_mclass */
  21. u8 msg_id; /*!< msg opcode with in the class */
  22. union {
  23. struct {
  24. u8 qid;
  25. u8 fn_lpu; /*!< msg destination */
  26. } __packed h2i;
  27. u16 i2htok; /*!< token in msgs to host */
  28. } __packed mtag;
  29. } __packed;
  30. #define bfi_fn_lpu(__fn, __lpu) ((__fn) << 1 | (__lpu))
  31. #define bfi_mhdr_2_fn(_mh) ((_mh)->mtag.h2i.fn_lpu >> 1)
  32. #define bfi_mhdr_2_qid(_mh) ((_mh)->mtag.h2i.qid)
  33. #define bfi_h2i_set(_mh, _mc, _op, _fn_lpu) do { \
  34. (_mh).msg_class = (_mc); \
  35. (_mh).msg_id = (_op); \
  36. (_mh).mtag.h2i.fn_lpu = (_fn_lpu); \
  37. } while (0)
  38. #define bfi_i2h_set(_mh, _mc, _op, _i2htok) do { \
  39. (_mh).msg_class = (_mc); \
  40. (_mh).msg_id = (_op); \
  41. (_mh).mtag.i2htok = (_i2htok); \
  42. } while (0)
  43. /*
  44. * Message opcodes: 0-127 to firmware, 128-255 to host
  45. */
  46. #define BFI_I2H_OPCODE_BASE 128
  47. #define BFA_I2HM(_x) ((_x) + BFI_I2H_OPCODE_BASE)
  48. /****************************************************************************
  49. *
  50. * Scatter Gather Element and Page definition
  51. *
  52. ****************************************************************************
  53. */
  54. /* DMA addresses */
  55. union bfi_addr_u {
  56. struct {
  57. u32 addr_lo;
  58. u32 addr_hi;
  59. } __packed a32;
  60. } __packed;
  61. /* Generic DMA addr-len pair. */
  62. struct bfi_alen {
  63. union bfi_addr_u al_addr; /* DMA addr of buffer */
  64. u32 al_len; /* length of buffer */
  65. } __packed;
  66. /*
  67. * Large Message structure - 128 Bytes size Msgs
  68. */
  69. #define BFI_LMSG_SZ 128
  70. #define BFI_LMSG_PL_WSZ \
  71. ((BFI_LMSG_SZ - sizeof(struct bfi_mhdr)) / 4)
  72. /* Mailbox message structure */
  73. #define BFI_MBMSG_SZ 7
  74. struct bfi_mbmsg {
  75. struct bfi_mhdr mh;
  76. u32 pl[BFI_MBMSG_SZ];
  77. } __packed;
  78. /* Supported PCI function class codes (personality) */
  79. enum bfi_pcifn_class {
  80. BFI_PCIFN_CLASS_FC = 0x0c04,
  81. BFI_PCIFN_CLASS_ETH = 0x0200,
  82. };
  83. /* Message Classes */
  84. enum bfi_mclass {
  85. BFI_MC_IOC = 1, /*!< IO Controller (IOC) */
  86. BFI_MC_DIAG = 2, /*!< Diagnostic Msgs */
  87. BFI_MC_FLASH = 3, /*!< Flash message class */
  88. BFI_MC_CEE = 4, /*!< CEE */
  89. BFI_MC_FCPORT = 5, /*!< FC port */
  90. BFI_MC_IOCFC = 6, /*!< FC - IO Controller (IOC) */
  91. BFI_MC_LL = 7, /*!< Link Layer */
  92. BFI_MC_UF = 8, /*!< Unsolicited frame receive */
  93. BFI_MC_FCXP = 9, /*!< FC Transport */
  94. BFI_MC_LPS = 10, /*!< lport fc login services */
  95. BFI_MC_RPORT = 11, /*!< Remote port */
  96. BFI_MC_ITNIM = 12, /*!< I-T nexus (Initiator mode) */
  97. BFI_MC_IOIM_READ = 13, /*!< read IO (Initiator mode) */
  98. BFI_MC_IOIM_WRITE = 14, /*!< write IO (Initiator mode) */
  99. BFI_MC_IOIM_IO = 15, /*!< IO (Initiator mode) */
  100. BFI_MC_IOIM = 16, /*!< IO (Initiator mode) */
  101. BFI_MC_IOIM_IOCOM = 17, /*!< good IO completion */
  102. BFI_MC_TSKIM = 18, /*!< Initiator Task management */
  103. BFI_MC_SBOOT = 19, /*!< SAN boot services */
  104. BFI_MC_IPFC = 20, /*!< IP over FC Msgs */
  105. BFI_MC_PORT = 21, /*!< Physical port */
  106. BFI_MC_SFP = 22, /*!< SFP module */
  107. BFI_MC_MSGQ = 23, /*!< MSGQ */
  108. BFI_MC_ENET = 24, /*!< ENET commands/responses */
  109. BFI_MC_PHY = 25, /*!< External PHY message class */
  110. BFI_MC_NBOOT = 26, /*!< Network Boot */
  111. BFI_MC_TIO_READ = 27, /*!< read IO (Target mode) */
  112. BFI_MC_TIO_WRITE = 28, /*!< write IO (Target mode) */
  113. BFI_MC_TIO_DATA_XFERED = 29, /*!< ds transferred (target mode) */
  114. BFI_MC_TIO_IO = 30, /*!< IO (Target mode) */
  115. BFI_MC_TIO = 31, /*!< IO (target mode) */
  116. BFI_MC_MFG = 32, /*!< MFG/ASIC block commands */
  117. BFI_MC_EDMA = 33, /*!< EDMA copy commands */
  118. BFI_MC_MAX = 34
  119. };
  120. #define BFI_IOC_MSGLEN_MAX 32 /* 32 bytes */
  121. #define BFI_FWBOOT_ENV_OS 0
  122. /*----------------------------------------------------------------------
  123. * IOC
  124. *----------------------------------------------------------------------
  125. */
  126. /* Different asic generations */
  127. enum bfi_asic_gen {
  128. BFI_ASIC_GEN_CB = 1,
  129. BFI_ASIC_GEN_CT = 2,
  130. BFI_ASIC_GEN_CT2 = 3,
  131. };
  132. enum bfi_asic_mode {
  133. BFI_ASIC_MODE_FC = 1, /* FC up to 8G speed */
  134. BFI_ASIC_MODE_FC16 = 2, /* FC up to 16G speed */
  135. BFI_ASIC_MODE_ETH = 3, /* Ethernet ports */
  136. BFI_ASIC_MODE_COMBO = 4, /* FC 16G and Ethernet 10G port */
  137. };
  138. enum bfi_ioc_h2i_msgs {
  139. BFI_IOC_H2I_ENABLE_REQ = 1,
  140. BFI_IOC_H2I_DISABLE_REQ = 2,
  141. BFI_IOC_H2I_GETATTR_REQ = 3,
  142. BFI_IOC_H2I_DBG_SYNC = 4,
  143. BFI_IOC_H2I_DBG_DUMP = 5,
  144. };
  145. enum bfi_ioc_i2h_msgs {
  146. BFI_IOC_I2H_ENABLE_REPLY = BFA_I2HM(1),
  147. BFI_IOC_I2H_DISABLE_REPLY = BFA_I2HM(2),
  148. BFI_IOC_I2H_GETATTR_REPLY = BFA_I2HM(3),
  149. BFI_IOC_I2H_HBEAT = BFA_I2HM(4),
  150. };
  151. /* BFI_IOC_H2I_GETATTR_REQ message */
  152. struct bfi_ioc_getattr_req {
  153. struct bfi_mhdr mh;
  154. union bfi_addr_u attr_addr;
  155. } __packed;
  156. struct bfi_ioc_attr {
  157. u64 mfg_pwwn; /*!< Mfg port wwn */
  158. u64 mfg_nwwn; /*!< Mfg node wwn */
  159. u8 mfg_mac[ETH_ALEN]; /*!< Mfg mac */
  160. u8 port_mode; /* enum bfi_port_mode */
  161. u8 rsvd_a;
  162. u64 pwwn;
  163. u64 nwwn;
  164. u8 mac[ETH_ALEN]; /*!< PBC or Mfg mac */
  165. u16 rsvd_b;
  166. u8 fcoe_mac[ETH_ALEN];
  167. u16 rsvd_c;
  168. char brcd_serialnum[STRSZ(BFA_MFG_SERIALNUM_SIZE)];
  169. u8 pcie_gen;
  170. u8 pcie_lanes_orig;
  171. u8 pcie_lanes;
  172. u8 rx_bbcredit; /*!< receive buffer credits */
  173. u32 adapter_prop; /*!< adapter properties */
  174. u16 maxfrsize; /*!< max receive frame size */
  175. char asic_rev;
  176. u8 rsvd_d;
  177. char fw_version[BFA_VERSION_LEN];
  178. char optrom_version[BFA_VERSION_LEN];
  179. struct bfa_mfg_vpd vpd;
  180. u32 card_type; /*!< card type */
  181. } __packed;
  182. /* BFI_IOC_I2H_GETATTR_REPLY message */
  183. struct bfi_ioc_getattr_reply {
  184. struct bfi_mhdr mh; /*!< Common msg header */
  185. u8 status; /*!< cfg reply status */
  186. u8 rsvd[3];
  187. } __packed;
  188. /* Firmware memory page offsets */
  189. #define BFI_IOC_SMEM_PG0_CB (0x40)
  190. #define BFI_IOC_SMEM_PG0_CT (0x180)
  191. /* Firmware statistic offset */
  192. #define BFI_IOC_FWSTATS_OFF (0x6B40)
  193. #define BFI_IOC_FWSTATS_SZ (4096)
  194. /* Firmware trace offset */
  195. #define BFI_IOC_TRC_OFF (0x4b00)
  196. #define BFI_IOC_TRC_ENTS 256
  197. #define BFI_IOC_TRC_ENT_SZ 16
  198. #define BFI_IOC_TRC_HDR_SZ 32
  199. #define BFI_IOC_FW_SIGNATURE (0xbfadbfad)
  200. #define BFI_IOC_FW_INV_SIGN (0xdeaddead)
  201. #define BFI_IOC_MD5SUM_SZ 4
  202. struct bfi_ioc_fwver {
  203. #ifdef __BIG_ENDIAN
  204. u8 patch;
  205. u8 maint;
  206. u8 minor;
  207. u8 major;
  208. u8 rsvd[2];
  209. u8 build;
  210. u8 phase;
  211. #else
  212. u8 major;
  213. u8 minor;
  214. u8 maint;
  215. u8 patch;
  216. u8 phase;
  217. u8 build;
  218. u8 rsvd[2];
  219. #endif
  220. } __packed;
  221. struct bfi_ioc_image_hdr {
  222. u32 signature; /*!< constant signature */
  223. u8 asic_gen; /*!< asic generation */
  224. u8 asic_mode;
  225. u8 port0_mode; /*!< device mode for port 0 */
  226. u8 port1_mode; /*!< device mode for port 1 */
  227. u32 exec; /*!< exec vector */
  228. u32 bootenv; /*!< firmware boot env */
  229. u32 rsvd_b[2];
  230. struct bfi_ioc_fwver fwver;
  231. u32 md5sum[BFI_IOC_MD5SUM_SZ];
  232. } __packed;
  233. enum bfi_ioc_img_ver_cmp {
  234. BFI_IOC_IMG_VER_INCOMP,
  235. BFI_IOC_IMG_VER_OLD,
  236. BFI_IOC_IMG_VER_SAME,
  237. BFI_IOC_IMG_VER_BETTER
  238. };
  239. #define BFI_FWBOOT_DEVMODE_OFF 4
  240. #define BFI_FWBOOT_TYPE_OFF 8
  241. #define BFI_FWBOOT_ENV_OFF 12
  242. #define BFI_FWBOOT_DEVMODE(__asic_gen, __asic_mode, __p0_mode, __p1_mode) \
  243. (((u32)(__asic_gen)) << 24 | \
  244. ((u32)(__asic_mode)) << 16 | \
  245. ((u32)(__p0_mode)) << 8 | \
  246. ((u32)(__p1_mode)))
  247. enum bfi_fwboot_type {
  248. BFI_FWBOOT_TYPE_NORMAL = 0,
  249. BFI_FWBOOT_TYPE_FLASH = 1,
  250. BFI_FWBOOT_TYPE_MEMTEST = 2,
  251. };
  252. enum bfi_port_mode {
  253. BFI_PORT_MODE_FC = 1,
  254. BFI_PORT_MODE_ETH = 2,
  255. };
  256. struct bfi_ioc_hbeat {
  257. struct bfi_mhdr mh; /*!< common msg header */
  258. u32 hb_count; /*!< current heart beat count */
  259. } __packed;
  260. /* IOC hardware/firmware state */
  261. enum bfi_ioc_state {
  262. BFI_IOC_UNINIT = 0, /*!< not initialized */
  263. BFI_IOC_INITING = 1, /*!< h/w is being initialized */
  264. BFI_IOC_HWINIT = 2, /*!< h/w is initialized */
  265. BFI_IOC_CFG = 3, /*!< IOC configuration in progress */
  266. BFI_IOC_OP = 4, /*!< IOC is operational */
  267. BFI_IOC_DISABLING = 5, /*!< IOC is being disabled */
  268. BFI_IOC_DISABLED = 6, /*!< IOC is disabled */
  269. BFI_IOC_CFG_DISABLED = 7, /*!< IOC is being disabled;transient */
  270. BFI_IOC_FAIL = 8, /*!< IOC heart-beat failure */
  271. BFI_IOC_MEMTEST = 9, /*!< IOC is doing memtest */
  272. };
  273. enum {
  274. BFI_ADAPTER_TYPE_FC = 0x01, /*!< FC adapters */
  275. BFI_ADAPTER_TYPE_MK = 0x0f0000, /*!< adapter type mask */
  276. BFI_ADAPTER_TYPE_SH = 16, /*!< adapter type shift */
  277. BFI_ADAPTER_NPORTS_MK = 0xff00, /*!< number of ports mask */
  278. BFI_ADAPTER_NPORTS_SH = 8, /*!< number of ports shift */
  279. BFI_ADAPTER_SPEED_MK = 0xff, /*!< adapter speed mask */
  280. BFI_ADAPTER_SPEED_SH = 0, /*!< adapter speed shift */
  281. BFI_ADAPTER_PROTO = 0x100000, /*!< prototype adapaters */
  282. BFI_ADAPTER_TTV = 0x200000, /*!< TTV debug capable */
  283. BFI_ADAPTER_UNSUPP = 0x400000, /*!< unknown adapter type */
  284. };
  285. #define BFI_ADAPTER_GETP(__prop, __adap_prop) \
  286. (((__adap_prop) & BFI_ADAPTER_ ## __prop ## _MK) >> \
  287. BFI_ADAPTER_ ## __prop ## _SH)
  288. #define BFI_ADAPTER_SETP(__prop, __val) \
  289. ((__val) << BFI_ADAPTER_ ## __prop ## _SH)
  290. #define BFI_ADAPTER_IS_SPECIAL(__adap_type) \
  291. ((__adap_type) & (BFI_ADAPTER_TTV | BFI_ADAPTER_PROTO | \
  292. BFI_ADAPTER_UNSUPP))
  293. /* BFI_IOC_H2I_ENABLE_REQ & BFI_IOC_H2I_DISABLE_REQ messages */
  294. struct bfi_ioc_ctrl_req {
  295. struct bfi_mhdr mh;
  296. u16 clscode;
  297. u16 rsvd;
  298. u32 tv_sec;
  299. } __packed;
  300. /* BFI_IOC_I2H_ENABLE_REPLY & BFI_IOC_I2H_DISABLE_REPLY messages */
  301. struct bfi_ioc_ctrl_reply {
  302. struct bfi_mhdr mh; /*!< Common msg header */
  303. u8 status; /*!< enable/disable status */
  304. u8 port_mode; /*!< enum bfa_mode */
  305. u8 cap_bm; /*!< capability bit mask */
  306. u8 rsvd;
  307. } __packed;
  308. #define BFI_IOC_MSGSZ 8
  309. /* H2I Messages */
  310. union bfi_ioc_h2i_msg_u {
  311. struct bfi_mhdr mh;
  312. struct bfi_ioc_ctrl_req enable_req;
  313. struct bfi_ioc_ctrl_req disable_req;
  314. struct bfi_ioc_getattr_req getattr_req;
  315. u32 mboxmsg[BFI_IOC_MSGSZ];
  316. } __packed;
  317. /* I2H Messages */
  318. union bfi_ioc_i2h_msg_u {
  319. struct bfi_mhdr mh;
  320. struct bfi_ioc_ctrl_reply fw_event;
  321. u32 mboxmsg[BFI_IOC_MSGSZ];
  322. } __packed;
  323. /*----------------------------------------------------------------------
  324. * MSGQ
  325. *----------------------------------------------------------------------
  326. */
  327. enum bfi_msgq_h2i_msgs {
  328. BFI_MSGQ_H2I_INIT_REQ = 1,
  329. BFI_MSGQ_H2I_DOORBELL_PI = 2,
  330. BFI_MSGQ_H2I_DOORBELL_CI = 3,
  331. BFI_MSGQ_H2I_CMDQ_COPY_RSP = 4,
  332. };
  333. enum bfi_msgq_i2h_msgs {
  334. BFI_MSGQ_I2H_INIT_RSP = BFA_I2HM(BFI_MSGQ_H2I_INIT_REQ),
  335. BFI_MSGQ_I2H_DOORBELL_PI = BFA_I2HM(BFI_MSGQ_H2I_DOORBELL_PI),
  336. BFI_MSGQ_I2H_DOORBELL_CI = BFA_I2HM(BFI_MSGQ_H2I_DOORBELL_CI),
  337. BFI_MSGQ_I2H_CMDQ_COPY_REQ = BFA_I2HM(BFI_MSGQ_H2I_CMDQ_COPY_RSP),
  338. };
  339. /* Messages(commands/responsed/AENS will have the following header */
  340. struct bfi_msgq_mhdr {
  341. u8 msg_class;
  342. u8 msg_id;
  343. u16 msg_token;
  344. u16 num_entries;
  345. u8 enet_id;
  346. u8 rsvd;
  347. } __packed;
  348. #define bfi_msgq_mhdr_set(_mh, _mc, _mid, _tok, _enet_id) do { \
  349. (_mh).msg_class = (_mc); \
  350. (_mh).msg_id = (_mid); \
  351. (_mh).msg_token = (_tok); \
  352. (_mh).enet_id = (_enet_id); \
  353. } while (0)
  354. /*
  355. * Mailbox for messaging interface
  356. */
  357. #define BFI_MSGQ_CMD_ENTRY_SIZE (64) /* TBD */
  358. #define BFI_MSGQ_RSP_ENTRY_SIZE (64) /* TBD */
  359. #define bfi_msgq_num_cmd_entries(_size) \
  360. (((_size) + BFI_MSGQ_CMD_ENTRY_SIZE - 1) / BFI_MSGQ_CMD_ENTRY_SIZE)
  361. struct bfi_msgq {
  362. union bfi_addr_u addr;
  363. u16 q_depth; /* Total num of entries in the queue */
  364. u8 rsvd[2];
  365. } __packed;
  366. /* BFI_ENET_MSGQ_CFG_REQ TBD init or cfg? */
  367. struct bfi_msgq_cfg_req {
  368. struct bfi_mhdr mh;
  369. struct bfi_msgq cmdq;
  370. struct bfi_msgq rspq;
  371. } __packed;
  372. /* BFI_ENET_MSGQ_CFG_RSP */
  373. struct bfi_msgq_cfg_rsp {
  374. struct bfi_mhdr mh;
  375. u8 cmd_status;
  376. u8 rsvd[3];
  377. } __packed;
  378. /* BFI_MSGQ_H2I_DOORBELL */
  379. struct bfi_msgq_h2i_db {
  380. struct bfi_mhdr mh;
  381. union {
  382. u16 cmdq_pi;
  383. u16 rspq_ci;
  384. } __packed idx;
  385. } __packed;
  386. /* BFI_MSGQ_I2H_DOORBELL */
  387. struct bfi_msgq_i2h_db {
  388. struct bfi_mhdr mh;
  389. union {
  390. u16 rspq_pi;
  391. u16 cmdq_ci;
  392. } __packed idx;
  393. } __packed;
  394. #define BFI_CMD_COPY_SZ 28
  395. /* BFI_MSGQ_H2I_CMD_COPY_RSP */
  396. struct bfi_msgq_h2i_cmdq_copy_rsp {
  397. struct bfi_mhdr mh;
  398. u8 data[BFI_CMD_COPY_SZ];
  399. } __packed;
  400. /* BFI_MSGQ_I2H_CMD_COPY_REQ */
  401. struct bfi_msgq_i2h_cmdq_copy_req {
  402. struct bfi_mhdr mh;
  403. u16 offset;
  404. u16 len;
  405. } __packed;
  406. /*
  407. * FLASH module specific
  408. */
  409. enum bfi_flash_h2i_msgs {
  410. BFI_FLASH_H2I_QUERY_REQ = 1,
  411. BFI_FLASH_H2I_ERASE_REQ = 2,
  412. BFI_FLASH_H2I_WRITE_REQ = 3,
  413. BFI_FLASH_H2I_READ_REQ = 4,
  414. BFI_FLASH_H2I_BOOT_VER_REQ = 5,
  415. };
  416. enum bfi_flash_i2h_msgs {
  417. BFI_FLASH_I2H_QUERY_RSP = BFA_I2HM(1),
  418. BFI_FLASH_I2H_ERASE_RSP = BFA_I2HM(2),
  419. BFI_FLASH_I2H_WRITE_RSP = BFA_I2HM(3),
  420. BFI_FLASH_I2H_READ_RSP = BFA_I2HM(4),
  421. BFI_FLASH_I2H_BOOT_VER_RSP = BFA_I2HM(5),
  422. BFI_FLASH_I2H_EVENT = BFA_I2HM(127),
  423. };
  424. /*
  425. * Flash query request
  426. */
  427. struct bfi_flash_query_req {
  428. struct bfi_mhdr mh; /* Common msg header */
  429. struct bfi_alen alen;
  430. } __packed;
  431. /*
  432. * Flash write request
  433. */
  434. struct bfi_flash_write_req {
  435. struct bfi_mhdr mh; /* Common msg header */
  436. struct bfi_alen alen;
  437. u32 type; /* partition type */
  438. u8 instance; /* partition instance */
  439. u8 last;
  440. u8 rsv[2];
  441. u32 offset;
  442. u32 length;
  443. } __packed;
  444. /*
  445. * Flash read request
  446. */
  447. struct bfi_flash_read_req {
  448. struct bfi_mhdr mh; /* Common msg header */
  449. u32 type; /* partition type */
  450. u8 instance; /* partition instance */
  451. u8 rsv[3];
  452. u32 offset;
  453. u32 length;
  454. struct bfi_alen alen;
  455. } __packed;
  456. /*
  457. * Flash query response
  458. */
  459. struct bfi_flash_query_rsp {
  460. struct bfi_mhdr mh; /* Common msg header */
  461. u32 status;
  462. } __packed;
  463. /*
  464. * Flash read response
  465. */
  466. struct bfi_flash_read_rsp {
  467. struct bfi_mhdr mh; /* Common msg header */
  468. u32 type; /* partition type */
  469. u8 instance; /* partition instance */
  470. u8 rsv[3];
  471. u32 status;
  472. u32 length;
  473. } __packed;
  474. /*
  475. * Flash write response
  476. */
  477. struct bfi_flash_write_rsp {
  478. struct bfi_mhdr mh; /* Common msg header */
  479. u32 type; /* partition type */
  480. u8 instance; /* partition instance */
  481. u8 rsv[3];
  482. u32 status;
  483. u32 length;
  484. } __packed;
  485. #endif /* __BFI_H__ */