linux/drivers/scsi/hpsa.c

/*
 *    Disk Array driver for HP Smart Array SAS controllers
 *    Copyright (c) 2019-2020 Microchip Technology Inc. and its subsidiaries
 *    Copyright 2016 Microsemi Corporation
 *    Copyright 2014-2015 PMC-Sierra, Inc.
 *    Copyright 2000,2009-2015 Hewlett-Packard Development Company, L.P.
 *
 *    This program is free software; you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation; version 2 of the License.
 *
 *    This program is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
 *    NON INFRINGEMENT.  See the GNU General Public License for more details.
 *
 *    Questions/Comments/Bugfixes to [email protected]
 *
 */

#include <linux/module.h>
#include <linux/interrupt.h>
#include <linux/types.h>
#include <linux/pci.h>
#include <linux/kernel.h>
#include <linux/slab.h>
#include <linux/delay.h>
#include <linux/fs.h>
#include <linux/timer.h>
#include <linux/init.h>
#include <linux/spinlock.h>
#include <linux/compat.h>
#include <linux/blktrace_api.h>
#include <linux/uaccess.h>
#include <linux/io.h>
#include <linux/dma-mapping.h>
#include <linux/completion.h>
#include <linux/moduleparam.h>
#include <scsi/scsi.h>
#include <scsi/scsi_cmnd.h>
#include <scsi/scsi_device.h>
#include <scsi/scsi_host.h>
#include <scsi/scsi_tcq.h>
#include <scsi/scsi_eh.h>
#include <scsi/scsi_transport_sas.h>
#include <scsi/scsi_dbg.h>
#include <linux/cciss_ioctl.h>
#include <linux/string.h>
#include <linux/bitmap.h>
#include <linux/atomic.h>
#include <linux/jiffies.h>
#include <linux/percpu-defs.h>
#include <linux/percpu.h>
#include <asm/unaligned.h>
#include <asm/div64.h>
#include "hpsa_cmd.h"
#include "hpsa.h"

/*
 * HPSA_DRIVER_VERSION must be 3 byte values (0-255) separated by '.'
 * with an optional trailing '-' followed by a byte value (0-255).
 */
#define HPSA_DRIVER_VERSION
#define DRIVER_NAME
#define HPSA

/* How long to wait for CISS doorbell communication */
#define CLEAR_EVENT_WAIT_INTERVAL
#define MODE_CHANGE_WAIT_INTERVAL
#define MAX_CLEAR_EVENT_WAIT
#define MAX_MODE_CHANGE_WAIT
#define MAX_IOCTL_CONFIG_WAIT

/*define how many times we will try a command because of bus resets */
#define MAX_CMD_RETRIES
/* How long to wait before giving up on a command */
#define HPSA_EH_PTRAID_TIMEOUT

/* Embedded module documentation macros - see modules.h */
MODULE_AUTHOR();
MODULE_DESCRIPTION();
MODULE_VERSION();
MODULE_LICENSE();
MODULE_ALIAS();

static int hpsa_simple_mode;
module_param(hpsa_simple_mode, int, S_IRUGO|S_IWUSR);
MODULE_PARM_DESC();

/* define the PCI info for the cards we can control */
static const struct pci_device_id hpsa_pci_device_id[] =;

MODULE_DEVICE_TABLE(pci, hpsa_pci_device_id);

/*  board_id = Subsystem Device ID & Vendor ID
 *  product = Marketing Name for the board
 *  access = Address of the struct of function pointers
 */
static struct board_type products[] =;

static struct scsi_transport_template *hpsa_sas_transport_template;
static int hpsa_add_sas_host(struct ctlr_info *h);
static void hpsa_delete_sas_host(struct ctlr_info *h);
static int hpsa_add_sas_device(struct hpsa_sas_node *hpsa_sas_node,
			struct hpsa_scsi_dev_t *device);
static void hpsa_remove_sas_device(struct hpsa_scsi_dev_t *device);
static struct hpsa_scsi_dev_t
	*hpsa_find_device_by_sas_rphy(struct ctlr_info *h,
		struct sas_rphy *rphy);

#define SCSI_CMD_BUSY
static const struct scsi_cmnd hpsa_cmd_busy;
#define SCSI_CMD_IDLE
static const struct scsi_cmnd hpsa_cmd_idle;
static int number_of_controllers;

static irqreturn_t do_hpsa_intr_intx(int irq, void *dev_id);
static irqreturn_t do_hpsa_intr_msi(int irq, void *dev_id);
static int hpsa_ioctl(struct scsi_device *dev, unsigned int cmd,
		      void __user *arg);
static int hpsa_passthru_ioctl(struct ctlr_info *h,
			       IOCTL_Command_struct *iocommand);
static int hpsa_big_passthru_ioctl(struct ctlr_info *h,
				   BIG_IOCTL_Command_struct *ioc);

#ifdef CONFIG_COMPAT
static int hpsa_compat_ioctl(struct scsi_device *dev, unsigned int cmd,
	void __user *arg);
#endif

static void cmd_free(struct ctlr_info *h, struct CommandList *c);
static struct CommandList *cmd_alloc(struct ctlr_info *h);
static void cmd_tagged_free(struct ctlr_info *h, struct CommandList *c);
static struct CommandList *cmd_tagged_alloc(struct ctlr_info *h,
					    struct scsi_cmnd *scmd);
static int fill_cmd(struct CommandList *c, u8 cmd, struct ctlr_info *h,
	void *buff, size_t size, u16 page_code, unsigned char *scsi3addr,
	int cmd_type);
static void hpsa_free_cmd_pool(struct ctlr_info *h);
#define VPD_PAGE
#define HPSA_SIMPLE_ERROR_BITS

static int hpsa_scsi_queue_command(struct Scsi_Host *h, struct scsi_cmnd *cmd);
static void hpsa_scan_start(struct Scsi_Host *);
static int hpsa_scan_finished(struct Scsi_Host *sh,
	unsigned long elapsed_time);
static int hpsa_change_queue_depth(struct scsi_device *sdev, int qdepth);

static int hpsa_eh_device_reset_handler(struct scsi_cmnd *scsicmd);
static int hpsa_slave_alloc(struct scsi_device *sdev);
static int hpsa_slave_configure(struct scsi_device *sdev);
static void hpsa_slave_destroy(struct scsi_device *sdev);

static void hpsa_update_scsi_devices(struct ctlr_info *h);
static int check_for_unit_attention(struct ctlr_info *h,
	struct CommandList *c);
static void check_ioctl_unit_attention(struct ctlr_info *h,
	struct CommandList *c);
/* performant mode helper functions */
static void calc_bucket_map(int *bucket, int num_buckets,
	int nsgs, int min_blocks, u32 *bucket_map);
static void hpsa_free_performant_mode(struct ctlr_info *h);
static int hpsa_put_ctlr_into_performant_mode(struct ctlr_info *h);
static inline u32 next_command(struct ctlr_info *h, u8 q);
static int hpsa_find_cfg_addrs(struct pci_dev *pdev, void __iomem *vaddr,
			       u32 *cfg_base_addr, u64 *cfg_base_addr_index,
			       u64 *cfg_offset);
