linux/drivers/scsi/qedi/qedi_main.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * QLogic iSCSI Offload Driver
 * Copyright (c) 2016 Cavium Inc.
 */

#include <linux/module.h>
#include <linux/pci.h>
#include <linux/kernel.h>
#include <linux/if_arp.h>
#include <scsi/iscsi_if.h>
#include <linux/inet.h>
#include <net/arp.h>
#include <linux/list.h>
#include <linux/kthread.h>
#include <linux/mm.h>
#include <linux/if_vlan.h>
#include <linux/cpu.h>
#include <linux/iscsi_boot_sysfs.h>

#include <scsi/scsi_cmnd.h>
#include <scsi/scsi_device.h>
#include <scsi/scsi_eh.h>
#include <scsi/scsi_host.h>
#include <scsi/scsi.h>

#include "qedi.h"
#include "qedi_gbl.h"
#include "qedi_iscsi.h"

static uint qedi_qed_debug;
module_param(qedi_qed_debug, uint, 0644);
MODULE_PARM_DESC();

static uint qedi_fw_debug;
module_param(qedi_fw_debug, uint, 0644);
MODULE_PARM_DESC();

uint qedi_dbg_log =;
module_param(qedi_dbg_log, uint, 0644);
MODULE_PARM_DESC();

uint qedi_io_tracing;
module_param(qedi_io_tracing, uint, 0644);
MODULE_PARM_DESC();

static uint qedi_ll2_buf_size =;
module_param(qedi_ll2_buf_size, uint, 0644);
MODULE_PARM_DESC();

static uint qedi_flags_override;
module_param(qedi_flags_override, uint, 0644);
MODULE_PARM_DESC();

const struct qed_iscsi_ops *qedi_ops;
static struct scsi_transport_template *qedi_scsi_transport;
static struct pci_driver qedi_pci_driver;
static DEFINE_PER_CPU(struct qedi_percpu_s, qedi_percpu);
static LIST_HEAD(qedi_udev_list);
/* Static function declaration */
static int qedi_alloc_global_queues(struct qedi_ctx *qedi);
static void qedi_free_global_queues(struct qedi_ctx *qedi);
static struct qedi_cmd *qedi_get_cmd_from_tid(struct qedi_ctx *qedi, u32 tid);
static void qedi_reset_uio_rings(struct qedi_uio_dev *udev);
static void qedi_ll2_free_skbs(struct qedi_ctx *qedi);
static struct nvm_iscsi_block *qedi_get_nvram_block(struct qedi_ctx *qedi);
static void qedi_recovery_handler(struct work_struct *work);
static void qedi_schedule_hw_err_handler(void *dev,
					 enum qed_hw_err_type err_type);
static int qedi_suspend(struct pci_dev *pdev, pm_message_t state);

static int qedi_iscsi_event_cb(void *context, u8 fw_event_code, void *fw_handle)
{}

static int qedi_uio_open(struct uio_info *uinfo, struct inode *inode)
{}

static int qedi_uio_close(struct uio_info *uinfo, struct inode *inode)
{}

static void __qedi_free_uio_rings(struct qedi_uio_dev *udev)
{}

static void __qedi_free_uio(struct qedi_uio_dev *udev)
{}

static void qedi_free_uio(struct qedi_uio_dev *udev)
{}

static void qedi_reset_uio_rings(struct qedi_uio_dev *udev)
{}

static int __qedi_alloc_uio_rings(struct qedi_uio_dev *udev)
{}

static int qedi_alloc_uio_rings(struct qedi_ctx *qedi)
{}

static int qedi_init_uio(struct qedi_ctx *qedi)
{}

static int qedi_alloc_and_init_sb(struct qedi_ctx *qedi,
				  struct qed_sb_info *sb_info, u16 sb_id)
{}

static void qedi_free_sb(struct qedi_ctx *qedi)
{}

static void qedi_free_fp(struct qedi_ctx *qedi)
{}

static void qedi_destroy_fp(struct qedi_ctx *qedi)
{}

static int qedi_alloc_fp(struct qedi_ctx *qedi)
{}

