linux/drivers/scsi/mvumi.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * Marvell UMI driver
 *
 * Copyright 2011 Marvell. <[email protected]>
*/

#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/init.h>
#include <linux/device.h>
#include <linux/pci.h>
#include <linux/list.h>
#include <linux/spinlock.h>
#include <linux/interrupt.h>
#include <linux/delay.h>
#include <linux/ktime.h>
#include <linux/blkdev.h>
#include <linux/io.h>
#include <scsi/scsi.h>
#include <scsi/scsi_cmnd.h>
#include <scsi/scsi_device.h>
#include <scsi/scsi_host.h>
#include <scsi/scsi_transport.h>
#include <scsi/scsi_eh.h>
#include <linux/uaccess.h>
#include <linux/kthread.h>

#include "mvumi.h"

MODULE_LICENSE();
MODULE_AUTHOR();
MODULE_DESCRIPTION();

static const struct pci_device_id mvumi_pci_table[] =;

MODULE_DEVICE_TABLE(pci, mvumi_pci_table);

static void tag_init(struct mvumi_tag *st, unsigned short size)
{}

static unsigned short tag_get_one(struct mvumi_hba *mhba, struct mvumi_tag *st)
{}

static void tag_release_one(struct mvumi_hba *mhba, struct mvumi_tag *st,
							unsigned short tag)
{}

static bool tag_is_empty(struct mvumi_tag *st)
{}

static void mvumi_unmap_pci_addr(struct pci_dev *dev, void **addr_array)
{}

static int mvumi_map_pci_addr(struct pci_dev *dev, void **addr_array)
{}

static struct mvumi_res *mvumi_alloc_mem_resource(struct mvumi_hba *mhba,
				enum resource_type type, unsigned int size)
{}

static void mvumi_release_mem_resource(struct mvumi_hba *mhba)
{}

/**
 * mvumi_make_sgl -	Prepares  SGL
 * @mhba:		Adapter soft state
 * @scmd:		SCSI command from the mid-layer
 * @sgl_p:		SGL to be filled in
 * @sg_count:		return the number of SG elements
 *
 * If successful, this function returns 0. otherwise, it returns -1.
 */
static int mvumi_make_sgl(struct mvumi_hba *mhba, struct scsi_cmnd *scmd,
					void *sgl_p, unsigned char *sg_count)
{}

static int mvumi_internal_cmd_sgl(struct mvumi_hba *mhba, struct mvumi_cmd *cmd,
							unsigned int size)
{}

static struct mvumi_cmd *mvumi_create_internal_cmd(struct mvumi_hba *mhba,
				unsigned int buf_size)
{}

static void mvumi_delete_internal_cmd(struct mvumi_hba *mhba,
						struct mvumi_cmd *cmd)
{}

/**
 * mvumi_get_cmd -	Get a command from the free pool
 * @mhba:		Adapter soft state
 *
 * Returns a free command from the pool
 */
static struct mvumi_cmd *mvumi_get_cmd(struct mvumi_hba *mhba)
{}

/**
 * mvumi_return_cmd -	Return a cmd to free command pool
 * @mhba:		Adapter soft state
 * @cmd:		Command packet to be returned to free command pool
 */
static inline void mvumi_return_cmd(struct mvumi_hba *mhba,
						struct mvumi_cmd *cmd)
{}

/**
 * mvumi_free_cmds -	Free all the cmds in the free cmd pool
 * @mhba:		Adapter soft state
 */
static void mvumi_free_cmds(struct mvumi_hba *mhba)
{}

/**
 * mvumi_alloc_cmds -	Allocates the command packets
 * @mhba:		Adapter soft state
 *
 */
static int mvumi_alloc_cmds(struct mvumi_hba *mhba)
{}

static unsigned int mvumi_check_ib_list_9143(struct mvumi_hba *mhba)
{}

static unsigned int mvumi_check_ib_list_9580(struct mvumi_hba *mhba)
{}

static void mvumi_get_ib_list_entry(struct mvumi_hba *mhba, void **ib_entry)
{}

static void mvumi_send_ib_list_entry(struct mvumi_hba *mhba)
{}

