Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions | Variables
adapter.h File Reference
#include <linux/pci.h>
#include <linux/spinlock.h>
#include <linux/interrupt.h>
#include <linux/timer.h>
#include <linux/cache.h>
#include <linux/mutex.h>
#include <linux/bitops.h>
#include "t3cdev.h"
#include <asm/io.h>

Go to the source code of this file.

Data Structures

struct  iscsi_config
 
struct  port_info
 
struct  fl_pg_chunk
 
struct  sge_fl
 
struct  sge_rspq
 
struct  sge_txq
 
struct  sge_qset
 
struct  sge
 
struct  adapter
 

Macros

#define RX_BUNDLE_SIZE   8
 
#define OFFLOAD_DEVMAP_BIT   15
 
#define tdev2adap(d)   container_of(d, struct adapter, tdev)
 

Enumerations

enum  mac_idx_types { LAN_MAC_IDX = 0, SAN_MAC_IDX, MAX_MAC_IDX }
 
enum  {
  FULL_INIT_DONE = (1 << 0), USING_MSI = (1 << 1), USING_MSIX = (1 << 2), QUEUES_BOUND = (1 << 3),
  TP_PARITY_INIT = (1 << 4), NAPI_INIT = (1 << 5)
}
 
enum  {
  SGE_PSTAT_TSO, SGE_PSTAT_RX_CSUM_GOOD, SGE_PSTAT_TX_CSUM, SGE_PSTAT_VLANEX,
  SGE_PSTAT_VLANINS, SGE_PSTAT_MAX
}
 

Functions

int t3_offload_tx (struct t3cdev *tdev, struct sk_buff *skb)
 
void t3_os_ext_intr_handler (struct adapter *adapter)
 
void t3_os_link_changed (struct adapter *adapter, int port_id, int link_status, int speed, int duplex, int fc)
 
void t3_os_phymod_changed (struct adapter *adap, int port_id)
 
void t3_os_link_fault (struct adapter *adapter, int port_id, int state)
 
void t3_os_link_fault_handler (struct adapter *adapter, int port_id)
 
void t3_sge_start (struct adapter *adap)
 
void t3_sge_stop (struct adapter *adap)
 
void t3_start_sge_timers (struct adapter *adap)
 
void t3_stop_sge_timers (struct adapter *adap)
 
void t3_free_sge_resources (struct adapter *adap)
 
void t3_sge_err_intr_handler (struct adapter *adapter)
 
irq_handler_t t3_intr_handler (struct adapter *adap, int polling)
 
netdev_tx_t t3_eth_xmit (struct sk_buff *skb, struct net_device *dev)
 
int t3_mgmt_tx (struct adapter *adap, struct sk_buff *skb)
 
void t3_update_qset_coalesce (struct sge_qset *qs, const struct qset_params *p)
 
int t3_sge_alloc_qset (struct adapter *adapter, unsigned int id, int nports, int irq_vec_idx, const struct qset_params *p, int ntxq, struct net_device *dev, struct netdev_queue *netdevq)
 
int t3_get_edc_fw (struct cphy *phy, int edc_idx, int size)
 

Variables

struct sge_qset ____cacheline_aligned
 
struct workqueue_structcxgb3_wq
 

Macro Definition Documentation

#define OFFLOAD_DEVMAP_BIT   15

Definition at line 298 of file adapter.h.

#define RX_BUNDLE_SIZE   8

Definition at line 127 of file adapter.h.

#define tdev2adap (   d)    container_of(d, struct adapter, tdev)

Definition at line 300 of file adapter.h.

Enumeration Type Documentation

anonymous enum
Enumerator:
FULL_INIT_DONE 
USING_MSI 
USING_MSIX 
QUEUES_BOUND 
TP_PARITY_INIT 
NAPI_INIT 

Definition at line 83 of file adapter.h.

anonymous enum
Enumerator:
SGE_PSTAT_TSO 
SGE_PSTAT_RX_CSUM_GOOD 
SGE_PSTAT_TX_CSUM 
SGE_PSTAT_VLANEX 
SGE_PSTAT_VLANINS 
SGE_PSTAT_MAX 

Definition at line 188 of file adapter.h.

Enumerator:
LAN_MAC_IDX 
SAN_MAC_IDX 
MAX_MAC_IDX 

Definition at line 52 of file adapter.h.

Function Documentation

netdev_tx_t t3_eth_xmit ( struct sk_buff skb,
struct net_device dev 
)

eth_xmit - add a packet to the Ethernet Tx queue : the packet : the egress net device

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

Definition at line 1221 of file sge.c.

void t3_free_sge_resources ( struct adapter adap)

t3_free_sge_resources - free SGE resources : the adapter

Frees resources used by the SGE queue sets.

Definition at line 3184 of file sge.c.

int t3_get_edc_fw ( struct cphy phy,
int  edc_idx,
int  size 
)

