Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Typedefs | Enumerations | Functions
adapter.h File Reference
#include <linux/interrupt.h>
#include <linux/pci.h>
#include <linux/spinlock.h>
#include <linux/skbuff.h>
#include <linux/if_ether.h>
#include <linux/netdevice.h>
#include "../cxgb4/t4_hw.h"

Go to the source code of this file.

Data Structures

struct  port_info
 
struct  sge_fl
 
struct  pkt_gl
 
struct  sge_rspq
 
struct  sge_eth_stats
 
struct  sge_eth_rxq
 
struct  tx_desc
 
struct  sge_txq
 
struct  sge_eth_txq
 
struct  sge
 
struct  adapter
 

Macros

#define EQ_IDX(s, abs_id)   ((unsigned int)((abs_id) - (s)->egr_base))
 
#define IQ_IDX(s, abs_id)   ((unsigned int)((abs_id) - (s)->ingr_base))
 
#define EQ_MAP(s, abs_id)   ((s)->egr_map[EQ_IDX(s, abs_id)])
 
#define IQ_MAP(s, abs_id)   ((s)->ingr_map[IQ_IDX(s, abs_id)])
 
#define for_each_ethrxq(sge, iter)   for (iter = 0; iter < (sge)->ethqsets; iter++)
 

Typedefs

typedef int(* rspq_handler_t )(struct sge_rspq *, const __be64 *, const struct pkt_gl *)
 

Enumerations

enum  {
  MAX_NPORTS = 1, MAX_PORT_QSETS = 8, MAX_ETH_QSETS = MAX_NPORTS*MAX_PORT_QSETS, MSIX_FW = 0,
  MSIX_IQFLINT = 1, MSIX_EXTRAS = 1, MSIX_ENTRIES = MAX_ETH_QSETS + MSIX_EXTRAS, INGQ_EXTRAS = 2,
  MAX_INGQ = MAX_ETH_QSETS+INGQ_EXTRAS, MAX_EGRQ = MAX_ETH_QSETS*2
}
 
enum  { FULL_INIT_DONE = (1UL << 0), USING_MSI = (1UL << 1), USING_MSIX = (1UL << 2), QUEUES_BOUND = (1UL << 3) }
 

Functions

void t4vf_os_link_changed (struct adapter *, int, int)
 
int t4vf_sge_alloc_rxq (struct adapter *, struct sge_rspq *, bool, struct net_device *, int, struct sge_fl *, rspq_handler_t)
 
int t4vf_sge_alloc_eth_txq (struct adapter *, struct sge_eth_txq *, struct net_device *, struct netdev_queue *, unsigned int)
 
void t4vf_free_sge_resources (struct adapter *)
 
int t4vf_eth_xmit (struct sk_buff *, struct net_device *)
 
int t4vf_ethrx_handler (struct sge_rspq *, const __be64 *, const struct pkt_gl *)
 
irq_handler_t t4vf_intr_handler (struct adapter *)
 
irqreturn_t t4vf_sge_intr_msix (int, void *)
 
int t4vf_sge_init (struct adapter *)
 
void t4vf_sge_start (struct adapter *)
 
void t4vf_sge_stop (struct adapter *)
 

Macro Definition Documentation

#define EQ_IDX (   s,
  abs_id 
)    ((unsigned int)((abs_id) - (s)->egr_base))

Definition at line 322 of file adapter.h.

#define EQ_MAP (   s,
  abs_id 
)    ((s)->egr_map[EQ_IDX(s, abs_id)])

Definition at line 325 of file adapter.h.

#define for_each_ethrxq (   sge,
  iter 
)    for (iter = 0; iter < (sge)->ethqsets; iter++)

Definition at line 331 of file adapter.h.

#define IQ_IDX (   s,
  abs_id 
)    ((unsigned int)((abs_id) - (s)->ingr_base))

Definition at line 323 of file adapter.h.

#define IQ_MAP (   s,
  abs_id 
)    ((s)->ingr_map[IQ_IDX(s, abs_id)])

Definition at line 326 of file adapter.h.

Typedef Documentation

typedef int(* rspq_handler_t)(struct sge_rspq *, const __be64 *, const struct pkt_gl *)

