#include <linux/module.h>
#include <linux/netdevice.h>
#include <linux/ethtool.h>
#include <linux/mutex.h>
#include <linux/list.h>
#include <linux/rculist.h>
#include <linux/spinlock.h>
#include <linux/pci.h>
#include <net/dcbnl.h>
#include <net/ipv6.h>
#include <net/addrconf.h>
#include <linux/if_ether.h>
#include <linux/auxiliary_bus.h>
#include <rdma/ib_verbs.h>
#include <rdma/ib_user_verbs.h>
#include <rdma/ib_umem.h>
#include <rdma/ib_addr.h>
#include <linux/hashtable.h>
#include "bnxt_ulp.h"
#include "roce_hsi.h"
#include "qplib_res.h"
#include "qplib_sp.h"
#include "qplib_fp.h"
#include "qplib_rcfw.h"
#include "bnxt_re.h"
#include "ib_verbs.h"
#include <rdma/bnxt_re-abi.h>
#include "bnxt.h"
#include "hw_counters.h"
static char version[] = …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…);
MODULE_LICENSE(…) …;
static DEFINE_MUTEX(bnxt_re_mutex);
static void bnxt_re_stop_irq(void *handle);
static void bnxt_re_dev_stop(struct bnxt_re_dev *rdev);
static int bnxt_re_netdev_event(struct notifier_block *notifier,
unsigned long event, void *ptr);
static struct bnxt_re_dev *bnxt_re_from_netdev(struct net_device *netdev);
static void bnxt_re_dev_uninit(struct bnxt_re_dev *rdev);
static int bnxt_re_hwrm_qcaps(struct bnxt_re_dev *rdev);
static int bnxt_re_hwrm_qcfg(struct bnxt_re_dev *rdev, u32 *db_len,
u32 *offset);
static void bnxt_re_set_db_offset(struct bnxt_re_dev *rdev)
{ … }
static void bnxt_re_set_drv_mode(struct bnxt_re_dev *rdev, u8 mode)
{ … }
static void bnxt_re_destroy_chip_ctx(struct bnxt_re_dev *rdev)
{ … }
static int bnxt_re_setup_chip_ctx(struct bnxt_re_dev *rdev, u8 wqe_mode)
{ … }
static void bnxt_re_get_sriov_func_type(struct bnxt_re_dev *rdev)
{ … }
static void bnxt_re_limit_pf_res(struct bnxt_re_dev *rdev)
{ … }
static void bnxt_re_limit_vf_res(struct bnxt_qplib_ctx *qplib_ctx, u32 num_vf)
{ … }
static void bnxt_re_set_resource_limits(struct bnxt_re_dev *rdev)
{ … }
static void bnxt_re_vf_res_config(struct bnxt_re_dev *rdev)
{ … }
static void bnxt_re_shutdown(struct auxiliary_device *adev)
{ … }
static void bnxt_re_stop_irq(void *handle)
{ … }
static void bnxt_re_start_irq(void *handle, struct bnxt_msix_entry *ent)
{ … }
static struct bnxt_ulp_ops bnxt_re_ulp_ops = …;
static int bnxt_re_register_netdev(struct bnxt_re_dev *rdev)
{ … }
static void bnxt_re_init_hwrm_hdr(struct input *hdr, u16 opcd)
{ … }
static void bnxt_re_fill_fw_msg(struct bnxt_fw_msg *fw_msg, void *msg,
int msg_len, void *resp, int resp_max_len,
int timeout)
{ … }
static int bnxt_re_hwrm_qcfg(struct bnxt_re_dev *rdev, u32 *db_len,
u32 *offset)
{ … }
int bnxt_re_hwrm_qcaps(struct bnxt_re_dev *rdev)
{ … }
static int bnxt_re_hwrm_dbr_pacing_qcfg(struct bnxt_re_dev *rdev)
{ … }
static void bnxt_re_set_default_pacing_data(struct bnxt_re_dev *rdev)
{ … }
static u32 __get_fifo_occupancy(struct bnxt_re_dev *rdev)
{ … }
static bool is_dbr_fifo_full(struct bnxt_re_dev *rdev)
{ … }
static void __wait_for_fifo_occupancy_below_th(struct bnxt_re_dev *rdev)
{ … }
static void bnxt_re_db_fifo_check(struct work_struct *work)
{ … }
static void bnxt_re_pacing_timer_exp(struct work_struct *work)
{ … }
void bnxt_re_pacing_alert(struct bnxt_re_dev *rdev)
{ … }
static int bnxt_re_initialize_dbr_pacing(struct bnxt_re_dev *rdev)
{ … }
static void bnxt_re_deinitialize_dbr_pacing(struct bnxt_re_dev *rdev)
{ … }
static int bnxt_re_net_ring_free(struct bnxt_re_dev *rdev,
u16 fw_ring_id, int type)
{ … }
static int bnxt_re_net_ring_alloc(struct bnxt_re_dev *rdev,
struct bnxt_re_ring_attr *ring_attr,
u16 *fw_ring_id)
{ … }
static int bnxt_re_net_stats_ctx_free(struct bnxt_re_dev *rdev,
u32 fw_stats_ctx_id)
{ … }
static int bnxt_re_net_stats_ctx_alloc(struct bnxt_re_dev *rdev,
dma_addr_t dma_map,
u32 *fw_stats_ctx_id)
{ … }
static void bnxt_re_disassociate_ucontext(struct ib_ucontext *ibcontext)
{ … }
static struct bnxt_re_dev *bnxt_re_from_netdev(struct net_device *netdev)
{ … }
static ssize_t hw_rev_show(struct device *device, struct device_attribute *attr,
char *buf)
{ … }
static DEVICE_ATTR_RO(hw_rev);
static ssize_t hca_type_show(struct device *device,
struct device_attribute *attr, char *buf)
{ … }
static DEVICE_ATTR_RO(hca_type);
static struct attribute *bnxt_re_attributes[] = …;
static const struct attribute_group bnxt_re_dev_attr_group = …;
static const struct ib_device_ops bnxt_re_dev_ops = …;
static int bnxt_re_register_ib(struct bnxt_re_dev *rdev)
{ … }
static struct bnxt_re_dev *bnxt_re_dev_add(struct bnxt_aux_priv *aux_priv,
struct bnxt_en_dev *en_dev)
{ … }
static int bnxt_re_handle_unaffi_async_event(struct creq_func_event
*unaffi_async)
{ … }
static int bnxt_re_handle_qp_async_event(struct creq_qp_event *qp_event,
struct bnxt_re_qp *qp)
{ … }
static int bnxt_re_handle_cq_async_error(void *event, struct bnxt_re_cq *cq)
{ … }
static int bnxt_re_handle_affi_async_event(struct creq_qp_event *affi_async,
void *obj)
{ … }
static int bnxt_re_aeq_handler(struct bnxt_qplib_rcfw *rcfw,
void *aeqe, void *obj)
{ … }
static int bnxt_re_srqn_handler(struct bnxt_qplib_nq *nq,
struct bnxt_qplib_srq *handle, u8 event)
{ … }
static int bnxt_re_cqn_handler(struct bnxt_qplib_nq *nq,
struct bnxt_qplib_cq *handle)
{ … }
static void bnxt_re_cleanup_res(struct bnxt_re_dev *rdev)
{ … }
static int bnxt_re_init_res(struct bnxt_re_dev *rdev)
{ … }
static void bnxt_re_free_nq_res(struct bnxt_re_dev *rdev)
{ … }
static void bnxt_re_free_res(struct bnxt_re_dev *rdev)
{ … }
static int bnxt_re_alloc_res(struct bnxt_re_dev *rdev)
{ … }
static void bnxt_re_dispatch_event(struct ib_device *ibdev, struct ib_qp *qp,
u8 port_num, enum ib_event_type event)
{ … }
static bool bnxt_re_is_qp1_or_shadow_qp(struct bnxt_re_dev *rdev,
struct bnxt_re_qp *qp)
{ … }
static void bnxt_re_dev_stop(struct bnxt_re_dev *rdev)
{ … }
static int bnxt_re_update_gid(struct bnxt_re_dev *rdev)
{ … }
static u32 bnxt_re_get_priority_mask(struct bnxt_re_dev *rdev)
{ … }
static int bnxt_re_setup_qos(struct bnxt_re_dev *rdev)
{ … }
static void bnxt_re_query_hwrm_intf_version(struct bnxt_re_dev *rdev)
{ … }
static int bnxt_re_ib_init(struct bnxt_re_dev *rdev)
{ … }
static void bnxt_re_dev_uninit(struct bnxt_re_dev *rdev)
{ … }
static void bnxt_re_worker(struct work_struct *work)
{ … }
static int bnxt_re_dev_init(struct bnxt_re_dev *rdev, u8 wqe_mode)
{ … }
static int bnxt_re_add_device(struct auxiliary_device *adev, u8 wqe_mode)
{ … }
static void bnxt_re_setup_cc(struct bnxt_re_dev *rdev, bool enable)
{ … }
static int bnxt_re_netdev_event(struct notifier_block *notifier,
unsigned long event, void *ptr)
{ … }
#define BNXT_ADEV_NAME …
static void bnxt_re_remove(struct auxiliary_device *adev)
{ … }
static int bnxt_re_probe(struct auxiliary_device *adev,
const struct auxiliary_device_id *id)
{ … }
static int bnxt_re_suspend(struct auxiliary_device *adev, pm_message_t state)
{ … }
static int bnxt_re_resume(struct auxiliary_device *adev)
{ … }
static const struct auxiliary_device_id bnxt_re_id_table[] = …;
MODULE_DEVICE_TABLE(auxiliary, bnxt_re_id_table);
static struct auxiliary_driver bnxt_re_driver = …;
static int __init bnxt_re_mod_init(void)
{ … }
static void __exit bnxt_re_mod_exit(void)
{ … }
module_init(…) …;
module_exit(bnxt_re_mod_exit);