Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
nic.c File Reference
#include <linux/bitops.h>
#include <linux/delay.h>
#include <linux/interrupt.h>
#include <linux/pci.h>
#include <linux/module.h>
#include <linux/seq_file.h>
#include "net_driver.h"
#include "bitfield.h"
#include "efx.h"
#include "nic.h"
#include "regs.h"
#include "io.h"
#include "workarounds.h"

Go to the source code of this file.

Data Structures

struct  efx_nic_reg
 
struct  efx_nic_reg_table
 

Macros

#define TX_DC_ENTRIES   16
 
#define TX_DC_ENTRIES_ORDER   1
 
#define RX_DC_ENTRIES   64
 
#define RX_DC_ENTRIES_ORDER   3
 
#define EFX_INT_ERROR_EXPIRE   3600
 
#define EFX_MAX_INT_ERRORS   5
 
#define EFX_RX_FLUSH_COUNT   4
 
#define _EFX_CHANNEL_MAGIC_TEST   0x000101
 
#define _EFX_CHANNEL_MAGIC_FILL   0x000102
 
#define _EFX_CHANNEL_MAGIC_RX_DRAIN   0x000103
 
#define _EFX_CHANNEL_MAGIC_TX_DRAIN   0x000104
 
#define _EFX_CHANNEL_MAGIC(_code, _data)   ((_code) << 8 | (_data))
 
#define _EFX_CHANNEL_MAGIC_CODE(_magic)   ((_magic) >> 8)
 
#define EFX_CHANNEL_MAGIC_TEST(_channel)   _EFX_CHANNEL_MAGIC(_EFX_CHANNEL_MAGIC_TEST, (_channel)->channel)
 
#define EFX_CHANNEL_MAGIC_FILL(_rx_queue)
 
#define EFX_CHANNEL_MAGIC_RX_DRAIN(_rx_queue)
 
#define EFX_CHANNEL_MAGIC_TX_DRAIN(_tx_queue)
 
#define REGISTER_REVISION_A   1
 
#define REGISTER_REVISION_B   2
 
#define REGISTER_REVISION_C   3
 
#define REGISTER_REVISION_Z   3 /* latest revision */
 
#define REGISTER(name, min_rev, max_rev)
 
#define REGISTER_AA(name)   REGISTER(name, A, A)
 
#define REGISTER_AB(name)   REGISTER(name, A, B)
 
#define REGISTER_AZ(name)   REGISTER(name, A, Z)
 
#define REGISTER_BB(name)   REGISTER(name, B, B)
 
#define REGISTER_BZ(name)   REGISTER(name, B, Z)
 
#define REGISTER_CZ(name)   REGISTER(name, C, Z)
 
#define REGISTER_TABLE_DIMENSIONS(_, offset, min_rev, max_rev, step, rows)
 
#define REGISTER_TABLE(name, min_rev, max_rev)
 
#define REGISTER_TABLE_AA(name)   REGISTER_TABLE(name, A, A)
 
#define REGISTER_TABLE_AZ(name)   REGISTER_TABLE(name, A, Z)
 
#define REGISTER_TABLE_BB(name)   REGISTER_TABLE(name, B, B)
 
#define REGISTER_TABLE_BZ(name)   REGISTER_TABLE(name, B, Z)
 
#define REGISTER_TABLE_BB_CZ(name)
 
#define REGISTER_TABLE_CZ(name)   REGISTER_TABLE(name, C, Z)
 

Functions

int efx_nic_test_registers (struct efx_nic *efx, const struct efx_nic_register_test *regs, size_t n_regs)
 
int efx_nic_alloc_buffer (struct efx_nic *efx, struct efx_buffer *buffer, unsigned int len)
 
void efx_nic_free_buffer (struct efx_nic *efx, struct efx_buffer *buffer)
 
void efx_nic_push_buffers (struct efx_tx_queue *tx_queue)
 
int efx_nic_probe_tx (struct efx_tx_queue *tx_queue)
 
void efx_nic_init_tx (struct efx_tx_queue *tx_queue)
 