static int hpsa_pci_find_memory_BAR(struct pci_dev *pdev,
				    unsigned long *memory_bar);
static int hpsa_lookup_board_id(struct pci_dev *pdev, u32 *board_id,
				bool *legacy_board);
static int wait_for_device_to_become_ready(struct ctlr_info *h,
					   unsigned char lunaddr[],
					   int reply_queue);
static int hpsa_wait_for_board_state(struct pci_dev *pdev, void __iomem *vaddr,
				     int wait_for_ready);
static inline void finish_cmd(struct CommandList *c);
static int hpsa_wait_for_mode_change_ack(struct ctlr_info *h);
#define BOARD_NOT_READY
#define BOARD_READY
static void hpsa_drain_accel_commands(struct ctlr_info *h);
static void hpsa_flush_cache(struct ctlr_info *h);
static int hpsa_scsi_ioaccel_queue_command(struct ctlr_info *h,
	struct CommandList *c, u32 ioaccel_handle, u8 *cdb, int cdb_len,
	u8 *scsi3addr, struct hpsa_scsi_dev_t *phys_disk);
static void hpsa_command_resubmit_worker(struct work_struct *work);
static u32 lockup_detected(struct ctlr_info *h);
static int detect_controller_lockup(struct ctlr_info *h);
static void hpsa_disable_rld_caching(struct ctlr_info *h);
static inline int hpsa_scsi_do_report_phys_luns(struct ctlr_info *h,
	struct ReportExtendedLUNdata *buf, int bufsize);
static bool hpsa_vpd_page_supported(struct ctlr_info *h,
	unsigned char scsi3addr[], u8 page);
static int hpsa_luns_changed(struct ctlr_info *h);
static bool hpsa_cmd_dev_match(struct ctlr_info *h, struct CommandList *c,
			       struct hpsa_scsi_dev_t *dev,
			       unsigned char *scsi3addr);

static inline struct ctlr_info *sdev_to_hba(struct scsi_device *sdev)
{}

static inline struct ctlr_info *shost_to_hba(struct Scsi_Host *sh)
{}

static inline bool hpsa_is_cmd_idle(struct CommandList *c)
{}

/* extract sense key, asc, and ascq from sense data.  -1 means invalid. */
static void decode_sense_data(const u8 *sense_data, int sense_data_len,
			u8 *sense_key, u8 *asc, u8 *ascq)
{}

static int check_for_unit_attention(struct ctlr_info *h,
	struct CommandList *c)
{}

static int check_for_busy(struct ctlr_info *h, struct CommandList *c)
{}

static u32 lockup_detected(struct ctlr_info *h);
static ssize_t host_show_lockup_detected(struct device *dev,
		struct device_attribute *attr, char *buf)
{}

static ssize_t host_store_hp_ssd_smart_path_status(struct device *dev,
					 struct device_attribute *attr,
					 const char *buf, size_t count)
{}

static ssize_t host_store_raid_offload_debug(struct device *dev,
					 struct device_attribute *attr,
					 const char *buf, size_t count)
{}

static ssize_t host_store_rescan(struct device *dev,
				 struct device_attribute *attr,
				 const char *buf, size_t count)
{}

static void hpsa_turn_off_ioaccel_for_device(struct hpsa_scsi_dev_t *device)
{}

static ssize_t host_show_firmware_revision(struct device *dev,
	     struct device_attribute *attr, char *buf)
{}

static ssize_t host_show_commands_outstanding(struct device *dev,
	     struct device_attribute *attr, char *buf)
{}

static ssize_t host_show_transport_mode(struct device *dev,
	struct device_attribute *attr, char *buf)
{}

static ssize_t host_show_hp_ssd_smart_path_status(struct device *dev,
	struct device_attribute *attr, char *buf)
{}

/* List of controllers which cannot be hard reset on kexec with reset_devices */
static u32 unresettable_controller[] =;

/* List of controllers which cannot even be soft reset */
static u32 soft_unresettable_controller[] =;

static int board_id_in_array(u32 a[], int nelems, u32 board_id)
{}

static int ctlr_is_hard_resettable(u32 board_id)
{}

static int ctlr_is_soft_resettable(u32 board_id)
{}

static int ctlr_is_resettable(u32 board_id)
{}

static ssize_t host_show_resettable(struct device *dev,
	struct device_attribute *attr, char *buf)
{}

static inline int is_logical_dev_addr_mode(unsigned char scsi3addr[])
{}

static const char * const raid_label[] =;
#define HPSA_RAID_0
#define HPSA_RAID_4
#define HPSA_RAID_1
#define HPSA_RAID_5
#define HPSA_RAID_51
#define HPSA_RAID_6
#define HPSA_RAID_ADM
#define RAID_UNKNOWN
#define PHYSICAL_DRIVE

static inline bool is_logical_device(struct hpsa_scsi_dev_t *device)
{}

static ssize_t raid_level_show(struct device *dev,
	     struct device_attribute *attr, char *buf)
{}

static ssize_t lunid_show(struct device *dev,
	     struct device_attribute *attr, char *buf)
{}

static ssize_t unique_id_show(struct device *dev,
	     struct device_attribute *attr, char *buf)
{}

static ssize_t sas_address_show(struct device *dev,
	      struct device_attribute *attr, char *buf)
{}

static ssize_t host_show_hp_ssd_smart_path_enabled(struct device *dev,
	     struct device_attribute *attr, char *buf)
{}

#define MAX_PATHS
static ssize_t path_info_show(struct device *dev,
	     struct device_attribute *attr, char *buf)
{}

static ssize_t host_show_ctlr_num(struct device *dev,
	struct device_attribute *attr, char *buf)
{}

static ssize_t host_show_legacy_board(struct device *dev,
	struct device_attribute *attr, char *buf)
{}

static DEVICE_ATTR_RO(raid_level);
static DEVICE_ATTR_RO(lunid);
static DEVICE_ATTR_RO(unique_id);
static DEVICE_ATTR(rescan, S_IWUSR, NULL, host_store_rescan);
static DEVICE_ATTR_RO(sas_address);
static DEVICE_ATTR(hp_ssd_smart_path_enabled, S_IRUGO,
			host_show_hp_ssd_smart_path_enabled, NULL);
static DEVICE_ATTR_RO(path_info);
static DEVICE_ATTR(hp_ssd_smart_path_status, S_IWUSR|S_IRUGO|S_IROTH,
		host_show_hp_ssd_smart_path_status,
		host_store_hp_ssd_smart_path_status);
static DEVICE_ATTR(raid_offload_debug, S_IWUSR, NULL,
			host_store_raid_offload_debug);
static DEVICE_ATTR(firmware_revision, S_IRUGO,
	host_show_firmware_revision, NULL);
static DEVICE_ATTR(commands_outstanding, S_IRUGO,
	host_show_commands_outstanding, NULL);
