#include "bnx2fc.h"
#include <linux/ethtool.h>
static struct list_head adapter_list;
static struct list_head if_list;
static u32 adapter_count;
static DEFINE_MUTEX(bnx2fc_dev_lock);
DEFINE_PER_CPU(struct bnx2fc_percpu_s, bnx2fc_percpu);
#define DRV_MODULE_NAME …
#define DRV_MODULE_VERSION …
#define DRV_MODULE_RELDATE …
static char version[] = …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;
MODULE_VERSION(…);
#define BNX2FC_MAX_QUEUE_DEPTH …
#define BNX2FC_MIN_QUEUE_DEPTH …
#define FCOE_WORD_TO_BYTE …
static struct scsi_transport_template *bnx2fc_transport_template;
static struct scsi_transport_template *bnx2fc_vport_xport_template;
struct workqueue_struct *bnx2fc_wq;
struct fcoe_percpu_s bnx2fc_global;
static DEFINE_SPINLOCK(bnx2fc_global_lock);
static struct cnic_ulp_ops bnx2fc_cnic_cb;
static struct libfc_function_template bnx2fc_libfc_fcn_templ;
static struct scsi_host_template bnx2fc_shost_template;
static struct fc_function_template bnx2fc_transport_function;
static struct fcoe_sysfs_function_template bnx2fc_fcoe_sysfs_templ;
static struct fc_function_template bnx2fc_vport_xport_function;
static int bnx2fc_create(struct net_device *netdev, enum fip_mode fip_mode);
static void __bnx2fc_destroy(struct bnx2fc_interface *interface);
static int bnx2fc_destroy(struct net_device *net_device);
static int bnx2fc_enable(struct net_device *netdev);
static int bnx2fc_disable(struct net_device *netdev);
static int bnx2fc_ctlr_alloc(struct net_device *netdev);
static int bnx2fc_ctlr_enabled(struct fcoe_ctlr_device *cdev);
static void bnx2fc_recv_frame(struct sk_buff *skb);
static void bnx2fc_start_disc(struct bnx2fc_interface *interface);
static int bnx2fc_shost_config(struct fc_lport *lport, struct device *dev);
static int bnx2fc_lport_config(struct fc_lport *lport);
static int bnx2fc_em_config(struct fc_lport *lport, struct bnx2fc_hba *hba);
static int bnx2fc_bind_adapter_devices(struct bnx2fc_hba *hba);
static void bnx2fc_unbind_adapter_devices(struct bnx2fc_hba *hba);
static int bnx2fc_bind_pcidev(struct bnx2fc_hba *hba);
static void bnx2fc_unbind_pcidev(struct bnx2fc_hba *hba);
static struct fc_lport *bnx2fc_if_create(struct bnx2fc_interface *interface,
struct device *parent, int npiv);
static void bnx2fc_port_destroy(struct fcoe_port *port);
static struct bnx2fc_hba *bnx2fc_hba_lookup(struct net_device *phys_dev);
static struct bnx2fc_interface *bnx2fc_interface_lookup(struct net_device
*phys_dev);
static inline void bnx2fc_interface_put(struct bnx2fc_interface *interface);
static struct bnx2fc_hba *bnx2fc_find_hba_for_cnic(struct cnic_dev *cnic);
static int bnx2fc_fw_init(struct bnx2fc_hba *hba);
static void bnx2fc_fw_destroy(struct bnx2fc_hba *hba);
static void bnx2fc_port_shutdown(struct fc_lport *lport);
static void bnx2fc_stop(struct bnx2fc_interface *interface);
static int __init bnx2fc_mod_init(void);
static void __exit bnx2fc_mod_exit(void);
unsigned int bnx2fc_debug_level;
module_param_named(debug_logging, bnx2fc_debug_level, int, S_IRUGO|S_IWUSR);
MODULE_PARM_DESC(…) …;
static uint bnx2fc_devloss_tmo;
module_param_named(devloss_tmo, bnx2fc_devloss_tmo, uint, S_IRUGO);
MODULE_PARM_DESC(…) …;
static uint bnx2fc_max_luns = …;
module_param_named(max_luns, bnx2fc_max_luns, uint, S_IRUGO);
MODULE_PARM_DESC(…) …;
static uint bnx2fc_queue_depth;
module_param_named(queue_depth, bnx2fc_queue_depth, uint, S_IRUGO);
MODULE_PARM_DESC(…) …;
static uint bnx2fc_log_fka;
module_param_named(log_fka, bnx2fc_log_fka, uint, S_IRUGO|S_IWUSR);
MODULE_PARM_DESC(…) …;
static inline struct net_device *bnx2fc_netdev(const struct fc_lport *lport)
{ … }
static void bnx2fc_fcf_get_vlan_id(struct fcoe_fcf_device *fcf_dev)
{ … }
static void bnx2fc_clean_rx_queue(struct fc_lport *lp)
{ … }
int bnx2fc_get_paged_crc_eof(struct sk_buff *skb, int tlen)
{ … }
static void bnx2fc_abort_io(struct fc_lport *lport)
{ … }
static void bnx2fc_cleanup(struct fc_lport *lport)
{ … }
static int bnx2fc_xmit_l2_frame(struct bnx2fc_rport *tgt,
struct fc_frame *fp)
{ … }
static int bnx2fc_xmit(struct fc_lport *lport, struct fc_frame *fp)
{ … }
static int bnx2fc_rcv(struct sk_buff *skb, struct net_device *dev,
struct packet_type *ptype, struct net_device *olddev)
{ … }
static int bnx2fc_l2_rcv_thread(void *arg)
{ … }
static void bnx2fc_recv_frame(struct sk_buff *skb)
{ … }
static int bnx2fc_percpu_io_thread(void *arg)
{ … }
static struct fc_host_statistics *bnx2fc_get_host_stats(struct Scsi_Host *shost)
{ … }
static int bnx2fc_shost_config(struct fc_lport *lport, struct device *dev)
{ … }
static int bnx2fc_link_ok(struct fc_lport *lport)
{ … }
void bnx2fc_get_link_state(struct bnx2fc_hba *hba)
{ … }
static int bnx2fc_net_config(struct fc_lport *lport, struct net_device *netdev)
{ … }
static void bnx2fc_destroy_timer(struct timer_list *t)
{ … }
static void bnx2fc_indicate_netevent(void *context, unsigned long event,
u16 vlan_id)
{ … }
static int bnx2fc_libfc_config(struct fc_lport *lport)
{ … }
static int bnx2fc_em_config(struct fc_lport *lport, struct bnx2fc_hba *hba)
{ … }
static int bnx2fc_lport_config(struct fc_lport *lport)
{ … }
static int bnx2fc_fip_recv(struct sk_buff *skb, struct net_device *dev,
struct packet_type *ptype,
struct net_device *orig_dev)
{ … }
static void bnx2fc_update_src_mac(struct fc_lport *lport, u8 *addr)
{ … }
static u8 *bnx2fc_get_src_mac(struct fc_lport *lport)
{ … }
static void bnx2fc_fip_send(struct fcoe_ctlr *fip, struct sk_buff *skb)
{ … }
static int bnx2fc_vport_create(struct fc_vport *vport, bool disabled)
{ … }
static void bnx2fc_free_vport(struct bnx2fc_hba *hba, struct fc_lport *lport)
{ … }
static int bnx2fc_vport_destroy(struct fc_vport *vport)
{ … }
static int bnx2fc_vport_disable(struct fc_vport *vport, bool disable)
{ … }
static int bnx2fc_interface_setup(struct bnx2fc_interface *interface)
{ … }
static int bnx2fc_attach_transport(void)
{ … }
static void bnx2fc_release_transport(void)
{ … }
static void bnx2fc_interface_release(struct kref *kref)
{ … }
static inline void bnx2fc_interface_get(struct bnx2fc_interface *interface)
{ … }
static inline void bnx2fc_interface_put(struct bnx2fc_interface *interface)
{ … }
static void bnx2fc_hba_destroy(struct bnx2fc_hba *hba)
{ … }
static struct bnx2fc_hba *bnx2fc_hba_create(struct cnic_dev *cnic)
{ … }
static struct bnx2fc_interface *
bnx2fc_interface_create(struct bnx2fc_hba *hba,
struct net_device *netdev,
enum fip_mode fip_mode)
{ … }
static struct fc_lport *bnx2fc_if_create(struct bnx2fc_interface *interface,
struct device *parent, int npiv)
{ … }
static void bnx2fc_net_cleanup(struct bnx2fc_interface *interface)
{ … }
static void bnx2fc_interface_cleanup(struct bnx2fc_interface *interface)
{ … }
static void bnx2fc_if_destroy(struct fc_lport *lport)
{ … }
static void __bnx2fc_destroy(struct bnx2fc_interface *interface)
{ … }
static int bnx2fc_destroy(struct net_device *netdev)
{ … }
static void bnx2fc_port_destroy(struct fcoe_port *port)
{ … }
static void bnx2fc_unbind_adapter_devices(struct bnx2fc_hba *hba)
{ … }
static int bnx2fc_bind_adapter_devices(struct bnx2fc_hba *hba)
{ … }
static int bnx2fc_bind_pcidev(struct bnx2fc_hba *hba)
{ … }
static void bnx2fc_unbind_pcidev(struct bnx2fc_hba *hba)
{ … }
static int bnx2fc_ulp_get_stats(void *handle)
{ … }
static void bnx2fc_ulp_start(void *handle)
{ … }
static void bnx2fc_port_shutdown(struct fc_lport *lport)
{ … }
static void bnx2fc_stop(struct bnx2fc_interface *interface)
{ … }
static int bnx2fc_fw_init(struct bnx2fc_hba *hba)
{ … }
static void bnx2fc_fw_destroy(struct bnx2fc_hba *hba)
{ … }
static void bnx2fc_ulp_stop(void *handle)
{ … }
static void bnx2fc_start_disc(struct bnx2fc_interface *interface)
{ … }
static void bnx2fc_ulp_init(struct cnic_dev *dev)
{ … }
static int __bnx2fc_disable(struct fcoe_ctlr *ctlr)
{ … }
static int bnx2fc_disable(struct net_device *netdev)
{ … }
static uint bnx2fc_npiv_create_vports(struct fc_lport *lport,
struct cnic_fc_npiv_tbl *npiv_tbl)
{ … }
static int __bnx2fc_enable(struct fcoe_ctlr *ctlr)
{ … }
static int bnx2fc_enable(struct net_device *netdev)
{ … }
static int bnx2fc_ctlr_enabled(struct fcoe_ctlr_device *cdev)
{ … }
enum bnx2fc_create_link_state { … };
static int _bnx2fc_create(struct net_device *netdev,
enum fip_mode fip_mode,
enum bnx2fc_create_link_state link_state)
{ … }
static int bnx2fc_create(struct net_device *netdev, enum fip_mode fip_mode)
{ … }
static int bnx2fc_ctlr_alloc(struct net_device *netdev)
{ … }
static struct bnx2fc_hba *bnx2fc_find_hba_for_cnic(struct cnic_dev *cnic)
{ … }
static struct bnx2fc_interface *bnx2fc_interface_lookup(struct net_device
*netdev)
{ … }
static struct bnx2fc_hba *bnx2fc_hba_lookup(struct net_device
*phys_dev)
{ … }
static void bnx2fc_ulp_exit(struct cnic_dev *dev)
{ … }
static void bnx2fc_rport_terminate_io(struct fc_rport *rport)
{ … }
static int bnx2fc_fcoe_reset(struct Scsi_Host *shost)
{ … }
static bool bnx2fc_match(struct net_device *netdev)
{ … }
static struct fcoe_transport bnx2fc_transport = …;
static int bnx2fc_cpu_online(unsigned int cpu)
{ … }
static int bnx2fc_cpu_offline(unsigned int cpu)
{ … }
static int bnx2fc_slave_configure(struct scsi_device *sdev)
{ … }
static enum cpuhp_state bnx2fc_online_state;
static int __init bnx2fc_mod_init(void)
{ … }
static void __exit bnx2fc_mod_exit(void)
{ … }
module_init(…) …;
module_exit(bnx2fc_mod_exit);
static struct fcoe_sysfs_function_template bnx2fc_fcoe_sysfs_templ = …;
static struct fc_function_template bnx2fc_transport_function = …;
static struct fc_function_template bnx2fc_vport_xport_function = …;
static ssize_t
bnx2fc_tm_timeout_show(struct device *dev, struct device_attribute *attr,
char *buf)
{ … }
static ssize_t
bnx2fc_tm_timeout_store(struct device *dev,
struct device_attribute *attr, const char *buf, size_t count)
{ … }
static DEVICE_ATTR(tm_timeout, S_IRUGO|S_IWUSR, bnx2fc_tm_timeout_show,
bnx2fc_tm_timeout_store);
static struct attribute *bnx2fc_host_attrs[] = …;
ATTRIBUTE_GROUPS(…);
static struct scsi_host_template bnx2fc_shost_template = …;
static struct libfc_function_template bnx2fc_libfc_fcn_templ = …;
static struct cnic_ulp_ops bnx2fc_cnic_cb = …;