Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions
mcdi.c File Reference
#include <linux/delay.h>
#include "net_driver.h"
#include "nic.h"
#include "io.h"
#include "regs.h"
#include "mcdi_pcol.h"
#include "phy.h"

Go to the source code of this file.

Macros

#define MCDI_RPC_TIMEOUT   10 /*seconds */
 
#define MCDI_PDU(efx)   (efx_port_num(efx) ? MC_SMEM_P1_PDU_OFST : MC_SMEM_P0_PDU_OFST)
 
#define MCDI_DOORBELL(efx)   (efx_port_num(efx) ? MC_SMEM_P1_DOORBELL_OFST : MC_SMEM_P0_DOORBELL_OFST)
 
#define MCDI_STATUS(efx)   (efx_port_num(efx) ? MC_SMEM_P1_STATUS_OFST : MC_SMEM_P0_STATUS_OFST)
 
#define MCDI_STATUS_DELAY_US   100
 
#define MCDI_STATUS_DELAY_COUNT   100
 
#define MCDI_STATUS_SLEEP_MS   (MCDI_STATUS_DELAY_US * MCDI_STATUS_DELAY_COUNT / 1000)
 
#define SEQ_MASK   EFX_MASK32(EFX_WIDTH(MCDI_HEADER_SEQ))
 
#define TRANSLATE_ERROR(name)
 

Functions

void efx_mcdi_init (struct efx_nic *efx)
 
int efx_mcdi_poll_reboot (struct efx_nic *efx)
 
int efx_mcdi_rpc (struct efx_nic *efx, unsigned cmd, const u8 *inbuf, size_t inlen, u8 *outbuf, size_t outlen, size_t *outlen_actual)
 
void efx_mcdi_rpc_start (struct efx_nic *efx, unsigned cmd, const u8 *inbuf, size_t inlen)
 
int efx_mcdi_rpc_finish (struct efx_nic *efx, unsigned cmd, size_t inlen, u8 *outbuf, size_t outlen, size_t *outlen_actual)
 
void efx_mcdi_mode_poll (struct efx_nic *efx)
 
void efx_mcdi_mode_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)
 
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)
 
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_mcdi_nvram_update_start (struct efx_nic *efx, unsigned int type)
 
int efx_mcdi_nvram_read (struct efx_nic *efx, unsigned int type, loff_t offset, u8 *buffer, size_t length)
 
int efx_mcdi_nvram_write (struct efx_nic *efx, unsigned int type, loff_t offset, const u8 *buffer, size_t length)
 
int efx_mcdi_nvram_erase (struct efx_nic *efx, unsigned int type, loff_t offset, size_t length)
 
int efx_mcdi_nvram_update_finish (struct efx_nic *efx, unsigned int type)
 
int efx_mcdi_nvram_test_all (struct efx_nic *efx)
 
int efx_mcdi_handle_assertion (struct efx_nic *efx)
 
void efx_mcdi_set_id_led (struct efx_nic *efx, enum efx_led_mode mode)
 
int efx_mcdi_reset_port (struct efx_nic *efx)
 
int efx_mcdi_reset_mc (struct efx_nic *efx)
 
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)
 

Macro Definition Documentation

#define MCDI_DOORBELL (   efx)    (efx_port_num(efx) ? MC_SMEM_P1_DOORBELL_OFST : MC_SMEM_P0_DOORBELL_OFST)

Definition at line 29 of file mcdi.c.

#define MCDI_PDU (   efx)    (efx_port_num(efx) ? MC_SMEM_P1_PDU_OFST : MC_SMEM_P0_PDU_OFST)

Definition at line 27 of file mcdi.c.

#define MCDI_RPC_TIMEOUT   10 /*seconds */

Definition at line 25 of file mcdi.c.

#define MCDI_STATUS (   efx)    (efx_port_num(efx) ? MC_SMEM_P1_STATUS_OFST : MC_SMEM_P0_STATUS_OFST)

Definition at line 31 of file mcdi.c.

#define MCDI_STATUS_DELAY_COUNT   100

Definition at line 38 of file mcdi.c.

#define MCDI_STATUS_DELAY_US   100

Definition at line 37 of file mcdi.c.

#define MCDI_STATUS_SLEEP_MS   (MCDI_STATUS_DELAY_US * MCDI_STATUS_DELAY_COUNT / 1000)

Definition at line 39 of file mcdi.c.

#define SEQ_MASK   EFX_MASK32(EFX_WIDTH(MCDI_HEADER_SEQ))

Definition at line 42 of file mcdi.c.

#define TRANSLATE_ERROR (   name)
Value:
case MC_CMD_ERR_ ## name: \
rc = name; \
break

