blob: d861628b7ee67fa5247b0fafec7fb4aa2a22f6ad [file] [log] [blame]
Ben Hutchingsafd4aea2009-11-29 15:15:25 +00001/****************************************************************************
Ben Hutchingsf7a6d2c2013-08-29 23:32:48 +01002 * Driver for Solarflare network controllers and boards
3 * Copyright 2008-2013 Solarflare Communications Inc.
Ben Hutchingsafd4aea2009-11-29 15:15:25 +00004 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 as published
7 * by the Free Software Foundation, incorporated herein by reference.
8 */
9
10#ifndef EFX_MCDI_H
11#define EFX_MCDI_H
12
13/**
Ben Hutchingsf76fe122012-10-26 17:53:11 +010014 * enum efx_mcdi_state - MCDI request handling state
Ben Hutchingsafd4aea2009-11-29 15:15:25 +000015 * @MCDI_STATE_QUIESCENT: No pending MCDI requests. If the caller holds the
Ben Hutchingsf76fe122012-10-26 17:53:11 +010016 * mcdi @iface_lock then they are able to move to %MCDI_STATE_RUNNING
Ben Hutchingscade7152013-08-27 23:12:31 +010017 * @MCDI_STATE_RUNNING_SYNC: There is a synchronous MCDI request pending.
18 * Only the thread that moved into this state is allowed to move out of it.
19 * @MCDI_STATE_RUNNING_ASYNC: There is an asynchronous MCDI request pending.
Ben Hutchingsafd4aea2009-11-29 15:15:25 +000020 * @MCDI_STATE_COMPLETED: An MCDI request has completed, but the owning thread
21 * has not yet consumed the result. For all other threads, equivalent to
Ben Hutchingsf76fe122012-10-26 17:53:11 +010022 * %MCDI_STATE_RUNNING.
Ben Hutchingsafd4aea2009-11-29 15:15:25 +000023 */
24enum efx_mcdi_state {
25 MCDI_STATE_QUIESCENT,
Ben Hutchingscade7152013-08-27 23:12:31 +010026 MCDI_STATE_RUNNING_SYNC,
27 MCDI_STATE_RUNNING_ASYNC,
Ben Hutchingsafd4aea2009-11-29 15:15:25 +000028 MCDI_STATE_COMPLETED,
29};
30
31enum efx_mcdi_mode {
32 MCDI_MODE_POLL,
33 MCDI_MODE_EVENTS,
34};
35
36/**
Ben Hutchingsf76fe122012-10-26 17:53:11 +010037 * struct efx_mcdi_iface - MCDI protocol context
Ben Hutchingscade7152013-08-27 23:12:31 +010038 * @efx: The associated NIC.
Ben Hutchingsf76fe122012-10-26 17:53:11 +010039 * @state: Request handling state. Waited for by @wq.
Ben Hutchingsafd4aea2009-11-29 15:15:25 +000040 * @mode: Poll for mcdi completion, or wait for an mcdi_event.
Ben Hutchingsf76fe122012-10-26 17:53:11 +010041 * @wq: Wait queue for threads waiting for @state != %MCDI_STATE_RUNNING
Daniel Pieczkod36a08b2013-06-20 11:40:07 +010042 * @new_epoch: Indicates start of day or start of MC reboot recovery
Ben Hutchingscade7152013-08-27 23:12:31 +010043 * @iface_lock: Serialises access to @seqno, @credits and response metadata
Ben Hutchingsafd4aea2009-11-29 15:15:25 +000044 * @seqno: The next sequence number to use for mcdi requests.
Ben Hutchingsafd4aea2009-11-29 15:15:25 +000045 * @credits: Number of spurious MCDI completion events allowed before we
Ben Hutchingsf76fe122012-10-26 17:53:11 +010046 * trigger a fatal error
Ben Hutchings5bc283e2012-10-08 21:43:00 +010047 * @resprc: Response error/success code (Linux numbering)
Ben Hutchingsdf2cd8a2012-09-19 00:56:18 +010048 * @resp_hdr_len: Response header length
49 * @resp_data_len: Response data (SDU or error) length
Ben Hutchingscade7152013-08-27 23:12:31 +010050 * @async_lock: Serialises access to @async_list while event processing is
51 * enabled
52 * @async_list: Queue of asynchronous requests
53 * @async_timer: Timer for asynchronous request timeout
Ben Hutchingsafd4aea2009-11-29 15:15:25 +000054 */
55struct efx_mcdi_iface {
Ben Hutchingscade7152013-08-27 23:12:31 +010056 struct efx_nic *efx;
Ben Hutchings251111d2013-08-27 23:04:29 +010057 enum efx_mcdi_state state;
Ben Hutchingsf76fe122012-10-26 17:53:11 +010058 enum efx_mcdi_mode mode;
Ben Hutchingsafd4aea2009-11-29 15:15:25 +000059 wait_queue_head_t wq;
60 spinlock_t iface_lock;
Daniel Pieczkod36a08b2013-06-20 11:40:07 +010061 bool new_epoch;
Ben Hutchingsafd4aea2009-11-29 15:15:25 +000062 unsigned int credits;
63 unsigned int seqno;
Ben Hutchings5bc283e2012-10-08 21:43:00 +010064 int resprc;
Ben Hutchingsdf2cd8a2012-09-19 00:56:18 +010065 size_t resp_hdr_len;
66 size_t resp_data_len;
Ben Hutchingscade7152013-08-27 23:12:31 +010067 spinlock_t async_lock;
68 struct list_head async_list;
69 struct timer_list async_timer;
Ben Hutchingsafd4aea2009-11-29 15:15:25 +000070};
71
Ben Hutchings55c5e0f82012-01-06 20:25:39 +000072struct efx_mcdi_mon {
73 struct efx_buffer dma_buf;
74 struct mutex update_lock;
75 unsigned long last_update;
76 struct device *device;
77 struct efx_mcdi_mon_attribute *attrs;
Guenter Roeck85493e62013-11-27 18:54:31 -080078 struct attribute_group group;
79 const struct attribute_group *groups[2];
Ben Hutchings55c5e0f82012-01-06 20:25:39 +000080 unsigned int n_attrs;
81};
82
Ben Hutchings45a3fd52012-11-28 04:38:14 +000083struct efx_mcdi_mtd_partition {
84 struct efx_mtd_partition common;
85 bool updating;
Ben Hutchings8127d662013-08-29 19:19:29 +010086 u16 nvram_type;
Ben Hutchings45a3fd52012-11-28 04:38:14 +000087 u16 fw_subtype;
88};
89
90#define to_efx_mcdi_mtd_partition(mtd) \
91 container_of(mtd, struct efx_mcdi_mtd_partition, common.mtd)
92
Ben Hutchingsf3ad5002012-09-18 02:33:56 +010093/**
94 * struct efx_mcdi_data - extra state for NICs that implement MCDI
95 * @iface: Interface/protocol state
96 * @hwmon: Hardware monitor state
97 */
98struct efx_mcdi_data {
99 struct efx_mcdi_iface iface;
100#ifdef CONFIG_SFC_MCDI_MON
101 struct efx_mcdi_mon hwmon;
102#endif
103};
104
105#ifdef CONFIG_SFC_MCDI_MON
106static inline struct efx_mcdi_mon *efx_mcdi_mon(struct efx_nic *efx)
107{
108 EFX_BUG_ON_PARANOID(!efx->mcdi);
109 return &efx->mcdi->hwmon;
110}
111#endif
112
Joe Perches00aef982013-09-23 11:37:59 -0700113int efx_mcdi_init(struct efx_nic *efx);
114void efx_mcdi_fini(struct efx_nic *efx);
Ben Hutchingsafd4aea2009-11-29 15:15:25 +0000115
Joe Perches00aef982013-09-23 11:37:59 -0700116int efx_mcdi_rpc(struct efx_nic *efx, unsigned cmd, const efx_dword_t *inbuf,
117 size_t inlen, efx_dword_t *outbuf, size_t outlen,
118 size_t *outlen_actual);
119
120int efx_mcdi_rpc_start(struct efx_nic *efx, unsigned cmd,
121 const efx_dword_t *inbuf, size_t inlen);
122int efx_mcdi_rpc_finish(struct efx_nic *efx, unsigned cmd, size_t inlen,
Ben Hutchings9528b922012-09-14 17:31:41 +0100123 efx_dword_t *outbuf, size_t outlen,
Ben Hutchingsafd4aea2009-11-29 15:15:25 +0000124 size_t *outlen_actual);
125
Ben Hutchingscade7152013-08-27 23:12:31 +0100126typedef void efx_mcdi_async_completer(struct efx_nic *efx,
127 unsigned long cookie, int rc,
128 efx_dword_t *outbuf,
129 size_t outlen_actual);
Joe Perches00aef982013-09-23 11:37:59 -0700130int efx_mcdi_rpc_async(struct efx_nic *efx, unsigned int cmd,
131 const efx_dword_t *inbuf, size_t inlen, size_t outlen,
132 efx_mcdi_async_completer *complete,
133 unsigned long cookie);
Ben Hutchings9528b922012-09-14 17:31:41 +0100134
Joe Perches00aef982013-09-23 11:37:59 -0700135int efx_mcdi_poll_reboot(struct efx_nic *efx);
136void efx_mcdi_mode_poll(struct efx_nic *efx);
137void efx_mcdi_mode_event(struct efx_nic *efx);
138void efx_mcdi_flush_async(struct efx_nic *efx);
Ben Hutchingsafd4aea2009-11-29 15:15:25 +0000139
Joe Perches00aef982013-09-23 11:37:59 -0700140void efx_mcdi_process_event(struct efx_channel *channel, efx_qword_t *event);
141void efx_mcdi_sensor_event(struct efx_nic *efx, efx_qword_t *ev);
Ben Hutchingsafd4aea2009-11-29 15:15:25 +0000142
Ben Hutchings9528b922012-09-14 17:31:41 +0100143/* We expect that 16- and 32-bit fields in MCDI requests and responses
Ben Hutchings338f74d2012-10-10 23:20:17 +0100144 * are appropriately aligned, but 64-bit fields are only
145 * 32-bit-aligned. Also, on Siena we must copy to the MC shared
146 * memory strictly 32 bits at a time, so add any necessary padding.
Ben Hutchings9528b922012-09-14 17:31:41 +0100147 */
Ben Hutchings59cfc472012-09-14 17:30:10 +0100148#define MCDI_DECLARE_BUF(_name, _len) \
Ben Hutchings9528b922012-09-14 17:31:41 +0100149 efx_dword_t _name[DIV_ROUND_UP(_len, 4)]
Ben Hutchingsa649dfc2012-09-14 17:30:58 +0100150#define _MCDI_PTR(_buf, _offset) \
151 ((u8 *)(_buf) + (_offset))
Ben Hutchings30af6912012-09-14 17:30:44 +0100152#define MCDI_PTR(_buf, _field) \
Ben Hutchingsa649dfc2012-09-14 17:30:58 +0100153 _MCDI_PTR(_buf, MC_CMD_ ## _field ## _OFST)
Ben Hutchings9528b922012-09-14 17:31:41 +0100154#define _MCDI_CHECK_ALIGN(_ofst, _align) \
155 ((_ofst) + BUILD_BUG_ON_ZERO((_ofst) & (_align - 1)))
Ben Hutchings30af6912012-09-14 17:30:44 +0100156#define _MCDI_DWORD(_buf, _field) \
Ben Hutchings9528b922012-09-14 17:31:41 +0100157 ((_buf) + (_MCDI_CHECK_ALIGN(MC_CMD_ ## _field ## _OFST, 4) >> 2))
Ben Hutchings59cfc472012-09-14 17:30:10 +0100158
Ben Hutchings8127d662013-08-29 19:19:29 +0100159#define MCDI_WORD(_buf, _field) \
160 ((u16)BUILD_BUG_ON_ZERO(MC_CMD_ ## _field ## _LEN != 2) + \
161 le16_to_cpu(*(__force const __le16 *)MCDI_PTR(_buf, _field)))
Ben Hutchings30af6912012-09-14 17:30:44 +0100162#define MCDI_SET_DWORD(_buf, _field, _value) \
163 EFX_POPULATE_DWORD_1(*_MCDI_DWORD(_buf, _field), EFX_DWORD_0, _value)
164#define MCDI_DWORD(_buf, _field) \
165 EFX_DWORD_FIELD(*_MCDI_DWORD(_buf, _field), EFX_DWORD_0)
Ben Hutchingsf5253d92012-10-10 23:24:51 +0100166#define MCDI_POPULATE_DWORD_1(_buf, _field, _name1, _value1) \
167 EFX_POPULATE_DWORD_1(*_MCDI_DWORD(_buf, _field), \
168 MC_CMD_ ## _name1, _value1)
169#define MCDI_POPULATE_DWORD_2(_buf, _field, _name1, _value1, \
170 _name2, _value2) \
171 EFX_POPULATE_DWORD_2(*_MCDI_DWORD(_buf, _field), \
172 MC_CMD_ ## _name1, _value1, \
173 MC_CMD_ ## _name2, _value2)
174#define MCDI_POPULATE_DWORD_3(_buf, _field, _name1, _value1, \
175 _name2, _value2, _name3, _value3) \
176 EFX_POPULATE_DWORD_3(*_MCDI_DWORD(_buf, _field), \
177 MC_CMD_ ## _name1, _value1, \
178 MC_CMD_ ## _name2, _value2, \
179 MC_CMD_ ## _name3, _value3)
180#define MCDI_POPULATE_DWORD_4(_buf, _field, _name1, _value1, \
181 _name2, _value2, _name3, _value3, \
182 _name4, _value4) \
183 EFX_POPULATE_DWORD_4(*_MCDI_DWORD(_buf, _field), \
184 MC_CMD_ ## _name1, _value1, \
185 MC_CMD_ ## _name2, _value2, \
186 MC_CMD_ ## _name3, _value3, \
187 MC_CMD_ ## _name4, _value4)
188#define MCDI_POPULATE_DWORD_5(_buf, _field, _name1, _value1, \
189 _name2, _value2, _name3, _value3, \
190 _name4, _value4, _name5, _value5) \
191 EFX_POPULATE_DWORD_5(*_MCDI_DWORD(_buf, _field), \
192 MC_CMD_ ## _name1, _value1, \
193 MC_CMD_ ## _name2, _value2, \
194 MC_CMD_ ## _name3, _value3, \
195 MC_CMD_ ## _name4, _value4, \
196 MC_CMD_ ## _name5, _value5)
197#define MCDI_POPULATE_DWORD_6(_buf, _field, _name1, _value1, \
198 _name2, _value2, _name3, _value3, \
199 _name4, _value4, _name5, _value5, \
200 _name6, _value6) \
201 EFX_POPULATE_DWORD_6(*_MCDI_DWORD(_buf, _field), \
202 MC_CMD_ ## _name1, _value1, \
203 MC_CMD_ ## _name2, _value2, \
204 MC_CMD_ ## _name3, _value3, \
205 MC_CMD_ ## _name4, _value4, \
206 MC_CMD_ ## _name5, _value5, \
207 MC_CMD_ ## _name6, _value6)
208#define MCDI_POPULATE_DWORD_7(_buf, _field, _name1, _value1, \
209 _name2, _value2, _name3, _value3, \
210 _name4, _value4, _name5, _value5, \
211 _name6, _value6, _name7, _value7) \
212 EFX_POPULATE_DWORD_7(*_MCDI_DWORD(_buf, _field), \
213 MC_CMD_ ## _name1, _value1, \
214 MC_CMD_ ## _name2, _value2, \
215 MC_CMD_ ## _name3, _value3, \
216 MC_CMD_ ## _name4, _value4, \
217 MC_CMD_ ## _name5, _value5, \
218 MC_CMD_ ## _name6, _value6, \
219 MC_CMD_ ## _name7, _value7)
Ben Hutchings338f74d2012-10-10 23:20:17 +0100220#define MCDI_SET_QWORD(_buf, _field, _value) \
221 do { \
222 EFX_POPULATE_DWORD_1(_MCDI_DWORD(_buf, _field)[0], \
223 EFX_DWORD_0, (u32)(_value)); \
224 EFX_POPULATE_DWORD_1(_MCDI_DWORD(_buf, _field)[1], \
225 EFX_DWORD_0, (u64)(_value) >> 32); \
226 } while (0)
Ben Hutchings30af6912012-09-14 17:30:44 +0100227#define MCDI_QWORD(_buf, _field) \
228 (EFX_DWORD_FIELD(_MCDI_DWORD(_buf, _field)[0], EFX_DWORD_0) | \
229 (u64)EFX_DWORD_FIELD(_MCDI_DWORD(_buf, _field)[1], EFX_DWORD_0) << 32)
Ben Hutchingsa649dfc2012-09-14 17:30:58 +0100230#define MCDI_FIELD(_ptr, _type, _field) \
Ben Hutchings0a6e5002012-09-11 21:46:41 +0100231 EFX_EXTRACT_DWORD( \
Ben Hutchingsa649dfc2012-09-14 17:30:58 +0100232 *(efx_dword_t *) \
233 _MCDI_PTR(_ptr, MC_CMD_ ## _type ## _ ## _field ## _OFST & ~3),\
234 MC_CMD_ ## _type ## _ ## _field ## _LBN & 0x1f, \
235 (MC_CMD_ ## _type ## _ ## _field ## _LBN & 0x1f) + \
236 MC_CMD_ ## _type ## _ ## _field ## _WIDTH - 1)
237
Ben Hutchings9528b922012-09-14 17:31:41 +0100238#define _MCDI_ARRAY_PTR(_buf, _field, _index, _align) \
239 (_MCDI_PTR(_buf, _MCDI_CHECK_ALIGN(MC_CMD_ ## _field ## _OFST, _align))\
240 + (_index) * _MCDI_CHECK_ALIGN(MC_CMD_ ## _field ## _LEN, _align))
Ben Hutchingsa649dfc2012-09-14 17:30:58 +0100241#define MCDI_DECLARE_STRUCT_PTR(_name) \
Ben Hutchings9528b922012-09-14 17:31:41 +0100242 efx_dword_t *_name
243#define MCDI_ARRAY_STRUCT_PTR(_buf, _field, _index) \
244 ((efx_dword_t *)_MCDI_ARRAY_PTR(_buf, _field, _index, 4))
Ben Hutchingsa649dfc2012-09-14 17:30:58 +0100245#define MCDI_VAR_ARRAY_LEN(_len, _field) \
246 min_t(size_t, MC_CMD_ ## _field ## _MAXNUM, \
247 ((_len) - MC_CMD_ ## _field ## _OFST) / MC_CMD_ ## _field ## _LEN)
248#define MCDI_ARRAY_WORD(_buf, _field, _index) \
249 (BUILD_BUG_ON_ZERO(MC_CMD_ ## _field ## _LEN != 2) + \
250 le16_to_cpu(*(__force const __le16 *) \
Ben Hutchings9528b922012-09-14 17:31:41 +0100251 _MCDI_ARRAY_PTR(_buf, _field, _index, 2)))
Ben Hutchingsa649dfc2012-09-14 17:30:58 +0100252#define _MCDI_ARRAY_DWORD(_buf, _field, _index) \
253 (BUILD_BUG_ON_ZERO(MC_CMD_ ## _field ## _LEN != 4) + \
Ben Hutchings9528b922012-09-14 17:31:41 +0100254 (efx_dword_t *)_MCDI_ARRAY_PTR(_buf, _field, _index, 4))
Ben Hutchingsa649dfc2012-09-14 17:30:58 +0100255#define MCDI_SET_ARRAY_DWORD(_buf, _field, _index, _value) \
256 EFX_SET_DWORD_FIELD(*_MCDI_ARRAY_DWORD(_buf, _field, _index), \
257 EFX_DWORD_0, _value)
258#define MCDI_ARRAY_DWORD(_buf, _field, _index) \
259 EFX_DWORD_FIELD(*_MCDI_ARRAY_DWORD(_buf, _field, _index), EFX_DWORD_0)
Ben Hutchings338f74d2012-10-10 23:20:17 +0100260#define _MCDI_ARRAY_QWORD(_buf, _field, _index) \
261 (BUILD_BUG_ON_ZERO(MC_CMD_ ## _field ## _LEN != 8) + \
262 (efx_dword_t *)_MCDI_ARRAY_PTR(_buf, _field, _index, 4))
263#define MCDI_SET_ARRAY_QWORD(_buf, _field, _index, _value) \
264 do { \
265 EFX_SET_DWORD_FIELD(_MCDI_ARRAY_QWORD(_buf, _field, _index)[0],\
266 EFX_DWORD_0, (u32)(_value)); \
267 EFX_SET_DWORD_FIELD(_MCDI_ARRAY_QWORD(_buf, _field, _index)[1],\
268 EFX_DWORD_0, (u64)(_value) >> 32); \
269 } while (0)
Ben Hutchingsa649dfc2012-09-14 17:30:58 +0100270#define MCDI_ARRAY_FIELD(_buf, _field1, _type, _index, _field2) \
271 MCDI_FIELD(MCDI_ARRAY_STRUCT_PTR(_buf, _field1, _index), \
272 _type ## _TYPEDEF, _field2)
Ben Hutchingsafd4aea2009-11-29 15:15:25 +0000273
Ben Hutchings30af6912012-09-14 17:30:44 +0100274#define MCDI_EVENT_FIELD(_ev, _field) \
275 EFX_QWORD_FIELD(_ev, MCDI_EVENT_ ## _field)
276
Joe Perches00aef982013-09-23 11:37:59 -0700277void efx_mcdi_print_fwver(struct efx_nic *efx, char *buf, size_t len);
278int efx_mcdi_get_board_cfg(struct efx_nic *efx, u8 *mac_address,
279 u16 *fw_subtype_list, u32 *capabilities);
280int efx_mcdi_log_ctrl(struct efx_nic *efx, bool evq, bool uart, u32 dest_evq);
281int efx_mcdi_nvram_types(struct efx_nic *efx, u32 *nvram_types_out);
282int efx_mcdi_nvram_info(struct efx_nic *efx, unsigned int type,
283 size_t *size_out, size_t *erase_size_out,
284 bool *protected_out);
285int efx_mcdi_nvram_test_all(struct efx_nic *efx);
286int efx_mcdi_handle_assertion(struct efx_nic *efx);
287void efx_mcdi_set_id_led(struct efx_nic *efx, enum efx_led_mode mode);
288int efx_mcdi_wol_filter_set_magic(struct efx_nic *efx, const u8 *mac,
289 int *id_out);
290int efx_mcdi_wol_filter_get_magic(struct efx_nic *efx, int *id_out);
291int efx_mcdi_wol_filter_remove(struct efx_nic *efx, int id);
292int efx_mcdi_wol_filter_reset(struct efx_nic *efx);
293int efx_mcdi_flush_rxqs(struct efx_nic *efx);
294int efx_mcdi_port_probe(struct efx_nic *efx);
295void efx_mcdi_port_remove(struct efx_nic *efx);
296int efx_mcdi_port_reconfigure(struct efx_nic *efx);
297int efx_mcdi_port_get_number(struct efx_nic *efx);
298u32 efx_mcdi_phy_get_caps(struct efx_nic *efx);
299void efx_mcdi_process_link_change(struct efx_nic *efx, efx_qword_t *ev);
300int efx_mcdi_set_mac(struct efx_nic *efx);
Ben Hutchings43f775b22012-09-18 02:33:54 +0100301#define EFX_MC_STATS_GENERATION_INVALID ((__force __le64)(-1))
Joe Perches00aef982013-09-23 11:37:59 -0700302void efx_mcdi_mac_start_stats(struct efx_nic *efx);
303void efx_mcdi_mac_stop_stats(struct efx_nic *efx);
Jon Cooperf8f3b5a2013-09-30 17:36:50 +0100304void efx_mcdi_mac_pull_stats(struct efx_nic *efx);
Joe Perches00aef982013-09-23 11:37:59 -0700305bool efx_mcdi_mac_check_fault(struct efx_nic *efx);
306enum reset_type efx_mcdi_map_reset_reason(enum reset_type reason);
307int efx_mcdi_reset(struct efx_nic *efx, enum reset_type method);
308int efx_mcdi_set_workaround(struct efx_nic *efx, u32 type, bool enabled);
Ben Hutchingsafd4aea2009-11-29 15:15:25 +0000309
Ben Hutchings55c5e0f82012-01-06 20:25:39 +0000310#ifdef CONFIG_SFC_MCDI_MON
Joe Perches00aef982013-09-23 11:37:59 -0700311int efx_mcdi_mon_probe(struct efx_nic *efx);
312void efx_mcdi_mon_remove(struct efx_nic *efx);
Ben Hutchings55c5e0f82012-01-06 20:25:39 +0000313#else
314static inline int efx_mcdi_mon_probe(struct efx_nic *efx) { return 0; }
315static inline void efx_mcdi_mon_remove(struct efx_nic *efx) {}
316#endif
317
Ben Hutchings45a3fd52012-11-28 04:38:14 +0000318#ifdef CONFIG_SFC_MTD
Joe Perches00aef982013-09-23 11:37:59 -0700319int efx_mcdi_mtd_read(struct mtd_info *mtd, loff_t start, size_t len,
320 size_t *retlen, u8 *buffer);
321int efx_mcdi_mtd_erase(struct mtd_info *mtd, loff_t start, size_t len);
322int efx_mcdi_mtd_write(struct mtd_info *mtd, loff_t start, size_t len,
323 size_t *retlen, const u8 *buffer);
324int efx_mcdi_mtd_sync(struct mtd_info *mtd);
325void efx_mcdi_mtd_rename(struct efx_mtd_partition *part);
Ben Hutchings45a3fd52012-11-28 04:38:14 +0000326#endif
327
Ben Hutchingsafd4aea2009-11-29 15:15:25 +0000328#endif /* EFX_MCDI_H */