linux/drivers/scsi/esas2r/esas2r_main.c

/*
 *  linux/drivers/scsi/esas2r/esas2r_main.c
 *      For use with ATTO ExpressSAS R6xx SAS/SATA RAID controllers
 *
 *  Copyright (c) 2001-2013 ATTO Technology, Inc.
 *  (mailto:[email protected])
 *
 * 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; either version 2
 * of the License, or (at your option) any later version.
 *
 * 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.  See the
 * GNU General Public License for more details.
 *
 * NO WARRANTY
 * THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR
 * CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT
 * LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT,
 * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is
 * solely responsible for determining the appropriateness of using and
 * distributing the Program and assumes all risks associated with its
 * exercise of rights under this Agreement, including but not limited to
 * the risks and costs of program errors, damage to or loss of data,
 * programs or equipment, and unavailability or interruption of operations.
 *
 * DISCLAIMER OF LIABILITY
 * NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY
 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 * DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND
 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
 * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
 * USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED
 * HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301,
 * USA.
 */

#include "esas2r.h"

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

/* global definitions */

static int found_adapters;
struct esas2r_adapter *esas2r_adapters[MAX_ADAPTERS];

#define ESAS2R_VDA_EVENT_PORT1
#define ESAS2R_VDA_EVENT_PORT2
#define ESAS2R_VDA_EVENT_SOCK_COUNT

static struct esas2r_adapter *esas2r_adapter_from_kobj(struct kobject *kobj)
{}

static ssize_t read_fw(struct file *file, struct kobject *kobj,
		       struct bin_attribute *attr,
		       char *buf, loff_t off, size_t count)
{}

static ssize_t write_fw(struct file *file, struct kobject *kobj,
			struct bin_attribute *attr,
			char *buf, loff_t off, size_t count)
{}

static ssize_t read_fs(struct file *file, struct kobject *kobj,
		       struct bin_attribute *attr,
		       char *buf, loff_t off, size_t count)
{}

static ssize_t write_fs(struct file *file, struct kobject *kobj,
			struct bin_attribute *attr,
			char *buf, loff_t off, size_t count)
{}

static ssize_t read_vda(struct file *file, struct kobject *kobj,
			struct bin_attribute *attr,
			char *buf, loff_t off, size_t count)
{}

static ssize_t write_vda(struct file *file, struct kobject *kobj,
			 struct bin_attribute *attr,
			 char *buf, loff_t off, size_t count)
{}

static ssize_t read_live_nvram(struct file *file, struct kobject *kobj,
			       struct bin_attribute *attr,
			       char *buf, loff_t off, size_t count)
{}

static ssize_t write_live_nvram(struct file *file, struct kobject *kobj,
				struct bin_attribute *attr,
				char *buf, loff_t off, size_t count)
{}

static ssize_t read_default_nvram(struct file *file, struct kobject *kobj,
				  struct bin_attribute *attr,
				  char *buf, loff_t off, size_t count)
{}

static ssize_t read_hw(struct file *file, struct kobject *kobj,
		       struct bin_attribute *attr,
		       char *buf, loff_t off, size_t count)
{}

static ssize_t write_hw(struct file *file, struct kobject *kobj,
			struct bin_attribute *attr,
			char *buf, loff_t off, size_t count)
{}

#define ESAS2R_RW_BIN_ATTR(_name)

ESAS2R_RW_BIN_ATTR();
ESAS2R_RW_BIN_ATTR();
ESAS2R_RW_BIN_ATTR();
ESAS2R_RW_BIN_ATTR();
ESAS2R_RW_BIN_ATTR();

struct bin_attribute bin_attr_default_nvram =;

static const struct scsi_host_template driver_template =;

int sgl_page_size =;
module_param(sgl_page_size, int, 0);
MODULE_PARM_DESC();

int num_sg_lists =;
module_param(num_sg_lists, int, 0);
MODULE_PARM_DESC();

int sg_tablesize =;
module_param(sg_tablesize, int, 0);
MODULE_PARM_DESC();

int num_requests =;
module_param(num_requests, int, 0);
MODULE_PARM_DESC();

int num_ae_requests =;
module_param(num_ae_requests, int, 0);
MODULE_PARM_DESC();

int cmd_per_lun =;
module_param(cmd_per_lun, int, 0);
MODULE_PARM_DESC();

int can_queue =;
module_param(can_queue, int, 0);
MODULE_PARM_DESC();

int esas2r_max_sectors =;
module_param(esas2r_max_sectors, int, 0);
MODULE_PARM_DESC();

int interrupt_mode =;
module_param(interrupt_mode, int, 0);
MODULE_PARM_DESC();

static const struct pci_device_id
	esas2r_pci_table[] =;

MODULE_DEVICE_TABLE(pci, esas2r_pci_table);

static int
esas2r_probe(struct pci_dev *pcid, const struct pci_device_id *id);