Function Documentation

int efx_mcdi_drv_attach ( struct efx_nic efx,
bool  driver_operating,
bool was_attached 
)

Definition at line 630 of file mcdi.c.

int efx_mcdi_flush_rxqs ( struct efx_nic efx)

Definition at line 1191 of file mcdi.c.

int efx_mcdi_get_board_cfg ( struct efx_nic efx,
u8 mac_address,
u16 fw_subtype_list,
u32 capabilities 
)

Definition at line 660 of file mcdi.c.

int efx_mcdi_handle_assertion ( struct efx_nic efx)

Definition at line 1043 of file mcdi.c.

void efx_mcdi_init ( struct efx_nic efx)

Definition at line 53 of file mcdi.c.

int efx_mcdi_log_ctrl ( struct efx_nic efx,
bool  evq,
bool  uart,
u32  dest_evq 
)

Definition at line 715 of file mcdi.c.

void efx_mcdi_mode_event ( struct efx_nic efx)

Definition at line 437 of file mcdi.c.

void efx_mcdi_mode_poll ( struct efx_nic efx)

Definition at line 413 of file mcdi.c.

int efx_mcdi_nvram_erase ( struct efx_nic efx,
unsigned int  type,
loff_t  offset,
size_t  length 
)

Definition at line 872 of file mcdi.c.

int efx_mcdi_nvram_info ( struct efx_nic efx,
unsigned int  type,
size_t size_out,
size_t erase_size_out,
bool protected_out 
)

Definition at line 769 of file mcdi.c.

int efx_mcdi_nvram_read ( struct efx_nic efx,
unsigned int  type,
loff_t  offset,
u8 buffer,
size_t  length 
)

Definition at line 821 of file mcdi.c.

int efx_mcdi_nvram_test_all ( struct efx_nic efx)

Definition at line 939 of file mcdi.c.

int efx_mcdi_nvram_types ( struct efx_nic efx,
u32 nvram_types_out 
)

Definition at line 743 of file mcdi.c.

int efx_mcdi_nvram_update_finish ( struct efx_nic efx,
unsigned int  type 
)

Definition at line 896 of file mcdi.c.

int efx_mcdi_nvram_update_start ( struct efx_nic efx,
unsigned int  type 
)

Definition at line 800 of file mcdi.c.

int efx_mcdi_nvram_write ( struct efx_nic efx,
unsigned int  type,
loff_t  offset,
const u8 buffer,
size_t  length 
)

Definition at line 846 of file mcdi.c.

int efx_mcdi_poll_reboot ( struct efx_nic efx)

Definition at line 211 of file mcdi.c.

void efx_mcdi_print_fwver ( struct efx_nic efx,
char buf,
size_t  len 
)

Definition at line 600 of file mcdi.c.

void efx_mcdi_process_event ( struct efx_channel channel,
efx_qword_t event 
)

Definition at line 536 of file mcdi.c.

int efx_mcdi_reset_mc ( struct efx_nic efx)

Definition at line 1085 of file mcdi.c.

int efx_mcdi_reset_port ( struct efx_nic efx)

Definition at line 1076 of file mcdi.c.

int efx_mcdi_rpc ( struct efx_nic efx,
unsigned  cmd,
const u8 inbuf,
size_t  inlen,
u8 outbuf,
size_t  outlen,
size_t outlen_actual 
)

Definition at line 323 of file mcdi.c.

int efx_mcdi_rpc_finish ( struct efx_nic efx,
unsigned  cmd,
size_t  inlen,
u8 outbuf,
size_t  outlen,
size_t outlen_actual 
)

Definition at line 349 of file mcdi.c.

void efx_mcdi_rpc_start ( struct efx_nic efx,
unsigned  cmd,
const u8 inbuf,
size_t  inlen 
)

Definition at line 332 of file mcdi.c.

void efx_mcdi_set_id_led ( struct efx_nic efx,
enum efx_led_mode  mode 
)

Definition at line 1056 of file mcdi.c.

int efx_mcdi_wol_filter_get_magic ( struct efx_nic efx,
int id_out 
)

Definition at line 1145 of file mcdi.c.

int efx_mcdi_wol_filter_remove ( struct efx_nic efx,
int  id 
)

Definition at line 1172 of file mcdi.c.

int efx_mcdi_wol_filter_reset ( struct efx_nic efx)

Definition at line 1226 of file mcdi.c.

int efx_mcdi_wol_filter_set_magic ( struct efx_nic efx,
const u8 mac,
int id_out 
)

Definition at line 1139 of file mcdi.c.