Definition at line 1020 of file cxgb3_main.c.

irq_handler_t t3_intr_handler ( struct adapter adap,
int  polling 
)

t3_intr_handler - select the top-level interrupt handler : the adapter : whether using NAPI to service response queues

Selects the top-level interrupt handler based on the type of interrupts (MSI-X, MSI, or legacy) and whether NAPI will be used to service the response queues.

Definition at line 2773 of file sge.c.

int t3_mgmt_tx ( struct adapter adap,
struct sk_buff skb 
)

Definition at line 1512 of file sge.c.

int t3_offload_tx ( struct t3cdev tdev,
struct sk_buff skb 
)

t3_offload_tx - send an offload packet : the offload device to send to : the packet

Sends an offload packet. We use the packet priority to select the appropriate Tx queue as follows: bit 0 indicates whether the packet should be sent as regular or control, bits 1-3 select the queue set.

Definition at line 1767 of file sge.c.

void t3_os_ext_intr_handler ( struct adapter adapter)

Definition at line 2837 of file cxgb3_main.c.

void t3_os_link_changed ( struct adapter adapter,
int  port_id,
int  link_stat,
int  speed,
int  duplex,
int  pause 
)

t3_os_link_changed - handle link status changes : the adapter associated with the link change : the port index whose limk status has changed : the new status of the link : the new speed setting : the new duplex setting : the new flow-control setting

This is the OS-dependent handler for link status changes. The OS neutral handler takes care of most of the processing for these events, then calls this handler for any OS-specific processing.

Definition at line 247 of file cxgb3_main.c.

void t3_os_link_fault ( struct adapter adapter,
int  port_id,
int  state 
)

Definition at line 195 of file cxgb3_main.c.

void t3_os_link_fault_handler ( struct adapter adapter,
int  port_id 
)

Definition at line 2855 of file cxgb3_main.c.

void t3_os_phymod_changed ( struct adapter adap,
int  port_id 
)

t3_os_phymod_changed - handle PHY module changes : the PHY reporting the module change : new module type

This is the OS-dependent handler for PHY module changes. It is invoked when a PHY module is removed or inserted for any OS-specific processing.

Definition at line 311 of file cxgb3_main.c.

int t3_sge_alloc_qset ( struct adapter adapter,
unsigned int  id,
int  nports,
int  irq_vec_idx,
const struct qset_params p,
int  ntxq,
struct net_device dev,
struct netdev_queue netdevq 
)

t3_sge_alloc_qset - initialize an SGE queue set : the adapter : the queue set id : how many Ethernet ports will be using this queue set : the IRQ vector index for response queue interrupts : configuration parameters for this queue set : number of Tx queues for the queue set : net device associated with this queue set : net device TX queue associated with this queue set

Allocate resources and initialize an SGE queue set. A queue set comprises a response queue, two Rx free-buffer queues, and up to 3 Tx queues. The Tx queues are assigned roles in the order Ethernet queue, offload queue, and control queue.

Definition at line 2968 of file sge.c.

void t3_sge_err_intr_handler ( struct adapter adapter)

t3_sge_err_intr_handler - SGE async event interrupt handler : the adapter

Interrupt handler for SGE asynchronous (non-data) events.

Definition at line 2799 of file sge.c.

void t3_sge_start ( struct adapter adap)

t3_sge_start - enable SGE : the adapter

Enables the SGE for DMAs. This is the last step in starting packet transfers.

Definition at line 3199 of file sge.c.

void t3_sge_stop ( struct adapter adap)

t3_sge_stop - disable SGE operation : the adapter

Disables the DMA engine. This can be called in emeregencies (e.g., from error interrupts) or from normal process context. In the latter case it also disables any pending queue restart tasklets. Note that if it is called in interrupt context it cannot disable the restart tasklets as it cannot wait, however the tasklets will have no effect since the doorbells are disabled and the driver will call this again later from process context, at which time the tasklets will be stopped if they are still running.

Definition at line 3217 of file sge.c.

void t3_start_sge_timers ( struct adapter adap)

t3_start_sge_timers - start SGE timer call backs : the adapter

Starts each SGE queue set's timer call back

Definition at line 3143 of file sge.c.

void t3_stop_sge_timers ( struct adapter adap)

t3_stop_sge_timers - stop SGE timer call backs : the adapter

Stops each SGE queue set's timer call back

Definition at line 3164 of file sge.c.

void t3_update_qset_coalesce ( struct sge_qset qs,
const struct qset_params p 
)

t3_update_qset_coalesce - update coalescing settings for a queue set : the SGE queue set : new queue set parameters

Update the coalescing settings for an SGE queue set. Nothing is done if the queue set is not initialized yet.

Definition at line 2945 of file sge.c.

Variable Documentation

Definition at line 145 of file cxgb3_main.c.