Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions
libcxgbi.c File Reference
#include <linux/skbuff.h>
#include <linux/crypto.h>
#include <linux/scatterlist.h>
#include <linux/pci.h>
#include <scsi/scsi.h>
#include <scsi/scsi_cmnd.h>
#include <scsi/scsi_host.h>
#include <linux/if_vlan.h>
#include <linux/inet.h>
#include <net/dst.h>
#include <net/route.h>
#include <linux/inetdevice.h>
#include <linux/module.h>
#include <net/tcp.h>
#include "libcxgbi.h"

Go to the source code of this file.


#define pr_fmt(fmt)   KBUILD_MODNAME ":%s: " fmt, __func__
#define DRV_MODULE_NAME   "libcxgbi"
#define DRV_MODULE_DESC   "Chelsio iSCSI driver library"
#define DRV_MODULE_VERSION   "0.9.0"
#define DRV_MODULE_RELDATE   "Jun. 2010"


 MODULE_AUTHOR ("Chelsio Communications, Inc.")
 module_param (dbg_level, uint, 0644)
 MODULE_PARM_DESC (dbg_level,"libiscsi debug level (default=0)")
int cxgbi_device_portmap_create (struct cxgbi_device *cdev, unsigned int base, unsigned int max_conn)
 EXPORT_SYMBOL_GPL (cxgbi_device_portmap_create)
void cxgbi_device_portmap_cleanup (struct cxgbi_device *cdev)
 EXPORT_SYMBOL_GPL (cxgbi_device_portmap_cleanup)
struct cxgbi_devicecxgbi_device_register (unsigned int extra, unsigned int nports)
 EXPORT_SYMBOL_GPL (cxgbi_device_register)
void cxgbi_device_unregister (struct cxgbi_device *cdev)
 EXPORT_SYMBOL_GPL (cxgbi_device_unregister)
void cxgbi_device_unregister_all (unsigned int flag)
 EXPORT_SYMBOL_GPL (cxgbi_device_unregister_all)
struct cxgbi_devicecxgbi_device_find_by_lldev (void *lldev)
 EXPORT_SYMBOL_GPL (cxgbi_device_find_by_lldev)
void cxgbi_hbas_remove (struct cxgbi_device *cdev)
 EXPORT_SYMBOL_GPL (cxgbi_hbas_remove)
int cxgbi_hbas_add (struct cxgbi_device *cdev, unsigned int max_lun, unsigned int max_id, struct scsi_host_template *sht, struct scsi_transport_template *stt)
 EXPORT_SYMBOL_GPL (cxgbi_hbas_add)
void cxgbi_sock_free_cpl_skbs (struct cxgbi_sock *csk)
 EXPORT_SYMBOL_GPL (cxgbi_sock_free_cpl_skbs)
void cxgbi_sock_established (struct cxgbi_sock *csk, unsigned int snd_isn, unsigned int opt)
 EXPORT_SYMBOL_GPL (cxgbi_sock_established)
void cxgbi_sock_closed (struct cxgbi_sock *csk)
 EXPORT_SYMBOL_GPL (cxgbi_sock_closed)
void cxgbi_sock_fail_act_open (struct cxgbi_sock *csk, int errno)
 EXPORT_SYMBOL_GPL (cxgbi_sock_fail_act_open)
void cxgbi_sock_act_open_req_arp_failure (void *handle, struct sk_buff *skb)
 EXPORT_SYMBOL_GPL (cxgbi_sock_act_open_req_arp_failure)
void cxgbi_sock_rcv_abort_rpl (struct cxgbi_sock *csk)
 EXPORT_SYMBOL_GPL (cxgbi_sock_rcv_abort_rpl)
void cxgbi_sock_rcv_peer_close (struct cxgbi_sock *csk)
 EXPORT_SYMBOL_GPL (cxgbi_sock_rcv_peer_close)
void cxgbi_sock_rcv_close_conn_rpl (struct cxgbi_sock *csk, u32 snd_nxt)
 EXPORT_SYMBOL_GPL (cxgbi_sock_rcv_close_conn_rpl)