static void
esas2r_remove(struct pci_dev *pcid);

static struct pci_driver
	esas2r_pci_driver =;

static int esas2r_probe(struct pci_dev *pcid,
			const struct pci_device_id *id)
{}

static void esas2r_remove(struct pci_dev *pdev)
{}

static int __init esas2r_init(void)
{}

/* Handle ioctl calls to "/proc/scsi/esas2r/ATTOnode" */
static const struct file_operations esas2r_proc_fops =;

static const struct proc_ops esas2r_proc_ops =;

static struct Scsi_Host *esas2r_proc_host;
static int esas2r_proc_major;

long esas2r_proc_ioctl(struct file *fp, unsigned int cmd, unsigned long arg)
{}

static void __exit esas2r_exit(void)
{}

int esas2r_show_info(struct seq_file *m, struct Scsi_Host *sh)
{}

const char *esas2r_info(struct Scsi_Host *sh)
{}

/* Callback for building a request scatter/gather list */
static u32 get_physaddr_from_sgc(struct esas2r_sg_context *sgc, u64 *addr)
{}

int esas2r_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *cmd)
{}

static void complete_task_management_request(struct esas2r_adapter *a,
					     struct esas2r_request *rq)
{}

/*
 * Searches the specified queue for the specified queue for the command
 * to abort.
 *
 * Return 0 on failure, 1 if command was not found, 2 if command was found
 */
static int esas2r_check_active_queue(struct esas2r_adapter *a,
				     struct esas2r_request **abort_request,
				     struct scsi_cmnd *cmd,
				     struct list_head *queue)
{}

int esas2r_eh_abort(struct scsi_cmnd *cmd)
{}

static int esas2r_host_bus_reset(struct scsi_cmnd *cmd, bool host_reset)
{}

int esas2r_host_reset(struct scsi_cmnd *cmd)
{}

int esas2r_bus_reset(struct scsi_cmnd *cmd)
{}

static int esas2r_dev_targ_reset(struct scsi_cmnd *cmd, bool target_reset)
{}

int esas2r_device_reset(struct scsi_cmnd *cmd)
{}

int esas2r_target_reset(struct scsi_cmnd *cmd)
{}

void esas2r_log_request_failure(struct esas2r_adapter *a,
				struct esas2r_request *rq)
{}

void esas2r_wait_request(struct esas2r_adapter *a, struct esas2r_request *rq)
{}

u32 esas2r_map_data_window(struct esas2r_adapter *a, u32 addr_lo)
{}

/* Read a block of data from chip memory */
bool esas2r_read_mem_block(struct esas2r_adapter *a,
			   void *to,
			   u32 from,
			   u32 size)
{}

void esas2r_nuxi_mgt_data(u8 function, void *data)
{}

void esas2r_nuxi_cfg_data(u8 function, void *data)
{}

void esas2r_nuxi_ae_data(union atto_vda_ae *ae)
{}

void esas2r_free_request(struct esas2r_adapter *a, struct esas2r_request *rq)
{}

struct esas2r_request *esas2r_alloc_request(struct esas2r_adapter *a)
{}

void esas2r_complete_request_cb(struct esas2r_adapter *a,
				struct esas2r_request *rq)
{}

/* Run tasklet to handle stuff outside of interrupt context. */
void esas2r_adapter_tasklet(unsigned long context)
{}

static void esas2r_timer_callback(struct timer_list *t);

void esas2r_kickoff_timer(struct esas2r_adapter *a)
{}

static void esas2r_timer_callback(struct timer_list *t)
{}

/*
 * Firmware events need to be handled outside of interrupt context
 * so we schedule a delayed_work to handle them.
 */

static void
esas2r_free_fw_event(struct esas2r_fw_event_work *fw_event)
{}

void
esas2r_fw_event_off(struct esas2r_adapter *a)
{}

void
esas2r_fw_event_on(struct esas2r_adapter *a)
{}

static void esas2r_add_device(struct esas2r_adapter *a, u16 target_id)
{}

static void esas2r_remove_device(struct esas2r_adapter *a, u16 target_id)
{}

/*
 * Sends a firmware asynchronous event to anyone who happens to be
 * listening on the defined ATTO VDA event ports.
 */
static void esas2r_send_ae_event(struct esas2r_fw_event_work *fw_event)
{}

static void
esas2r_firmware_event_work(struct work_struct *work)
{}

void esas2r_queue_fw_event(struct esas2r_adapter *a,
			   enum fw_event_type type,
			   void *data,
			   int data_sz)
{}

void esas2r_target_state_changed(struct esas2r_adapter *a, u16 targ_id,
				 u8 state)
{}

/* Translate status to a Linux SCSI mid-layer error code */
int esas2r_req_status_to_error(u8 req_stat)
{}

module_init();
module_exit(esas2r_exit);