#ifndef EFX_MCDI_H
#define EFX_MCDI_H
enum efx_mcdi_state { … };
enum efx_mcdi_mode { … };
struct efx_mcdi_iface { … };
struct efx_mcdi_mon { … };
struct efx_mcdi_mtd_partition { … };
#define to_efx_mcdi_mtd_partition(mtd) …
struct efx_mcdi_data { … };
static inline struct efx_mcdi_iface *efx_mcdi(struct efx_nic *efx)
{ … }
#ifdef CONFIG_SFC_MCDI_MON
static inline struct efx_mcdi_mon *efx_mcdi_mon(struct efx_nic *efx)
{ … }
#endif
int efx_mcdi_init(struct efx_nic *efx);
void efx_mcdi_detach(struct efx_nic *efx);
void efx_mcdi_fini(struct efx_nic *efx);
int efx_mcdi_rpc(struct efx_nic *efx, unsigned cmd, const efx_dword_t *inbuf,
size_t inlen, efx_dword_t *outbuf, size_t outlen,
size_t *outlen_actual);
int efx_mcdi_rpc_quiet(struct efx_nic *efx, unsigned cmd,
const efx_dword_t *inbuf, size_t inlen,
efx_dword_t *outbuf, size_t outlen,
size_t *outlen_actual);
int efx_mcdi_rpc_start(struct efx_nic *efx, unsigned cmd,
const efx_dword_t *inbuf, size_t inlen);
int efx_mcdi_rpc_finish(struct efx_nic *efx, unsigned cmd, size_t inlen,
efx_dword_t *outbuf, size_t outlen,
size_t *outlen_actual);
int efx_mcdi_rpc_finish_quiet(struct efx_nic *efx, unsigned cmd,
size_t inlen, efx_dword_t *outbuf,
size_t outlen, size_t *outlen_actual);
efx_mcdi_async_completer;
int efx_mcdi_rpc_async(struct efx_nic *efx, unsigned int cmd,
const efx_dword_t *inbuf, size_t inlen, size_t outlen,
efx_mcdi_async_completer *complete,
unsigned long cookie);
int efx_mcdi_rpc_async_quiet(struct efx_nic *efx, unsigned int cmd,
const efx_dword_t *inbuf, size_t inlen,
size_t outlen,
efx_mcdi_async_completer *complete,
unsigned long cookie);
void efx_mcdi_display_error(struct efx_nic *efx, unsigned cmd,
size_t inlen, efx_dword_t *outbuf,
size_t outlen, int rc);
int efx_mcdi_poll_reboot(struct efx_nic *efx);
void efx_mcdi_mode_poll(struct efx_nic *efx);
void efx_mcdi_mode_event(struct efx_nic *efx);
void efx_mcdi_flush_async(struct efx_nic *efx);
void efx_mcdi_process_event(struct efx_channel *channel, efx_qword_t *event);
void efx_mcdi_sensor_event(struct efx_nic *efx, efx_qword_t *ev);
#define MCDI_TX_BUF_LEN(_len) …
#define _MCDI_DECLARE_BUF(_name, _len) …
#define MCDI_DECLARE_BUF(_name, _len) …
#define MCDI_DECLARE_BUF_ERR(_name) …
#define _MCDI_PTR(_buf, _offset) …
#define MCDI_PTR(_buf, _field) …
#define MCDI_STRUCT_PTR(_buf, _field) …
#define _MCDI_CHECK_ALIGN(_ofst, _align) …
#define _MCDI_DWORD(_buf, _field) …
#define _MCDI_STRUCT_DWORD(_buf, _field) …
#define MCDI_STRUCT_SET_BYTE(_buf, _field, _value) …
#define MCDI_STRUCT_POPULATE_BYTE_1(_buf, _field, _name, _value) …
#define MCDI_BYTE(_buf, _field) …
#define MCDI_STRUCT_BYTE(_buf, _field) …
#define MCDI_SET_WORD(_buf, _field, _value) …
#define MCDI_STRUCT_SET_WORD(_buf, _field, _value) …
#define MCDI_WORD(_buf, _field) …
#define MCDI_STRUCT_WORD(_buf, _field) …
#define MCDI_SET_WORD_BE(_buf, _field, _value) …
#define MCDI_STRUCT_SET_WORD_BE(_buf, _field, _value) …
#define MCDI_SET_DWORD(_buf, _field, _value) …
#define MCDI_STRUCT_SET_DWORD(_buf, _field, _value) …
#define MCDI_DWORD(_buf, _field) …
#define MCDI_STRUCT_DWORD(_buf, _field) …
#define MCDI_STRUCT_SET_DWORD_BE(_buf, _field, _value) …
#define MCDI_POPULATE_DWORD_1(_buf, _field, _name1, _value1) …
#define MCDI_POPULATE_DWORD_2(_buf, _field, _name1, _value1, \
_name2, _value2) …
#define MCDI_POPULATE_DWORD_3(_buf, _field, _name1, _value1, \
_name2, _value2, _name3, _value3) …
#define MCDI_POPULATE_DWORD_4(_buf, _field, _name1, _value1, \
_name2, _value2, _name3, _value3, \
_name4, _value4) …
#define MCDI_POPULATE_DWORD_5(_buf, _field, _name1, _value1, \
_name2, _value2, _name3, _value3, \
_name4, _value4, _name5, _value5) …
#define MCDI_POPULATE_DWORD_6(_buf, _field, _name1, _value1, \
_name2, _value2, _name3, _value3, \
_name4, _value4, _name5, _value5, \
_name6, _value6) …
#define MCDI_POPULATE_DWORD_7(_buf, _field, _name1, _value1, \
_name2, _value2, _name3, _value3, \
_name4, _value4, _name5, _value5, \
_name6, _value6, _name7, _value7) …
#define MCDI_SET_QWORD(_buf, _field, _value) …
#define MCDI_QWORD(_buf, _field) …
#define MCDI_FIELD(_ptr, _type, _field) …
#define _MCDI_ARRAY_PTR(_buf, _field, _index, _align) …
#define MCDI_DECLARE_STRUCT_PTR(_name) …
#define MCDI_ARRAY_STRUCT_PTR(_buf, _field, _index) …
#define MCDI_VAR_ARRAY_LEN(_len, _field) …
#define MCDI_ARRAY_WORD(_buf, _field, _index) …
#define _MCDI_ARRAY_DWORD(_buf, _field, _index) …
#define MCDI_SET_ARRAY_DWORD(_buf, _field, _index, _value) …
#define MCDI_ARRAY_DWORD(_buf, _field, _index) …
#define _MCDI_ARRAY_QWORD(_buf, _field, _index) …
#define MCDI_SET_ARRAY_QWORD(_buf, _field, _index, _value) …
#define MCDI_ARRAY_FIELD(_buf, _field1, _type, _index, _field2) …
#define MCDI_EVENT_FIELD(_ev, _field) …
#define MCDI_CAPABILITY(field) …
#define MCDI_CAPABILITY_OFST(field) …
#define efx_has_cap(efx, field) …
void efx_mcdi_print_fwver(struct efx_nic *efx, char *buf, size_t len);
int efx_mcdi_get_board_cfg(struct efx_nic *efx, u8 *mac_address,
u16 *fw_subtype_list, u32 *capabilities);
int efx_mcdi_log_ctrl(struct efx_nic *efx, bool evq, bool uart, u32 dest_evq);
int efx_mcdi_nvram_types(struct efx_nic *efx, u32 *nvram_types_out);
int efx_mcdi_nvram_info(struct efx_nic *efx, unsigned int type,
size_t *size_out, size_t *erase_size_out,
bool *protected_out);
int efx_new_mcdi_nvram_test_all(struct efx_nic *efx);
int efx_mcdi_nvram_metadata(struct efx_nic *efx, unsigned int type,
u32 *subtype, u16 version[4], char *desc,
size_t descsize);
int efx_mcdi_nvram_test_all(struct efx_nic *efx);
int efx_mcdi_handle_assertion(struct efx_nic *efx);
int efx_mcdi_set_id_led(struct efx_nic *efx, enum efx_led_mode mode);
int efx_mcdi_wol_filter_set_magic(struct efx_nic *efx, const u8 *mac,
int *id_out);
int efx_mcdi_wol_filter_get_magic(struct efx_nic *efx, int *id_out);
int efx_mcdi_wol_filter_remove(struct efx_nic *efx, int id);
int efx_mcdi_wol_filter_reset(struct efx_nic *efx);
int efx_mcdi_flush_rxqs(struct efx_nic *efx);
void efx_mcdi_process_link_change(struct efx_nic *efx, efx_qword_t *ev);
void efx_mcdi_mac_start_stats(struct efx_nic *efx);
void efx_mcdi_mac_stop_stats(struct efx_nic *efx);
void efx_mcdi_mac_pull_stats(struct efx_nic *efx);
enum reset_type efx_mcdi_map_reset_reason(enum reset_type reason);
int efx_mcdi_reset(struct efx_nic *efx, enum reset_type method);
int efx_mcdi_set_workaround(struct efx_nic *efx, u32 type, bool enabled,
unsigned int *flags);
int efx_mcdi_get_workarounds(struct efx_nic *efx, unsigned int *impl_out,
unsigned int *enabled_out);
int efx_mcdi_get_privilege_mask(struct efx_nic *efx, u32 *mask);
#ifdef CONFIG_SFC_MCDI_MON
int efx_mcdi_mon_probe(struct efx_nic *efx);
void efx_mcdi_mon_remove(struct efx_nic *efx);
#else
static inline int efx_mcdi_mon_probe(struct efx_nic *efx) { return 0; }
static inline void efx_mcdi_mon_remove(struct efx_nic *efx) {}
#endif
#ifdef CONFIG_SFC_MTD
int efx_mcdi_mtd_read(struct mtd_info *mtd, loff_t start, size_t len,
size_t *retlen, u8 *buffer);
int efx_mcdi_mtd_erase(struct mtd_info *mtd, loff_t start, size_t len);
int efx_mcdi_mtd_write(struct mtd_info *mtd, loff_t start, size_t len,
size_t *retlen, const u8 *buffer);
int efx_mcdi_mtd_sync(struct mtd_info *mtd);
void efx_mcdi_mtd_rename(struct efx_mtd_partition *part);
#endif
#endif