void cxgbi_sock_rcv_wr_ack (struct cxgbi_sock *csk, unsigned int credits, unsigned int snd_una, int seq_chk)
 EXPORT_SYMBOL_GPL (cxgbi_sock_rcv_wr_ack)
unsigned int cxgbi_sock_select_mss (struct cxgbi_sock *csk, unsigned int pmtu)
 EXPORT_SYMBOL_GPL (cxgbi_sock_select_mss)
void cxgbi_sock_skb_entail (struct cxgbi_sock *csk, struct sk_buff *skb)
 EXPORT_SYMBOL_GPL (cxgbi_sock_skb_entail)
void cxgbi_sock_purge_wr_queue (struct cxgbi_sock *csk)
 EXPORT_SYMBOL_GPL (cxgbi_sock_purge_wr_queue)
void cxgbi_sock_check_wr_invariants (const struct cxgbi_sock *csk)
 EXPORT_SYMBOL_GPL (cxgbi_sock_check_wr_invariants)
void cxgbi_ddp_page_size_factor (int *pgsz_factor)
 EXPORT_SYMBOL_GPL (cxgbi_ddp_page_size_factor)
void cxgbi_ddp_ppod_set (struct cxgbi_pagepod *ppod, struct cxgbi_pagepod_hdr *hdr, struct cxgbi_gather_list *gl, unsigned int gidx)
 EXPORT_SYMBOL_GPL (cxgbi_ddp_ppod_set)
void cxgbi_ddp_ppod_clear (struct cxgbi_pagepod *ppod)
 EXPORT_SYMBOL_GPL (cxgbi_ddp_ppod_clear)
int cxgbi_ddp_reserve (struct cxgbi_sock *csk, unsigned int *tagp, unsigned int sw_tag, unsigned int xferlen, struct scatterlist *sgl, unsigned int sgcnt, gfp_t gfp)
int cxgbi_ddp_cleanup (struct cxgbi_device *cdev)
 EXPORT_SYMBOL_GPL (cxgbi_ddp_cleanup)
int cxgbi_ddp_init (struct cxgbi_device *cdev, unsigned int llimit, unsigned int ulimit, unsigned int max_txsz, unsigned int max_rxsz)
 EXPORT_SYMBOL_GPL (cxgbi_ddp_init)
void cxgbi_parse_pdu_itt (struct iscsi_conn *conn, itt_t itt, int *idx, int *age)
 EXPORT_SYMBOL_GPL (cxgbi_parse_pdu_itt)
void cxgbi_conn_tx_open (struct cxgbi_sock *csk)
 EXPORT_SYMBOL_GPL (cxgbi_conn_tx_open)
void cxgbi_conn_pdu_ready (struct cxgbi_sock *csk)
 EXPORT_SYMBOL_GPL (cxgbi_conn_pdu_ready)
int cxgbi_conn_alloc_pdu (struct iscsi_task *task, u8 opcode)
 EXPORT_SYMBOL_GPL (cxgbi_conn_alloc_pdu)
int cxgbi_conn_init_pdu (struct iscsi_task *task, unsigned int offset, unsigned int count)
 EXPORT_SYMBOL_GPL (cxgbi_conn_init_pdu)
int cxgbi_conn_xmit_pdu (struct iscsi_task *task)
 EXPORT_SYMBOL_GPL (cxgbi_conn_xmit_pdu)
void cxgbi_cleanup_task (struct iscsi_task *task)
 EXPORT_SYMBOL_GPL (cxgbi_cleanup_task)
void cxgbi_get_conn_stats (struct iscsi_cls_conn *cls_conn, struct iscsi_stats *stats)
 EXPORT_SYMBOL_GPL (cxgbi_get_conn_stats)
int cxgbi_set_conn_param (struct iscsi_cls_conn *cls_conn, enum iscsi_param param, char *buf, int buflen)
 EXPORT_SYMBOL_GPL (cxgbi_set_conn_param)
