#define pr_fmt(fmt) …
#include <linux/module.h>
#include <linux/init.h>
#include <linux/pci.h>
#include <linux/dma-mapping.h>
#include <linux/netdevice.h>
#include <linux/etherdevice.h>
#include <linux/if_vlan.h>
#include <linux/mdio.h>
#include <linux/sockios.h>
#include <linux/workqueue.h>
#include <linux/proc_fs.h>
#include <linux/rtnetlink.h>
#include <linux/firmware.h>
#include <linux/log2.h>
#include <linux/stringify.h>
#include <linux/sched.h>
#include <linux/slab.h>
#include <linux/uaccess.h>
#include <linux/nospec.h>
#include "common.h"
#include "cxgb3_ioctl.h"
#include "regs.h"
#include "cxgb3_offload.h"
#include "version.h"
#include "cxgb3_ctl_defs.h"
#include "t3_cpl.h"
#include "firmware_exports.h"
enum { … };
#define PORT_MASK …
#define DFLT_MSG_ENABLE …
#define EEPROM_MAGIC …
#define CH_DEVICE(devid, idx) …
static const struct pci_device_id cxgb3_pci_tbl[] = …;
MODULE_DESCRIPTION(…);
MODULE_AUTHOR(…) …;
MODULE_LICENSE(…) …;
MODULE_DEVICE_TABLE(pci, cxgb3_pci_tbl);
static int dflt_msg_enable = …;
module_param(dflt_msg_enable, int, 0644);
MODULE_PARM_DESC(…) …;
static int msi = …;
module_param(msi, int, 0644);
MODULE_PARM_DESC(…) …;
static int ofld_disable = …;
module_param(ofld_disable, int, 0644);
MODULE_PARM_DESC(…) …;
struct workqueue_struct *cxgb3_wq;
static void link_report(struct net_device *dev)
{ … }
static void enable_tx_fifo_drain(struct adapter *adapter,
struct port_info *pi)
{ … }
static void disable_tx_fifo_drain(struct adapter *adapter,
struct port_info *pi)
{ … }
void t3_os_link_fault(struct adapter *adap, int port_id, int state)
{ … }
void t3_os_link_changed(struct adapter *adapter, int port_id, int link_stat,
int speed, int duplex, int pause)
{ … }
void t3_os_phymod_changed(struct adapter *adap, int port_id)
{ … }
static void cxgb_set_rxmode(struct net_device *dev)
{ … }
static void link_start(struct net_device *dev)
{ … }
static inline void cxgb_disable_msi(struct adapter *adapter)
{ … }
static irqreturn_t t3_async_intr_handler(int irq, void *cookie)
{ … }
static void name_msix_vecs(struct adapter *adap)
{ … }
static int request_msix_data_irqs(struct adapter *adap)
{ … }
static void free_irq_resources(struct adapter *adapter)
{ … }
static int await_mgmt_replies(struct adapter *adap, unsigned long init_cnt,
unsigned long n)
{ … }
static int init_tp_parity(struct adapter *adap)
{ … }
static void setup_rss(struct adapter *adap)
{ … }
static void ring_dbs(struct adapter *adap)
{ … }
static void init_napi(struct adapter *adap)
{ … }
static void quiesce_rx(struct adapter *adap)
{ … }
static void enable_all_napi(struct adapter *adap)
{ … }
static int setup_sge_qsets(struct adapter *adap)
{ … }
static ssize_t attr_show(struct device *d, char *buf,
ssize_t(*format) (struct net_device *, char *))
{ … }
static ssize_t attr_store(struct device *d,
const char *buf, size_t len,
ssize_t(*set) (struct net_device *, unsigned int),
unsigned int min_val, unsigned int max_val)
{ … }
#define CXGB3_SHOW(name, val_expr) …
static ssize_t set_nfilters(struct net_device *dev, unsigned int val)
{ … }
static ssize_t store_nfilters(struct device *d, struct device_attribute *attr,
const char *buf, size_t len)
{ … }
static ssize_t set_nservers(struct net_device *dev, unsigned int val)
{ … }
static ssize_t store_nservers(struct device *d, struct device_attribute *attr,
const char *buf, size_t len)
{ … }
#define CXGB3_ATTR_R(name, val_expr) …
#define CXGB3_ATTR_RW(name, val_expr, store_method) …
CXGB3_ATTR_R(…);
CXGB3_ATTR_RW(…);
CXGB3_ATTR_RW(…);
static struct attribute *cxgb3_attrs[] = …;
static const struct attribute_group cxgb3_attr_group = …;
static ssize_t tm_attr_show(struct device *d,
char *buf, int sched)
{ … }
static ssize_t tm_attr_store(struct device *d,
const char *buf, size_t len, int sched)
{ … }
#define TM_ATTR(name, sched) …
TM_ATTR(…);
TM_ATTR(…);
TM_ATTR(…);
TM_ATTR(…);
TM_ATTR(…);
TM_ATTR(…);
TM_ATTR(…);
TM_ATTR(…);
static struct attribute *offload_attrs[] = …;
static const struct attribute_group offload_attr_group = …;
static inline int offload_tx(struct t3cdev *tdev, struct sk_buff *skb)
{ … }
static int write_smt_entry(struct adapter *adapter, int idx)
{ … }
static int init_smt(struct adapter *adapter)
{ … }
static void init_port_mtus(struct adapter *adapter)
{ … }
static int send_pktsched_cmd(struct adapter *adap, int sched, int qidx, int lo,
int hi, int port)
{ … }
static int bind_qsets(struct adapter *adap)
{ … }
#define FW_VERSION …
#define FW_FNAME …
#define TPSRAM_VERSION …
#define TPSRAM_NAME …
#define AEL2005_OPT_EDC_NAME …
#define AEL2005_TWX_EDC_NAME …
#define AEL2020_TWX_EDC_NAME …
MODULE_FIRMWARE(…);
MODULE_FIRMWARE(…) …;
MODULE_FIRMWARE(…) …;
MODULE_FIRMWARE(…);
MODULE_FIRMWARE(…);
MODULE_FIRMWARE(…);
static inline const char *get_edc_fw_name(int edc_idx)
{ … }
int t3_get_edc_fw(struct cphy *phy, int edc_idx, int size)
{ … }
static int upgrade_fw(struct adapter *adap)
{ … }
static inline char t3rev2char(struct adapter *adapter)
{ … }
static int update_tpsram(struct adapter *adap)
{ … }
static void t3_synchronize_rx(struct adapter *adap, const struct port_info *p)
{ … }
static void cxgb_vlan_mode(struct net_device *dev, netdev_features_t features)
{ … }
static int cxgb_up(struct adapter *adap)
{ … }
static void cxgb_down(struct adapter *adapter, int on_wq)
{ … }
static void schedule_chk_task(struct adapter *adap)
{ … }
static int offload_open(struct net_device *dev)
{ … }
static int offload_close(struct t3cdev *tdev)
{ … }
static int cxgb_open(struct net_device *dev)
{ … }
static int __cxgb_close(struct net_device *dev, int on_wq)
{ … }
static int cxgb_close(struct net_device *dev)
{ … }
static struct net_device_stats *cxgb_get_stats(struct net_device *dev)
{ … }
static u32 get_msglevel(struct net_device *dev)
{ … }
static void set_msglevel(struct net_device *dev, u32 val)
{ … }
static const char stats_strings[][ETH_GSTRING_LEN] = …;
static int get_sset_count(struct net_device *dev, int sset)
{ … }
#define T3_REGMAP_SIZE …
static int get_regs_len(struct net_device *dev)
{ … }
static int get_eeprom_len(struct net_device *dev)
{ … }
static void get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info)
{ … }
static void get_strings(struct net_device *dev, u32 stringset, u8 * data)
{ … }
static unsigned long collect_sge_port_stats(struct adapter *adapter,
struct port_info *p, int idx)
{ … }
static void get_stats(struct net_device *dev, struct ethtool_stats *stats,
u64 *data)
{ … }
static inline void reg_block_dump(struct adapter *ap, void *buf,
unsigned int start, unsigned int end)
{ … }
static void get_regs(struct net_device *dev, struct ethtool_regs *regs,
void *buf)
{ … }
static int restart_autoneg(struct net_device *dev)
{ … }
static int set_phys_id(struct net_device *dev,
enum ethtool_phys_id_state state)
{ … }
static int get_link_ksettings(struct net_device *dev,
struct ethtool_link_ksettings *cmd)
{ … }
static int speed_duplex_to_caps(int speed, int duplex)
{ … }
#define ADVERTISED_MASK …
static int set_link_ksettings(struct net_device *dev,
const struct ethtool_link_ksettings *cmd)
{ … }
static void get_pauseparam(struct net_device *dev,
struct ethtool_pauseparam *epause)
{ … }
static int set_pauseparam(struct net_device *dev,
struct ethtool_pauseparam *epause)
{ … }
static void get_sge_param(struct net_device *dev, struct ethtool_ringparam *e,
struct kernel_ethtool_ringparam *kernel_e,
struct netlink_ext_ack *extack)
{ … }
static int set_sge_param(struct net_device *dev, struct ethtool_ringparam *e,
struct kernel_ethtool_ringparam *kernel_e,
struct netlink_ext_ack *extack)
{ … }
static int set_coalesce(struct net_device *dev, struct ethtool_coalesce *c,
struct kernel_ethtool_coalesce *kernel_coal,
struct netlink_ext_ack *extack)
{ … }
static int get_coalesce(struct net_device *dev, struct ethtool_coalesce *c,
struct kernel_ethtool_coalesce *kernel_coal,
struct netlink_ext_ack *extack)
{ … }
static int get_eeprom(struct net_device *dev, struct ethtool_eeprom *e,
u8 * data)
{ … }
static int set_eeprom(struct net_device *dev, struct ethtool_eeprom *eeprom,
u8 * data)
{ … }
static void get_wol(struct net_device *dev, struct ethtool_wolinfo *wol)
{ … }
static const struct ethtool_ops cxgb_ethtool_ops = …;
static int cxgb_in_range(int val, int lo, int hi)
{ … }
static int cxgb_siocdevprivate(struct net_device *dev,
struct ifreq *ifreq,
void __user *useraddr,
int cmd)
{ … }
static int cxgb_ioctl(struct net_device *dev, struct ifreq *req, int cmd)
{ … }
static int cxgb_change_mtu(struct net_device *dev, int new_mtu)
{ … }
static int cxgb_set_mac_addr(struct net_device *dev, void *p)
{ … }
static netdev_features_t cxgb_fix_features(struct net_device *dev,
netdev_features_t features)
{ … }
static int cxgb_set_features(struct net_device *dev, netdev_features_t features)
{ … }
#ifdef CONFIG_NET_POLL_CONTROLLER
static void cxgb_netpoll(struct net_device *dev)
{ … }
#endif
static void mac_stats_update(struct adapter *adapter)
{ … }
static void check_link_status(struct adapter *adapter)
{ … }
static void check_t3b2_mac(struct adapter *adapter)
{ … }
static void t3_adap_check_task(struct work_struct *work)
{ … }
static void db_full_task(struct work_struct *work)
{ … }
static void db_empty_task(struct work_struct *work)
{ … }
static void db_drop_task(struct work_struct *work)
{ … }
static void ext_intr_task(struct work_struct *work)
{ … }
void t3_os_ext_intr_handler(struct adapter *adapter)
{ … }
void t3_os_link_fault_handler(struct adapter *adapter, int port_id)
{ … }
static int t3_adapter_error(struct adapter *adapter, int reset, int on_wq)
{ … }
static int t3_reenable_adapter(struct adapter *adapter)
{ … }
static void t3_resume_ports(struct adapter *adapter)
{ … }
static void fatal_error_task(struct work_struct *work)
{ … }
void t3_fatal_err(struct adapter *adapter)
{ … }
static pci_ers_result_t t3_io_error_detected(struct pci_dev *pdev,
pci_channel_state_t state)
{ … }
static pci_ers_result_t t3_io_slot_reset(struct pci_dev *pdev)
{ … }
static void t3_io_resume(struct pci_dev *pdev)
{ … }
static const struct pci_error_handlers t3_err_handler = …;
static void set_nqsets(struct adapter *adap)
{ … }
static int cxgb_enable_msix(struct adapter *adap)
{ … }
static void print_port_info(struct adapter *adap, const struct adapter_info *ai)
{ … }
static const struct net_device_ops cxgb_netdev_ops = …;
static void cxgb3_init_iscsi_mac(struct net_device *dev)
{ … }
#define TSO_FLAGS …
#define VLAN_FEAT …
static int init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
{ … }
static void remove_one(struct pci_dev *pdev)
{ … }
static struct pci_driver driver = …;
static int __init cxgb3_init_module(void)
{ … }
static void __exit cxgb3_cleanup_module(void)
{ … }
module_init(…) …;
module_exit(cxgb3_cleanup_module);