Definition at line 153 of file adapter.h.

Enumeration Type Documentation

anonymous enum
Enumerator:
MAX_NPORTS 
MAX_PORT_QSETS 
MAX_ETH_QSETS 
MSIX_FW 
MSIX_IQFLINT 
MSIX_EXTRAS 
MSIX_ENTRIES 
INGQ_EXTRAS 
MAX_INGQ 
MAX_EGRQ 

Definition at line 55 of file adapter.h.

anonymous enum
Enumerator:
FULL_INIT_DONE 
USING_MSI 
USING_MSIX 
QUEUES_BOUND 

Definition at line 368 of file adapter.h.

Function Documentation

int t4vf_eth_xmit ( struct sk_buff skb,
struct net_device dev 
)

t4vf_eth_xmit - add a packet to an Ethernet TX queue : the packet : the egress net device

Add a packet to an SGE Ethernet TX queue. Runs with softirqs disabled.

Definition at line 1072 of file sge.c.

int t4vf_ethrx_handler ( struct sge_rspq rspq,
const __be64 rsp,
const struct pkt_gl gl 
)

t4vf_ethrx_handler - process an ingress ethernet packet : the response queue that received the packet : the response queue descriptor holding the RX_PKT message : the gather list of packet fragments

Process an ingress ethernet packet and deliver it to the stack.

Definition at line 1500 of file sge.c.

void t4vf_free_sge_resources ( struct adapter adapter)

t4vf_free_sge_resources - free SGE resources : the adapter

Frees resources used by the SGE queue sets.

Definition at line 2342 of file sge.c.

irq_handler_t t4vf_intr_handler ( struct adapter adapter)

t4vf_intr_handler - select the top-level interrupt handler : the adapter

Selects the top-level interrupt handler based on the type of interrupts (MSI-X or MSI).

Definition at line 1904 of file sge.c.

void t4vf_os_link_changed ( struct adapter ,
int  ,
int   
)

Definition at line 141 of file cxgb4vf_main.c.

int t4vf_sge_alloc_eth_txq ( struct adapter adapter,
struct sge_eth_txq txq,
struct net_device dev,
struct netdev_queue devq,
unsigned int  iqid 
)

t4vf_sge_alloc_eth_txq - allocate an SGE Ethernet TX Queue : the adapter : pointer to the new txq to be filled in : the network TX queue associated with the new txq : the relative ingress queue ID to which events relating to the new txq should be directed

Definition at line 2204 of file sge.c.

int t4vf_sge_alloc_rxq ( struct adapter adapter,
struct sge_rspq rspq,
bool  iqasynch,
struct net_device dev,
int  intr_dest,
struct sge_fl fl,
rspq_handler_t  hnd 
)

t4vf_sge_alloc_rxq - allocate an SGE RX Queue : the adapter : pointer to to the new rxq's Response Queue to be filled in : if 0, a normal rspq; if 1, an asynchronous event queue : the network device associated with the new rspq : MSI-X vector index (overriden in MSI mode) : pointer to the new rxq's Free List to be filled in : the interrupt handler to invoke for the rspq

Definition at line 2033 of file sge.c.

int t4vf_sge_init ( struct adapter adapter)

t4vf_sge_init - initialize SGE : the adapter

Performs SGE initialization needed every time after a chip reset. We do not initialize any of the queue sets here, instead the driver top-level must request those individually. We also do not enable DMA here, that should be done after the queues have been set up.

Definition at line 2407 of file sge.c.

irqreturn_t t4vf_sge_intr_msix ( int  ,
void  
)

Definition at line 1793 of file sge.c.

void t4vf_sge_start ( struct adapter adapter)

t4vf_sge_start - enable SGE operation : the adapter

Start tasklets and timers associated with the DMA engine.

Definition at line 2373 of file sge.c.

void t4vf_sge_stop ( struct adapter adapter)

t4vf_sge_stop - disable SGE operation : the adapter

Stop tasklets and timers associated with the DMA engine. Note that this is effective only if measures have been taken to disable any HW events that may restart them.

Definition at line 2388 of file sge.c.