int cxgbi_get_ep_param (struct iscsi_endpoint *ep, enum iscsi_param param, char *buf)
 EXPORT_SYMBOL_GPL (cxgbi_get_ep_param)
struct iscsi_cls_conncxgbi_create_conn (struct iscsi_cls_session *cls_session, u32 cid)
 EXPORT_SYMBOL_GPL (cxgbi_create_conn)
int cxgbi_bind_conn (struct iscsi_cls_session *cls_session, struct iscsi_cls_conn *cls_conn, u64 transport_eph, int is_leading)
 EXPORT_SYMBOL_GPL (cxgbi_bind_conn)
struct iscsi_cls_sessioncxgbi_create_session (struct iscsi_endpoint *ep, u16 cmds_max, u16 qdepth, u32 initial_cmdsn)
 EXPORT_SYMBOL_GPL (cxgbi_create_session)
void cxgbi_destroy_session (struct iscsi_cls_session *cls_session)
 EXPORT_SYMBOL_GPL (cxgbi_destroy_session)
int cxgbi_set_host_param (struct Scsi_Host *shost, enum iscsi_host_param param, char *buf, int buflen)
 EXPORT_SYMBOL_GPL (cxgbi_set_host_param)
int cxgbi_get_host_param (struct Scsi_Host *shost, enum iscsi_host_param param, char *buf)
 EXPORT_SYMBOL_GPL (cxgbi_get_host_param)
struct iscsi_endpointcxgbi_ep_connect (struct Scsi_Host *shost, struct sockaddr *dst_addr, int non_blocking)
 EXPORT_SYMBOL_GPL (cxgbi_ep_connect)
int cxgbi_ep_poll (struct iscsi_endpoint *ep, int timeout_ms)
 EXPORT_SYMBOL_GPL (cxgbi_ep_poll)
void cxgbi_ep_disconnect (struct iscsi_endpoint *ep)
 EXPORT_SYMBOL_GPL (cxgbi_ep_disconnect)
int cxgbi_iscsi_init (struct iscsi_transport *itp, struct scsi_transport_template **stt)
 EXPORT_SYMBOL_GPL (cxgbi_iscsi_init)
void cxgbi_iscsi_cleanup (struct iscsi_transport *itp, struct scsi_transport_template **stt)
 EXPORT_SYMBOL_GPL (cxgbi_iscsi_cleanup)
umode_t cxgbi_attr_is_visible (int param_type, int param)
 EXPORT_SYMBOL_GPL (cxgbi_attr_is_visible)
 module_init (libcxgbi_init_module)
 module_exit (libcxgbi_exit_module)

Macro Definition Documentation

#define DRV_MODULE_DESC   "Chelsio iSCSI driver library"

Definition at line 36 of file libcxgbi.c.

#define DRV_MODULE_NAME   "libcxgbi"

Definition at line 35 of file libcxgbi.c.

#define DRV_MODULE_RELDATE   "Jun. 2010"

Definition at line 38 of file libcxgbi.c.

#define DRV_MODULE_VERSION   "0.9.0"

Definition at line 37 of file libcxgbi.c.

#define pr_fmt (   fmt)    KBUILD_MODNAME ":%s: " fmt, __func__

Definition at line 14 of file libcxgbi.c.

Function Documentation

