#include <linux/delay.h>
#include <linux/moduleparam.h>
#include <linux/atomic.h>
#include "net_driver.h"
#include "nic.h"
#include "io.h"
#include "mcdi_pcol.h"
#define MCDI_RPC_TIMEOUT …
#define MCDI_STATUS_DELAY_US …
#define MCDI_STATUS_DELAY_COUNT …
#define MCDI_STATUS_SLEEP_MS …
#define SEQ_MASK …
struct efx_mcdi_async_param { … };
static void efx_mcdi_timeout_async(struct timer_list *t);
static int efx_mcdi_drv_attach(struct efx_nic *efx, bool driver_operating,
bool *was_attached_out);
static bool efx_mcdi_poll_once(struct efx_nic *efx);
static void efx_mcdi_abandon(struct efx_nic *efx);
#ifdef CONFIG_SFC_MCDI_LOGGING
static bool mcdi_logging_default;
module_param(mcdi_logging_default, bool, 0644);
MODULE_PARM_DESC(…) …;
#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)
{ … }
static void efx_mcdi_send_request(struct efx_nic *efx, unsigned cmd,
const efx_dword_t *inbuf, size_t inlen)
{ … }
static int efx_mcdi_errno(unsigned int mcdi_err)
{ … }
static void efx_mcdi_read_response_header(struct efx_nic *efx)
{ … }
static bool efx_mcdi_poll_once(struct efx_nic *efx)
{ … }
static int efx_mcdi_poll(struct efx_nic *efx)
{ … }
int efx_mcdi_poll_reboot(struct efx_nic *efx)
{ … }
static bool efx_mcdi_acquire_async(struct efx_mcdi_iface *mcdi)
{ … }
static void efx_mcdi_acquire_sync(struct efx_mcdi_iface *mcdi)
{ … }
static int efx_mcdi_await_completion(struct efx_nic *efx)
{ … }
static bool efx_mcdi_complete_sync(struct efx_mcdi_iface *mcdi)
{ … }
static void efx_mcdi_release(struct efx_mcdi_iface *mcdi)
{ … }
static bool efx_mcdi_complete_async(struct efx_mcdi_iface *mcdi, bool timeout)
{ … }
static void efx_mcdi_ev_cpl(struct efx_nic *efx, unsigned int seqno,
unsigned int datalen, unsigned int mcdi_err)
{ … }
static void efx_mcdi_timeout_async(struct timer_list *t)
{ … }
static int
efx_mcdi_check_supported(struct efx_nic *efx, unsigned int cmd, size_t inlen)
{ … }
static bool efx_mcdi_get_proxy_handle(struct efx_nic *efx,
size_t hdr_len, size_t data_len,
u32 *proxy_handle)
{ … }
static int _efx_mcdi_rpc_finish(struct efx_nic *efx, unsigned int cmd,
size_t inlen,
efx_dword_t *outbuf, size_t outlen,
size_t *outlen_actual, bool quiet,
u32 *proxy_handle, int *raw_rc)
{ … }
static void efx_mcdi_proxy_abort(struct efx_mcdi_iface *mcdi)
{ … }
static void efx_mcdi_ev_proxy_response(struct efx_nic *efx,
u32 handle, int status)
{ … }
static int efx_mcdi_proxy_wait(struct efx_nic *efx, u32 handle, bool quiet)
{ … }
static int _efx_mcdi_rpc(struct efx_nic *efx, unsigned int cmd,
const efx_dword_t *inbuf, size_t inlen,
efx_dword_t *outbuf, size_t outlen,
size_t *outlen_actual, bool quiet, int *raw_rc)
{ … }
static int _efx_mcdi_rpc_evb_retry(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, bool quiet)
{ … }
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)
{ … }
static 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, bool quiet)
{ … }
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)
{ … }
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)
{ … }
void efx_mcdi_display_error(struct efx_nic *efx, unsigned cmd,
size_t inlen, efx_dword_t *outbuf,
size_t outlen, int rc)
{ … }
void efx_mcdi_mode_poll(struct efx_nic *efx)
{ … }
void efx_mcdi_flush_async(struct efx_nic *efx)
{ … }
void efx_mcdi_mode_event(struct efx_nic *efx)
{ … }
static void efx_mcdi_ev_death(struct efx_nic *efx, int rc)
{ … }
static void efx_mcdi_ev_bist(struct efx_nic *efx)
{ … }
static void efx_mcdi_abandon(struct efx_nic *efx)
{ … }
static void efx_handle_drain_event(struct efx_nic *efx)
{ … }
void efx_mcdi_process_event(struct efx_channel *channel,
efx_qword_t *event)
{ … }
void efx_mcdi_print_fwver(struct efx_nic *efx, char *buf, size_t len)
{ … }
static int efx_mcdi_drv_attach(struct efx_nic *efx, bool driver_operating,
bool *was_attached)
{ … }
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)
{ … }
static int efx_new_mcdi_nvram_types(struct efx_nic *efx, u32 *number,
u32 *nvram_types)
{ … }
int efx_mcdi_nvram_info(struct efx_nic *efx, unsigned int type,
size_t *size_out, size_t *erase_size_out,
bool *protected_out)
{ … }
static int efx_mcdi_nvram_test(struct efx_nic *efx, unsigned int type)
{ … }
int efx_new_mcdi_nvram_test_all(struct efx_nic *efx)
{ … }
int efx_mcdi_nvram_test_all(struct efx_nic *efx)
{ … }
static int efx_mcdi_read_assertion(struct efx_nic *efx)
{ … }
static int efx_mcdi_exit_assertion(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)
{ … }
static int efx_mcdi_reset_func(struct efx_nic *efx)
{ … }
static int efx_mcdi_reset_mc(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)
{ … }
static int efx_mcdi_wol_filter_set(struct efx_nic *efx, u32 type,
const u8 *mac, int *id_out)
{ … }
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_flush_rxqs(struct efx_nic *efx)
{ … }
int efx_mcdi_wol_filter_reset(struct efx_nic *efx)
{ … }
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)
{ … }
int efx_mcdi_nvram_metadata(struct efx_nic *efx, unsigned int type,
u32 *subtype, u16 version[4], char *desc,
size_t descsize)
{ … }
#ifdef CONFIG_SFC_MTD
#define EFX_MCDI_NVRAM_LEN_MAX …
static int efx_mcdi_nvram_update_start(struct efx_nic *efx, unsigned int type)
{ … }
static int efx_mcdi_nvram_read(struct efx_nic *efx, unsigned int type,
loff_t offset, u8 *buffer, size_t length)
{ … }
static int efx_mcdi_nvram_write(struct efx_nic *efx, unsigned int type,
loff_t offset, const u8 *buffer, size_t length)
{ … }
static int efx_mcdi_nvram_erase(struct efx_nic *efx, unsigned int type,
loff_t offset, size_t length)
{ … }
static int efx_mcdi_nvram_update_finish(struct efx_nic *efx, unsigned int type)
{ … }
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