48 #define EINFO_EIO_ADMIN_UNSET \ 49 __einfo_uniqify ( EINFO_EIO, 0x00, "Uncompleted" ) 50 #define EIO_ADMIN_UNSET \ 51 __einfo_error ( EINFO_EIO_ADMIN_UNSET ) 52 #define EINFO_EIO_ADMIN_ABORTED \ 53 __einfo_uniqify ( EINFO_EIO, 0x10, "Aborted" ) 54 #define EIO_ADMIN_ABORTED \ 55 __einfo_error ( EINFO_EIO_ADMIN_ABORTED ) 56 #define EINFO_EIO_ADMIN_EXISTS \ 57 __einfo_uniqify ( EINFO_EIO, 0x11, "Already exists" ) 58 #define EIO_ADMIN_EXISTS \ 59 __einfo_error ( EINFO_EIO_ADMIN_EXISTS ) 60 #define EINFO_EIO_ADMIN_CANCELLED \ 61 __einfo_uniqify ( EINFO_EIO, 0x12, "Cancelled" ) 62 #define EIO_ADMIN_CANCELLED \ 63 __einfo_error ( EINFO_EIO_ADMIN_CANCELLED ) 64 #define EINFO_EIO_ADMIN_DATALOSS \ 65 __einfo_uniqify ( EINFO_EIO, 0x13, "Data loss" ) 66 #define EIO_ADMIN_DATALOSS \ 67 __einfo_error ( EINFO_EIO_ADMIN_DATALOSS ) 68 #define EINFO_EIO_ADMIN_DEADLINE \ 69 __einfo_uniqify ( EINFO_EIO, 0x14, "Deadline exceeded" ) 70 #define EIO_ADMIN_DEADLINE \ 71 __einfo_error ( EINFO_EIO_ADMIN_DEADLINE ) 72 #define EINFO_EIO_ADMIN_PRECONDITION \ 73 __einfo_uniqify ( EINFO_EIO, 0x15, "Failed precondition" ) 74 #define EIO_ADMIN_PRECONDITION \ 75 __einfo_error ( EINFO_EIO_ADMIN_PRECONDITION ) 76 #define EINFO_EIO_ADMIN_INTERNAL \ 77 __einfo_uniqify ( EINFO_EIO, 0x16, "Internal error" ) 78 #define EIO_ADMIN_INTERNAL \ 79 __einfo_error ( EINFO_EIO_ADMIN_INTERNAL ) 80 #define EINFO_EIO_ADMIN_INVAL \ 81 __einfo_uniqify ( EINFO_EIO, 0x17, "Invalid argument" ) 82 #define EIO_ADMIN_INVAL \ 83 __einfo_error ( EINFO_EIO_ADMIN_INVAL ) 84 #define EINFO_EIO_ADMIN_NOT_FOUND \ 85 __einfo_uniqify ( EINFO_EIO, 0x18, "Not found" ) 86 #define EIO_ADMIN_NOT_FOUND \ 87 __einfo_error ( EINFO_EIO_ADMIN_NOT_FOUND ) 88 #define EINFO_EIO_ADMIN_RANGE \ 89 __einfo_uniqify ( EINFO_EIO, 0x19, "Out of range" ) 90 #define EIO_ADMIN_RANGE \ 91 __einfo_error ( EINFO_EIO_ADMIN_RANGE ) 92 #define EINFO_EIO_ADMIN_PERM \ 93 __einfo_uniqify ( EINFO_EIO, 0x1a, "Permission denied" ) 94 #define EIO_ADMIN_PERM \ 95 __einfo_error ( EINFO_EIO_ADMIN_PERM ) 96 #define EINFO_EIO_ADMIN_UNAUTH \ 97 __einfo_uniqify ( EINFO_EIO, 0x1b, "Unauthenticated" ) 98 #define EIO_ADMIN_UNAUTH \ 99 __einfo_error ( EINFO_EIO_ADMIN_UNAUTH ) 100 #define EINFO_EIO_ADMIN_RESOURCE \ 101 __einfo_uniqify ( EINFO_EIO, 0x1c, "Resource exhausted" ) 102 #define EIO_ADMIN_RESOURCE \ 103 __einfo_error ( EINFO_EIO_ADMIN_RESOURCE ) 104 #define EINFO_EIO_ADMIN_UNAVAIL \ 105 __einfo_uniqify ( EINFO_EIO, 0x1d, "Unavailable" ) 106 #define EIO_ADMIN_UNAVAIL \ 107 __einfo_error ( EINFO_EIO_ADMIN_UNAVAIL ) 108 #define EINFO_EIO_ADMIN_NOTSUP \ 109 __einfo_uniqify ( EINFO_EIO, 0x1e, "Unimplemented" ) 110 #define EIO_ADMIN_NOTSUP \ 111 __einfo_error ( EINFO_EIO_ADMIN_NOTSUP ) 112 #define EINFO_EIO_ADMIN_UNKNOWN \ 113 __einfo_uniqify ( EINFO_EIO, 0x1f, "Unknown error" ) 114 #define EIO_ADMIN_UNKNOWN \ 115 __einfo_error ( EINFO_EIO_ADMIN_UNKNOWN ) 116 #define EIO_ADMIN( status ) \ 117 EUNIQ ( EINFO_EIO, ( (status) & 0x1f ), \ 118 EIO_ADMIN_UNSET, EIO_ADMIN_ABORTED, EIO_ADMIN_EXISTS, \ 119 EIO_ADMIN_CANCELLED, EIO_ADMIN_DATALOSS, \ 120 EIO_ADMIN_DEADLINE, EIO_ADMIN_PRECONDITION, \ 121 EIO_ADMIN_INTERNAL, EIO_ADMIN_INVAL, \ 122 EIO_ADMIN_NOT_FOUND, EIO_ADMIN_RANGE, EIO_ADMIN_PERM, \ 123 EIO_ADMIN_UNAUTH, EIO_ADMIN_RESOURCE, \ 124 EIO_ADMIN_UNAVAIL, EIO_ADMIN_NOTSUP, EIO_ADMIN_UNKNOWN ) 152 DBGC ( gve,
"GVE %p skipping reset\n", gve );
172 DBGC ( gve,
"GVE %p reset timed out (PFN %#08x devstat %#08x)\n",
196 size_t scratch_len =
sizeof ( *scratch->
buf );
201 if ( ! admin->
cmd ) {
208 if ( ! scratch->
buf ) {
213 DBGC ( gve,
"GVE %p AQ at [%08lx,%08lx) scratch [%08lx,%08lx)\n",
236 size_t scratch_len =
sizeof ( *scratch->
buf );
313 if ( evt == admin->
prod )
325 DBGC ( gve,
"GVE %p AQ %#02x %s (completed %#02x, status %#08x)\n",
326 gve, admin->
prod, ( pfn ?
"timed out" :
"saw reset" ), evt,
353 DBGC2 ( gve,
"GVE %p AQ %#02x command %#04x request:\n",
372 DBGC ( gve,
"GVE %p AQ %#02x command %#04x failed: %#08x\n",
379 DBGC2 ( gve,
"GVE %p AQ %#02x command %#04x result:\n",
435 DBGC2 ( gve,
"GVE %p device descriptor:\n", gve );
442 DBGC ( gve,
"GVE %p using %d TX, %d RX, %d events\n",
450 DBGC ( gve,
"GVE %p MAC %s (\"%s\") MTU %zd\n",
490 DBGC ( gve,
"GVE %p IRQ %d doorbell +%#04x\n", gve, i, db_off );
491 irqs->
db[i] = ( gve->
db + db_off );
529 for ( i = 0 ; i < qpl->
count ; i++ ) {
620 unsigned int evt_idx;
629 cmd->hdr.opcode =
type->create;
639 DBGC ( gve,
"GVE %p %s doorbell +%#04x event counter %d\n",
640 gve,
type->name, db_off, evt_idx );
641 queue->db = ( gve->
db + db_off );
642 assert ( evt_idx < gve->events.count );
694 DBGC ( gve,
"GVE %p IRQs at [%08lx,%08lx)\n",
700 if ( ! events->
event ) {
704 DBGC ( gve,
"GVE %p events at [%08lx,%08lx)\n",
745 uint32_t id,
unsigned int buffers ) {
762 DBGC ( gve,
"GVE %p QPL %#08x at [%08lx,%08lx)\n",
848 size_t desc_len = (
queue->count *
type->desc_len );
849 size_t cmplt_len = (
queue->count *
type->cmplt_len );
850 size_t res_len =
sizeof ( *
queue->res );
857 if ( (
queue->count == 0 ) ||
859 DBGC ( gve,
"GVE %p %s invalid queue size %d\n",
870 DBGC ( gve,
"GVE %p %s using QPL %#08x with %d/%d descriptors\n",
875 queue->fill ) ) != 0 )
881 if ( !
queue->desc ) {
885 DBGC ( gve,
"GVE %p %s descriptors at [%08lx,%08lx)\n",
893 if ( !
queue->cmplt ) {
897 DBGC ( gve,
"GVE %p %s completions at [%08lx,%08lx)\n",
904 if ( !
queue->res ) {
912 for ( i = 0 ; i <
queue->count ; i++ ) {
943 size_t res_len =
sizeof ( *
queue->res );
974 for ( i = 0 ; i < (
sizeof ( gve->
tx_iobuf ) /
975 sizeof ( gve->
tx_iobuf[0] ) ) ; i++ ) {
994 goto err_register_tx;
998 goto err_register_rx;
1075 DBGC ( gve,
"GVE %p startup failed: %s\n", gve,
strerror (
rc ) );
1113 DBGC ( gve,
"GVE %p synthesising host reset\n", gve );
1127 DBGC2 ( gve,
"GVE %p idle but not in reset\n", gve );
1132 DBGC ( gve,
"GVE %p watchdog detected reset by host\n", gve );
1150 goto err_alloc_shared;
1229 if ( ( (
tx->prod -
tx->cons ) +
count ) >
tx->fill ) {
1248 index = (
tx->prod++ & (
tx->count - 1 ) );
1259 sizeof (
desc.pkt ) );
1260 DBGC2 ( gve,
"GVE %p TX %#04x %#02x:%#02x len %#04x/%#04x at " 1294 DBGC2 ( gve,
"GVE %p TX %#04x complete\n", gve,
tx->cons );
1332 sizeof ( cmplt.
pkt ) );
1341 DBGC2 ( gve,
"GVE %p RX %#04x %#02x:%#02x len %#04zx at " 1357 for ( ;
rx->cons !=
cons ;
rx->cons++ ) {
1360 index = (
rx->cons & (
rx->count - 1 ) );
1364 sizeof ( cmplt.
pkt.
len ) );
1411 if (
prod !=
rx->prod ) {
1414 DBGC2 ( gve,
"GVE %p RX %#04x ready\n", gve,
rx->prod );
1509 DBGC ( gve,
"GVE %p failed to get device description: %s\n",
1527 unsigned long cfg_start;
1528 unsigned long db_start;
1529 unsigned long db_size;
1542 memset ( gve, 0,
sizeof ( *gve ) );
1555 DBGC ( gve,
"GVE %p is revision %#02x\n", gve, gve->
revision );
1589 goto err_register_netdev;
1594 err_register_netdev:
1638 PCI_ROM ( 0x1ae0, 0x0042,
"gve",
"gVNIC", 0 ),
#define cpu_to_be16(value)
#define iob_pull(iobuf, len)
#define EINVAL
Invalid argument.
#define GVE_PAGE_SIZE
Page size.
#define ECONNRESET
Connection reset.
struct dma_device * dma
DMA device.
struct arbelprm_rc_send_wqe rc
#define GVE_ADMIN_STATUS_OK
Command succeeded.
struct gve_rx_packet pkt
Packet descriptor.
static void netdev_tx_complete(struct net_device *netdev, struct io_buffer *iobuf)
Complete network transmission.
static void gve_stop(struct gve_nic *gve)
Stop device.
#define iob_put(iobuf, len)
struct dma_device dma
DMA device.
void netdev_rx_err(struct net_device *netdev, struct io_buffer *iobuf, int rc)
Discard received packet.
void netdev_tx_defer(struct net_device *netdev, struct io_buffer *iobuf)
Defer transmitted packet.
static void gve_refill_rx(struct net_device *netdev)
Refill receive queue.
Create receive queue command.
static int gve_describe(struct gve_nic *gve)
Get device descriptor.
#define GVE_CFG_ADMIN_PFN
Admin queue page frame number (for older devices)
#define GVE_ADMIN_DESTROY_RX
Destroy receive queue command.
int(* open)(struct net_device *netdev)
Open network device.
static int gve_alloc_queue(struct gve_nic *gve, struct gve_queue *queue)
Allocate descriptor queue.
struct dma_mapping map
DMA mapping.
struct gve_event * event
Event counters.
#define GVE_ADMIN_DESCRIBE
Describe device command.
union gve_scratch::@46 * buf
Buffer contents.
static void gve_startup(struct gve_nic *gve)
Device startup process.
#define GVE_RX_IRQ
Receive queue interrupt channel.
#define GVE_CFG_DEVSTAT
Device status.
static int gve_destroy_queue(struct gve_nic *gve, struct gve_queue *queue)
Destroy transmit or receive queue.
static int gve_alloc_shared(struct gve_nic *gve)
Allocate shared queue resources.
struct gve_device_descriptor desc
Device descriptor.
struct pci_device_id * ids
PCI ID table.
#define GVE_CFG_BAR
Configuration BAR.
uint32_t type
Operating system type.
static int gve_deconfigure(struct gve_nic *gve)
Deconfigure device resources.
size_t mtu
Maximum transmission unit length.
static __always_inline void copy_from_user(void *dest, userptr_t src, off_t src_off, size_t len)
Copy data from user buffer.
#define GVE_RXF_MORE
Receive packet continues into next descriptor.
#define GVE_CFG_DRVSTAT
Driver status.
physaddr_t dma_phys(struct dma_mapping *map, physaddr_t addr)
Get DMA address from physical address.
Create transmit queue command.
uint32_t readl(volatile uint32_t *io_addr)
Read 32-bit dword from memory-mapped device.
unsigned long user_to_phys(userptr_t userptr, off_t offset)
Convert user pointer to physical address.
uint64_t desc
Microcode descriptor list physical address.
static int gve_admin(struct gve_nic *gve)
Issue admin queue command.
static int gve_admin_alloc(struct gve_nic *gve)
Allocate admin queue.
#define GVE_ALIGN
Address alignment.
uint64_t addr[GVE_QPL_MAX]
Page address.
static __always_inline void dma_set_mask_64bit(struct dma_device *dma)
Set 64-bit addressable space mask.
unsigned long long uint64_t
static void gve_create_rx_param(struct gve_queue *queue, union gve_admin_command *cmd)
Construct command to create receive queue.
A receive completion descriptor.
#define GVE_ADMIN_DESTROY_TX
Destroy transmit queue command.
struct dma_device * dma
DMA device.
void netdev_link_down(struct net_device *netdev)
Mark network device as having link down.
#define GVE_BUF_PER_PAGE
Number of data buffers per page.
#define PROC_DESC_ONCE(object_type, process, _step)
Define a process descriptor for a process that runs only once.
#define GVE_IRQ_DISABLE
Disable interrupts.
#define offsetof(type, field)
Get offset of a field within a structure.
A transmit or receive buffer descriptor.
static void gve_remove(struct pci_device *pci)
Remove PCI device.
#define GVE_WATCHDOG_TIMEOUT
Time between reset recovery checks.
#define GVE_ADMIN_REGISTER
Register page list command.
void process_del(struct process *process)
Remove process from process list.
void adjust_pci_device(struct pci_device *pci)
Enable PCI device.
struct io_buffer * alloc_iob(size_t len)
Allocate I/O buffer.
static void gve_free_queue(struct gve_nic *gve, struct gve_queue *queue)
Free descriptor queue.
static __always_inline unsigned long virt_to_phys(volatile const void *addr)
Convert virtual address to a physical address.
static int gve_register(struct gve_nic *gve, struct gve_qpl *qpl)
Register queue page list.
struct gve_queue rx
Receive queue.
struct device dev
Generic device.
#define GVE_TX_TYPE_CONT
Continuation of packet transmit descriptor type.
static struct net_device_operations gve_operations
GVE network device operations.
struct gve_queue tx
Transmit queue.
#define ECANCELED
Operation canceled.
u16 seq
802.11 Sequence Control field
#define GVE_TX_FILL
Maximum number of transmit buffers.
static const struct gve_queue_type gve_tx_type
Transmit descriptor queue type.
static int gve_start(struct gve_nic *gve)
Start up device.
#define GVE_DB_BAR
Doorbell BAR.
static void netdev_init(struct net_device *netdev, struct net_device_operations *op)
Initialise a network device.
void memset_user(userptr_t userptr, off_t offset, int c, size_t len)
Fill user buffer with a constant byte.
static void pci_set_drvdata(struct pci_device *pci, void *priv)
Set PCI driver-private data.
struct dma_mapping map
Page mapping.
#define ENOMEM
Not enough space.
uint32_t activity
Reset recovery recorded activity counter.
void * db
Doorbell registers.
userptr_t userptr_add(userptr_t userptr, off_t offset)
Add offset to user pointer.
void * memcpy(void *dest, const void *src, size_t len) __nonnull
struct retry_timer watchdog
Reset recovery watchdog timer.
uint32_t userptr_t
A pointer to a user buffer.
#define GVE_CFG_ADMIN_DB
Admin queue doorbell.
void dma_free(struct dma_mapping *map, void *addr, size_t len)
Unmap and free DMA-coherent buffer.
#define GVE_RX_SEQ_MASK
Receive sequence number mask.
struct dma_mapping map
DMA mapping.
#define be32_to_cpu(value)
struct process startup
Startup process.
assert((readw(&hdr->flags) &(GTF_reading|GTF_writing))==0)
Google Virtual Ethernet network driver.
static void netdev_put(struct net_device *netdev)
Drop reference to network device.
#define GVE_RX_FILL
Maximum number of receive buffers.
#define container_of(ptr, type, field)
Get containing structure.
static userptr_t gve_buffer(struct gve_queue *queue, unsigned int index)
Get buffer address.
uint8_t seq
Sequence number.
#define GVE_ADMIN_CREATE_TX
Create transmit queue command.
#define GVE_CFG_ADMIN_LEN
Admin queue base address length (16-bit register)
void * priv
Driver private data.
static int gve_reset(struct gve_nic *gve)
Reset hardware.
static void gve_free_qpl(struct gve_nic *nic __unused, struct gve_qpl *qpl)
Free queue page list.
static int gve_admin_simple(struct gve_nic *gve, unsigned int opcode, unsigned int id)
Issue simple admin queue command.
#define __unused
Declare a variable or data structure as unused.
uint32_t cons
Consumer counter.
static void netdev_link_up(struct net_device *netdev)
Mark network device as having link up.
void writel(uint32_t data, volatile uint32_t *io_addr)
Write 32-bit dword to memory-mapped device.
volatile uint32_t * db[GVE_IRQ_COUNT]
Interrupt doorbells.
static void gve_poll_rx(struct net_device *netdev)
Poll for received packets.
#define build_assert(condition)
Assert a condition at build time (after dead code elimination)
uint32_t prod
Producer counter.
static int netdev_link_ok(struct net_device *netdev)
Check link state of network device.
static struct net_device * netdev
unsigned int count
Number of pages.
#define be16_to_cpu(value)
uint16_t count
Number of entries.
unsigned long pci_bar_start(struct pci_device *pci, unsigned int reg)
Find the start of a PCI BAR.
#define GVE_TX_TYPE_START
Start of packet transmit descriptor type.
struct gve_irqs irqs
Interrupt channels.
#define GVE_TX_QPL
Transmit queue page list ID.
static void gve_create_tx_param(struct gve_queue *queue, union gve_admin_command *cmd)
Construct command to create transmit queue.
void unregister_netdev(struct net_device *netdev)
Unregister network device.
static int gve_create_queue(struct gve_nic *gve, struct gve_queue *queue)
Create transmit or receive queue.
uint8_t id
Request identifier.
void process_add(struct process *process)
Add process to process list.
void * cfg
Configuration registers.
#define GVE_CFG_ADMIN_BASE_LO
Admin queue base address low 32 bits.
#define GVE_RESET_MAX_WAIT_MS
Maximum time to wait for reset.
char * strerror(int errno)
Retrieve string representation of error number.
struct refcnt refcnt
Reference counter.
static int gve_alloc_qpl(struct gve_nic *gve, struct gve_qpl *qpl, uint32_t id, unsigned int buffers)
Allocate queue page list.
uint16_t cons
Consumer index.
static void gve_restart(struct gve_nic *gve)
Trigger startup process.
static void gve_poll_tx(struct net_device *netdev)
Poll for completed transmissions.
int register_netdev(struct net_device *netdev)
Register network device.
static size_t iob_len(struct io_buffer *iobuf)
Calculate length of data in an I/O buffer.
const char * eth_ntoa(const void *ll_addr)
Transcribe Ethernet address.
static __always_inline void copy_to_user(userptr_t dest, off_t dest_off, const void *src, size_t len)
Copy data to user buffer.
void netdev_link_err(struct net_device *netdev, int rc)
Mark network device as having a specific link state.
#define ENODEV
No such device.
char * inet_ntoa(struct in_addr in)
Convert IPv4 address to dotted-quad notation.
static void netdev_nullify(struct net_device *netdev)
Stop using a network device.
#define GVE_ADMIN_DECONFIGURE
Deconfigure device resources command.
A Google Virtual Ethernet NIC.
struct io_buffer * tx_iobuf[GVE_TX_FILL]
Transmit I/O buffers.
static void gve_watchdog(struct retry_timer *timer, int over __unused)
Reset recovery watchdog.
static void gve_close(struct net_device *netdev)
Close network device.
static size_t gve_address(struct gve_queue *queue, unsigned int index)
Get buffer address (within queue page list address space)
struct gve_pages pages
Page address list.
static void process_init_stopped(struct process *process, struct process_descriptor *desc, struct refcnt *refcnt)
Initialise process without adding to process list.
A PCI device ID list entry.
#define EIO_ADMIN(status)
static int gve_open(struct net_device *netdev)
Open network device.
unsigned int seq
Receive sequence number.
#define GVE_RX_QPL
Receive queue page list ID.
#define ENETDOWN
Network is down.
static struct xen_remove_from_physmap * remove
Network device operations.
uint8_t desc_len
Descriptor size.
#define GVE_TX_IRQ
Tranmsit queue interrupt channel.
void netdev_rx(struct net_device *netdev, struct io_buffer *iobuf)
Add packet to receive queue.
struct device * dev
Underlying hardware device.
#define GVE_QPL_MAX
Maximum number of pages per queue.
void * dma_alloc(struct dma_device *dma, struct dma_mapping *map, size_t len, size_t align)
Allocate and map DMA-coherent buffer.
Network device management.
void start_timer_fixed(struct retry_timer *timer, unsigned long timeout)
Start timer with a specified timeout.
unsigned int id
Queue page list ID.
static void * pci_get_drvdata(struct pci_device *pci)
Get PCI driver-private data.
void mdelay(unsigned long msecs)
Delay for a fixed number of milliseconds.
#define cpu_to_be32(value)
#define GVE_ADMIN_CONFIGURE
Configure device resources command.
void stop_timer(struct retry_timer *timer)
Stop timer.
void dma_ufree(struct dma_mapping *map, userptr_t addr, size_t len)
Unmap and free DMA-coherent buffer from external (user) memory.
void netdev_tx_complete_err(struct net_device *netdev, struct io_buffer *iobuf, int rc)
Complete network transmission.
#define GVE_ADMIN_MAX_WAIT_MS
Maximum time to wait for admin queue commands.
#define GVE_CFG_ADMIN_BASE_HI
Admin queue base address high 32 bits.
static unsigned int gve_next(unsigned int seq)
Calculate next receive sequence number.
unsigned int count
Number of descriptors (must be a power of two)
static struct pci_device_id gve_nics[]
GVE PCI device IDs.
struct gve_events events
Event counters.
#define GVE_ADMIN_COUNT
Number of admin queue commands.
#define GVE_CFG_ADMIN_EVT
Admin queue event counter.
#define GVE_IRQ_COUNT
Number of interrupt channels.
int(* probe)(struct pci_device *pci)
Probe device.
userptr_t data
Page addresses.
#define GVE_CFG_DRVSTAT_RUN
Run admin queue.
static int gve_transmit(struct net_device *netdev, struct io_buffer *iobuf)
Transmit packet.
uint64_t addr
Address (within queue page list address space)
unsigned int retries
Startup process retry counter.
void * data
Start of data.
unsigned int count
Actual number of event counters.
#define EIO
Input/output error.
#define GVE_ADMIN_CREATE_RX
Create receive queue command.
uint8_t revision
PCI revision.
struct net_device * alloc_etherdev(size_t priv_size)
Allocate Ethernet device.
u8 rx[WPA_TKIP_MIC_KEY_LEN]
MIC key for packets from the AP.
static void gve_admin_enable(struct gve_nic *gve)
Enable admin queue.
static union gve_admin_command * gve_admin_command(struct gve_nic *gve)
Get next available admin queue command slot.
void iounmap(volatile const void *io_addr)
Unmap I/O address.
#define cpu_to_be64(value)
struct pci_driver gve_driver __pci_driver
GVE PCI driver.
#define PCI_REVISION
PCI revision.
static int gve_unregister(struct gve_nic *gve, struct gve_qpl *qpl)
Unregister page list.
static int gve_admin_wait(struct gve_nic *gve)
Wait for admin queue command to complete.
static const struct gve_queue_type gve_rx_type
Receive descriptor queue type.
userptr_t dma_umalloc(struct dma_device *dma, struct dma_mapping *map, size_t len, size_t align)
Allocate and map DMA-coherent buffer from external (user) memory.
uint32_t db_idx
Interrupt doorbell index (within doorbell BAR)
Scratch buffer for admin queue commands.
static int gve_probe(struct pci_device *pci)
Probe PCI device.
uint16_t offset
Offset to command line.
#define GVE_ADMIN_UNREGISTER
Unregister page list command.
struct net_device * netdev
Network device.
typeof(acpi_finder=acpi_find)
ACPI table finder.
struct dma_mapping map
DMA mapping.
struct gve_irq * irq
Interrupt channels.
#define GVE_ADMIN_DESCRIBE_VER
Device descriptor version.
#define GVE_BUF_SIZE
Queue data buffer size.
static int gve_configure(struct gve_nic *gve)
Configure device resources.
static void gve_admin_free(struct gve_nic *gve)
Free admin queue.
FILE_LICENCE(GPL2_OR_LATER_OR_UBDL)
union gve_admin_command * cmd
Commands.
size_t max_pkt_len
Maximum packet length.
uint8_t cmplt_len
Completion size.
struct dma_mapping map
DMA mapping.
static int gve_setup(struct gve_nic *gve)
Set up admin queue and get device description.
#define GVE_RXF_ERROR
Receive error.
static __always_inline physaddr_t dma(struct dma_mapping *map, void *addr)
Get DMA address from virtual address.
void * pci_ioremap(struct pci_device *pci, unsigned long bus_addr, size_t len)
Map PCI bus address as an I/O address.
const struct gve_queue_type * type
Queue type.
struct gve_admin admin
Admin queue.
uint32_t prod
Producer counter.
uint8_t hw_addr[MAX_HW_ADDR_LEN]
Hardware address.
#define NULL
NULL pointer (VOID *)
#define ETIMEDOUT
Connection timed out.
#define PCI_ROM(_vendor, _device, _name, _description, _data)
#define GVE_RX_PAD
Padding at the start of all received packets.
uint8_t create
Command to create queue.
#define GVE_RESET_MAX_RETRY
Maximum number of times to reattempt device reset.
static void gve_poll(struct net_device *netdev)
Poll for completed and received packets.
void startup(void)
Start up iPXE.
struct gve_scratch scratch
Scratch buffer.
static struct process_descriptor gve_startup_desc
Device startup process descriptor.
static void gve_free_shared(struct gve_nic *gve)
Free shared queue resources.
u8 tx[WPA_TKIP_MIC_KEY_LEN]
MIC key for packets to the AP.
#define GVE_CFG_SIZE
Configuration BAR size.
void * memset(void *dest, int character, size_t len) __nonnull
int pci_read_config_byte(struct pci_device *pci, unsigned int where, uint8_t *value)
Read byte from PCI configuration space.