static char mvumi_check_ob_frame(struct mvumi_hba *mhba,
		unsigned int cur_obf, struct mvumi_rsp_frame *p_outb_frame)
{}

static int mvumi_check_ob_list_9143(struct mvumi_hba *mhba,
			unsigned int *cur_obf, unsigned int *assign_obf_end)
{}

static int mvumi_check_ob_list_9580(struct mvumi_hba *mhba,
			unsigned int *cur_obf, unsigned int *assign_obf_end)
{}

static void mvumi_receive_ob_list_entry(struct mvumi_hba *mhba)
{}

static void mvumi_reset(struct mvumi_hba *mhba)
{}

static unsigned char mvumi_start(struct mvumi_hba *mhba);

static int mvumi_wait_for_outstanding(struct mvumi_hba *mhba)
{}

static int mvumi_wait_for_fw(struct mvumi_hba *mhba)
{}

static void mvumi_backup_bar_addr(struct mvumi_hba *mhba)
{}

static void mvumi_restore_bar_addr(struct mvumi_hba *mhba)
{}

static int mvumi_pci_set_master(struct pci_dev *pdev)
{}

static int mvumi_reset_host_9580(struct mvumi_hba *mhba)
{}

static int mvumi_reset_host_9143(struct mvumi_hba *mhba)
{}

static int mvumi_host_reset(struct scsi_cmnd *scmd)
{}

static int mvumi_issue_blocked_cmd(struct mvumi_hba *mhba,
						struct mvumi_cmd *cmd)
{}

static void mvumi_release_fw(struct mvumi_hba *mhba)
{}

static unsigned char mvumi_flush_cache(struct mvumi_hba *mhba)
{}

static unsigned char
mvumi_calculate_checksum(struct mvumi_hs_header *p_header,
							unsigned short len)
{}

static void mvumi_hs_build_page(struct mvumi_hba *mhba,
				struct mvumi_hs_header *hs_header)
{}

/**
 * mvumi_init_data -	Initialize requested date for FW
 * @mhba:			Adapter soft state
 */
static int mvumi_init_data(struct mvumi_hba *mhba)
{}

static int mvumi_hs_process_page(struct mvumi_hba *mhba,
				struct mvumi_hs_header *hs_header)
{}

/**
 * mvumi_handshake -	Move the FW to READY state
 * @mhba:				Adapter soft state
 *
 * During the initialization, FW passes can potentially be in any one of
 * several possible states. If the FW in operational, waiting-for-handshake
 * states, driver must take steps to bring it to ready state. Otherwise, it
 * has to wait for the ready state.
 */
static int mvumi_handshake(struct mvumi_hba *mhba)
{}

static unsigned char mvumi_handshake_event(struct mvumi_hba *mhba)
{}

static unsigned char mvumi_check_handshake(struct mvumi_hba *mhba)
{}

static unsigned char mvumi_start(struct mvumi_hba *mhba)
{}

/**
 * mvumi_complete_cmd -	Completes a command
 * @mhba:			Adapter soft state
 * @cmd:			Command to be completed
 * @ob_frame:			Command response
 */
static void mvumi_complete_cmd(struct mvumi_hba *mhba, struct mvumi_cmd *cmd,
					struct mvumi_rsp_frame *ob_frame)
{}

static void mvumi_complete_internal_cmd(struct mvumi_hba *mhba,
						struct mvumi_cmd *cmd,
					struct mvumi_rsp_frame *ob_frame)
{}

static void mvumi_show_event(struct mvumi_hba *mhba,
			struct mvumi_driver_event *ptr)
{}

static int mvumi_handle_hotplug(struct mvumi_hba *mhba, u16 devid, int status)
{}

static u64 mvumi_inquiry(struct mvumi_hba *mhba,
	unsigned int id, struct mvumi_cmd *cmd)
{}

static void mvumi_detach_devices(struct mvumi_hba *mhba)
{}

static void mvumi_rescan_devices(struct mvumi_hba *mhba, int id)
{}

static int mvumi_match_devices(struct mvumi_hba *mhba, int id, u64 wwid)
{}

static void mvumi_remove_devices(struct mvumi_hba *mhba, int id)
{}

static int mvumi_probe_devices(struct mvumi_hba *mhba)
{}

