Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions
cxgb4_uld.h File Reference
#include <linux/cache.h>
#include <linux/spinlock.h>
#include <linux/skbuff.h>
#include <linux/atomic.h>

Go to the source code of this file.

Data Structures

struct  serv_entry
 
union  aopen_entry
 
struct  tid_info
 
struct  cxgb4_range
 
struct  cxgb4_virt_res
 
struct  cxgb4_lld_info
 
struct  cxgb4_uld_info
 

Macros

#define INIT_TP_WR(w, tid)
 
#define INIT_TP_WR_CPL(w, cpl, tid)
 
#define INIT_ULPTX_WR(w, wrlen, atomic, tid)
 
#define CXGB4_MSG_AN   ((void *)1)
 
#define OCQ_WIN_OFFSET(pdev, vres)   (pci_resource_len((pdev), 2) - roundup_pow_of_two((vres)->ocq.size))
 

Enumerations

enum  {
  CPL_PRIORITY_DATA = 0, CPL_PRIORITY_SETUP = 1, CPL_PRIORITY_TEARDOWN = 0, CPL_PRIORITY_LISTEN = 1,
  CPL_PRIORITY_ACK = 1, CPL_PRIORITY_CONTROL = 1
}
 
enum  cxgb4_uld { CXGB4_ULD_RDMA, CXGB4_ULD_ISCSI, CXGB4_ULD_MAX }
 
enum  cxgb4_state { CXGB4_STATE_UP, CXGB4_STATE_START_RECOVERY, CXGB4_STATE_DOWN, CXGB4_STATE_DETACH }
 
enum  cxgb4_control { CXGB4_CONTROL_DB_FULL, CXGB4_CONTROL_DB_EMPTY, CXGB4_CONTROL_DB_DROP }
 

Functions

int cxgb4_alloc_atid (struct tid_info *t, void *data)
 
int cxgb4_alloc_stid (struct tid_info *t, int family, void *data)
 
void cxgb4_free_atid (struct tid_info *t, unsigned int atid)
 
void cxgb4_free_stid (struct tid_info *t, unsigned int stid, int family)
 
void cxgb4_remove_tid (struct tid_info *t, unsigned int qid, unsigned int tid)
 
int cxgb4_create_server (const struct net_device *dev, unsigned int stid, __be32 sip, __be16 sport, unsigned int queue)
 
int cxgb4_register_uld (enum cxgb4_uld type, const struct cxgb4_uld_info *p)
 
int cxgb4_unregister_uld (enum cxgb4_uld type)
 
int cxgb4_ofld_send (struct net_device *dev, struct sk_buff *skb)
 
unsigned int cxgb4_dbfifo_count (const struct net_device *dev, int lpfifo)
 
unsigned int cxgb4_port_chan (const struct net_device *dev)
 
unsigned int cxgb4_port_viid (const struct net_device *dev)
 
unsigned int cxgb4_port_idx (const struct net_device *dev)
 
unsigned int cxgb4_best_mtu (const unsigned short *mtus, unsigned short mtu, unsigned int *idx)
 
void cxgb4_get_tcp_stats (struct pci_dev *pdev, struct tp_tcp_stats *v4, struct tp_tcp_stats *v6)
 
void cxgb4_iscsi_init (struct net_device *dev, unsigned int tag_mask, const unsigned int *pgsz_order)
 
struct sk_buffcxgb4_pktgl_to_skb (const struct pkt_gl *gl, unsigned int skb_len, unsigned int pull_len)
 
int cxgb4_sync_txq_pidx (struct net_device *dev, u16 qid, u16 pidx, u16 size)
 
int cxgb4_flush_eq_cache (struct net_device *dev)
 

Macro Definition Documentation

#define CXGB4_MSG_AN   ((void *)1)

Definition at line 74 of file cxgb4_uld.h.

#define INIT_TP_WR (   w,
  tid 
)
Value:
do { \
(w)->wr.wr_hi = htonl(FW_WR_OP(FW_TP_WR) | \
FW_WR_IMMDLEN(sizeof(*w) - sizeof(w->wr))); \
(w)->wr.wr_mid = htonl(FW_WR_LEN16(DIV_ROUND_UP(sizeof(*w), 16)) | \
FW_WR_FLOWID(tid)); \
(w)->wr.wr_lo = cpu_to_be64(0); \
} while (0)

Definition at line 53 of file cxgb4_uld.h.

#define INIT_TP_WR_CPL (   w,
  cpl,
  tid 
)
Value:
do { \
INIT_TP_WR(w, tid); \
OPCODE_TID(w) = htonl(MK_OPCODE_TID(cpl, tid)); \
} while (0)

Definition at line 61 of file cxgb4_uld.h.

#define INIT_ULPTX_WR (   w,
  wrlen,
  atomic,
  tid 
)
Value:
do { \
(w)->wr.wr_hi = htonl(FW_WR_OP(FW_ULPTX_WR) | FW_WR_ATOMIC(atomic)); \
(w)->wr.wr_mid = htonl(FW_WR_LEN16(DIV_ROUND_UP(wrlen, 16)) | \
FW_WR_FLOWID(tid)); \
(w)->wr.wr_lo = cpu_to_be64(0); \
} while (0)

Definition at line 66 of file cxgb4_uld.h.

#define OCQ_WIN_OFFSET (   pdev,
  vres 
)    (pci_resource_len((pdev), 2) - roundup_pow_of_two((vres)->ocq.size))

Definition at line 199 of file cxgb4_uld.h.

Enumeration Type Documentation

