mcdi.h 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /****************************************************************************
  3. * Driver for Solarflare network controllers and boards
  4. * Copyright 2008-2013 Solarflare Communications Inc.
  5. */
  6. #ifndef EFX_MCDI_H
  7. #define EFX_MCDI_H
  8. /**
  9. * enum efx_mcdi_state - MCDI request handling state
  10. * @MCDI_STATE_QUIESCENT: No pending MCDI requests. If the caller holds the
  11. * mcdi @iface_lock then they are able to move to %MCDI_STATE_RUNNING
  12. * @MCDI_STATE_RUNNING_SYNC: There is a synchronous MCDI request pending.
  13. * Only the thread that moved into this state is allowed to move out of it.
  14. * @MCDI_STATE_RUNNING_ASYNC: There is an asynchronous MCDI request pending.
  15. * @MCDI_STATE_PROXY_WAIT: An MCDI request has completed with a response that
  16. * indicates we must wait for a proxy try again message.
  17. * @MCDI_STATE_COMPLETED: An MCDI request has completed, but the owning thread
  18. * has not yet consumed the result. For all other threads, equivalent to
  19. * %MCDI_STATE_RUNNING.
  20. */
  21. enum efx_mcdi_state {
  22. MCDI_STATE_QUIESCENT,
  23. MCDI_STATE_RUNNING_SYNC,
  24. MCDI_STATE_RUNNING_ASYNC,
  25. MCDI_STATE_PROXY_WAIT,
  26. MCDI_STATE_COMPLETED,
  27. };
  28. /**
  29. * enum efx_mcdi_mode - MCDI transaction mode
  30. * @MCDI_MODE_POLL: poll for MCDI completion, until timeout
  31. * @MCDI_MODE_EVENTS: wait for an mcdi_event. On timeout, poll once
  32. * @MCDI_MODE_FAIL: we think MCDI is dead, so fail-fast all calls
  33. */
  34. enum efx_mcdi_mode {
  35. MCDI_MODE_POLL,
  36. MCDI_MODE_EVENTS,
  37. MCDI_MODE_FAIL,
  38. };
  39. /**
  40. * struct efx_mcdi_iface - MCDI protocol context
  41. * @efx: The associated NIC.
  42. * @state: Request handling state. Waited for by @wq.
  43. * @mode: Poll for mcdi completion, or wait for an mcdi_event.
  44. * @wq: Wait queue for threads waiting for @state != %MCDI_STATE_RUNNING
  45. * @new_epoch: Indicates start of day or start of MC reboot recovery
  46. * @iface_lock: Serialises access to @seqno, @credits and response metadata
  47. * @seqno: The next sequence number to use for mcdi requests.
  48. * @credits: Number of spurious MCDI completion events allowed before we
  49. * trigger a fatal error
  50. * @resprc: Response error/success code (Linux numbering)
  51. * @resp_hdr_len: Response header length
  52. * @resp_data_len: Response data (SDU or error) length
  53. * @async_lock: Serialises access to @async_list while event processing is
  54. * enabled
  55. * @async_list: Queue of asynchronous requests
  56. * @async_timer: Timer for asynchronous request timeout
  57. * @logging_buffer: buffer that may be used to build MCDI tracing messages
  58. * @logging_enabled: whether to trace MCDI
  59. * @proxy_rx_handle: Most recently received proxy authorisation handle
  60. * @proxy_rx_status: Status of most recent proxy authorisation
  61. * @proxy_rx_wq: Wait queue for updates to proxy_rx_handle
  62. */
  63. struct efx_mcdi_iface {
  64. struct efx_nic *efx;
  65. enum efx_mcdi_state state;
  66. enum efx_mcdi_mode mode;
  67. wait_queue_head_t wq;
  68. spinlock_t iface_lock;
  69. bool new_epoch;
  70. unsigned int credits;
  71. unsigned int seqno;
  72. int resprc;
  73. int resprc_raw;
  74. size_t resp_hdr_len;
  75. size_t resp_data_len;
  76. spinlock_t async_lock;
  77. struct list_head async_list;
  78. struct timer_list async_timer;
  79. #ifdef CONFIG_SFC_MCDI_LOGGING
  80. char *logging_buffer;
  81. bool logging_enabled;
  82. #endif
  83. unsigned int proxy_rx_handle;
  84. int proxy_rx_status;
  85. wait_queue_head_t proxy_rx_wq;
  86. };
  87. struct efx_mcdi_mon {
  88. struct efx_buffer dma_buf;
  89. struct mutex update_lock;
  90. unsigned long last_update;
  91. struct device *device;
  92. struct efx_mcdi_mon_attribute *attrs;
  93. struct attribute_group group;
  94. const struct attribute_group *groups[2];
  95. unsigned int n_attrs;
  96. };
  97. struct efx_mcdi_mtd_partition {
  98. struct efx_mtd_partition common;
  99. bool updating;
  100. u16 nvram_type;
  101. u16 fw_subtype;
  102. };
  103. #define to_efx_mcdi_mtd_partition(mtd) \
  104. container_of(mtd, struct efx_mcdi_mtd_partition, common.mtd)
  105. /**
  106. * struct efx_mcdi_data - extra state for NICs that implement MCDI
  107. * @iface: Interface/protocol state
  108. * @hwmon: Hardware monitor state
  109. * @fn_flags: Flags for this function, as returned by %MC_CMD_DRV_ATTACH.
  110. */
  111. struct efx_mcdi_data {
  112. struct efx_mcdi_iface iface;
  113. #ifdef CONFIG_SFC_MCDI_MON
  114. struct efx_mcdi_mon hwmon;
  115. #endif
  116. u32 fn_flags;
  117. };
  118. static inline struct efx_mcdi_iface *efx_mcdi(struct efx_nic *efx)
  119. {
  120. EFX_WARN_ON_PARANOID(!efx->mcdi);
  121. return &efx->mcdi->iface;
  122. }
  123. #ifdef CONFIG_SFC_MCDI_MON
  124. static inline struct efx_mcdi_mon *efx_mcdi_mon(struct efx_nic *efx)
  125. {
  126. EFX_WARN_ON_PARANOID(!efx->mcdi);
  127. return &efx->mcdi->hwmon;
  128. }
  129. #endif
  130. int efx_mcdi_init(struct efx_nic *efx);
  131. void efx_mcdi_detach(struct efx_nic *efx);
  132. void efx_mcdi_fini(struct efx_nic *efx);
  133. int efx_mcdi_rpc(struct efx_nic *efx, unsigned cmd, const efx_dword_t *inbuf,
  134. size_t inlen, efx_dword_t *outbuf, size_t outlen,
  135. size_t *outlen_actual);
  136. int efx_mcdi_rpc_quiet(struct efx_nic *efx, unsigned cmd,
  137. const efx_dword_t *inbuf, size_t inlen,
  138. efx_dword_t *outbuf, size_t outlen,
  139. size_t *outlen_actual);
  140. int efx_mcdi_rpc_start(struct efx_nic *efx, unsigned cmd,
  141. const efx_dword_t *inbuf, size_t inlen);
  142. int efx_mcdi_rpc_finish(struct efx_nic *efx, unsigned cmd, size_t inlen,
  143. efx_dword_t *outbuf, size_t outlen,
  144. size_t *outlen_actual);
  145. int efx_mcdi_rpc_finish_quiet(struct efx_nic *efx, unsigned cmd,
  146. size_t inlen, efx_dword_t *outbuf,
  147. size_t outlen, size_t *outlen_actual);
  148. typedef void efx_mcdi_async_completer(struct efx_nic *efx,
  149. unsigned long cookie, int rc,
  150. efx_dword_t *outbuf,
  151. size_t outlen_actual);
  152. int efx_mcdi_rpc_async(struct efx_nic *efx, unsigned int cmd,
  153. const efx_dword_t *inbuf, size_t inlen, size_t outlen,
  154. efx_mcdi_async_completer *complete,
  155. unsigned long cookie);
  156. int efx_mcdi_rpc_async_quiet(struct efx_nic *efx, unsigned int cmd,
  157. const efx_dword_t *inbuf, size_t inlen,
  158. size_t outlen,
  159. efx_mcdi_async_completer *complete,
  160. unsigned long cookie);
  161. void efx_mcdi_display_error(struct efx_nic *efx, unsigned cmd,
  162. size_t inlen, efx_dword_t *outbuf,
  163. size_t outlen, int rc);
  164. int efx_mcdi_poll_reboot(struct efx_nic *efx);
  165. void efx_mcdi_mode_poll(struct efx_nic *efx);
  166. void efx_mcdi_mode_event(struct efx_nic *efx);
  167. void efx_mcdi_flush_async(struct efx_nic *efx);
  168. void efx_mcdi_process_event(struct efx_channel *channel, efx_qword_t *event);
  169. void efx_mcdi_sensor_event(struct efx_nic *efx, efx_qword_t *ev);
  170. /* We expect that 16- and 32-bit fields in MCDI requests and responses
  171. * are appropriately aligned, but 64-bit fields are only
  172. * 32-bit-aligned. Also, on Siena we must copy to the MC shared
  173. * memory strictly 32 bits at a time, so add any necessary padding.
  174. */
  175. #define MCDI_TX_BUF_LEN(_len) DIV_ROUND_UP((_len), 4)
  176. #define _MCDI_DECLARE_BUF(_name, _len) \
  177. efx_dword_t _name[DIV_ROUND_UP(_len, 4)]
  178. #define MCDI_DECLARE_BUF(_name, _len) \
  179. _MCDI_DECLARE_BUF(_name, _len) = {{{0}}}
  180. #define MCDI_DECLARE_BUF_ERR(_name) \
  181. MCDI_DECLARE_BUF(_name, 8)
  182. #define _MCDI_PTR(_buf, _offset) \
  183. ((u8 *)(_buf) + (_offset))
  184. #define MCDI_PTR(_buf, _field) \
  185. _MCDI_PTR(_buf, MC_CMD_ ## _field ## _OFST)
  186. /* Use MCDI_STRUCT_ functions to access members of MCDI structuredefs.
  187. * _buf should point to the start of the structure, typically obtained with
  188. * MCDI_DECLARE_STRUCT_PTR(structure) = _MCDI_DWORD(mcdi_buf, FIELD_WHICH_IS_STRUCT);
  189. */
  190. #define MCDI_STRUCT_PTR(_buf, _field) \
  191. _MCDI_PTR(_buf, _field ## _OFST)
  192. #define _MCDI_CHECK_ALIGN(_ofst, _align) \
  193. ((_ofst) + BUILD_BUG_ON_ZERO((_ofst) & (_align - 1)))
  194. #define _MCDI_DWORD(_buf, _field) \
  195. ((_buf) + (_MCDI_CHECK_ALIGN(MC_CMD_ ## _field ## _OFST, 4) >> 2))
  196. #define _MCDI_STRUCT_DWORD(_buf, _field) \
  197. ((_buf) + (_MCDI_CHECK_ALIGN(_field ## _OFST, 4) >> 2))
  198. #define MCDI_STRUCT_SET_BYTE(_buf, _field, _value) do { \
  199. BUILD_BUG_ON(_field ## _LEN != 1); \
  200. *(u8 *)MCDI_STRUCT_PTR(_buf, _field) = _value; \
  201. } while (0)
  202. #define MCDI_BYTE(_buf, _field) \
  203. ((void)BUILD_BUG_ON_ZERO(MC_CMD_ ## _field ## _LEN != 1), \
  204. *MCDI_PTR(_buf, _field))
  205. #define MCDI_WORD(_buf, _field) \
  206. ((u16)BUILD_BUG_ON_ZERO(MC_CMD_ ## _field ## _LEN != 2) + \
  207. le16_to_cpu(*(__force const __le16 *)MCDI_PTR(_buf, _field)))
  208. #define MCDI_SET_DWORD(_buf, _field, _value) \
  209. EFX_POPULATE_DWORD_1(*_MCDI_DWORD(_buf, _field), EFX_DWORD_0, _value)
  210. #define MCDI_STRUCT_SET_DWORD(_buf, _field, _value) \
  211. EFX_POPULATE_DWORD_1(*_MCDI_STRUCT_DWORD(_buf, _field), EFX_DWORD_0, _value)
  212. #define MCDI_DWORD(_buf, _field) \
  213. EFX_DWORD_FIELD(*_MCDI_DWORD(_buf, _field), EFX_DWORD_0)
  214. #define MCDI_POPULATE_DWORD_1(_buf, _field, _name1, _value1) \
  215. EFX_POPULATE_DWORD_1(*_MCDI_DWORD(_buf, _field), \
  216. MC_CMD_ ## _name1, _value1)
  217. #define MCDI_POPULATE_DWORD_2(_buf, _field, _name1, _value1, \
  218. _name2, _value2) \
  219. EFX_POPULATE_DWORD_2(*_MCDI_DWORD(_buf, _field), \
  220. MC_CMD_ ## _name1, _value1, \
  221. MC_CMD_ ## _name2, _value2)
  222. #define MCDI_POPULATE_DWORD_3(_buf, _field, _name1, _value1, \
  223. _name2, _value2, _name3, _value3) \
  224. EFX_POPULATE_DWORD_3(*_MCDI_DWORD(_buf, _field), \
  225. MC_CMD_ ## _name1, _value1, \
  226. MC_CMD_ ## _name2, _value2, \
  227. MC_CMD_ ## _name3, _value3)
  228. #define MCDI_POPULATE_DWORD_4(_buf, _field, _name1, _value1, \
  229. _name2, _value2, _name3, _value3, \
  230. _name4, _value4) \
  231. EFX_POPULATE_DWORD_4(*_MCDI_DWORD(_buf, _field), \
  232. MC_CMD_ ## _name1, _value1, \
  233. MC_CMD_ ## _name2, _value2, \
  234. MC_CMD_ ## _name3, _value3, \
  235. MC_CMD_ ## _name4, _value4)
  236. #define MCDI_POPULATE_DWORD_5(_buf, _field, _name1, _value1, \
  237. _name2, _value2, _name3, _value3, \
  238. _name4, _value4, _name5, _value5) \
  239. EFX_POPULATE_DWORD_5(*_MCDI_DWORD(_buf, _field), \
  240. MC_CMD_ ## _name1, _value1, \
  241. MC_CMD_ ## _name2, _value2, \
  242. MC_CMD_ ## _name3, _value3, \
  243. MC_CMD_ ## _name4, _value4, \
  244. MC_CMD_ ## _name5, _value5)
  245. #define MCDI_POPULATE_DWORD_6(_buf, _field, _name1, _value1, \
  246. _name2, _value2, _name3, _value3, \
  247. _name4, _value4, _name5, _value5, \
  248. _name6, _value6) \
  249. EFX_POPULATE_DWORD_6(*_MCDI_DWORD(_buf, _field), \
  250. MC_CMD_ ## _name1, _value1, \
  251. MC_CMD_ ## _name2, _value2, \
  252. MC_CMD_ ## _name3, _value3, \
  253. MC_CMD_ ## _name4, _value4, \
  254. MC_CMD_ ## _name5, _value5, \
  255. MC_CMD_ ## _name6, _value6)
  256. #define MCDI_POPULATE_DWORD_7(_buf, _field, _name1, _value1, \
  257. _name2, _value2, _name3, _value3, \
  258. _name4, _value4, _name5, _value5, \
  259. _name6, _value6, _name7, _value7) \
  260. EFX_POPULATE_DWORD_7(*_MCDI_DWORD(_buf, _field), \
  261. MC_CMD_ ## _name1, _value1, \
  262. MC_CMD_ ## _name2, _value2, \
  263. MC_CMD_ ## _name3, _value3, \
  264. MC_CMD_ ## _name4, _value4, \
  265. MC_CMD_ ## _name5, _value5, \
  266. MC_CMD_ ## _name6, _value6, \
  267. MC_CMD_ ## _name7, _value7)
  268. #define MCDI_SET_QWORD(_buf, _field, _value) \
  269. do { \
  270. EFX_POPULATE_DWORD_1(_MCDI_DWORD(_buf, _field)[0], \
  271. EFX_DWORD_0, (u32)(_value)); \
  272. EFX_POPULATE_DWORD_1(_MCDI_DWORD(_buf, _field)[1], \
  273. EFX_DWORD_0, (u64)(_value) >> 32); \
  274. } while (0)
  275. #define MCDI_QWORD(_buf, _field) \
  276. (EFX_DWORD_FIELD(_MCDI_DWORD(_buf, _field)[0], EFX_DWORD_0) | \
  277. (u64)EFX_DWORD_FIELD(_MCDI_DWORD(_buf, _field)[1], EFX_DWORD_0) << 32)
  278. #define MCDI_FIELD(_ptr, _type, _field) \
  279. EFX_EXTRACT_DWORD( \
  280. *(efx_dword_t *) \
  281. _MCDI_PTR(_ptr, MC_CMD_ ## _type ## _ ## _field ## _OFST & ~3),\
  282. MC_CMD_ ## _type ## _ ## _field ## _LBN & 0x1f, \
  283. (MC_CMD_ ## _type ## _ ## _field ## _LBN & 0x1f) + \
  284. MC_CMD_ ## _type ## _ ## _field ## _WIDTH - 1)
  285. #define _MCDI_ARRAY_PTR(_buf, _field, _index, _align) \
  286. (_MCDI_PTR(_buf, _MCDI_CHECK_ALIGN(MC_CMD_ ## _field ## _OFST, _align))\
  287. + (_index) * _MCDI_CHECK_ALIGN(MC_CMD_ ## _field ## _LEN, _align))
  288. #define MCDI_DECLARE_STRUCT_PTR(_name) \
  289. efx_dword_t *_name
  290. #define MCDI_ARRAY_STRUCT_PTR(_buf, _field, _index) \
  291. ((efx_dword_t *)_MCDI_ARRAY_PTR(_buf, _field, _index, 4))
  292. #define MCDI_VAR_ARRAY_LEN(_len, _field) \
  293. min_t(size_t, MC_CMD_ ## _field ## _MAXNUM, \
  294. ((_len) - MC_CMD_ ## _field ## _OFST) / MC_CMD_ ## _field ## _LEN)
  295. #define MCDI_ARRAY_WORD(_buf, _field, _index) \
  296. (BUILD_BUG_ON_ZERO(MC_CMD_ ## _field ## _LEN != 2) + \
  297. le16_to_cpu(*(__force const __le16 *) \
  298. _MCDI_ARRAY_PTR(_buf, _field, _index, 2)))
  299. #define _MCDI_ARRAY_DWORD(_buf, _field, _index) \
  300. (BUILD_BUG_ON_ZERO(MC_CMD_ ## _field ## _LEN != 4) + \
  301. (efx_dword_t *)_MCDI_ARRAY_PTR(_buf, _field, _index, 4))
  302. #define MCDI_SET_ARRAY_DWORD(_buf, _field, _index, _value) \
  303. EFX_SET_DWORD_FIELD(*_MCDI_ARRAY_DWORD(_buf, _field, _index), \
  304. EFX_DWORD_0, _value)
  305. #define MCDI_ARRAY_DWORD(_buf, _field, _index) \
  306. EFX_DWORD_FIELD(*_MCDI_ARRAY_DWORD(_buf, _field, _index), EFX_DWORD_0)
  307. #define _MCDI_ARRAY_QWORD(_buf, _field, _index) \
  308. (BUILD_BUG_ON_ZERO(MC_CMD_ ## _field ## _LEN != 8) + \
  309. (efx_dword_t *)_MCDI_ARRAY_PTR(_buf, _field, _index, 4))
  310. #define MCDI_SET_ARRAY_QWORD(_buf, _field, _index, _value) \
  311. do { \
  312. EFX_SET_DWORD_FIELD(_MCDI_ARRAY_QWORD(_buf, _field, _index)[0],\
  313. EFX_DWORD_0, (u32)(_value)); \
  314. EFX_SET_DWORD_FIELD(_MCDI_ARRAY_QWORD(_buf, _field, _index)[1],\
  315. EFX_DWORD_0, (u64)(_value) >> 32); \
  316. } while (0)
  317. #define MCDI_ARRAY_FIELD(_buf, _field1, _type, _index, _field2) \
  318. MCDI_FIELD(MCDI_ARRAY_STRUCT_PTR(_buf, _field1, _index), \
  319. _type ## _TYPEDEF, _field2)
  320. #define MCDI_EVENT_FIELD(_ev, _field) \
  321. EFX_QWORD_FIELD(_ev, MCDI_EVENT_ ## _field)
  322. #define MCDI_CAPABILITY(field) \
  323. MC_CMD_GET_CAPABILITIES_V8_OUT_ ## field ## _LBN
  324. #define MCDI_CAPABILITY_OFST(field) \
  325. MC_CMD_GET_CAPABILITIES_V8_OUT_ ## field ## _OFST
  326. #define efx_has_cap(efx, field) \
  327. efx->type->check_caps(efx, \
  328. MCDI_CAPABILITY(field), \
  329. MCDI_CAPABILITY_OFST(field))
  330. void efx_mcdi_print_fwver(struct efx_nic *efx, char *buf, size_t len);
  331. int efx_mcdi_get_board_cfg(struct efx_nic *efx, u8 *mac_address,
  332. u16 *fw_subtype_list, u32 *capabilities);
  333. int efx_mcdi_log_ctrl(struct efx_nic *efx, bool evq, bool uart, u32 dest_evq);
  334. int efx_mcdi_nvram_types(struct efx_nic *efx, u32 *nvram_types_out);
  335. int efx_mcdi_nvram_info(struct efx_nic *efx, unsigned int type,
  336. size_t *size_out, size_t *erase_size_out,
  337. bool *protected_out);
  338. int efx_new_mcdi_nvram_test_all(struct efx_nic *efx);
  339. int efx_mcdi_nvram_test_all(struct efx_nic *efx);
  340. int efx_mcdi_handle_assertion(struct efx_nic *efx);
  341. int efx_mcdi_set_id_led(struct efx_nic *efx, enum efx_led_mode mode);
  342. int efx_mcdi_wol_filter_set_magic(struct efx_nic *efx, const u8 *mac,
  343. int *id_out);
  344. int efx_mcdi_wol_filter_get_magic(struct efx_nic *efx, int *id_out);
  345. int efx_mcdi_wol_filter_remove(struct efx_nic *efx, int id);
  346. int efx_mcdi_wol_filter_reset(struct efx_nic *efx);
  347. int efx_mcdi_flush_rxqs(struct efx_nic *efx);
  348. void efx_mcdi_process_link_change(struct efx_nic *efx, efx_qword_t *ev);
  349. void efx_mcdi_mac_start_stats(struct efx_nic *efx);
  350. void efx_mcdi_mac_stop_stats(struct efx_nic *efx);
  351. void efx_mcdi_mac_pull_stats(struct efx_nic *efx);
  352. enum reset_type efx_mcdi_map_reset_reason(enum reset_type reason);
  353. int efx_mcdi_reset(struct efx_nic *efx, enum reset_type method);
  354. int efx_mcdi_set_workaround(struct efx_nic *efx, u32 type, bool enabled,
  355. unsigned int *flags);
  356. int efx_mcdi_get_workarounds(struct efx_nic *efx, unsigned int *impl_out,
  357. unsigned int *enabled_out);
  358. int efx_mcdi_get_privilege_mask(struct efx_nic *efx, u32 *mask);
  359. #ifdef CONFIG_SFC_MCDI_MON
  360. int efx_mcdi_mon_probe(struct efx_nic *efx);
  361. void efx_mcdi_mon_remove(struct efx_nic *efx);
  362. #else
  363. static inline int efx_mcdi_mon_probe(struct efx_nic *efx) { return 0; }
  364. static inline void efx_mcdi_mon_remove(struct efx_nic *efx) {}
  365. #endif
  366. #ifdef CONFIG_SFC_MTD
  367. int efx_mcdi_mtd_read(struct mtd_info *mtd, loff_t start, size_t len,
  368. size_t *retlen, u8 *buffer);
  369. int efx_mcdi_mtd_erase(struct mtd_info *mtd, loff_t start, size_t len);
  370. int efx_mcdi_mtd_write(struct mtd_info *mtd, loff_t start, size_t len,
  371. size_t *retlen, const u8 *buffer);
  372. int efx_mcdi_mtd_sync(struct mtd_info *mtd);
  373. void efx_mcdi_mtd_rename(struct efx_mtd_partition *part);
  374. #endif
  375. #endif /* EFX_MCDI_H */