45 DBG (
"igbvf_setup_tx_resources\n" );
79 DBG (
"igbvf_free_tx_resources\n" );
94 DBG (
"igbvf_free_rx_resources\n" );
118 DBGP (
"igbvf_refill_rx_ring\n");
122 rx_curr_desc = adapter->
rx_base + rx_curr;
130 DBG2 (
"Refilling rx desc %d\n", rx_curr );
135 rx_curr_desc->
wb.
upper.status_error = 0;
138 DBG (
"alloc_iob failed\n" );
144 ew32 ( RDT(0), rx_curr );
184 DBG (
"igbvf_irq\n" );
207 DBGP (
"process_tx_packets: tx_head = %d, tx_tail = %d\n", adapter->
tx_head,
212 tx_curr_desc = (
void * ) ( adapter->
tx_base ) +
213 ( i *
sizeof ( *adapter->
tx_base ) );
215 tx_status = tx_curr_desc->
wb.
status;
217 DBG (
" tx_status = %#08x\n", tx_status );
223 DBG (
"Sent packet. tx_head: %d tx_tail: %d tx_status: %#08x\n",
227 DBG (
"Success transmitting packet, tx_status: %#08x\n",
233 memset ( tx_curr_desc, 0,
sizeof ( *tx_curr_desc ) );
254 DBGP (
"igbvf_process_rx_packets\n" );
261 rx_curr_desc = (
void * ) ( adapter->
rx_base ) +
262 ( i *
sizeof ( *adapter->
rx_base ) );
263 rx_status = rx_curr_desc->
wb.
upper.status_error;
265 DBG2 (
"Before DD Check RX_status: %#08x, rx_curr: %d\n",
274 DBG (
"E1000_RCTL = %#08x\n",
er32 (RCTL) );
276 rx_len = rx_curr_desc->
wb.
upper.length;
278 DBG (
"Received packet, rx_curr: %d rx_status: %#08x rx_len: %d\n",
279 i, rx_status, rx_len );
288 DBG (
"igbvf_process_rx_packets: Corrupted packet received!" 289 " rx_err: %#08x\n",
rx_err );
296 memset ( rx_curr_desc, 0,
sizeof ( *rx_curr_desc ) );
313 DBGP (
"igbvf_poll\n" );
315 rx_curr_desc = (
void * ) ( adapter->
rx_base ) +
317 rx_status = rx_curr_desc->
wb.
upper.status_error;
341 DBG (
"igbvf_config_collision_dist");
363 DBG (
"igbvf_configure_tx\n" );
366 tctl =
er32 ( TCTL );
371 ew32 ( TDBAH(0), 0 );
375 DBG (
"E1000_TDBAL(0): %#08x\n",
er32 ( TDBAL(0) ) );
376 DBG (
"E1000_TDLEN(0): %d\n",
er32 ( TDLEN(0) ) );
386 txdctl =
er32(TXDCTL(0));
388 ew32 ( TXDCTL(0), txdctl );
390 txdctl =
er32 ( TXDCTL(0) );
392 ew32 ( TXDCTL(0), txdctl );
433 if (
mac->ops.reset_hw(
hw) )
434 DBG (
"PF still resetting\n");
436 mac->ops.init_hw (
hw );
476 DBG (
"hw.mac.ops.init_params(&adapter->hw) Failure\n");
482 DBG (
"hw.mbx.ops.init_params(&adapter->hw) Failure\n");
501 DBG (
"igbvf_setup_srrctl\n" );
514 ew32 ( SRRCTL(0), srrctl );
528 DBG (
"igbvf_configure_rx\n" );
531 rxdctl =
er32 ( RXDCTL(0) );
540 ew32 ( RDBAH(0), 0 );
547 rxdctl &= 0xFFF00000;
555 ew32 ( RXDCTL(0), rxdctl );
570 DBG (
"igbvf_setup_rx_resources\n" );
585 rx_curr_desc = adapter->
rx_base + i;
588 rx_curr_desc->
wb.
upper.status_error = 0;
590 DBG (
"alloc_iob failed\n" );
618 DBG (
"igbvf_open\n");
627 DBG (
"Error setting up TX resources!\n" );
637 DBG (
"Error setting up RX resources!\n" );
646 DBG (
"err_setup_rx\n" );
651 DBG (
"err_setup_tx\n" );
674 DBG (
"igbvf_close\n" );
681 rxdctl =
er32 ( RXDCTL(0) );
706 DBGP (
"igbvf_transmit\n");
709 DBG (
"TX overflow\n");
718 tx_curr_desc = (
void * ) ( adapter->
tx_base ) +
719 ( tx_curr *
sizeof ( *adapter->
tx_base ) );
722 DBG (
"tx_curr_desc + 16 = %#08lx\n",
virt_to_bus ( tx_curr_desc ) + 16 );
732 DBG (
"TX fill: %d tx_curr: %d addr: %#08lx len: %zd\n", adapter->
tx_fill_ctr,
771 ctrl_ext =
er32 ( CTRL_EXT );
791 unsigned long mmio_start, mmio_len;
794 DBG (
"igbvf_probe\n" );
802 goto err_alloc_etherdev;
814 memset ( adapter, 0, (
sizeof ( *adapter ) ) );
816 adapter->
pdev = pdev;
827 adapter->
hw.
back = adapter;
843 DBG (
"mmio_start: %#08lx\n", mmio_start );
844 DBG (
"mmio_len: %#08lx\n", mmio_len );
847 DBG (
"adapter->hw.hw_addr: %p\n", adapter->
hw.
hw_addr );
850 DBG (
"err_ioremap\n" );
857 DBG (
"err_sw_init\n" );
862 err =
hw->mac.ops.reset_hw (
hw );
864 DBG (
"PF still in reset state, assigning new address\n");
873 err =
hw->mac.ops.read_mac_addr(
hw);
875 DBG (
"Error reading MAC address\n");
897 DBG (
"err_register\n" );
901 DBG (
"igbvf_probe_succeeded\n");
929 DBG (
"igbvf_remove\n" );
943 PCI_ROM(0x8086, 0x10CA,
"igbvf",
"E1000_DEV_ID_82576_VF", 0),
944 PCI_ROM(0x8086, 0x1520,
"i350vf",
"E1000_DEV_ID_I350_VF", 0),
struct pci_driver igbvf_driver __pci_driver
void igbvf_get_hw_control(struct igbvf_adapter *adapter)
igbvf_get_hw_control - get control of the h/w from f/w @adapter: address of board private structure
#define EINVAL
Invalid argument.
uint8_t irq
Interrupt number.
struct arbelprm_rc_send_wqe rc
struct ath5k_hw_rx_error rx_err
#define E1000_RXDCTL_QUEUE_ENABLE
static void netdev_tx_complete(struct net_device *netdev, struct io_buffer *iobuf)
Complete network transmission.
#define iob_put(iobuf, len)
#define E1000_SRRCTL_DESCTYPE_ADV_ONEBUF
void netdev_rx_err(struct net_device *netdev, struct io_buffer *iobuf, int rc)
Discard received packet.
union e1000_adv_tx_desc * tx_base
void igbvf_rlpml_set_vf(struct e1000_hw *hw, u16 max_size)
igbvf_rlpml_set_vf - Set the maximum receive packet length @hw: pointer to the HW structure @max_size...
int(* open)(struct net_device *netdev)
Open network device.
unsigned long ioaddr
I/O address.
u8 __iomem * flash_address
static int __devinit igbvf_sw_init(struct igbvf_adapter *adapter)
igbvf_sw_init - Initialize general software structures (struct igbvf_adapter) @adapter: board private...
void free_iob(struct io_buffer *iobuf)
Free I/O buffer.
struct pci_device_id * ids
PCI ID table.
static void igbvf_process_tx_packets(struct net_device *netdev)
igbvf_process_tx_packets - process transmitted packets
struct e1000_mac_operations ops
#define E1000_COLLISION_THRESHOLD
static void igbvf_irq_enable(struct igbvf_adapter *adapter)
igbvf_irq_enable - Enable default interrupt generation settings @adapter: board private structure
#define E1000_RXDEXT_ERR_FRAME_ERR_MASK
static void *__malloc malloc_phys(size_t size, size_t phys_align)
Allocate memory with specified physical alignment.
#define PCI_BASE_ADDRESS_0
int pci_read_config_word(struct pci_device *pci, unsigned int where, uint16_t *value)
Read 16-bit word from PCI configuration space.
#define PCI_COMMAND
PCI command.
uint8_t mac[ETH_ALEN]
MAC address.
#define E1000_SRRCTL_BSIZEPKT_MASK
struct e1000_adv_rx_desc::@55::@57 upper
#define MAXIMUM_ETHERNET_VLAN_SIZE
void adjust_pci_device(struct pci_device *pci)
Enable PCI device.
struct io_buffer * alloc_iob(size_t len)
Allocate I/O buffer.
struct device dev
Generic device.
struct e1000_adv_rx_desc::@54 read
void igbvf_free_tx_resources(struct igbvf_adapter *adapter)
igbvf_free_tx_resources - Free Tx Resources per Queue @adapter: board private structure
int igbvf_setup_rx_resources(struct igbvf_adapter *adapter)
igbvf_setup_rx_resources - allocate Rx resources (Descriptors)
#define E1000_ADVTXD_DCMD_EOP
void igbvf_free_rx_resources(struct igbvf_adapter *adapter)
igbvf_free_rx_resources - Free Rx Resources @adapter: board private structure
static void igbvf_irq(struct net_device *netdev, int enable)
igbvf_irq - enable or Disable interrupts
struct e1000_mbx_operations ops
static void igbvf_setup_srrctl(struct igbvf_adapter *adapter)
igbvf_setup_srrctl - configure the receive control registers @adapter: Board private structure
static void netdev_init(struct net_device *netdev, struct net_device_operations *op)
Initialise a network device.
static void pci_set_drvdata(struct pci_device *pci, void *priv)
Set PCI driver-private data.
#define ENOMEM
Not enough space.
void * memcpy(void *dest, const void *src, size_t len) __nonnull
static __always_inline unsigned long virt_to_bus(volatile const void *addr)
Convert virtual address to a bus address.
uint16_t device
Device ID.
#define E1000_ADVTXD_DCMD_DEXT
static int igbvf_transmit(struct net_device *netdev, struct io_buffer *iobuf)
igbvf_transmit - Transmit a packet
static void netdev_put(struct net_device *netdev)
Drop reference to network device.
static void igbvf_close(struct net_device *netdev)
igbvf_close - Disables a network interface @netdev: network interface device structure
static struct net_device_operations igbvf_operations
igbvf net device operations
void * priv
Driver private data.
static void netdev_link_up(struct net_device *netdev)
Mark network device as having link up.
struct e1000_mac_info mac
#define E1000_CTRL_EXT_DRV_LOAD
static struct net_device * netdev
unsigned long pci_bar_start(struct pci_device *pci, unsigned int reg)
Find the start of a PCI BAR.
struct e1000_mbx_info mbx
struct e1000_adv_tx_desc::@63 wb
#define E1000_SRRCTL_BSIZEPKT_SHIFT
struct e1000_adv_rx_desc::@55 wb
void unregister_netdev(struct net_device *netdev)
Unregister network device.
static void igbvf_process_rx_packets(struct net_device *netdev)
igbvf_process_rx_packets - process received packets
int igbvf_probe(struct pci_device *pdev)
igbvf_probe - Device Initialization Routine @pdev: PCI device information struct @ent: entry in igbvf...
struct net_device * netdev
#define E1000_ADVTXD_DTYP_DATA
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.
void igbvf_config_collision_dist(struct e1000_hw *hw)
igbvf_config_collision_dist_generic - Configure collision distance @hw: pointer to the HW structure
static void netdev_nullify(struct net_device *netdev)
Stop using a network device.
#define E1000_ADVTXD_DCMD_RS
A PCI device ID list entry.
static int is_valid_ether_addr(const void *addr)
Check if Ethernet address is valid.
static struct xen_remove_from_physmap * remove
uint16_t vendor
Vendor ID.
#define E1000_ADVTXD_DCMD_IFCS
Network device operations.
void netdev_rx(struct net_device *netdev, struct io_buffer *iobuf)
Add packet to receive queue.
struct device * dev
Underlying hardware device.
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.
struct e1000_adv_tx_desc::@62 read
static void igbvf_configure_rx(struct igbvf_adapter *adapter)
igbvf_configure_rx - Configure 8254x Receive Unit after Reset @adapter: board private structure
#define E1000_TXD_STAT_DD
#define E1000_SRRCTL_BSIZEHDR_MASK
#define E1000_SRRCTL_DESCTYPE_MASK
#define ENOBUFS
No buffer space available.
static int igbvf_refill_rx_ring(struct igbvf_adapter *adapter)
igbvf_refill_rx_ring - allocate Rx io_buffers
int(* probe)(struct pci_device *pci)
Probe device.
void * data
Start of data.
#define E1000_ADVTXD_PAYLEN_SHIFT
#define EIO
Input/output error.
#define E1000_RXD_STAT_DD
struct io_buffer * tx_iobuf[NUM_TX_DESC]
static void igbvf_configure_tx(struct igbvf_adapter *adapter)
igbvf_configure_tx - Configure Transmit Unit after Reset @adapter: board private structure
s32(* init_params)(struct e1000_hw *hw)
struct net_device * alloc_etherdev(size_t priv_size)
Allocate Ethernet device.
void iounmap(volatile const void *io_addr)
Unmap I/O address.
#define PCI_REVISION
PCI revision.
void igbvf_remove(struct pci_device *pdev)
igbvf_remove - Device Removal Routine @pdev: PCI device information struct
#define E1000_TXDCTL_QUEUE_ENABLE
static void free_phys(void *ptr, size_t size)
Free memory allocated with malloc_phys()
static void igbvf_poll(struct net_device *netdev)
igbvf_poll - Poll for received packets
static void igbvf_irq_disable(struct igbvf_adapter *adapter)
igbvf_irq_disable - Mask off interrupt generation on the NIC @adapter: board private structure
static struct pci_device_id igbvf_pci_tbl[]
uint8_t ll_addr[MAX_LL_ADDR_LEN]
Link-layer address.
static int igbvf_open(struct net_device *netdev)
igbvf_open - Called when a network interface is made active @netdev: network interface device structu...
#define DBG(...)
Print a debugging message.
void * pci_ioremap(struct pci_device *pci, unsigned long bus_addr, size_t len)
Map PCI bus address as an I/O address.
#define E1000_SRRCTL_DROP_EN
uint8_t hw_addr[MAX_HW_ADDR_LEN]
Hardware address.
#define NULL
NULL pointer (VOID *)
#define PCI_ROM(_vendor, _device, _name, _description, _data)
union e1000_adv_rx_desc * rx_base
void eth_random_addr(void *hw_addr)
Generate random Ethernet address.
void igbvf_reset(struct igbvf_adapter *adapter)
int igbvf_setup_tx_resources(struct igbvf_adapter *adapter)
igbvf_setup_tx_resources - allocate Tx resources (Descriptors)
struct io_buffer * rx_iobuf[NUM_RX_DESC]
#define E1000_COLLISION_DISTANCE
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.
s32(* init_params)(struct e1000_hw *)
void igbvf_init_function_pointers_vf(struct e1000_hw *hw)
igbvf_init_function_pointers_vf - Inits function pointers @hw: pointer to the HW structure