static DEVICE_ATTR(transport_mode, S_IRUGO,
	host_show_transport_mode, NULL);
static DEVICE_ATTR(resettable, S_IRUGO,
	host_show_resettable, NULL);
static DEVICE_ATTR(lockup_detected, S_IRUGO,
	host_show_lockup_detected, NULL);
static DEVICE_ATTR(ctlr_num, S_IRUGO,
	host_show_ctlr_num, NULL);
static DEVICE_ATTR(legacy_board, S_IRUGO,
	host_show_legacy_board, NULL);

static struct attribute *hpsa_sdev_attrs[] =;

ATTRIBUTE_GROUPS();

static struct attribute *hpsa_shost_attrs[] =;

ATTRIBUTE_GROUPS();

#define HPSA_NRESERVED_CMDS

static const struct scsi_host_template hpsa_driver_template =;

static inline u32 next_command(struct ctlr_info *h, u8 q)
{}

/*
 * There are some special bits in the bus address of the
 * command that we have to set for the controller to know
 * how to process the command:
 *
 * Normal performant mode:
 * bit 0: 1 means performant mode, 0 means simple mode.
 * bits 1-3 = block fetch table entry
 * bits 4-6 = command type (== 0)
 *
 * ioaccel1 mode:
 * bit 0 = "performant mode" bit.
 * bits 1-3 = block fetch table entry
 * bits 4-6 = command type (== 110)
 * (command type is needed because ioaccel1 mode
 * commands are submitted through the same register as normal
 * mode commands, so this is how the controller knows whether
 * the command is normal mode or ioaccel1 mode.)
 *
 * ioaccel2 mode:
 * bit 0 = "performant mode" bit.
 * bits 1-4 = block fetch table entry (note extra bit)
 * bits 4-6 = not needed, because ioaccel2 mode has
 * a separate special register for submitting commands.
 */

/*
 * set_performant_mode: Modify the tag for cciss performant
 * set bit 0 for pull model, bits 3-1 for block fetch
 * register number
 */
#define DEFAULT_REPLY_QUEUE
static void set_performant_mode(struct ctlr_info *h, struct CommandList *c,
					int reply_queue)
{}

static void set_ioaccel1_performant_mode(struct ctlr_info *h,
						struct CommandList *c,
						int reply_queue)
{}

static void set_ioaccel2_tmf_performant_mode(struct ctlr_info *h,
						struct CommandList *c,
						int reply_queue)
{}

static void set_ioaccel2_performant_mode(struct ctlr_info *h,
						struct CommandList *c,
						int reply_queue)
{}

static int is_firmware_flash_cmd(u8 *cdb)
{}

/*
 * During firmware flash, the heartbeat register may not update as frequently
 * as it should.  So we dial down lockup detection during firmware flash. and
 * dial it back up when firmware flash completes.
 */
#define HEARTBEAT_SAMPLE_INTERVAL_DURING_FLASH
#define HEARTBEAT_SAMPLE_INTERVAL
#define HPSA_EVENT_MONITOR_INTERVAL
static void dial_down_lockup_detection_during_fw_flash(struct ctlr_info *h,
		struct CommandList *c)
{}

static void dial_up_lockup_detection_on_fw_flash_complete(struct ctlr_info *h,
		struct CommandList *c)
{}

static void __enqueue_cmd_and_start_io(struct ctlr_info *h,
	struct CommandList *c, int reply_queue)
{}

static void enqueue_cmd_and_start_io(struct ctlr_info *h, struct CommandList *c)
{}

static inline int is_hba_lunid(unsigned char scsi3addr[])
{}

static inline int is_scsi_rev_5(struct ctlr_info *h)
{}

static int hpsa_find_target_lun(struct ctlr_info *h,
	unsigned char scsi3addr[], int bus, int *target, int *lun)
{}

static void hpsa_show_dev_msg(const char *level, struct ctlr_info *h,
	struct hpsa_scsi_dev_t *dev, char *description)
{}

/* Add an entry into h->dev[] array. */
static int hpsa_scsi_add_entry(struct ctlr_info *h,
		struct hpsa_scsi_dev_t *device,
		struct hpsa_scsi_dev_t *added[], int *nadded)
{}

/*
 * Called during a scan operation.
 *
 * Update an entry in h->dev[] array.
 */
static void hpsa_scsi_update_entry(struct ctlr_info *h,
	int entry, struct hpsa_scsi_dev_t *new_entry)
{}

/* Replace an entry from h->dev[] array. */
static void hpsa_scsi_replace_entry(struct ctlr_info *h,
	int entry, struct hpsa_scsi_dev_t *new_entry,
	struct hpsa_scsi_dev_t *added[], int *nadded,
	struct hpsa_scsi_dev_t *removed[], int *nremoved)
{}

/* Remove an entry from h->dev[] array. */
static void hpsa_scsi_remove_entry(struct ctlr_info *h, int entry,
	struct hpsa_scsi_dev_t *removed[], int *nremoved)
{}

#define SCSI3ADDR_EQ(a, b)

static void fixup_botched_add(struct ctlr_info *h,
	struct hpsa_scsi_dev_t *added)
{}

static inline int device_is_the_same(struct hpsa_scsi_dev_t *dev1,
	struct hpsa_scsi_dev_t *dev2)
{}

static inline int device_updated(struct hpsa_scsi_dev_t *dev1,
	struct hpsa_scsi_dev_t *dev2)
{}

/* Find needle in haystack.  If exact match found, return DEVICE_SAME,
 * and return needle location in *index.  If scsi3addr matches, but not
 * vendor, model, serial num, etc. return DEVICE_CHANGED, and return needle
 * location in *index.
 * In the case of a minor device attribute change, such as RAID level, just
 * return DEVICE_UPDATED, along with the updated device's location in index.
 * If needle not found, return DEVICE_NOT_FOUND.
 */
static int hpsa_scsi_find_entry(struct hpsa_scsi_dev_t *needle,
	struct hpsa_scsi_dev_t *haystack[], int haystack_size,
	int *index)
{}

static void hpsa_monitor_offline_device(struct ctlr_info *h,
					unsigned char scsi3addr[])
{}

/* Print a message explaining various offline volume states */
static void hpsa_show_volume_status(struct ctlr_info *h,
	struct hpsa_scsi_dev_t *sd)
{}

/*
 * Figure the list of physical drive pointers for a logical drive with
 * raid offload configured.
 */
static void hpsa_figure_phys_disk_ptrs(struct ctlr_info *h,
				struct hpsa_scsi_dev_t *dev[], int ndevices,
				struct hpsa_scsi_dev_t *logical_drive)
{}

static void hpsa_update_log_drive_phys_drive_ptrs(struct ctlr_info *h,
				struct hpsa_scsi_dev_t *dev[], int ndevices)
{}

static int hpsa_add_device(struct ctlr_info *h, struct hpsa_scsi_dev_t *device)
{}

static int hpsa_find_outstanding_commands_for_dev(struct ctlr_info *h,
						struct hpsa_scsi_dev_t *dev)
{}