static int mvumi_rescan_bus(void *data)
{}

static void mvumi_proc_msg(struct mvumi_hba *mhba,
					struct mvumi_hotplug_event *param)
{}

static void mvumi_notification(struct mvumi_hba *mhba, u8 msg, void *buffer)
{}

static int mvumi_get_event(struct mvumi_hba *mhba, unsigned char msg)
{}

static void mvumi_scan_events(struct work_struct *work)
{}

static void mvumi_launch_events(struct mvumi_hba *mhba, u32 isr_status)
{}

static void mvumi_handle_clob(struct mvumi_hba *mhba)
{}

static irqreturn_t mvumi_isr_handler(int irq, void *devp)
{}

static enum mvumi_qc_result mvumi_send_command(struct mvumi_hba *mhba,
						struct mvumi_cmd *cmd)
{}

static void mvumi_fire_cmd(struct mvumi_hba *mhba, struct mvumi_cmd *cmd)
{}

/**
 * mvumi_enable_intr -	Enables interrupts
 * @mhba:		Adapter soft state
 */
static void mvumi_enable_intr(struct mvumi_hba *mhba)
{}

/**
 * mvumi_disable_intr -Disables interrupt
 * @mhba:		Adapter soft state
 */
static void mvumi_disable_intr(struct mvumi_hba *mhba)
{}

static int mvumi_clear_intr(void *extend)
{}

/**
 * mvumi_read_fw_status_reg - returns the current FW status value
 * @mhba:		Adapter soft state
 */
static unsigned int mvumi_read_fw_status_reg(struct mvumi_hba *mhba)
{}

static struct mvumi_instance_template mvumi_instance_9143 =;

static struct mvumi_instance_template mvumi_instance_9580 =;

static int mvumi_slave_configure(struct scsi_device *sdev)
{}

/**
 * mvumi_build_frame -	Prepares a direct cdb (DCDB) command
 * @mhba:		Adapter soft state
 * @scmd:		SCSI command
 * @cmd:		Command to be prepared in
 *
 * This function prepares CDB commands. These are typcially pass-through
 * commands to the devices.
 */
static unsigned char mvumi_build_frame(struct mvumi_hba *mhba,
				struct scsi_cmnd *scmd, struct mvumi_cmd *cmd)
{}

/**
 * mvumi_queue_command -	Queue entry point
 * @shost:			Scsi host to queue command on
 * @scmd:			SCSI command to be queued
 */
static int mvumi_queue_command(struct Scsi_Host *shost,
					struct scsi_cmnd *scmd)
{}

static enum scsi_timeout_action mvumi_timed_out(struct scsi_cmnd *scmd)
{}

static int
mvumi_bios_param(struct scsi_device *sdev, struct block_device *bdev,
			sector_t capacity, int geom[])
{}

static const struct scsi_host_template mvumi_template =;

static int mvumi_cfg_hw_reg(struct mvumi_hba *mhba)
{}

/**
 * mvumi_init_fw -	Initializes the FW
 * @mhba:		Adapter soft state
 *
 * This is the main function for initializing firmware.
 */
static int mvumi_init_fw(struct mvumi_hba *mhba)
{}

/**
 * mvumi_io_attach -	Attaches this driver to SCSI mid-layer
 * @mhba:		Adapter soft state
 */
static int mvumi_io_attach(struct mvumi_hba *mhba)
{}

/**
 * mvumi_probe_one -	PCI hotplug entry point
 * @pdev:		PCI device structure
 * @id:			PCI ids of supported hotplugged adapter
 */
static int mvumi_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)
{}

static void mvumi_detach_one(struct pci_dev *pdev)
{}

/**
 * mvumi_shutdown -	Shutdown entry point
 * @pdev:		PCI device structure
 */
static void mvumi_shutdown(struct pci_dev *pdev)
{}

static int __maybe_unused mvumi_suspend(struct device *dev)
{}

static int __maybe_unused mvumi_resume(struct device *dev)
{}

static SIMPLE_DEV_PM_OPS(mvumi_pm_ops, mvumi_suspend, mvumi_resume);

static struct pci_driver mvumi_pci_driver =;

module_pci_driver();