static void qedi_int_fp(struct qedi_ctx *qedi)
{}

static int qedi_prepare_fp(struct qedi_ctx *qedi)
{}

static int qedi_setup_cid_que(struct qedi_ctx *qedi)
{}

static void qedi_release_cid_que(struct qedi_ctx *qedi)
{}

static int qedi_init_id_tbl(struct qedi_portid_tbl *id_tbl, u16 size,
			    u16 start_id, u16 next)
{}

static void qedi_free_id_tbl(struct qedi_portid_tbl *id_tbl)
{}

int qedi_alloc_id(struct qedi_portid_tbl *id_tbl, u16 id)
{}

u16 qedi_alloc_new_id(struct qedi_portid_tbl *id_tbl)
{}

void qedi_free_id(struct qedi_portid_tbl *id_tbl, u16 id)
{}

static void qedi_cm_free_mem(struct qedi_ctx *qedi)
{}

static int qedi_cm_alloc_mem(struct qedi_ctx *qedi)
{}

static struct qedi_ctx *qedi_host_alloc(struct pci_dev *pdev)
{}

static int qedi_ll2_rx(void *cookie, struct sk_buff *skb, u32 arg1, u32 arg2)
{}

/* map this skb to iscsiuio mmaped region */
static int qedi_ll2_process_skb(struct qedi_ctx *qedi, struct sk_buff *skb,
				u16 vlan_id)
{}

static void qedi_ll2_free_skbs(struct qedi_ctx *qedi)
{}

static int qedi_ll2_recv_thread(void *arg)
{}

static int qedi_set_iscsi_pf_param(struct qedi_ctx *qedi)
{}

/* Free DMA coherent memory for array of queue pointers we pass to qed */
static void qedi_free_iscsi_pf_param(struct qedi_ctx *qedi)
{}

static void qedi_get_boot_tgt_info(struct nvm_iscsi_block *block,
				   struct qedi_boot_target *tgt, u8 index)
{}

static int qedi_find_boot_info(struct qedi_ctx *qedi,
			       struct qed_mfw_tlv_iscsi *iscsi,
			       struct nvm_iscsi_block *block)
{}

static void qedi_get_generic_tlv_data(void *dev, struct qed_generic_tlvs *data)
{}

/*
 * Protocol TLV handler
 */
static void qedi_get_protocol_tlv_data(void *dev, void *data)
{}

void qedi_schedule_hw_err_handler(void *dev,
				  enum qed_hw_err_type err_type)
{}

static void qedi_schedule_recovery_handler(void *dev)
{}

static void qedi_set_conn_recovery(struct iscsi_cls_session *cls_session)
{}

static void qedi_link_update(void *dev, struct qed_link_output *link)
{}

static struct qed_iscsi_cb_ops qedi_cb_ops =;

static int qedi_queue_cqe(struct qedi_ctx *qedi, union iscsi_cqe *cqe,
			  u16 que_idx, struct qedi_percpu_s *p)
{}

static bool qedi_process_completions(struct qedi_fastpath *fp)
{}

static bool qedi_fp_has_work(struct qedi_fastpath *fp)
{}

/* MSI-X fastpath handler code */
static irqreturn_t qedi_msix_handler(int irq, void *dev_id)
{}

/* simd handler for MSI/INTa */
static void qedi_simd_int_handler(void *cookie)
{}

#define QEDI_SIMD_HANDLER_NUM
static void qedi_sync_free_irqs(struct qedi_ctx *qedi)
{}

static int qedi_request_msix_irq(struct qedi_ctx *qedi)
{}

static int qedi_setup_int(struct qedi_ctx *qedi)
{}

static void qedi_free_nvm_iscsi_cfg(struct qedi_ctx *qedi)
{}

static int qedi_alloc_nvm_iscsi_cfg(struct qedi_ctx *qedi)
{}

static void qedi_free_bdq(struct qedi_ctx *qedi)
{}

static void qedi_free_global_queues(struct qedi_ctx *qedi)
{}

static int qedi_alloc_bdq(struct qedi_ctx *qedi)
{}

static int qedi_alloc_global_queues(struct qedi_ctx *qedi)
{}