#define NUM_WAIT
static void hpsa_wait_for_outstanding_commands_for_dev(struct ctlr_info *h,
						struct hpsa_scsi_dev_t *device)
{}

static void hpsa_remove_device(struct ctlr_info *h,
			struct hpsa_scsi_dev_t *device)
{}

static void adjust_hpsa_scsi_table(struct ctlr_info *h,
	struct hpsa_scsi_dev_t *sd[], int nsds)
{}

/*
 * Lookup bus/target/lun and return corresponding struct hpsa_scsi_dev_t *
 * Assume's h->devlock is held.
 */
static struct hpsa_scsi_dev_t *lookup_hpsa_scsi_dev(struct ctlr_info *h,
	int bus, int target, int lun)
{}

static int hpsa_slave_alloc(struct scsi_device *sdev)
{}

/* configure scsi device based on internal per-device structure */
#define CTLR_TIMEOUT
static int hpsa_slave_configure(struct scsi_device *sdev)
{}

static void hpsa_slave_destroy(struct scsi_device *sdev)
{}

static void hpsa_free_ioaccel2_sg_chain_blocks(struct ctlr_info *h)
{}

static int hpsa_allocate_ioaccel2_sg_chain_blocks(struct ctlr_info *h)
{}

static void hpsa_free_sg_chain_blocks(struct ctlr_info *h)
{}

static int hpsa_alloc_sg_chain_blocks(struct ctlr_info *h)
{}

static int hpsa_map_ioaccel2_sg_chain_block(struct ctlr_info *h,
	struct io_accel2_cmd *cp, struct CommandList *c)
{}

static void hpsa_unmap_ioaccel2_sg_chain_block(struct ctlr_info *h,
	struct io_accel2_cmd *cp)
{}

static int hpsa_map_sg_chain_block(struct ctlr_info *h,
	struct CommandList *c)
{}

static void hpsa_unmap_sg_chain_block(struct ctlr_info *h,
	struct CommandList *c)
{}


/* Decode the various types of errors on ioaccel2 path.
 * Return 1 for any error that should generate a RAID path retry.
 * Return 0 for errors that don't require a RAID path retry.
 */
static int handle_ioaccel_mode2_error(struct ctlr_info *h,
					struct CommandList *c,
					struct scsi_cmnd *cmd,
					struct io_accel2_cmd *c2,
					struct hpsa_scsi_dev_t *dev)
{}

static void hpsa_cmd_resolve_events(struct ctlr_info *h,
		struct CommandList *c)
{}

static void hpsa_cmd_resolve_and_free(struct ctlr_info *h,
				      struct CommandList *c)
{}

static void hpsa_cmd_free_and_done(struct ctlr_info *h,
		struct CommandList *c, struct scsi_cmnd *cmd)
{}

static void hpsa_retry_cmd(struct ctlr_info *h, struct CommandList *c)
{}

static void process_ioaccel2_completion(struct ctlr_info *h,
		struct CommandList *c, struct scsi_cmnd *cmd,
		struct hpsa_scsi_dev_t *dev)
{}

/* Returns 0 on success, < 0 otherwise. */
static int hpsa_evaluate_tmf_status(struct ctlr_info *h,
					struct CommandList *cp)
{}

static void complete_scsi_command(struct CommandList *cp)
{}

static void hpsa_pci_unmap(struct pci_dev *pdev, struct CommandList *c,
		int sg_used, enum dma_data_direction data_direction)
{}

static int hpsa_map_one(struct pci_dev *pdev,
		struct CommandList *cp,
		unsigned char *buf,
		size_t buflen,
		enum dma_data_direction data_direction)
{}

#define NO_TIMEOUT
#define DEFAULT_TIMEOUT
static int hpsa_scsi_do_simple_cmd_core(struct ctlr_info *h,
	struct CommandList *c, int reply_queue, unsigned long timeout_msecs)
{}

static int hpsa_scsi_do_simple_cmd(struct ctlr_info *h, struct CommandList *c,
				   int reply_queue, unsigned long timeout_msecs)
{}

static u32 lockup_detected(struct ctlr_info *h)
{}

#define MAX_DRIVER_CMD_RETRIES
static int hpsa_scsi_do_simple_cmd_with_retry(struct ctlr_info *h,
		struct CommandList *c, enum dma_data_direction data_direction,
		unsigned long timeout_msecs)
{}

static void hpsa_print_cmd(struct ctlr_info *h, char *txt,
				struct CommandList *c)
{}

static void hpsa_scsi_interpret_error(struct ctlr_info *h,
			struct CommandList *cp)
{}

static int hpsa_do_receive_diagnostic(struct ctlr_info *h, u8 *scsi3addr,
					u8 page, u8 *buf, size_t bufsize)
{}

static u64 hpsa_get_enclosure_logical_identifier(struct ctlr_info *h,
						u8 *scsi3addr)
{}

static int hpsa_scsi_do_inquiry(struct ctlr_info *h, unsigned char *scsi3addr,
			u16 page, unsigned char *buf,
			unsigned char bufsize)
{}

static int hpsa_send_reset(struct ctlr_info *h, struct hpsa_scsi_dev_t *dev,
	u8 reset_type, int reply_queue)
{}

static bool hpsa_cmd_dev_match(struct ctlr_info *h, struct CommandList *c,
			       struct hpsa_scsi_dev_t *dev,
			       unsigned char *scsi3addr)
{}

static int hpsa_do_reset(struct ctlr_info *h, struct hpsa_scsi_dev_t *dev,
	u8 reset_type, int reply_queue)
{}

static void hpsa_get_raid_level(struct ctlr_info *h,
	unsigned char *scsi3addr, unsigned char *raid_level)
{}

#define HPSA_MAP_DEBUG
#ifdef HPSA_MAP_DEBUG
static void hpsa_debug_map_buff(struct ctlr_info *h, int rc,
				struct raid_map_data *map_buff)
{}
#else
static void hpsa_debug_map_buff(__attribute__((unused)) struct ctlr_info *h,
			__attribute__((unused)) int rc,
			__attribute__((unused)) struct raid_map_data *map_buff)
{
}
#endif

static int hpsa_get_raid_map(struct ctlr_info *h,
	unsigned char *scsi3addr, struct hpsa_scsi_dev_t *this_device)
{}

static int hpsa_bmic_sense_subsystem_information(struct ctlr_info *h,
		unsigned char scsi3addr[], u16 bmic_device_index,
		struct bmic_sense_subsystem_info *buf, size_t bufsize)
{}

static int hpsa_bmic_id_controller(struct ctlr_info *h,
	struct bmic_identify_controller *buf, size_t bufsize)
{}

static int hpsa_bmic_id_physical_device(struct ctlr_info *h,
		unsigned char scsi3addr[], u16 bmic_device_index,
		struct bmic_identify_physical_device *buf, size_t bufsize)
{}