anonymous enum
Enumerator:
CPL_PRIORITY_DATA 
CPL_PRIORITY_SETUP 
CPL_PRIORITY_TEARDOWN 
CPL_PRIORITY_LISTEN 
CPL_PRIORITY_ACK 
CPL_PRIORITY_CONTROL 

Definition at line 44 of file cxgb4_uld.h.

Enumerator:
CXGB4_CONTROL_DB_FULL 
CXGB4_CONTROL_DB_EMPTY 
CXGB4_CONTROL_DB_DROP 

Definition at line 171 of file cxgb4_uld.h.

Enumerator:
CXGB4_STATE_UP 
CXGB4_STATE_START_RECOVERY 
CXGB4_STATE_DOWN 
CXGB4_STATE_DETACH 

Definition at line 164 of file cxgb4_uld.h.

enum cxgb4_uld
Enumerator:
CXGB4_ULD_RDMA 
CXGB4_ULD_ISCSI 
CXGB4_ULD_MAX 

Definition at line 158 of file cxgb4_uld.h.

Function Documentation

int cxgb4_alloc_atid ( struct tid_info t,
void data 
)

Definition at line 2190 of file cxgb4_main.c.

int cxgb4_alloc_stid ( struct tid_info t,
int  family,
void data 
)

Definition at line 2226 of file cxgb4_main.c.

unsigned int cxgb4_best_mtu ( const unsigned short mtus,
unsigned short  mtu,
unsigned int idx 
)

cxgb4_best_mtu - find the entry in the MTU table closest to an MTU : the HW MTU table : the target MTU : index of selected entry in the MTU table

Returns the index and the value in the HW MTU table that is closest to but does not exceed , unless is smaller than any value in the table, in which case that smallest available value is selected.

Definition at line 2444 of file cxgb4_main.c.

int cxgb4_create_server ( const struct net_device dev,
unsigned int  stid,
__be32  sip,
__be16  sport,
unsigned int  queue 
)

cxgb4_create_server - create an IP server : the device : the server TID : local IP address to bind server to : the server's TCP port : queue to direct messages from this server to

Create an IP server for the given port and address. Returns <0 on error and one of the NET_XMIT_* values on success.

Definition at line 2406 of file cxgb4_main.c.

unsigned int cxgb4_dbfifo_count ( const struct net_device dev,
int  lpfifo 
)

Definition at line 2469 of file cxgb4_main.c.

int cxgb4_flush_eq_cache ( struct net_device dev)

Definition at line 2526 of file cxgb4_main.c.

void cxgb4_free_atid ( struct tid_info t,
unsigned int  atid 
)

Definition at line 2211 of file cxgb4_main.c.

void cxgb4_free_stid ( struct tid_info t,
unsigned int  stid,
int  family 
)

Definition at line 2255 of file cxgb4_main.c.

void cxgb4_get_tcp_stats ( struct pci_dev pdev,
struct tp_tcp_stats v4,
struct tp_tcp_stats v6 
)

Definition at line 2503 of file cxgb4_main.c.

void cxgb4_iscsi_init ( struct net_device dev,
unsigned int  tag_mask,
const unsigned int pgsz_order 
)

Definition at line 2514 of file cxgb4_main.c.

int cxgb4_ofld_send ( struct net_device dev,
struct sk_buff skb 
)

cxgb4_ofld_send - send an offload packet : the net device : the packet

Sends an offload packet. This is an exported version of , intended for ULDs.

Definition at line 1468 of file sge.c.

struct sk_buff* cxgb4_pktgl_to_skb ( const struct pkt_gl gl,
unsigned int  skb_len,
unsigned int  pull_len 
)
read

cxgb4_pktgl_to_skb - build an sk_buff from a packet gather list : the gather list : size of sk_buff main body if it carries fragments : amount of data to move to the sk_buff's main body

Builds an sk_buff from the given packet gather list. Returns the sk_buff or NULL if sk_buff allocation failed.

Definition at line 1502 of file sge.c.

unsigned int cxgb4_port_chan ( const struct net_device dev)

cxgb4_port_chan - get the HW channel of a port : the net device for the port

Return the HW Tx channel of the given port.

Definition at line 2463 of file cxgb4_main.c.

unsigned int cxgb4_port_idx ( const struct net_device dev)

cxgb4_port_idx - get the index of a port : the net device for the port

Return the index of the given port.

Definition at line 2497 of file cxgb4_main.c.

unsigned int cxgb4_port_viid ( const struct net_device dev)

cxgb4_port_viid - get the VI id of a port : the net device for the port

Return the VI id of the given port.

Definition at line 2485 of file cxgb4_main.c.

int cxgb4_register_uld ( enum cxgb4_uld  type,
const struct cxgb4_uld_info p 
)

cxgb4_register_uld - register an upper-layer driver : the ULD type : the ULD methods

Registers an upper-layer driver with this driver and notifies the ULD about any presently available devices that support its type. Returns %-EBUSY if a ULD of the same type is already registered.

Definition at line 2854 of file cxgb4_main.c.

void cxgb4_remove_tid ( struct tid_info t,
unsigned int  qid,
unsigned int  tid 
)

Definition at line 2340 of file cxgb4_main.c.

int cxgb4_sync_txq_pidx ( struct net_device dev,
u16  qid,
u16  pidx,
u16  size 
)

Definition at line 2551 of file cxgb4_main.c.

int cxgb4_unregister_uld ( enum cxgb4_uld  type)

cxgb4_unregister_uld - unregister an upper-layer driver : the ULD type

Unregisters an existing upper-layer driver.

Definition at line 2880 of file cxgb4_main.c.