void efx_nic_fini_tx (struct efx_tx_queue *tx_queue)
 
void efx_nic_remove_tx (struct efx_tx_queue *tx_queue)
 
void efx_nic_notify_rx_desc (struct efx_rx_queue *rx_queue)
 
int efx_nic_probe_rx (struct efx_rx_queue *rx_queue)
 
void efx_nic_init_rx (struct efx_rx_queue *rx_queue)
 
void efx_nic_fini_rx (struct efx_rx_queue *rx_queue)
 
void efx_nic_remove_rx (struct efx_rx_queue *rx_queue)
 
int efx_nic_flush_queues (struct efx_nic *efx)
 
void efx_nic_eventq_read_ack (struct efx_channel *channel)
 
void efx_generate_event (struct efx_nic *efx, unsigned int evq, efx_qword_t *event)
 
int efx_nic_process_eventq (struct efx_channel *channel, int budget)
 
bool efx_nic_event_present (struct efx_channel *channel)
 
int efx_nic_probe_eventq (struct efx_channel *channel)
 
void efx_nic_init_eventq (struct efx_channel *channel)
 
void efx_nic_fini_eventq (struct efx_channel *channel)
 
void efx_nic_remove_eventq (struct efx_channel *channel)
 
void efx_nic_event_test_start (struct efx_channel *channel)
 
void efx_nic_generate_fill_event (struct efx_rx_queue *rx_queue)
 
void efx_nic_enable_interrupts (struct efx_nic *efx)
 
void efx_nic_disable_interrupts (struct efx_nic *efx)
 
void efx_nic_irq_test_start (struct efx_nic *efx)
 
irqreturn_t efx_nic_fatal_interrupt (struct efx_nic *efx)
 
void efx_nic_push_rx_indir_table (struct efx_nic *efx)
 
int efx_nic_init_interrupt (struct efx_nic *efx)
 
void efx_nic_fini_interrupt (struct efx_nic *efx)
 
void efx_nic_dimension_resources (struct efx_nic *efx, unsigned sram_lim_qw)
 
u32 efx_nic_fpga_ver (struct efx_nic *efx)
 
void efx_nic_init_common (struct efx_nic *efx)
 
size_t efx_nic_get_regs_len (struct efx_nic *efx)
 
void efx_nic_get_regs (struct efx_nic *efx, void *buf)
 

Macro Definition Documentation

#define _EFX_CHANNEL_MAGIC (   _code,
  _data 
)    ((_code) << 8 | (_data))

Definition at line 61 of file nic.c.

#define _EFX_CHANNEL_MAGIC_CODE (   _magic)    ((_magic) >> 8)

Definition at line 62 of file nic.c.

#define _EFX_CHANNEL_MAGIC_FILL   0x000102

Definition at line 57 of file nic.c.

#define _EFX_CHANNEL_MAGIC_RX_DRAIN   0x000103

Definition at line 58 of file nic.c.

#define _EFX_CHANNEL_MAGIC_TEST   0x000101

Definition at line 56 of file nic.c.

#define _EFX_CHANNEL_MAGIC_TX_DRAIN   0x000104

Definition at line 59 of file nic.c.

#define EFX_CHANNEL_MAGIC_FILL (   _rx_queue)
Value:
efx_rx_queue_index(_rx_queue))

Definition at line 66 of file nic.c.

#define EFX_CHANNEL_MAGIC_RX_DRAIN (   _rx_queue)
Value:
efx_rx_queue_index(_rx_queue))

Definition at line 69 of file nic.c.

#define EFX_CHANNEL_MAGIC_TEST (   _channel)    _EFX_CHANNEL_MAGIC(_EFX_CHANNEL_MAGIC_TEST, (_channel)->channel)

Definition at line 64 of file nic.c.

#define EFX_CHANNEL_MAGIC_TX_DRAIN (   _tx_queue)
Value:

Definition at line 72 of file nic.c.

#define EFX_INT_ERROR_EXPIRE   3600

Definition at line 49 of file nic.c.