/*
 * get enclosure information
 * struct ReportExtendedLUNdata *rlep - Used for BMIC drive number
 * struct hpsa_scsi_dev_t *encl_dev - device entry for enclosure
 * Uses id_physical_device to determine the box_index.
 */
static void hpsa_get_enclosure_info(struct ctlr_info *h,
			unsigned char *scsi3addr,
			struct ReportExtendedLUNdata *rlep, int rle_index,
			struct hpsa_scsi_dev_t *encl_dev)
{}

static u64 hpsa_get_sas_address_from_report_physical(struct ctlr_info *h,
						unsigned char *scsi3addr)
{}

static void hpsa_get_sas_address(struct ctlr_info *h, unsigned char *scsi3addr,
					struct hpsa_scsi_dev_t *dev)
{}

static void hpsa_ext_ctrl_present(struct ctlr_info *h,
	struct ReportExtendedLUNdata *physdev)
{}

/* Get a device id from inquiry page 0x83 */
static bool hpsa_vpd_page_supported(struct ctlr_info *h,
	unsigned char scsi3addr[], u8 page)
{}

/*
 * Called during a scan operation.
 * Sets ioaccel status on the new device list, not the existing device list
 *
 * The device list used during I/O will be updated later in
 * adjust_hpsa_scsi_table.
 */
static void hpsa_get_ioaccel_status(struct ctlr_info *h,
	unsigned char *scsi3addr, struct hpsa_scsi_dev_t *this_device)
{}

/* Get the device id from inquiry page 0x83 */
static int hpsa_get_device_id(struct ctlr_info *h, unsigned char *scsi3addr,
	unsigned char *device_id, int index, int buflen)
{}

static int hpsa_scsi_do_report_luns(struct ctlr_info *h, int logical,
		void *buf, int bufsize,
		int extended_response)
{}

static inline int hpsa_scsi_do_report_phys_luns(struct ctlr_info *h,
		struct ReportExtendedLUNdata *buf, int bufsize)
{}

static inline int hpsa_scsi_do_report_log_luns(struct ctlr_info *h,
		struct ReportLUNdata *buf, int bufsize)
{}

static inline void hpsa_set_bus_target_lun(struct hpsa_scsi_dev_t *device,
	int bus, int target, int lun)
{}

/* Use VPD inquiry to get details of volume status */
static int hpsa_get_volume_status(struct ctlr_info *h,
					unsigned char scsi3addr[])
{}

/* Determine offline status of a volume.
 * Return either:
 *  0 (not offline)
 *  0xff (offline for unknown reasons)
 *  # (integer code indicating one of several NOT READY states
 *     describing why a volume is to be kept offline)
 */
static unsigned char hpsa_volume_offline(struct ctlr_info *h,
					unsigned char scsi3addr[])
{}

static int hpsa_update_device_info(struct ctlr_info *h,
	unsigned char scsi3addr[], struct hpsa_scsi_dev_t *this_device,
	unsigned char *is_OBDR_device)
{}

/*
 * Helper function to assign bus, target, lun mapping of devices.
 * Logical drive target and lun are assigned at this time, but
 * physical device lun and target assignment are deferred (assigned
 * in hpsa_find_target_lun, called by hpsa_scsi_add_entry.)
*/
static void figure_bus_target_lun(struct ctlr_info *h,
	u8 *lunaddrbytes, struct hpsa_scsi_dev_t *device)
{}

static int  figure_external_status(struct ctlr_info *h, int raid_ctlr_position,
	int i, int nphysicals, int nlocal_logicals)
{}

/*
 * Do CISS_REPORT_PHYS and CISS_REPORT_LOG.  Data is returned in physdev,
 * logdev.  The number of luns in physdev and logdev are returned in
 * *nphysicals and *nlogicals, respectively.
 * Returns 0 on success, -1 otherwise.
 */
static int hpsa_gather_lun_info(struct ctlr_info *h,
	struct ReportExtendedLUNdata *physdev, u32 *nphysicals,
	struct ReportLUNdata *logdev, u32 *nlogicals)
{}

static u8 *figure_lunaddrbytes(struct ctlr_info *h, int raid_ctlr_position,
	int i, int nphysicals, int nlogicals,
	struct ReportExtendedLUNdata *physdev_list,
	struct ReportLUNdata *logdev_list)
{}

/* get physical drive ioaccel handle and queue depth */
static void hpsa_get_ioaccel_drive_info(struct ctlr_info *h,
		struct hpsa_scsi_dev_t *dev,
		struct ReportExtendedLUNdata *rlep, int rle_index,
		struct bmic_identify_physical_device *id_phys)
{}

static void hpsa_get_path_info(struct hpsa_scsi_dev_t *this_device,
	struct ReportExtendedLUNdata *rlep, int rle_index,
	struct bmic_identify_physical_device *id_phys)
{}

/* get number of local logical disks. */
static int hpsa_set_local_logical_count(struct ctlr_info *h,
	struct bmic_identify_controller *id_ctlr,
	u32 *nlocals)
{}

static bool hpsa_is_disk_spare(struct ctlr_info *h, u8 *lunaddrbytes)
{}

#define RPL_DEV_FLAG_NON_DISK
#define RPL_DEV_FLAG_UNCONFIG_DISK_REPORTING_SUPPORTED
#define RPL_DEV_FLAG_UNCONFIG_DISK

#define BMIC_DEVICE_TYPE_ENCLOSURE

static bool hpsa_skip_device(struct ctlr_info *h, u8 *lunaddrbytes,
				struct ext_report_lun_entry *rle)
{}

static void hpsa_update_scsi_devices(struct ctlr_info *h)
{}

static void hpsa_set_sg_descriptor(struct SGDescriptor *desc,
				   struct scatterlist *sg)
{}

/*
 * hpsa_scatter_gather takes a struct scsi_cmnd, (cmd), and does the pci
 * dma mapping  and fills in the scatter gather entries of the
 * hpsa command, cp.
 */
static int hpsa_scatter_gather(struct ctlr_info *h,
		struct CommandList *cp,
		struct scsi_cmnd *cmd)
{}

static inline void warn_zero_length_transfer(struct ctlr_info *h,
						u8 *cdb, int cdb_len,
						const char *func)
{}

#define IO_ACCEL_INELIGIBLE
/* zero-length transfers trigger hardware errors. */
static bool is_zero_length_transfer(u8 *cdb)
{}

static int fixup_ioaccel_cdb(u8 *cdb, int *cdb_len)
{}

static int hpsa_scsi_ioaccel1_queue_command(struct ctlr_info *h,
	struct CommandList *c, u32 ioaccel_handle, u8 *cdb, int cdb_len,
	u8 *scsi3addr, struct hpsa_scsi_dev_t *phys_disk)
{}

/*
 * Queue a command directly to a device behind the controller using the
 * I/O accelerator path.
 */
static int hpsa_scsi_ioaccel_direct_map(struct ctlr_info *h,
	struct CommandList *c)
{}

/*
 * Set encryption parameters for the ioaccel2 request
 */
