#define pr_fmt(fmt) …
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <scsi/scsi_host.h>
#include <net/tcp.h>
#include <net/dst.h>
#include <linux/netdevice.h>
#include <net/addrconf.h>
#include "t4_regs.h"
#include "t4_msg.h"
#include "cxgb4.h"
#include "cxgb4_uld.h"
#include "t4fw_api.h"
#include "l2t.h"
#include "cxgb4i.h"
#include "clip_tbl.h"
static unsigned int dbg_level;
#include "../libcxgbi.h"
#ifdef CONFIG_CHELSIO_T4_DCB
#include <net/dcbevent.h>
#include "cxgb4_dcb.h"
#endif
#define DRV_MODULE_NAME …
#define DRV_MODULE_DESC …
#define DRV_MODULE_VERSION …
#define DRV_MODULE_RELDATE …
static char version[] = …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…);
MODULE_VERSION(…);
MODULE_LICENSE(…) …;
module_param(dbg_level, uint, 0644);
MODULE_PARM_DESC(…) …;
#define CXGB4I_DEFAULT_10G_RCV_WIN …
static int cxgb4i_rcv_win = …;
module_param(cxgb4i_rcv_win, int, 0644);
MODULE_PARM_DESC(…) …;
#define CXGB4I_DEFAULT_10G_SND_WIN …
static int cxgb4i_snd_win = …;
module_param(cxgb4i_snd_win, int, 0644);
MODULE_PARM_DESC(…) …;
static int cxgb4i_rx_credit_thres = …;
module_param(cxgb4i_rx_credit_thres, int, 0644);
MODULE_PARM_DESC(…) …;
static unsigned int cxgb4i_max_connect = …;
module_param(cxgb4i_max_connect, uint, 0644);
MODULE_PARM_DESC(…) …;
static unsigned short cxgb4i_sport_base = …;
module_param(cxgb4i_sport_base, ushort, 0644);
MODULE_PARM_DESC(…) …;
cxgb4i_cplhandler_func;
static void *t4_uld_add(const struct cxgb4_lld_info *);
static int t4_uld_rx_handler(void *, const __be64 *, const struct pkt_gl *);
static int t4_uld_state_change(void *, enum cxgb4_state state);
static inline int send_tx_flowc_wr(struct cxgbi_sock *);
static const struct cxgb4_uld_info cxgb4i_uld_info = …;
static struct scsi_host_template cxgb4i_host_template = …;
static struct iscsi_transport cxgb4i_iscsi_transport = …;
#ifdef CONFIG_CHELSIO_T4_DCB
static int
cxgb4_dcb_change_notify(struct notifier_block *, unsigned long, void *);
static struct notifier_block cxgb4_dcb_change = …;
#endif
static struct scsi_transport_template *cxgb4i_stt;
#define RCV_BUFSIZ_MASK …
#define MAX_IMM_TX_PKT_LEN …
static int push_tx_frames(struct cxgbi_sock *, int);
static inline bool is_ofld_imm(const struct sk_buff *skb)
{ … }
static void send_act_open_req(struct cxgbi_sock *csk, struct sk_buff *skb,
struct l2t_entry *e)
{ … }
#if IS_ENABLED(CONFIG_IPV6)
static void send_act_open_req6(struct cxgbi_sock *csk, struct sk_buff *skb,
struct l2t_entry *e)
{ … }
#endif
static void send_close_req(struct cxgbi_sock *csk)
{ … }
static void abort_arp_failure(void *handle, struct sk_buff *skb)
{ … }
static void send_abort_req(struct cxgbi_sock *csk)
{ … }
static void send_abort_rpl(struct cxgbi_sock *csk, int rst_status)
{ … }
static u32 send_rx_credits(struct cxgbi_sock *csk, u32 credits)
{ … }
static inline unsigned int sgl_len(unsigned int n)
{ … }
static inline unsigned int calc_tx_flits_ofld(const struct sk_buff *skb)
{ … }
#define FLOWC_WR_NPARAMS_MIN …
static inline int tx_flowc_wr_credits(int *nparamsp, int *flowclenp)
{ … }
static inline int send_tx_flowc_wr(struct cxgbi_sock *csk)
{ … }
static void
cxgb4i_make_tx_iso_cpl(struct sk_buff *skb, struct cpl_tx_data_iso *cpl)
{ … }
static void
cxgb4i_make_tx_data_wr(struct cxgbi_sock *csk, struct sk_buff *skb, int dlen,
int len, u32 credits, int compl)
{ … }
static void arp_failure_skb_discard(void *handle, struct sk_buff *skb)
{ … }
static int push_tx_frames(struct cxgbi_sock *csk, int req_completion)
{ … }
static inline void free_atid(struct cxgbi_sock *csk)
{ … }
static void do_act_establish(struct cxgbi_device *cdev, struct sk_buff *skb)
{ … }
static int act_open_rpl_status_to_errno(int status)
{ … }
static void csk_act_open_retry_timer(struct timer_list *t)
{ … }
static inline bool is_neg_adv(unsigned int status)
{ … }
static void do_act_open_rpl(struct cxgbi_device *cdev, struct sk_buff *skb)
{ … }
static void do_peer_close(struct cxgbi_device *cdev, struct sk_buff *skb)
{ … }
static void do_close_con_rpl(struct cxgbi_device *cdev, struct sk_buff *skb)
{ … }
static int abort_status_to_errno(struct cxgbi_sock *csk, int abort_reason,
int *need_rst)
{ … }
static void do_abort_req_rss(struct cxgbi_device *cdev, struct sk_buff *skb)
{ … }
static void do_abort_rpl_rss(struct cxgbi_device *cdev, struct sk_buff *skb)
{ … }
static void do_rx_data(struct cxgbi_device *cdev, struct sk_buff *skb)
{ … }
static void do_rx_iscsi_hdr(struct cxgbi_device *cdev, struct sk_buff *skb)
{ … }
static void do_rx_iscsi_data(struct cxgbi_device *cdev, struct sk_buff *skb)
{ … }
static void
cxgb4i_process_ddpvld(struct cxgbi_sock *csk,
struct sk_buff *skb, u32 ddpvld)
{ … }
static void do_rx_data_ddp(struct cxgbi_device *cdev,
struct sk_buff *skb)
{ … }
static void
do_rx_iscsi_cmp(struct cxgbi_device *cdev, struct sk_buff *skb)
{ … }
static void do_fw4_ack(struct cxgbi_device *cdev, struct sk_buff *skb)
{ … }
static void do_set_tcb_rpl(struct cxgbi_device *cdev, struct sk_buff *skb)
{ … }
static int alloc_cpls(struct cxgbi_sock *csk)
{ … }
static inline void l2t_put(struct cxgbi_sock *csk)
{ … }
static void release_offload_resources(struct cxgbi_sock *csk)
{ … }
#ifdef CONFIG_CHELSIO_T4_DCB
static inline u8 get_iscsi_dcb_state(struct net_device *ndev)
{ … }
static int select_priority(int pri_mask)
{ … }
static u8 get_iscsi_dcb_priority(struct net_device *ndev)
{ … }
#endif
static int init_act_open(struct cxgbi_sock *csk)
{ … }
static cxgb4i_cplhandler_func cxgb4i_cplhandlers[NUM_CPL_CMDS] = …;
static int cxgb4i_ofld_init(struct cxgbi_device *cdev)
{ … }
static inline void
ulp_mem_io_set_hdr(struct cxgbi_device *cdev,
struct ulp_mem_io *req,
unsigned int wr_len, unsigned int dlen,
unsigned int pm_addr,
int tid)
{ … }
static struct sk_buff *
ddp_ppod_init_idata(struct cxgbi_device *cdev,
struct cxgbi_ppm *ppm,
unsigned int idx, unsigned int npods,
unsigned int tid)
{ … }
static int ddp_ppod_write_idata(struct cxgbi_ppm *ppm, struct cxgbi_sock *csk,
struct cxgbi_task_tag_info *ttinfo,
unsigned int idx, unsigned int npods,
struct scatterlist **sg_pp,
unsigned int *sg_off)
{ … }
static int ddp_set_map(struct cxgbi_ppm *ppm, struct cxgbi_sock *csk,
struct cxgbi_task_tag_info *ttinfo)
{ … }
static int ddp_setup_conn_pgidx(struct cxgbi_sock *csk, unsigned int tid,
int pg_idx)
{ … }
static int ddp_setup_conn_digest(struct cxgbi_sock *csk, unsigned int tid,
int hcrc, int dcrc)
{ … }
static struct cxgbi_ppm *cdev2ppm(struct cxgbi_device *cdev)
{ … }
static int cxgb4i_ddp_init(struct cxgbi_device *cdev)
{ … }
static bool is_memfree(struct adapter *adap)
{ … }
static void *t4_uld_add(const struct cxgb4_lld_info *lldi)
{ … }
#define RX_PULL_LEN …
static int t4_uld_rx_handler(void *handle, const __be64 *rsp,
const struct pkt_gl *pgl)
{ … }
static int t4_uld_state_change(void *handle, enum cxgb4_state state)
{ … }
#ifdef CONFIG_CHELSIO_T4_DCB
static int
cxgb4_dcb_change_notify(struct notifier_block *self, unsigned long val,
void *data)
{ … }
#endif
static int __init cxgb4i_init_module(void)
{ … }
static void __exit cxgb4i_exit_module(void)
{ … }
module_init(…) …;
module_exit(cxgb4i_exit_module);