#define EFX_MAX_INT_ERRORS   5

Definition at line 50 of file nic.c.

#define EFX_RX_FLUSH_COUNT   4

Definition at line 53 of file nic.c.

#define REGISTER (   name,
  min_rev,
  max_rev 
)
Value:
{ \
FR_ ## min_rev ## max_rev ## _ ## name, \
REGISTER_REVISION_ ## min_rev, REGISTER_REVISION_ ## max_rev \
}

Definition at line 1802 of file nic.c.

#define REGISTER_AA (   name)    REGISTER(name, A, A)

Definition at line 1806 of file nic.c.

#define REGISTER_AB (   name)    REGISTER(name, A, B)

Definition at line 1807 of file nic.c.

#define REGISTER_AZ (   name)    REGISTER(name, A, Z)

Definition at line 1808 of file nic.c.

#define REGISTER_BB (   name)    REGISTER(name, B, B)

Definition at line 1809 of file nic.c.

#define REGISTER_BZ (   name)    REGISTER(name, B, Z)

Definition at line 1810 of file nic.c.

#define REGISTER_CZ (   name)    REGISTER(name, C, Z)

Definition at line 1811 of file nic.c.

#define REGISTER_REVISION_A   1

Definition at line 1792 of file nic.c.

#define REGISTER_REVISION_B   2

Definition at line 1793 of file nic.c.

#define REGISTER_REVISION_C   3

Definition at line 1794 of file nic.c.

#define REGISTER_REVISION_Z   3 /* latest revision */

Definition at line 1795 of file nic.c.

#define REGISTER_TABLE (   name,
  min_rev,
  max_rev 
)
Value:
name, FR_ ## min_rev ## max_rev ## _ ## name, \
min_rev, max_rev, \
FR_ ## min_rev ## max_rev ## _ ## name ## _STEP, \
FR_ ## min_rev ## max_rev ## _ ## name ## _ROWS)

Definition at line 1931 of file nic.c.

#define REGISTER_TABLE_AA (   name)    REGISTER_TABLE(name, A, A)

Definition at line 1937 of file nic.c.

#define REGISTER_TABLE_AZ (   name)    REGISTER_TABLE(name, A, Z)

Definition at line 1938 of file nic.c.

#define REGISTER_TABLE_BB (   name)    REGISTER_TABLE(name, B, B)

Definition at line 1939 of file nic.c.

#define REGISTER_TABLE_BB_CZ (   name)
Value:
FR_BZ_ ## name ## _STEP, \
FR_BB_ ## name ## _ROWS), \
REGISTER_TABLE_DIMENSIONS(name, FR_BZ_ ## name, C, Z, \
FR_BZ_ ## name ## _STEP, \
FR_CZ_ ## name ## _ROWS)

Definition at line 1941 of file nic.c.

#define REGISTER_TABLE_BZ (   name)    REGISTER_TABLE(name, B, Z)

Definition at line 1940 of file nic.c.

#define REGISTER_TABLE_CZ (   name)    REGISTER_TABLE(name, C, Z)

Definition at line 1948 of file nic.c.

#define REGISTER_TABLE_DIMENSIONS (   _,
  offset,
  min_rev,
  max_rev,
  step,
  rows 
)
Value:
{ \
REGISTER_REVISION_ ## min_rev, REGISTER_REVISION_ ## max_rev, \
step, rows \
}

Definition at line 1926 of file nic.c.

#define RX_DC_ENTRIES   64

Definition at line 42 of file nic.c.

#define RX_DC_ENTRIES_ORDER   3

Definition at line 43 of file nic.c.

#define TX_DC_ENTRIES   16

Definition at line 39 of file nic.c.

#define TX_DC_ENTRIES_ORDER   1

Definition at line 40 of file nic.c.

Function Documentation

void efx_generate_event ( struct efx_nic efx,
unsigned int  evq,
efx_qword_t event 
)

Definition at line 774 of file nic.c.

int efx_nic_alloc_buffer ( struct efx_nic efx,
struct efx_buffer buffer,
unsigned int  len 
)