static void set_encrypt_ioaccel2(struct ctlr_info *h,
	struct CommandList *c, struct io_accel2_cmd *cp)
{}

static int hpsa_scsi_ioaccel2_queue_command(struct ctlr_info *h,
	struct CommandList *c, u32 ioaccel_handle, u8 *cdb, int cdb_len,
	u8 *scsi3addr, struct hpsa_scsi_dev_t *phys_disk)
{}

/*
 * Queue a command to the correct I/O accelerator path.
 */
static int hpsa_scsi_ioaccel_queue_command(struct ctlr_info *h,
	struct CommandList *c, u32 ioaccel_handle, u8 *cdb, int cdb_len,
	u8 *scsi3addr, struct hpsa_scsi_dev_t *phys_disk)
{}

static void raid_map_helper(struct raid_map_data *map,
		int offload_to_mirror, u32 *map_index, u32 *current_group)
{}

/*
 * Attempt to perform offload RAID mapping for a logical volume I/O.
 */
static int hpsa_scsi_ioaccel_raid_map(struct ctlr_info *h,
	struct CommandList *c)
{}

/*
 * Submit commands down the "normal" RAID stack path
 * All callers to hpsa_ciss_submit must check lockup_detected
 * beforehand, before (opt.) and after calling cmd_alloc
 */
static int hpsa_ciss_submit(struct ctlr_info *h,
	struct CommandList *c, struct scsi_cmnd *cmd,
	struct hpsa_scsi_dev_t *dev)
{}

static void hpsa_cmd_init(struct ctlr_info *h, int index,
				struct CommandList *c)
{}

static void hpsa_preinitialize_commands(struct ctlr_info *h)
{}

static inline void hpsa_cmd_partial_init(struct ctlr_info *h, int index,
				struct CommandList *c)
{}

static int hpsa_ioaccel_submit(struct ctlr_info *h,
		struct CommandList *c, struct scsi_cmnd *cmd,
		bool retry)
{}

static void hpsa_command_resubmit_worker(struct work_struct *work)
{}

/* Running in struct Scsi_Host->host_lock less mode */
static int hpsa_scsi_queue_command(struct Scsi_Host *sh, struct scsi_cmnd *cmd)
{}

static void hpsa_scan_complete(struct ctlr_info *h)
{}

static void hpsa_scan_start(struct Scsi_Host *sh)
{}

static int hpsa_change_queue_depth(struct scsi_device *sdev, int qdepth)
{}

static int hpsa_scan_finished(struct Scsi_Host *sh,
	unsigned long elapsed_time)
{}

static int hpsa_scsi_host_alloc(struct ctlr_info *h)
{}

static int hpsa_scsi_add_host(struct ctlr_info *h)
{}

/*
 * The block layer has already gone to the trouble of picking out a unique,
 * small-integer tag for this request.  We use an offset from that value as
 * an index to select our command block.  (The offset allows us to reserve the
 * low-numbered entries for our own uses.)
 */
static int hpsa_get_cmd_index(struct scsi_cmnd *scmd)
{}

/*
 * Send a TEST_UNIT_READY command to the specified LUN using the specified
 * reply queue; returns zero if the unit is ready, and non-zero otherwise.
 */
static int hpsa_send_test_unit_ready(struct ctlr_info *h,
				struct CommandList *c, unsigned char lunaddr[],
				int reply_queue)
{}

/*
 * Wait for a TEST_UNIT_READY command to complete, retrying as necessary;
 * returns zero when the unit is ready, and non-zero when giving up.
 */
static int hpsa_wait_for_test_unit_ready(struct ctlr_info *h,
				struct CommandList *c,
				unsigned char lunaddr[], int reply_queue)
{}

static int wait_for_device_to_become_ready(struct ctlr_info *h,
					   unsigned char lunaddr[],
					   int reply_queue)
{}

/* Need at least one of these error handlers to keep ../scsi/hosts.c from
 * complaining.  Doing a host- or bus-reset can't do anything good here.
 */
static int hpsa_eh_device_reset_handler(struct scsi_cmnd *scsicmd)
{}

/*
 * For operations with an associated SCSI command, a command block is allocated
 * at init, and managed by cmd_tagged_alloc() and cmd_tagged_free() using the
 * block request tag as an index into a table of entries.  cmd_tagged_free() is
 * the complement, although cmd_free() may be called instead.
 * This function is only called for new requests from queue_command.
 */
static struct CommandList *cmd_tagged_alloc(struct ctlr_info *h,
					    struct scsi_cmnd *scmd)
{}

static void cmd_tagged_free(struct ctlr_info *h, struct CommandList *c)
{}

/*
 * For operations that cannot sleep, a command block is allocated at init,
 * and managed by cmd_alloc() and cmd_free() using a simple bitmap to track
 * which ones are free or in use.  Lock must be held when calling this.
 * cmd_free() is the complement.
 * This function never gives up and returns NULL.  If it hangs,
 * another thread must call cmd_free() to free some tags.
 */

static struct CommandList *cmd_alloc(struct ctlr_info *h)
{}

/*
 * This is the complementary operation to cmd_alloc().  Note, however, in some
 * corner cases it may also be used to free blocks allocated by
 * cmd_tagged_alloc() in which case the ref-count decrement does the trick and
 * the clear-bit is harmless.
 */
static void cmd_free(struct ctlr_info *h, struct CommandList *c)
{}

#ifdef CONFIG_COMPAT

static int hpsa_ioctl32_passthru(struct scsi_device *dev, unsigned int cmd,
	void __user *arg)
{}

static int hpsa_ioctl32_big_passthru(struct scsi_device *dev,
	unsigned int cmd, void __user *arg)
{}

static int hpsa_compat_ioctl(struct scsi_device *dev, unsigned int cmd,
			     void __user *arg)
{}
#endif

static int hpsa_getpciinfo_ioctl(struct ctlr_info *h, void __user *argp)
{}

static int hpsa_getdrivver_ioctl(struct ctlr_info *h, void __user *argp)
{}

static int hpsa_passthru_ioctl(struct ctlr_info *h,
			       IOCTL_Command_struct *iocommand)
{}

static int hpsa_big_passthru_ioctl(struct ctlr_info *h,
				   BIG_IOCTL_Command_struct *ioc)
{}

static void check_ioctl_unit_attention(struct ctlr_info *h,
	struct CommandList *c)
{}

/*
 * ioctl
 */
static int hpsa_ioctl(struct scsi_device *dev, unsigned int cmd,
		      void __user *argp)
{}

static void hpsa_send_host_reset(struct ctlr_info *h, u8 reset_type)
{}

static int fill_cmd(struct CommandList *c, u8 cmd, struct ctlr_info *h,
	void *buff, size_t size, u16 page_code, unsigned char *scsi3addr,
	int cmd_type)
{}

/*
 * Map (physical) PCI mem into (virtual) kernel space
 */
static void __iomem *remap_pci_mem(ulong base, ulong size)
{}

static inline unsigned long get_next_completion(struct ctlr_info *h, u8 q)
{}

