iPXE
Data Structures | Defines | Enumerations | Functions | Variables
igbvf.h File Reference
#include "igbvf_vf.h"

Go to the source code of this file.

Data Structures

struct  igbvf_queue_stats
struct  igbvf_buffer
struct  igbvf_ring
struct  igbvf_adapter
struct  igbvf_info

Defines

#define _IGBVF_H_
#define IGBVF_START_ITR   648 /* ~6000 ints/sec */
#define IGBVF_DEFAULT_TXD   256
#define IGBVF_MAX_TXD   4096
#define IGBVF_MIN_TXD   80
#define IGBVF_DEFAULT_RXD   256
#define IGBVF_MAX_RXD   4096
#define IGBVF_MIN_RXD   80
#define IGBVF_MIN_ITR_USECS   10 /* 100000 irq/sec */
#define IGBVF_MAX_ITR_USECS   10000 /* 100 irq/sec */
#define IGBVF_RX_PTHRESH   16
#define IGBVF_RX_HTHRESH   8
#define IGBVF_RX_WTHRESH   1
#define IGBVF_TX_PTHRESH   8
#define IGBVF_TX_HTHRESH   1
#define IGBVF_TX_WTHRESH   1
#define MAXIMUM_ETHERNET_VLAN_SIZE   1522
#define IGBVF_FC_PAUSE_TIME   0x0680 /* 858 usec */
#define IGBVF_TX_QUEUE_WAKE   32
#define IGBVF_RX_BUFFER_WRITE   16 /* Must be power of 2 */
#define AUTO_ALL_MODES   0
#define IGBVF_EEPROM_APME   0x0400
#define IGBVF_MNG_VLAN_NONE   (-1)
#define NUM_TX_DESC   8
#define NUM_RX_DESC   8
#define IGBVF_FLAG_RX_CSUM_DISABLED   (1 << 0)
#define IGBVF_DESC_UNUSED(R)
#define IGBVF_RX_DESC_ADV(R, i)   (&(((union e1000_adv_rx_desc *)((R).desc))[i]))
#define IGBVF_TX_DESC_ADV(R, i)   (&(((union e1000_adv_tx_desc *)((R).desc))[i]))
#define IGBVF_TX_CTXTDESC_ADV(R, i)   (&(((struct e1000_adv_tx_context_desc *)((R).desc))[i]))
#define er32(reg)   E1000_READ_REG(hw, E1000_##reg)
#define ew32(reg, val)   E1000_WRITE_REG(hw, E1000_##reg, (val))
#define e1e_flush()   er32(STATUS)

Enumerations

enum  igbvf_boards { board_vf }
enum  igbvf_state_t { __IGBVF_TESTING, __IGBVF_RESETTING, __IGBVF_DOWN }
enum  latency_range { lowest_latency = 0, low_latency = 1, bulk_latency = 2, latency_invalid = 255 }

Functions

 FILE_LICENCE (GPL2_ONLY)
void igbvf_check_options (struct igbvf_adapter *adapter)
void igbvf_set_ethtool_ops (struct net_device *netdev)
int igbvf_up (struct igbvf_adapter *adapter)
void igbvf_down (struct igbvf_adapter *adapter)
void igbvf_reinit_locked (struct igbvf_adapter *adapter)
void igbvf_reset (struct igbvf_adapter *adapter)
int igbvf_setup_rx_resources (struct igbvf_adapter *adapter)
 igbvf_setup_rx_resources - allocate Rx resources (Descriptors)
int igbvf_setup_tx_resources (struct igbvf_adapter *adapter)
 igbvf_setup_tx_resources - allocate Tx resources (Descriptors)
void igbvf_free_rx_resources (struct igbvf_adapter *adapter)
 igbvf_free_rx_resources - Free Rx Resources : board private structure
void igbvf_free_tx_resources (struct igbvf_adapter *adapter)
 igbvf_free_tx_resources - Free Tx Resources per Queue : board private structure