Definition at line 305 of file nic.c.

void efx_nic_dimension_resources ( struct efx_nic efx,
unsigned  sram_lim_qw 
)

Definition at line 1651 of file nic.c.

void efx_nic_disable_interrupts ( struct efx_nic efx)

Definition at line 1376 of file nic.c.

void efx_nic_enable_interrupts ( struct efx_nic efx)

Definition at line 1368 of file nic.c.

bool efx_nic_event_present ( struct efx_channel channel)

Definition at line 1260 of file nic.c.

void efx_nic_event_test_start ( struct efx_channel channel)

Definition at line 1334 of file nic.c.

void efx_nic_eventq_read_ack ( struct efx_channel channel)

Definition at line 762 of file nic.c.

irqreturn_t efx_nic_fatal_interrupt ( struct efx_nic efx)

Definition at line 1396 of file nic.c.

void efx_nic_fini_eventq ( struct efx_channel channel)

Definition at line 1311 of file nic.c.

void efx_nic_fini_interrupt ( struct efx_nic efx)

Definition at line 1620 of file nic.c.

void efx_nic_fini_rx ( struct efx_rx_queue rx_queue)

Definition at line 633 of file nic.c.

void efx_nic_fini_tx ( struct efx_tx_queue tx_queue)

Definition at line 503 of file nic.c.

int efx_nic_flush_queues ( struct efx_nic efx)

Definition at line 675 of file nic.c.

u32 efx_nic_fpga_ver ( struct efx_nic efx)

Definition at line 1694 of file nic.c.

void efx_nic_free_buffer ( struct efx_nic efx,
struct efx_buffer buffer 
)

Definition at line 317 of file nic.c.

void efx_nic_generate_fill_event ( struct efx_rx_queue rx_queue)

Definition at line 1341 of file nic.c.

void efx_nic_get_regs ( struct efx_nic efx,
void buf 
)

Definition at line 2004 of file nic.c.

size_t efx_nic_get_regs_len ( struct efx_nic efx)

Definition at line 1981 of file nic.c.

void efx_nic_init_common ( struct efx_nic efx)

Definition at line 1701 of file nic.c.

void efx_nic_init_eventq ( struct efx_channel channel)

Definition at line 1276 of file nic.c.

int efx_nic_init_interrupt ( struct efx_nic efx)

Definition at line 1575 of file nic.c.

void efx_nic_init_rx ( struct efx_rx_queue rx_queue)

Definition at line 586 of file nic.c.

void efx_nic_init_tx ( struct efx_tx_queue tx_queue)

Definition at line 436 of file nic.c.

void efx_nic_irq_test_start ( struct efx_nic efx)

Definition at line 1386 of file nic.c.

void efx_nic_notify_rx_desc ( struct efx_rx_queue rx_queue)

Definition at line 556 of file nic.c.

int efx_nic_probe_eventq ( struct efx_channel channel)

Definition at line 1266 of file nic.c.

int efx_nic_probe_rx ( struct efx_rx_queue rx_queue)

Definition at line 576 of file nic.c.

int efx_nic_probe_tx ( struct efx_tx_queue tx_queue)

Definition at line 426 of file nic.c.

int efx_nic_process_eventq ( struct efx_channel channel,
int  budget 
)

Definition at line 1184 of file nic.c.

void efx_nic_push_buffers ( struct efx_tx_queue tx_queue)

Definition at line 387 of file nic.c.

void efx_nic_push_rx_indir_table ( struct efx_nic efx)

Definition at line 1554 of file nic.c.

void efx_nic_remove_eventq ( struct efx_channel channel)

Definition at line 1328 of file nic.c.

void efx_nic_remove_rx ( struct efx_rx_queue rx_queue)

Definition at line 648 of file nic.c.

void efx_nic_remove_tx ( struct efx_tx_queue tx_queue)

Definition at line 518 of file nic.c.

int efx_nic_test_registers ( struct efx_nic efx,
const struct efx_nic_register_test regs,
size_t  n_regs 
)

Definition at line 120 of file nic.c.