84 ESF_DZ_TX_KER_TYPE, 0,
85 ESF_DZ_TX_KER_CONT, 0,
86 ESF_DZ_TX_KER_BYTE_CNT,
iob_len(iob),
87 ESF_DZ_TX_KER_BUF_ADDR, dma_addr);
106 int fill_level, space;
118 txq->
buf[buf_id] = iob;
120 DBGCIO(efx,
"tx_buf[%d] for iob %p data %p len %zd\n",
149 DBGCIO(efx,
"tx_buf[%d] for iob %p done\n", read_ptr, iob);
188 ESF_DZ_RX_KER_BUF_ADDR, dma_addr);
221 DBGCP(efx,
"pushing rx_buf[%d] iob %p data %p\n",
222 buf_id, iob, iob->
data);
224 rxq->
buf[buf_id] = iob;
236 DBGCP(efx,
"pushed %d rx buffers to fill level %d\n",
251 assert((
id & 15) == ((read_ptr + (
len != 0)) & 15));
254 iob = rxq->
buf[buf_ptr];
257 DBGCIO(efx,
"popping rx_buf[%d] iob %p data %p with %d bytes %s %x\n",
258 read_ptr, iob, iob->
data,
len, drop ?
"bad" :
"ok", drop);
358 ERF_DD_EVQ_IND_RPTR, evq->
read_ptr &
371 int ev_code, desc_ptr,
len;
372 int next_ptr_lbits, packet_drop;
393 packet_drop = (
len == 0) | (rx_cont << 1) |
400 DBGCP(efx,
"Unknown event type %d\n", ev_code);
418 DBGCP(efx,
"Event at index 0x%x address %p is "
474 ERF_DZ_TC_TIMER_MODE, 0,
475 ERF_DZ_TC_TIMER_VAL, 0);
#define NULL
NULL pointer (VOID *)
#define assert(condition)
Assert a condition at run-time.
EF10 hardware architecture definitions.
#define EFE_DD_EVQ_IND_RPTR_FLAGS_HIGH
#define EFE_DD_EVQ_IND_RPTR_FLAGS_LOW
#define ESE_DZ_EV_CODE_TX_EV
#define ESE_DZ_EV_CODE_RX_EV
#define ER_DD_EVQ_INDIRECT
#define ER_DZ_RX_DESC_UPD
#define ER_DZ_BIU_INT_ISR
#define ER_DZ_TX_DESC_UPD_DWORD
#define ERF_DD_EVQ_IND_RPTR_WIDTH
#define EFX_QWORD_VAL(qword)
#define EFX_POPULATE_DWORD_2(dword,...)
#define EFX_SET_QWORD(qword)
#define EFX_DWORD_IS_ALL_ONES(dword)
#define EFX_POPULATE_QWORD_2(qword,...)
#define EFX_POPULATE_DWORD_1(dword,...)
#define EFX_POPULATE_QWORD_4(qword,...)
union efx_dword efx_dword_t
A doubleword (4 byte) datatype - little-endian in HW.
void efx_readl(struct efx_nic *efx, efx_dword_t *value, unsigned int reg)
#define efx_writel_page(efx, value, index, reg)
#define efx_writel_table(efx, value, index, reg)
efx_qword_t efx_rx_desc_t
#define EFX_NUM_RX_DESC_MASK
efx_qword_t efx_tx_desc_t
void efx_hunt_free_special_buffer(void *buf, int bytes)
static void efx_hunt_rxq_fill(struct efx_nic *efx)
int efx_hunt_open(struct net_device *netdev)
static void efx_hunt_evq_read_ack(struct efx_nic *efx)
static void efx_hunt_receive(struct efx_nic *efx, unsigned int id, int len, int drop)
static void efx_hunt_clear_interrupts(struct efx_nic *efx)
static void efx_hunt_build_rx_desc(efx_rx_desc_t *rxd, struct io_buffer *iob)
static void efx_hunt_build_tx_desc(efx_tx_desc_t *txd, struct io_buffer *iob)
static int efx_hunt_event_present(efx_event_t *event)
See if an event is present.
void efx_hunt_close(struct net_device *netdev)
int efx_hunt_ev_init(struct net_device *netdev, dma_addr_t *dma_addr)
int efx_hunt_rx_init(struct net_device *netdev, dma_addr_t *dma_addr)
static void efx_hunt_notify_rx_desc(struct efx_nic *efx)
void efx_hunt_poll(struct net_device *netdev)
int efx_hunt_transmit(struct net_device *netdev, struct io_buffer *iob)
static unsigned int efx_hunt_handle_event(struct efx_nic *efx, efx_event_t *evt)
void efx_hunt_irq(struct net_device *netdev, int enable)
int efx_hunt_tx_init(struct net_device *netdev, dma_addr_t *dma_addr)
static void * efx_hunt_alloc_special_buffer(int bytes, struct efx_special_buffer *entry)
static void efx_hunt_notify_tx_desc(struct efx_nic *efx)
static void efx_hunt_transmit_done(struct efx_nic *efx, int id)
static struct net_device * netdev
uint32_t buffer
Buffer index (or NETVSC_RNDIS_NO_BUFFER)
#define FILE_LICENCE(_licence)
Declare a particular licence as applying to a file.
#define EBADMSG
Bad message.
#define ENOMEM
Not enough space.
#define ENOBUFS
No buffer space available.
static __always_inline unsigned long virt_to_bus(volatile const void *addr)
Convert virtual address to a bus address.
void * memset(void *dest, int character, size_t len) __nonnull
void free_iob(struct io_buffer *iobuf)
Free I/O buffer.
struct io_buffer * alloc_iob(size_t len)
Allocate I/O buffer.
#define iob_put(iobuf, len)
static size_t iob_len(struct io_buffer *iobuf)
Calculate length of data in an I/O buffer.
#define iob_pull(iobuf, len)
void * malloc_phys(size_t size, size_t phys_align)
Allocate memory with specified physical alignment.
void free_phys(void *ptr, size_t size)
Free memory allocated with malloc_phys()
Dynamic memory allocation.
static unsigned int unsigned int reg
void netdev_rx(struct net_device *netdev, struct io_buffer *iobuf)
Add packet to receive queue.
void netdev_rx_err(struct net_device *netdev, struct io_buffer *iobuf, int rc)
Discard received packet.
Network device management.
static void netdev_tx_complete(struct net_device *netdev, struct io_buffer *iobuf)
Complete network transmission.
#define NETDEV_OPEN
Network device is open.
struct efx_special_buffer entry
struct net_device * netdev
unsigned int rx_prefix_size
unsigned int rx_cont_prev
struct io_buffer * buf[EFX_NUM_RX_DESC]
struct efx_special_buffer entry
A buffer table allocation backing a tx dma, rx dma or eventq.
struct io_buffer * buf[EFX_TXD_SIZE]
struct efx_special_buffer entry
void * data
Start of data.
unsigned int state
Current device state.