umode_t cxgbi_attr_is_visible ( int  param_type,
int  param 

Definition at line 2573 of file libcxgbi.c.

int cxgbi_bind_conn ( struct iscsi_cls_session cls_session,
struct iscsi_cls_conn cls_conn,
u64  transport_eph,
int  is_leading 

Definition at line 2251 of file libcxgbi.c.

void cxgbi_cleanup_task ( struct iscsi_task task)

Definition at line 2069 of file libcxgbi.c.

int cxgbi_conn_alloc_pdu ( struct iscsi_task task,
u8  opcode 

Definition at line 1850 of file libcxgbi.c.

int cxgbi_conn_init_pdu ( struct iscsi_task task,
unsigned int  offset,
unsigned int  count 

Definition at line 1912 of file libcxgbi.c.

void cxgbi_conn_pdu_ready ( struct cxgbi_sock csk)

Definition at line 1666 of file libcxgbi.c.

void cxgbi_conn_tx_open ( struct cxgbi_sock csk)

Definition at line 1522 of file libcxgbi.c.

int cxgbi_conn_xmit_pdu ( struct iscsi_task task)

Definition at line 2015 of file libcxgbi.c.

struct iscsi_cls_conn* cxgbi_create_conn ( struct iscsi_cls_session cls_session,
u32  cid 

Definition at line 2227 of file libcxgbi.c.

struct iscsi_cls_session* cxgbi_create_session ( struct iscsi_endpoint ep,
u16  cmds_max,
u16  qdepth,
u32  initial_cmdsn 

Definition at line 2301 of file libcxgbi.c.

int cxgbi_ddp_cleanup ( struct cxgbi_device cdev)

Definition at line 1365 of file libcxgbi.c.

int cxgbi_ddp_init ( struct cxgbi_device cdev,
unsigned int  llimit,
unsigned int  ulimit,
unsigned int  max_txsz,
unsigned int  max_rxsz 

Definition at line 1378 of file libcxgbi.c.

void cxgbi_ddp_page_size_factor ( int pgsz_factor)

Definition at line 1014 of file libcxgbi.c.

void cxgbi_ddp_ppod_clear ( struct cxgbi_pagepod ppod)

Definition at line 1041 of file libcxgbi.c.

void cxgbi_ddp_ppod_set ( struct cxgbi_pagepod ppod,
struct cxgbi_pagepod_hdr hdr,
struct cxgbi_gather_list gl,
unsigned int  gidx 

Definition at line 1027 of file libcxgbi.c.

int cxgbi_ddp_reserve ( struct cxgbi_sock csk,
unsigned int tagp,
unsigned int  sw_tag,
unsigned int  xferlen,
struct scatterlist sgl,
unsigned int  sgcnt,
gfp_t  gfp 

Definition at line 1307 of file libcxgbi.c.

void cxgbi_destroy_session ( struct iscsi_cls_session cls_session)

Definition at line 2344 of file libcxgbi.c.

struct cxgbi_device* cxgbi_device_find_by_lldev ( void lldev)

Definition at line 178 of file libcxgbi.c.

void cxgbi_device_portmap_cleanup ( struct cxgbi_device cdev)

Definition at line 76 of file libcxgbi.c.

int cxgbi_device_portmap_create ( struct cxgbi_device cdev,
unsigned int  base,
unsigned int  max_conn 

Definition at line 56 of file libcxgbi.c.

struct cxgbi_device* cxgbi_device_register ( unsigned int  extra,
unsigned int  nports 

Definition at line 116 of file libcxgbi.c.

void cxgbi_device_unregister ( struct cxgbi_device cdev)

Definition at line 147 of file libcxgbi.c.

void cxgbi_device_unregister_all ( unsigned int  flag)

Definition at line 159 of file libcxgbi.c.

struct iscsi_endpoint* cxgbi_ep_connect ( struct Scsi_Host shost,
struct sockaddr dst_addr,
int  non_blocking 

Definition at line 2428 of file libcxgbi.c.

void cxgbi_ep_disconnect ( struct iscsi_endpoint ep)

Definition at line 2516 of file libcxgbi.c.

int cxgbi_ep_poll ( struct iscsi_endpoint ep,
int  timeout_ms 

Definition at line 2505 of file libcxgbi.c.

void cxgbi_get_conn_stats ( struct iscsi_cls_conn cls_conn,
struct iscsi_stats stats 

Definition at line 2087 of file libcxgbi.c.

int cxgbi_get_ep_param ( struct iscsi_endpoint ep,
enum iscsi_param  param,
char buf 

Definition at line 2197 of file libcxgbi.c.

int cxgbi_get_host_param ( struct Scsi_Host shost,
enum iscsi_host_param  param,
char buf 

Definition at line 2387 of file libcxgbi.c.

int cxgbi_hbas_add ( struct cxgbi_device cdev,
unsigned int  max_lun,
unsigned int  max_id,
struct scsi_host_template sht,
struct scsi_transport_template stt 

Definition at line 248 of file libcxgbi.c.

void cxgbi_hbas_remove ( struct cxgbi_device cdev)

Definition at line 228 of file libcxgbi.c.

void cxgbi_iscsi_cleanup ( struct iscsi_transport itp,
struct scsi_transport_template **  stt 

Definition at line 2560 of file libcxgbi.c.

int cxgbi_iscsi_init ( struct iscsi_transport itp,
struct scsi_transport_template **  stt 

Definition at line 2544 of file libcxgbi.c.

void cxgbi_parse_pdu_itt ( struct iscsi_conn conn,
itt_t  itt,
int idx,
int age 

Definition at line 1501 of file libcxgbi.c.

int cxgbi_set_conn_param ( struct iscsi_cls_conn cls_conn,
enum iscsi_param  param,
char buf,
int  buflen 

Definition at line 2150 of file libcxgbi.c.

int cxgbi_set_host_param ( struct Scsi_Host shost,
enum iscsi_host_param  param,
char buf,
int  buflen 

Definition at line 2354 of file libcxgbi.c.

void cxgbi_sock_act_open_req_arp_failure ( void handle,
struct sk_buff skb 

Definition at line 648 of file libcxgbi.c.

void cxgbi_sock_check_wr_invariants ( const struct cxgbi_sock csk)

Definition at line 857 of file libcxgbi.c.

void cxgbi_sock_closed ( struct cxgbi_sock csk)

Definition at line 584 of file libcxgbi.c.

void cxgbi_sock_established ( struct cxgbi_sock csk,
unsigned int  snd_isn,
unsigned int  opt 

Definition at line 559 of file libcxgbi.c.

void cxgbi_sock_fail_act_open ( struct cxgbi_sock csk,
int  errno 

Definition at line 634 of file libcxgbi.c.

void cxgbi_sock_free_cpl_skbs ( struct cxgbi_sock csk)

Definition at line 407 of file libcxgbi.c.

void cxgbi_sock_purge_wr_queue ( struct cxgbi_sock csk)

Definition at line 848 of file libcxgbi.c.

void cxgbi_sock_rcv_abort_rpl ( struct cxgbi_sock csk)

Definition at line 664 of file libcxgbi.c.

void cxgbi_sock_rcv_close_conn_rpl ( struct cxgbi_sock csk,
u32  snd_nxt 

Definition at line 718 of file libcxgbi.c.

void cxgbi_sock_rcv_peer_close ( struct cxgbi_sock csk)

Definition at line 685 of file libcxgbi.c.

void cxgbi_sock_rcv_wr_ack ( struct cxgbi_sock csk,
unsigned int  credits,
unsigned int  snd_una,
int  seq_chk 

Definition at line 749 of file libcxgbi.c.

unsigned int cxgbi_sock_select_mss ( struct cxgbi_sock csk,
unsigned int  pmtu 

Definition at line 824 of file libcxgbi.c.

void cxgbi_sock_skb_entail ( struct cxgbi_sock csk,
struct sk_buff skb 

Definition at line 841 of file libcxgbi.c.

EXPORT_SYMBOL_GPL ( cxgbi_device_portmap_create  )
EXPORT_SYMBOL_GPL ( cxgbi_device_portmap_cleanup  )
EXPORT_SYMBOL_GPL ( cxgbi_device_register  )
EXPORT_SYMBOL_GPL ( cxgbi_device_unregister  )
EXPORT_SYMBOL_GPL ( cxgbi_device_unregister_all  )
EXPORT_SYMBOL_GPL ( cxgbi_device_find_by_lldev  )
EXPORT_SYMBOL_GPL ( cxgbi_hbas_remove  )
EXPORT_SYMBOL_GPL ( cxgbi_hbas_add  )
EXPORT_SYMBOL_GPL ( cxgbi_sock_free_cpl_skbs  )
EXPORT_SYMBOL_GPL ( cxgbi_sock_established  )
EXPORT_SYMBOL_GPL ( cxgbi_sock_closed  )
EXPORT_SYMBOL_GPL ( cxgbi_sock_fail_act_open  )
EXPORT_SYMBOL_GPL ( cxgbi_sock_act_open_req_arp_failure  )
EXPORT_SYMBOL_GPL ( cxgbi_sock_rcv_abort_rpl  )
EXPORT_SYMBOL_GPL ( cxgbi_sock_rcv_peer_close  )
EXPORT_SYMBOL_GPL ( cxgbi_sock_rcv_close_conn_rpl  )
EXPORT_SYMBOL_GPL ( cxgbi_sock_rcv_wr_ack  )
EXPORT_SYMBOL_GPL ( cxgbi_sock_select_mss  )
EXPORT_SYMBOL_GPL ( cxgbi_sock_skb_entail  )
EXPORT_SYMBOL_GPL ( cxgbi_sock_purge_wr_queue  )
EXPORT_SYMBOL_GPL ( cxgbi_sock_check_wr_invariants  )
EXPORT_SYMBOL_GPL ( cxgbi_ddp_page_size_factor  )
EXPORT_SYMBOL_GPL ( cxgbi_ddp_ppod_set  )
EXPORT_SYMBOL_GPL ( cxgbi_ddp_ppod_clear  )
EXPORT_SYMBOL_GPL ( cxgbi_ddp_cleanup  )
EXPORT_SYMBOL_GPL ( cxgbi_ddp_init  )
EXPORT_SYMBOL_GPL ( cxgbi_parse_pdu_itt  )
EXPORT_SYMBOL_GPL ( cxgbi_conn_tx_open  )
EXPORT_SYMBOL_GPL ( cxgbi_conn_pdu_ready  )
EXPORT_SYMBOL_GPL ( cxgbi_conn_alloc_pdu  )
EXPORT_SYMBOL_GPL ( cxgbi_conn_init_pdu  )
EXPORT_SYMBOL_GPL ( cxgbi_conn_xmit_pdu  )
EXPORT_SYMBOL_GPL ( cxgbi_cleanup_task  )
EXPORT_SYMBOL_GPL ( cxgbi_get_conn_stats  )
EXPORT_SYMBOL_GPL ( cxgbi_set_conn_param  )
EXPORT_SYMBOL_GPL ( cxgbi_get_ep_param  )
EXPORT_SYMBOL_GPL ( cxgbi_create_conn  )
EXPORT_SYMBOL_GPL ( cxgbi_bind_conn  )
EXPORT_SYMBOL_GPL ( cxgbi_create_session  )
EXPORT_SYMBOL_GPL ( cxgbi_destroy_session  )
EXPORT_SYMBOL_GPL ( cxgbi_set_host_param  )
EXPORT_SYMBOL_GPL ( cxgbi_get_host_param  )
EXPORT_SYMBOL_GPL ( cxgbi_ep_connect  )
EXPORT_SYMBOL_GPL ( cxgbi_ep_poll  )
EXPORT_SYMBOL_GPL ( cxgbi_ep_disconnect  )
EXPORT_SYMBOL_GPL ( cxgbi_iscsi_init  )
EXPORT_SYMBOL_GPL ( cxgbi_iscsi_cleanup  )
EXPORT_SYMBOL_GPL ( cxgbi_attr_is_visible  )
MODULE_AUTHOR ( "Chelsio  Communications,
module_exit ( libcxgbi_exit_module  )
module_init ( libcxgbi_init_module  )
module_param ( dbg_level  ,
uint  ,
MODULE_PARM_DESC ( dbg_level  ,
"libiscsi debug level (default=0)"