static inline bool interrupt_pending(struct ctlr_info *h)
{}

static inline long interrupt_not_for_us(struct ctlr_info *h)
{}

static inline int bad_tag(struct ctlr_info *h, u32 tag_index,
	u32 raw_tag)
{}

static inline void finish_cmd(struct CommandList *c)
{}

/* process completion of an indexed ("direct lookup") command */
static inline void process_indexed_cmd(struct ctlr_info *h,
	u32 raw_tag)
{}

/* Some controllers, like p400, will give us one interrupt
 * after a soft reset, even if we turned interrupts off.
 * Only need to check for this in the hpsa_xxx_discard_completions
 * functions.
 */
static int ignore_bogus_interrupt(struct ctlr_info *h)
{}

/*
 * Convert &h->q[x] (passed to interrupt handlers) back to h.
 * Relies on (h-q[x] == x) being true for x such that
 * 0 <= x < MAX_REPLY_QUEUES.
 */
static struct ctlr_info *queue_to_hba(u8 *queue)
{}

static irqreturn_t hpsa_intx_discard_completions(int irq, void *queue)
{}

static irqreturn_t hpsa_msix_discard_completions(int irq, void *queue)
{}

static irqreturn_t do_hpsa_intr_intx(int irq, void *queue)
{}

static irqreturn_t do_hpsa_intr_msi(int irq, void *queue)
{}

/* Send a message CDB to the firmware. Careful, this only works
 * in simple mode, not performant mode due to the tag lookup.
 * We only ever use this immediately after a controller reset.
 */
static int hpsa_message(struct pci_dev *pdev, unsigned char opcode,
			unsigned char type)
{}

#define hpsa_noop(p)

static int hpsa_controller_hard_reset(struct pci_dev *pdev,
	void __iomem *vaddr, u32 use_doorbell)
{}

static void init_driver_version(char *driver_version, int len)
{}

static int write_driver_ver_to_cfgtable(struct CfgTable __iomem *cfgtable)
{}

static void read_driver_ver_from_cfgtable(struct CfgTable __iomem *cfgtable,
					  unsigned char *driver_ver)
{}

static int controller_reset_failed(struct CfgTable __iomem *cfgtable)
{}
/* This does a hard reset of the controller using PCI power management
 * states or the using the doorbell register.
 */
static int hpsa_kdump_hard_reset_controller(struct pci_dev *pdev, u32 board_id)
{}

/*
 *  We cannot read the structure directly, for portability we must use
 *   the io functions.
 *   This is for debug only.
 */
static void print_cfg_table(struct device *dev, struct CfgTable __iomem *tb)
{}

static int find_PCI_BAR_index(struct pci_dev *pdev, unsigned long pci_bar_addr)
{}

static void hpsa_disable_interrupt_mode(struct ctlr_info *h)
{}

static void hpsa_setup_reply_map(struct ctlr_info *h)
{}

/* If MSI/MSI-X is supported by the kernel we will try to enable it on
 * controllers that are capable. If not, we use legacy INTx mode.
 */
static int hpsa_interrupt_mode(struct ctlr_info *h)
{}

static int hpsa_lookup_board_id(struct pci_dev *pdev, u32 *board_id,
				bool *legacy_board)
{}

static int hpsa_pci_find_memory_BAR(struct pci_dev *pdev,
				    unsigned long *memory_bar)
{}

static int hpsa_wait_for_board_state(struct pci_dev *pdev, void __iomem *vaddr,
				     int wait_for_ready)
{}

static int hpsa_find_cfg_addrs(struct pci_dev *pdev, void __iomem *vaddr,
			       u32 *cfg_base_addr, u64 *cfg_base_addr_index,
			       u64 *cfg_offset)
{}

static void hpsa_free_cfgtables(struct ctlr_info *h)
{}

/* Find and map CISS config table and transfer table
+ * several items must be unmapped (freed) later
+ * */
static int hpsa_find_cfgtables(struct ctlr_info *h)
{}

static void hpsa_get_max_perf_mode_cmds(struct ctlr_info *h)
{}

/* If the controller reports that the total max sg entries is greater than 512,
 * then we know that chained SG blocks work.  (Original smart arrays did not
 * support chained SG blocks and would return zero for max sg entries.)
 */
static int hpsa_supports_chained_sg_blocks(struct ctlr_info *h)
{}

/* Interrogate the hardware for some limits:
 * max commands, max SG elements without chaining, and with chaining,
 * SG chain block size, etc.
 */
static void hpsa_find_board_params(struct ctlr_info *h)
{}

static inline bool hpsa_CISS_signature_present(struct ctlr_info *h)
{}

static inline void hpsa_set_driver_support_bits(struct ctlr_info *h)
{}

/* Disable DMA prefetch for the P600.  Otherwise an ASIC bug may result
 * in a prefetch beyond physical memory.
 */
static inline void hpsa_p600_dma_prefetch_quirk(struct ctlr_info *h)
{}

static int hpsa_wait_for_clear_event_notify_ack(struct ctlr_info *h)
{}

static int hpsa_wait_for_mode_change_ack(struct ctlr_info *h)
{}

/* return -ENODEV or other reason on error, 0 on success */
static int hpsa_enter_simple_mode(struct ctlr_info *h)
{}

/* free items allocated or mapped by hpsa_pci_init */
static void hpsa_free_pci_init(struct ctlr_info *h)
{}

/* several items must be freed later */
static int hpsa_pci_init(struct ctlr_info *h)
{}

static void hpsa_hba_inquiry(struct ctlr_info *h)
{}

static int hpsa_init_reset_devices(struct pci_dev *pdev, u32 board_id)
{}

static void hpsa_free_cmd_pool(struct ctlr_info *h)
{}

static int hpsa_alloc_cmd_pool(struct ctlr_info *h)
{}

/* clear affinity hints and free MSI-X, MSI, or legacy INTx vectors */
static void hpsa_free_irqs(struct ctlr_info *h)
{}

/* returns 0 on success; cleans up and returns -Enn on error */
static int hpsa_request_irqs(struct ctlr_info *h,
	irqreturn_t (*msixhandler)(int, void *),
	irqreturn_t (*intxhandler)(int, void *))
{}

static int hpsa_kdump_soft_reset(struct ctlr_info *h)
{}

static void hpsa_free_reply_queues(struct ctlr_info *h)
{}

static void hpsa_undo_allocations_after_kdump_soft_reset(struct ctlr_info *h)
{}

/* Called when controller lockup detected. */
static void fail_all_outstanding_cmds(struct ctlr_info *h)
{}

static void set_lockup_detected_for_all_cpus(struct ctlr_info *h, u32 value)
{}

static void controller_lockup_detected(struct ctlr_info *h)
{}

static int detect_controller_lockup(struct ctlr_info *h)
{}

/*
 * Set ioaccel status for all ioaccel volumes.
 *
 * Called from monitor controller worker (hpsa_event_monitor_worker)
 *
 * A Volume (or Volumes that comprise an Array set) may be undergoing a
 * transformation, so we will be turning off ioaccel for all volumes that
 * make up the Array.
 */