int qedi_alloc_sq(struct qedi_ctx *qedi, struct qedi_endpoint *ep)
{}

void qedi_free_sq(struct qedi_ctx *qedi, struct qedi_endpoint *ep)
{}

int qedi_get_task_idx(struct qedi_ctx *qedi)
{}

void qedi_clear_task_idx(struct qedi_ctx *qedi, int idx)
{}

void qedi_update_itt_map(struct qedi_ctx *qedi, u32 tid, u32 proto_itt,
			 struct qedi_cmd *cmd)
{}

void qedi_get_task_tid(struct qedi_ctx *qedi, u32 itt, s16 *tid)
{}

void qedi_get_proto_itt(struct qedi_ctx *qedi, u32 tid, u32 *proto_itt)
{}

struct qedi_cmd *qedi_get_cmd_from_tid(struct qedi_ctx *qedi, u32 tid)
{}

static int qedi_alloc_itt(struct qedi_ctx *qedi)
{}

static void qedi_free_itt(struct qedi_ctx *qedi)
{}

static struct qed_ll2_cb_ops qedi_ll2_cb_ops =;

static int qedi_percpu_io_thread(void *arg)
{}

static int qedi_cpu_online(unsigned int cpu)
{}

static int qedi_cpu_offline(unsigned int cpu)
{}

void qedi_reset_host_mtu(struct qedi_ctx *qedi, u16 mtu)
{}

/*
 * qedi_get_nvram_block: - Scan through the iSCSI NVRAM block (while accounting
 * for gaps) for the matching absolute-pf-id of the QEDI device.
 */
static struct nvm_iscsi_block *
qedi_get_nvram_block(struct qedi_ctx *qedi)
{}

static ssize_t qedi_show_boot_eth_info(void *data, int type, char *buf)
{}

static umode_t qedi_eth_get_attr_visibility(void *data, int type)
{}

static ssize_t qedi_show_boot_ini_info(void *data, int type, char *buf)
{}

static umode_t qedi_ini_get_attr_visibility(void *data, int type)
{}

static ssize_t
qedi_show_boot_tgt_info(struct qedi_ctx *qedi, int type,
			char *buf, enum qedi_nvm_tgts idx)
{}

static ssize_t qedi_show_boot_tgt_pri_info(void *data, int type, char *buf)
{}

static ssize_t qedi_show_boot_tgt_sec_info(void *data, int type, char *buf)
{}

static umode_t qedi_tgt_get_attr_visibility(void *data, int type)
{}

static void qedi_boot_release(void *data)
{}

static int qedi_get_boot_info(struct qedi_ctx *qedi)
{}

static int qedi_setup_boot_info(struct qedi_ctx *qedi)
{}

static pci_ers_result_t qedi_io_error_detected(struct pci_dev *pdev,
					       pci_channel_state_t state)
{}

static void __qedi_remove(struct pci_dev *pdev, int mode)
{}

static void qedi_board_disable_work(struct work_struct *work)
{}

static void qedi_shutdown(struct pci_dev *pdev)
{}

static int qedi_suspend(struct pci_dev *pdev, pm_message_t state)
{}

static int __qedi_probe(struct pci_dev *pdev, int mode)
{}

static void qedi_mark_conn_recovery(struct iscsi_cls_session *cls_session)
{}

static void qedi_recovery_handler(struct work_struct *work)
{}

static int qedi_probe(struct pci_dev *pdev, const struct pci_device_id *id)
{}

static void qedi_remove(struct pci_dev *pdev)
{}

static struct pci_device_id qedi_pci_tbl[] =;
MODULE_DEVICE_TABLE(pci, qedi_pci_tbl);

static enum cpuhp_state qedi_cpuhp_state;

static struct pci_error_handlers qedi_err_handler =;

static struct pci_driver qedi_pci_driver =;

static int __init qedi_init(void)
{}

static void __exit qedi_cleanup(void)
{}

MODULE_DESCRIPTION();
MODULE_LICENSE();
MODULE_AUTHOR();
MODULE_VERSION();
module_init();
module_exit(qedi_cleanup);