#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 <linux/crc32.h>
#include "net_driver.h"
#include "bitfield.h"
#include "efx.h"
#include "rx_common.h"
#include "tx_common.h"
#include "nic.h"
#include "farch_regs.h"
#include "sriov.h"
#include "siena_sriov.h"
#include "io.h"
#include "workarounds.h"
#define TX_DC_ENTRIES …
#define TX_DC_ENTRIES_ORDER …
#define RX_DC_ENTRIES …
#define RX_DC_ENTRIES_ORDER …
#define EFX_INT_ERROR_EXPIRE …
#define EFX_MAX_INT_ERRORS …
#define EFX_RX_FLUSH_COUNT …
#define _EFX_CHANNEL_MAGIC_TEST …
#define _EFX_CHANNEL_MAGIC_FILL …
#define _EFX_CHANNEL_MAGIC_RX_DRAIN …
#define _EFX_CHANNEL_MAGIC_TX_DRAIN …
#define _EFX_CHANNEL_MAGIC(_code, _data) …
#define _EFX_CHANNEL_MAGIC_CODE(_magic) …
#define EFX_CHANNEL_MAGIC_TEST(_channel) …
#define EFX_CHANNEL_MAGIC_FILL(_rx_queue) …
#define EFX_CHANNEL_MAGIC_RX_DRAIN(_rx_queue) …
#define EFX_CHANNEL_MAGIC_TX_DRAIN(_tx_queue) …
static void efx_farch_magic_event(struct efx_channel *channel, u32 magic);
static inline void efx_write_buf_tbl(struct efx_nic *efx, efx_qword_t *value,
unsigned int index)
{ … }
static bool efx_masked_compare_oword(const efx_oword_t *a, const efx_oword_t *b,
const efx_oword_t *mask)
{ … }
int efx_farch_test_registers(struct efx_nic *efx,
const struct efx_farch_register_test *regs,
size_t n_regs)
{ … }
static void
efx_init_special_buffer(struct efx_nic *efx, struct efx_special_buffer *buffer)
{ … }
static void
efx_fini_special_buffer(struct efx_nic *efx, struct efx_special_buffer *buffer)
{ … }
static int efx_alloc_special_buffer(struct efx_nic *efx,
struct efx_special_buffer *buffer,
unsigned int len)
{ … }
static void
efx_free_special_buffer(struct efx_nic *efx, struct efx_special_buffer *buffer)
{ … }
static inline void efx_farch_notify_tx_desc(struct efx_tx_queue *tx_queue)
{ … }
static inline void efx_farch_push_tx_desc(struct efx_tx_queue *tx_queue,
const efx_qword_t *txd)
{ … }
void efx_farch_tx_write(struct efx_tx_queue *tx_queue)
{ … }
unsigned int efx_farch_tx_limit_len(struct efx_tx_queue *tx_queue,
dma_addr_t dma_addr, unsigned int len)
{ … }
int efx_farch_tx_probe(struct efx_tx_queue *tx_queue)
{ … }
void efx_farch_tx_init(struct efx_tx_queue *tx_queue)
{ … }
static void efx_farch_flush_tx_queue(struct efx_tx_queue *tx_queue)
{ … }
void efx_farch_tx_fini(struct efx_tx_queue *tx_queue)
{ … }
void efx_farch_tx_remove(struct efx_tx_queue *tx_queue)
{ … }
static inline void
efx_farch_build_rx_desc(struct efx_rx_queue *rx_queue, unsigned index)
{ … }
void efx_farch_rx_write(struct efx_rx_queue *rx_queue)
{ … }
int efx_farch_rx_probe(struct efx_rx_queue *rx_queue)
{ … }
void efx_farch_rx_init(struct efx_rx_queue *rx_queue)
{ … }
static void efx_farch_flush_rx_queue(struct efx_rx_queue *rx_queue)
{ … }
void efx_farch_rx_fini(struct efx_rx_queue *rx_queue)
{ … }
void efx_farch_rx_remove(struct efx_rx_queue *rx_queue)
{ … }
static bool efx_farch_flush_wake(struct efx_nic *efx)
{ … }
static bool efx_check_tx_flush_complete(struct efx_nic *efx)
{ … }
static int efx_farch_do_flush(struct efx_nic *efx)
{ … }
int efx_farch_fini_dmaq(struct efx_nic *efx)
{ … }
void efx_farch_finish_flr(struct efx_nic *efx)
{ … }
void efx_farch_ev_read_ack(struct efx_channel *channel)
{ … }
void efx_farch_generate_event(struct efx_nic *efx, unsigned int evq,
efx_qword_t *event)
{ … }
static void efx_farch_magic_event(struct efx_channel *channel, u32 magic)
{ … }
static void
efx_farch_handle_tx_event(struct efx_channel *channel, efx_qword_t *event)
{ … }
static u16 efx_farch_handle_rx_not_ok(struct efx_rx_queue *rx_queue,
const efx_qword_t *event)
{ … }
static bool
efx_farch_handle_rx_bad_index(struct efx_rx_queue *rx_queue, unsigned index)
{ … }
static void
efx_farch_handle_rx_event(struct efx_channel *channel, const efx_qword_t *event)
{ … }
static void
efx_farch_handle_tx_flush_done(struct efx_nic *efx, efx_qword_t *event)
{ … }
static void
efx_farch_handle_rx_flush_done(struct efx_nic *efx, efx_qword_t *event)
{ … }
static void
efx_farch_handle_drain_event(struct efx_channel *channel)
{ … }
static void efx_farch_handle_generated_event(struct efx_channel *channel,
efx_qword_t *event)
{ … }
static void
efx_farch_handle_driver_event(struct efx_channel *channel, efx_qword_t *event)
{ … }
int efx_farch_ev_process(struct efx_channel *channel, int budget)
{ … }
int efx_farch_ev_probe(struct efx_channel *channel)
{ … }
int efx_farch_ev_init(struct efx_channel *channel)
{ … }
void efx_farch_ev_fini(struct efx_channel *channel)
{ … }
void efx_farch_ev_remove(struct efx_channel *channel)
{ … }
void efx_farch_ev_test_generate(struct efx_channel *channel)
{ … }
void efx_farch_rx_defer_refill(struct efx_rx_queue *rx_queue)
{ … }
static inline void efx_farch_interrupts(struct efx_nic *efx,
bool enabled, bool force)
{ … }
void efx_farch_irq_enable_master(struct efx_nic *efx)
{ … }
void efx_farch_irq_disable_master(struct efx_nic *efx)
{ … }
int efx_farch_irq_test_generate(struct efx_nic *efx)
{ … }
irqreturn_t efx_farch_fatal_interrupt(struct efx_nic *efx)
{ … }
irqreturn_t efx_farch_legacy_interrupt(int irq, void *dev_id)
{ … }
irqreturn_t efx_farch_msi_interrupt(int irq, void *dev_id)
{ … }
void efx_farch_rx_push_indir_table(struct efx_nic *efx)
{ … }
void efx_farch_rx_pull_indir_table(struct efx_nic *efx)
{ … }
void efx_farch_dimension_resources(struct efx_nic *efx, unsigned sram_lim_qw)
{ … }
u32 efx_farch_fpga_ver(struct efx_nic *efx)
{ … }
void efx_farch_init_common(struct efx_nic *efx)
{ … }
#define EFX_FARCH_FILTER_CTL_SRCH_FUDGE_WILD …
#define EFX_FARCH_FILTER_CTL_SRCH_FUDGE_FULL …
#define EFX_FARCH_FILTER_CTL_SRCH_MAX …
#define EFX_FARCH_FILTER_CTL_SRCH_HINT_MAX …
enum efx_farch_filter_type { … };
enum efx_farch_filter_table_id { … };
enum efx_farch_filter_index { … };
struct efx_farch_filter_spec { … };
struct efx_farch_filter_table { … };
struct efx_farch_filter_state { … };
static void
efx_farch_filter_table_clear_entry(struct efx_nic *efx,
struct efx_farch_filter_table *table,
unsigned int filter_idx);
static u16 efx_farch_filter_hash(u32 key)
{ … }
static u16 efx_farch_filter_increment(u32 key)
{ … }
static enum efx_farch_filter_table_id
efx_farch_filter_spec_table_id(const struct efx_farch_filter_spec *spec)
{ … }
static void efx_farch_filter_push_rx_config(struct efx_nic *efx)
{ … }
static void efx_farch_filter_push_tx_limits(struct efx_nic *efx)
{ … }
static int
efx_farch_filter_from_gen_spec(struct efx_farch_filter_spec *spec,
const struct efx_filter_spec *gen_spec)
{ … }
static void
efx_farch_filter_to_gen_spec(struct efx_filter_spec *gen_spec,
const struct efx_farch_filter_spec *spec)
{ … }
static void
efx_farch_filter_init_rx_auto(struct efx_nic *efx,
struct efx_farch_filter_spec *spec)
{ … }
static u32 efx_farch_filter_build(efx_oword_t *filter,
struct efx_farch_filter_spec *spec)
{ … }
static bool efx_farch_filter_equal(const struct efx_farch_filter_spec *left,
const struct efx_farch_filter_spec *right)
{ … }
#define EFX_FARCH_FILTER_MATCH_PRI_COUNT …
static const u8 efx_farch_filter_type_match_pri[EFX_FARCH_FILTER_TYPE_COUNT] = …;
static const enum efx_farch_filter_table_id efx_farch_filter_range_table[] = …;
#define EFX_FARCH_FILTER_INDEX_WIDTH …
#define EFX_FARCH_FILTER_INDEX_MASK …
static inline u32
efx_farch_filter_make_id(const struct efx_farch_filter_spec *spec,
unsigned int index)
{ … }
static inline enum efx_farch_filter_table_id
efx_farch_filter_id_table_id(u32 id)
{ … }
static inline unsigned int efx_farch_filter_id_index(u32 id)
{ … }
u32 efx_farch_filter_get_rx_id_limit(struct efx_nic *efx)
{ … }
s32 efx_farch_filter_insert(struct efx_nic *efx,
struct efx_filter_spec *gen_spec,
bool replace_equal)
{ … }
static void
efx_farch_filter_table_clear_entry(struct efx_nic *efx,
struct efx_farch_filter_table *table,
unsigned int filter_idx)
{ … }
static int efx_farch_filter_remove(struct efx_nic *efx,
struct efx_farch_filter_table *table,
unsigned int filter_idx,
enum efx_filter_priority priority)
{ … }
int efx_farch_filter_remove_safe(struct efx_nic *efx,
enum efx_filter_priority priority,
u32 filter_id)
{ … }
int efx_farch_filter_get_safe(struct efx_nic *efx,
enum efx_filter_priority priority,
u32 filter_id, struct efx_filter_spec *spec_buf)
{ … }
static void
efx_farch_filter_table_clear(struct efx_nic *efx,
enum efx_farch_filter_table_id table_id,
enum efx_filter_priority priority)
{ … }
int efx_farch_filter_clear_rx(struct efx_nic *efx,
enum efx_filter_priority priority)
{ … }
u32 efx_farch_filter_count_rx_used(struct efx_nic *efx,
enum efx_filter_priority priority)
{ … }
s32 efx_farch_filter_get_rx_ids(struct efx_nic *efx,
enum efx_filter_priority priority,
u32 *buf, u32 size)
{ … }
void efx_farch_filter_table_restore(struct efx_nic *efx)
{ … }
void efx_farch_filter_table_remove(struct efx_nic *efx)
{ … }
int efx_farch_filter_table_probe(struct efx_nic *efx)
{ … }
void efx_farch_filter_update_rx_scatter(struct efx_nic *efx)
{ … }
#ifdef CONFIG_RFS_ACCEL
bool efx_farch_filter_rfs_expire_one(struct efx_nic *efx, u32 flow_id,
unsigned int index)
{ … }
#endif
void efx_farch_filter_sync_rx_mode(struct efx_nic *efx)
{ … }