static void hpsa_set_ioaccel_status(struct ctlr_info *h)
{}

static void hpsa_ack_ctlr_events(struct ctlr_info *h)
{}

/* Check a register on the controller to see if there are configuration
 * changes (added/changed/removed logical drives, etc.) which mean that
 * we should rescan the controller for devices.
 * Also check flag for driver-initiated rescan.
 */
static int hpsa_ctlr_needs_rescan(struct ctlr_info *h)
{}

/*
 * Check if any of the offline devices have become ready
 */
static int hpsa_offline_devices_ready(struct ctlr_info *h)
{}

static int hpsa_luns_changed(struct ctlr_info *h)
{}

static void hpsa_perform_rescan(struct ctlr_info *h)
{}

/*
 * watch for controller events
 */
static void hpsa_event_monitor_worker(struct work_struct *work)
{}

static void hpsa_rescan_ctlr_worker(struct work_struct *work)
{}

static void hpsa_monitor_ctlr_worker(struct work_struct *work)
{}

static struct workqueue_struct *hpsa_create_controller_wq(struct ctlr_info *h,
						char *name)
{}

static void hpda_free_ctlr_info(struct ctlr_info *h)
{}

static struct ctlr_info *hpda_alloc_ctlr_info(void)
{}

static int hpsa_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
{}

static void hpsa_flush_cache(struct ctlr_info *h)
{}

/* Make controller gather fresh report lun data each time we
 * send down a report luns request
 */
static void hpsa_disable_rld_caching(struct ctlr_info *h)
{}

static void __hpsa_shutdown(struct pci_dev *pdev)
{}

static void hpsa_shutdown(struct pci_dev *pdev)
{}

static void hpsa_free_device_info(struct ctlr_info *h)
{}

static void hpsa_remove_one(struct pci_dev *pdev)
{}

static int __maybe_unused hpsa_suspend(
	__attribute__((unused)) struct device *dev)
{}

static int __maybe_unused hpsa_resume
	(__attribute__((unused)) struct device *dev)
{}

static SIMPLE_DEV_PM_OPS(hpsa_pm_ops, hpsa_suspend, hpsa_resume);

static struct pci_driver hpsa_pci_driver =;

/* Fill in bucket_map[], given nsgs (the max number of
 * scatter gather elements supported) and bucket[],
 * which is an array of 8 integers.  The bucket[] array
 * contains 8 different DMA transfer sizes (in 16
 * byte increments) which the controller uses to fetch
 * commands.  This function fills in bucket_map[], which
 * maps a given number of scatter gather elements to one of
 * the 8 DMA transfer sizes.  The point of it is to allow the
 * controller to only do as much DMA as needed to fetch the
 * command, with the DMA transfer size encoded in the lower
 * bits of the command address.
 */
static void  calc_bucket_map(int bucket[], int num_buckets,
	int nsgs, int min_blocks, u32 *bucket_map)
{}

/*
 * return -ENODEV on err, 0 on success (or no action)
 * allocates numerous items that must be freed later
 */
static int hpsa_enter_performant_mode(struct ctlr_info *h, u32 trans_support)
{}

/* Free ioaccel1 mode command blocks and block fetch table */
static void hpsa_free_ioaccel1_cmd_and_bft(struct ctlr_info *h)
{}

/* Allocate ioaccel1 mode command blocks and block fetch table */
static int hpsa_alloc_ioaccel1_cmd_and_bft(struct ctlr_info *h)
{}

/* Free ioaccel2 mode command blocks and block fetch table */
static void hpsa_free_ioaccel2_cmd_and_bft(struct ctlr_info *h)
{}

/* Allocate ioaccel2 mode command blocks and block fetch table */
static int hpsa_alloc_ioaccel2_cmd_and_bft(struct ctlr_info *h)
{}

/* Free items allocated by hpsa_put_ctlr_into_performant_mode */
static void hpsa_free_performant_mode(struct ctlr_info *h)
{}

/* return -ENODEV on error, 0 on success (or no action)
 * allocates numerous items that must be freed later
 */
static int hpsa_put_ctlr_into_performant_mode(struct ctlr_info *h)
{}

static int is_accelerated_cmd(struct CommandList *c)
{}

static void hpsa_drain_accel_commands(struct ctlr_info *h)
{}

static struct hpsa_sas_phy *hpsa_alloc_sas_phy(
				struct hpsa_sas_port *hpsa_sas_port)
{}

static void hpsa_free_sas_phy(struct hpsa_sas_phy *hpsa_sas_phy)
{}

static int hpsa_sas_port_add_phy(struct hpsa_sas_phy *hpsa_sas_phy)
{}

static int
	hpsa_sas_port_add_rphy(struct hpsa_sas_port *hpsa_sas_port,
				struct sas_rphy *rphy)
{}

static struct hpsa_sas_port
	*hpsa_alloc_sas_port(struct hpsa_sas_node *hpsa_sas_node,
				u64 sas_address)
{}

static void hpsa_free_sas_port(struct hpsa_sas_port *hpsa_sas_port)
{}

static struct hpsa_sas_node *hpsa_alloc_sas_node(struct device *parent_dev)
{}

static void hpsa_free_sas_node(struct hpsa_sas_node *hpsa_sas_node)
{}

static struct hpsa_scsi_dev_t
	*hpsa_find_device_by_sas_rphy(struct ctlr_info *h,
					struct sas_rphy *rphy)
{}

static int hpsa_add_sas_host(struct ctlr_info *h)
{}

static void hpsa_delete_sas_host(struct ctlr_info *h)
{}

static int hpsa_add_sas_device(struct hpsa_sas_node *hpsa_sas_node,
				struct hpsa_scsi_dev_t *device)
{}

static void hpsa_remove_sas_device(struct hpsa_scsi_dev_t *device)
{}

static int
hpsa_sas_get_linkerrors(struct sas_phy *phy)
{}

static int
hpsa_sas_get_enclosure_identifier(struct sas_rphy *rphy, u64 *identifier)
{}

static int
hpsa_sas_get_bay_identifier(struct sas_rphy *rphy)
{}

static int
hpsa_sas_phy_reset(struct sas_phy *phy, int hard_reset)
{}

static int
hpsa_sas_phy_enable(struct sas_phy *phy, int enable)
{}

static int
hpsa_sas_phy_setup(struct sas_phy *phy)
{}

static void
hpsa_sas_phy_release(struct sas_phy *phy)
{}

static int
hpsa_sas_phy_speed(struct sas_phy *phy, struct sas_phy_linkrates *rates)
{}

static struct sas_function_template hpsa_sas_transport_functions =;

/*
 *  This is it.  Register the PCI driver information for the cards we control
 *  the OS will call our registered routines when it finds one of our cards.
 */
static int __init hpsa_init(void)
{}

static void __exit hpsa_cleanup(void)
{}

static void __attribute__((unused)) verify_offsets(void)
{}

module_init();
module_exit(hpsa_cleanup);