void igbvf_update_stats (struct igbvf_adapter *adapter)
void igbvf_set_interrupt_capability (struct igbvf_adapter *adapter)
void igbvf_reset_interrupt_capability (struct igbvf_adapter *adapter)
static u32 __er32 (struct e1000_hw *hw, unsigned long reg)
static void __ew32 (struct e1000_hw *hw, unsigned long reg, u32 val)

Variables

char igbvf_driver_name []
const char igbvf_driver_version []
unsigned int copybreak

Define Documentation

#define _IGBVF_H_

Definition at line 34 of file igbvf.h.

#define IGBVF_START_ITR   648 /* ~6000 ints/sec */

Definition at line 43 of file igbvf.h.

#define IGBVF_DEFAULT_TXD   256

Definition at line 46 of file igbvf.h.

#define IGBVF_MAX_TXD   4096

Definition at line 47 of file igbvf.h.

#define IGBVF_MIN_TXD   80

Definition at line 48 of file igbvf.h.

#define IGBVF_DEFAULT_RXD   256

Definition at line 50 of file igbvf.h.

#define IGBVF_MAX_RXD   4096

Definition at line 51 of file igbvf.h.

#define IGBVF_MIN_RXD   80

Definition at line 52 of file igbvf.h.

#define IGBVF_MIN_ITR_USECS   10 /* 100000 irq/sec */

Definition at line 54 of file igbvf.h.

#define IGBVF_MAX_ITR_USECS   10000 /* 100 irq/sec */

Definition at line 55 of file igbvf.h.

#define IGBVF_RX_PTHRESH   16

Definition at line 68 of file igbvf.h.

Referenced by igbvf_configure_rx().

#define IGBVF_RX_HTHRESH   8

Definition at line 69 of file igbvf.h.

Referenced by igbvf_configure_rx().

#define IGBVF_RX_WTHRESH   1

Definition at line 70 of file igbvf.h.

Referenced by igbvf_configure_rx().

#define IGBVF_TX_PTHRESH   8

Definition at line 72 of file igbvf.h.

#define IGBVF_TX_HTHRESH   1

Definition at line 73 of file igbvf.h.

#define IGBVF_TX_WTHRESH   1

Definition at line 74 of file igbvf.h.

#define MAXIMUM_ETHERNET_VLAN_SIZE   1522

Definition at line 77 of file igbvf.h.

Referenced by igbvf_refill_rx_ring(), igbvf_setup_rx_resources(), and igbvf_sw_init().

#define IGBVF_FC_PAUSE_TIME   0x0680 /* 858 usec */

Definition at line 79 of file igbvf.h.

#define IGBVF_TX_QUEUE_WAKE   32

Definition at line 82 of file igbvf.h.

#define IGBVF_RX_BUFFER_WRITE   16 /* Must be power of 2 */

Definition at line 84 of file igbvf.h.

#define AUTO_ALL_MODES   0

Definition at line 86 of file igbvf.h.

#define IGBVF_EEPROM_APME   0x0400

Definition at line 87 of file igbvf.h.

#define IGBVF_MNG_VLAN_NONE   (-1)

Definition at line 89 of file igbvf.h.

#define NUM_TX_DESC   8
#define NUM_RX_DESC   8
#define IGBVF_FLAG_RX_CSUM_DISABLED   (1 << 0)

Definition at line 315 of file igbvf.h.

#define IGBVF_DESC_UNUSED (   R)
Value:
((((R)->next_to_clean > (R)->next_to_use) ? 0 : (R)->count) + \
        (R)->next_to_clean - (R)->next_to_use - 1)

Definition at line 317 of file igbvf.h.

#define IGBVF_RX_DESC_ADV (   R,
 
)    (&(((union e1000_adv_rx_desc *)((R).desc))[i]))

Definition at line 321 of file igbvf.h.

#define IGBVF_TX_DESC_ADV (   R,
 
)    (&(((union e1000_adv_tx_desc *)((R).desc))[i]))

Definition at line 323 of file igbvf.h.

#define IGBVF_TX_CTXTDESC_ADV (   R,
 
)    (&(((struct e1000_adv_tx_context_desc *)((R).desc))[i]))

Definition at line 325 of file igbvf.h.

#define er32 (   reg)    E1000_READ_REG(hw, E1000_##reg)
#define ew32 (   reg,
  val 
)    E1000_WRITE_REG(hw, E1000_##reg, (val))
#define e1e_flush ( )    er32(STATUS)

Definition at line 375 of file igbvf.h.

Referenced by igbvf_config_collision_dist(), igbvf_configure_tx(), and igbvf_transmit().


Enumeration Type Documentation

Enumerator:
board_vf 

Definition at line 91 of file igbvf.h.

                  {
        board_vf,
};
Enumerator:
__IGBVF_TESTING 
__IGBVF_RESETTING 
__IGBVF_DOWN 

Definition at line 328 of file igbvf.h.

Enumerator:
lowest_latency 
low_latency 
bulk_latency 
latency_invalid 

Definition at line 334 of file igbvf.h.


Function Documentation

FILE_LICENCE ( GPL2_ONLY  )
void igbvf_check_options ( struct igbvf_adapter adapter)
void igbvf_set_ethtool_ops ( struct net_device netdev)
int igbvf_up ( struct igbvf_adapter adapter)
void igbvf_down ( struct igbvf_adapter adapter)
void igbvf_reinit_locked ( struct igbvf_adapter adapter)
void igbvf_reset ( struct igbvf_adapter adapter)

Definition at line 426 of file igbvf_main.c.

References DBG, ETH_ALEN, igbvf_adapter::hw, net_device::hw_addr, is_valid_ether_addr(), mac, memcpy(), netdev, and igbvf_adapter::netdev.

Referenced by igbvf_close(), igbvf_open(), igbvf_probe(), and igbvf_remove().

{
        struct e1000_mac_info *mac = &adapter->hw.mac;
        struct net_device *netdev = adapter->netdev;
        struct e1000_hw *hw = &adapter->hw;

        /* Allow time for pending master requests to run */
        if ( mac->ops.reset_hw(hw) )
                DBG ("PF still resetting\n");

        mac->ops.init_hw ( hw );

        if ( is_valid_ether_addr(adapter->hw.mac.addr) ) {
                memcpy ( netdev->hw_addr, adapter->hw.mac.addr, ETH_ALEN );
        }
}
int igbvf_setup_rx_resources ( struct igbvf_adapter adapter)

igbvf_setup_rx_resources - allocate Rx resources (Descriptors)

Parameters:
adaptere1000 private structure

Definition at line 564 of file igbvf_main.c.

References alloc_iob(), io_buffer::data, DBG, ENOMEM, malloc_dma(), MAXIMUM_ETHERNET_VLAN_SIZE, memset(), NUM_RX_DESC, igbvf_adapter::rx_base, igbvf_adapter::rx_iobuf, igbvf_adapter::rx_ring_size, and virt_to_bus().

Referenced by igbvf_open().

{
        int i;
        union e1000_adv_rx_desc *rx_curr_desc;
        struct io_buffer *iob;

        DBG ( "igbvf_setup_rx_resources\n" );

        /* Allocate receive descriptor ring memory.
           It must not cross a 64K boundary because of hardware errata
         */

        adapter->rx_base =
                malloc_dma ( adapter->rx_ring_size, adapter->rx_ring_size );

        if ( ! adapter->rx_base ) {
                return -ENOMEM;
        }
        memset ( adapter->rx_base, 0, adapter->rx_ring_size );

        for ( i = 0; i < NUM_RX_DESC; i++ ) {
                rx_curr_desc = adapter->rx_base + i;
                iob = alloc_iob ( MAXIMUM_ETHERNET_VLAN_SIZE );
                adapter->rx_iobuf[i] = iob;
                rx_curr_desc->wb.upper.status_error = 0;
                if ( ! iob ) {
                        DBG ( "alloc_iob failed\n" );
                        return -ENOMEM;
                } else {
                        rx_curr_desc->read.pkt_addr = virt_to_bus ( iob->data );
                        rx_curr_desc->read.hdr_addr = 0;
                }
        }

        return 0;
}
int igbvf_setup_tx_resources ( struct igbvf_adapter adapter)

igbvf_setup_tx_resources - allocate Tx resources (Descriptors)

Parameters:
adaptere1000 private structure
Return values:
rcReturns 0 on success, negative on failure

Definition at line 43 of file igbvf_main.c.

References DBG, ENOMEM, malloc_dma(), memset(), igbvf_adapter::tx_base, igbvf_adapter::tx_ring_size, and virt_to_bus().

Referenced by igbvf_open().

{
        DBG ( "igbvf_setup_tx_resources\n" );

        /* Allocate transmit descriptor ring memory.
           It must not cross a 64K boundary because of hardware errata #23
           so we use malloc_dma() requesting a 128 byte block that is
           128 byte aligned. This should guarantee that the memory
           allocated will not cross a 64K boundary, because 128 is an
           even multiple of 65536 ( 65536 / 128 == 512 ), so all possible
           allocations of 128 bytes on a 128 byte boundary will not
           cross 64K bytes.
         */

        adapter->tx_base =
                malloc_dma ( adapter->tx_ring_size, adapter->tx_ring_size );

        if ( ! adapter->tx_base ) {
                return -ENOMEM;
        }

        memset ( adapter->tx_base, 0, adapter->tx_ring_size );

        DBG ( "adapter->tx_base = %#08lx\n", virt_to_bus ( adapter->tx_base ) );

        return 0;
}
void igbvf_free_rx_resources ( struct igbvf_adapter adapter)

igbvf_free_rx_resources - Free Rx Resources : board private structure

Free all receive software resources

Definition at line 90 of file igbvf_main.c.

References DBG, free_dma(), free_iob(), NUM_RX_DESC, igbvf_adapter::rx_base, igbvf_adapter::rx_iobuf, and igbvf_adapter::rx_ring_size.

Referenced by igbvf_close().

{
        int i;

        DBG ( "igbvf_free_rx_resources\n" );

        free_dma ( adapter->rx_base, adapter->rx_ring_size );

        for ( i = 0; i < NUM_RX_DESC; i++ ) {
                free_iob ( adapter->rx_iobuf[i] );
        }
}
void igbvf_free_tx_resources ( struct igbvf_adapter adapter)

igbvf_free_tx_resources - Free Tx Resources per Queue : board private structure

Free all transmit software resources

Definition at line 77 of file igbvf_main.c.

References DBG, free_dma(), igbvf_adapter::tx_base, and igbvf_adapter::tx_ring_size.

Referenced by igbvf_close(), and igbvf_open().

{
        DBG ( "igbvf_free_tx_resources\n" );

        free_dma ( adapter->tx_base, adapter->tx_ring_size );
}
void igbvf_update_stats ( struct igbvf_adapter adapter)
void igbvf_set_interrupt_capability ( struct igbvf_adapter adapter)
void igbvf_reset_interrupt_capability ( struct igbvf_adapter adapter)
static u32 __er32 ( struct e1000_hw *  hw,
unsigned long  reg 
) [inline, static]

Definition at line 364 of file igbvf.h.

References readl().

{
        return readl(hw->hw_addr + reg);
}
static void __ew32 ( struct e1000_hw *  hw,
unsigned long  reg,
u32  val 
) [inline, static]

Definition at line 369 of file igbvf.h.

References writel().

{
        writel(val, hw->hw_addr + reg);
}

Variable Documentation

const char igbvf_driver_version[]
unsigned int copybreak