Commit 7552a93a authored by Andrew Vasquez's avatar Andrew Vasquez Committed by James Bottomley

qla2xxx: Dead code removal

From: Christoph Hellwig <hch@lst.de>

remove dead code, add missing statics
Signed-off-by: default avatarAndrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@SteelEye.com>
parent b68999ea
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
/* /*
* Adapter model names. * Adapter model names.
*/ */
char *qla2x00_model_name[QLA_MODEL_NAMES] = { static char *qla2x00_model_name[QLA_MODEL_NAMES] = {
"QLA2340", /* 0x100 */ "QLA2340", /* 0x100 */
"QLA2342", /* 0x101 */ "QLA2342", /* 0x101 */
"QLA2344", /* 0x102 */ "QLA2344", /* 0x102 */
...@@ -39,7 +39,7 @@ char *qla2x00_model_name[QLA_MODEL_NAMES] = { ...@@ -39,7 +39,7 @@ char *qla2x00_model_name[QLA_MODEL_NAMES] = {
"QLA4040C" /* 0x120 */ "QLA4040C" /* 0x120 */
}; };
char *qla2x00_model_desc[QLA_MODEL_NAMES] = { static char *qla2x00_model_desc[QLA_MODEL_NAMES] = {
"133MHz PCI-X to 2Gb FC, Single Channel", /* 0x100 */ "133MHz PCI-X to 2Gb FC, Single Channel", /* 0x100 */
"133MHz PCI-X to 2Gb FC, Dual Channel", /* 0x101 */ "133MHz PCI-X to 2Gb FC, Dual Channel", /* 0x101 */
"133MHz PCI-X to 2Gb FC, Quad Channel", /* 0x102 */ "133MHz PCI-X to 2Gb FC, Quad Channel", /* 0x102 */
......
...@@ -45,12 +45,9 @@ extern void qla2x00_restart_queues(scsi_qla_host_t *, uint8_t); ...@@ -45,12 +45,9 @@ extern void qla2x00_restart_queues(scsi_qla_host_t *, uint8_t);
extern void qla2x00_rescan_fcports(scsi_qla_host_t *); extern void qla2x00_rescan_fcports(scsi_qla_host_t *);
extern void qla2x00_tgt_free(scsi_qla_host_t *ha, uint16_t t); extern void qla2x00_tgt_free(scsi_qla_host_t *ha, uint16_t t);
extern os_tgt_t *qla2x00_tgt_alloc(scsi_qla_host_t *, uint16_t);
extern os_lun_t * qla2x00_lun_alloc(scsi_qla_host_t *, uint16_t, uint16_t);
extern int qla2x00_abort_isp(scsi_qla_host_t *); extern int qla2x00_abort_isp(scsi_qla_host_t *);
/* /*
* Global Data in qla_os.c source file. * Global Data in qla_os.c source file.
*/ */
...@@ -82,9 +79,6 @@ extern char *qla2x00_get_fw_version_str(struct scsi_qla_host *, char *); ...@@ -82,9 +79,6 @@ extern char *qla2x00_get_fw_version_str(struct scsi_qla_host *, char *);
extern void qla2x00_cmd_timeout(srb_t *); extern void qla2x00_cmd_timeout(srb_t *);
extern int qla2x00_queuecommand(struct scsi_cmnd *,
void (*)(struct scsi_cmnd *));
extern int __qla2x00_suspend_lun(scsi_qla_host_t *, os_lun_t *, int, int, int); extern int __qla2x00_suspend_lun(scsi_qla_host_t *, os_lun_t *, int, int, int);
extern void qla2x00_done(scsi_qla_host_t *); extern void qla2x00_done(scsi_qla_host_t *);
...@@ -92,17 +86,11 @@ extern void qla2x00_next(scsi_qla_host_t *); ...@@ -92,17 +86,11 @@ extern void qla2x00_next(scsi_qla_host_t *);
extern void qla2x00_flush_failover_q(scsi_qla_host_t *, os_lun_t *); extern void qla2x00_flush_failover_q(scsi_qla_host_t *, os_lun_t *);
extern void qla2x00_reset_lun_fo_counts(scsi_qla_host_t *, os_lun_t *); extern void qla2x00_reset_lun_fo_counts(scsi_qla_host_t *, os_lun_t *);
extern int qla2x00_check_tgt_status(scsi_qla_host_t *, struct scsi_cmnd *);
extern int qla2x00_check_port_status(scsi_qla_host_t *, fc_port_t *);
extern void qla2x00_extend_timeout(struct scsi_cmnd *, int); extern void qla2x00_extend_timeout(struct scsi_cmnd *, int);
extern srb_t * qla2x00_get_new_sp (scsi_qla_host_t *ha);
extern void qla2x00_mark_device_lost(scsi_qla_host_t *, fc_port_t *, int); extern void qla2x00_mark_device_lost(scsi_qla_host_t *, fc_port_t *, int);
extern void qla2x00_mark_all_devices_lost(scsi_qla_host_t *); extern void qla2x00_mark_all_devices_lost(scsi_qla_host_t *);
extern int qla2x00_get_prop_xstr(scsi_qla_host_t *, char *, uint8_t *, int);
extern void qla2x00_abort_queues(scsi_qla_host_t *, uint8_t); extern void qla2x00_abort_queues(scsi_qla_host_t *, uint8_t);
extern void qla2x00_blink_led(scsi_qla_host_t *); extern void qla2x00_blink_led(scsi_qla_host_t *);
...@@ -112,8 +100,6 @@ extern int qla2x00_down_timeout(struct semaphore *, unsigned long); ...@@ -112,8 +100,6 @@ extern int qla2x00_down_timeout(struct semaphore *, unsigned long);
/* /*
* Global Function Prototypes in qla_iocb.c source file. * Global Function Prototypes in qla_iocb.c source file.
*/ */
extern request_t *qla2x00_req_pkt(scsi_qla_host_t *);
extern request_t *qla2x00_ms_req_pkt(scsi_qla_host_t *, srb_t *);
extern void qla2x00_isp_cmd(scsi_qla_host_t *); extern void qla2x00_isp_cmd(scsi_qla_host_t *);
extern uint16_t qla2x00_calc_iocbs_32(uint16_t); extern uint16_t qla2x00_calc_iocbs_32(uint16_t);
...@@ -127,9 +113,6 @@ int __qla2x00_marker(scsi_qla_host_t *, uint16_t, uint16_t, uint8_t); ...@@ -127,9 +113,6 @@ int __qla2x00_marker(scsi_qla_host_t *, uint16_t, uint16_t, uint8_t);
/* /*
* Global Function Prototypes in qla_mbx.c source file. * Global Function Prototypes in qla_mbx.c source file.
*/ */
extern int
qla2x00_mailbox_command(scsi_qla_host_t *, mbx_cmd_t *);
extern int extern int
qla2x00_load_ram(scsi_qla_host_t *, dma_addr_t, uint16_t, uint16_t); qla2x00_load_ram(scsi_qla_host_t *, dma_addr_t, uint16_t, uint16_t);
...@@ -149,13 +132,6 @@ qla2x00_get_fw_options(scsi_qla_host_t *, uint16_t *); ...@@ -149,13 +132,6 @@ qla2x00_get_fw_options(scsi_qla_host_t *, uint16_t *);
extern int extern int
qla2x00_set_fw_options(scsi_qla_host_t *, uint16_t *); qla2x00_set_fw_options(scsi_qla_host_t *, uint16_t *);
extern int
qla2x00_read_ram_word(scsi_qla_host_t *, uint16_t, uint16_t *);
extern int
qla2x00_write_ram_word(scsi_qla_host_t *, uint16_t, uint16_t);
extern int
qla2x00_write_ram_word_ext(scsi_qla_host_t *, uint32_t, uint16_t);
extern int extern int
qla2x00_mbx_reg_test(scsi_qla_host_t *); qla2x00_mbx_reg_test(scsi_qla_host_t *);
...@@ -168,9 +144,6 @@ qla2x00_issue_iocb(scsi_qla_host_t *, void *, dma_addr_t, size_t); ...@@ -168,9 +144,6 @@ qla2x00_issue_iocb(scsi_qla_host_t *, void *, dma_addr_t, size_t);
extern int extern int
qla2x00_abort_command(scsi_qla_host_t *, srb_t *); qla2x00_abort_command(scsi_qla_host_t *, srb_t *);
extern int
qla2x00_abort_device(scsi_qla_host_t *, uint16_t, uint16_t);
#if USE_ABORT_TGT #if USE_ABORT_TGT
extern int extern int
qla2x00_abort_target(fc_port_t *fcport); qla2x00_abort_target(fc_port_t *fcport);
...@@ -198,9 +171,6 @@ qla2x00_get_firmware_state(scsi_qla_host_t *, uint16_t *); ...@@ -198,9 +171,6 @@ qla2x00_get_firmware_state(scsi_qla_host_t *, uint16_t *);
extern int extern int
qla2x00_get_port_name(scsi_qla_host_t *, uint16_t, uint8_t *, uint8_t); qla2x00_get_port_name(scsi_qla_host_t *, uint16_t, uint8_t *, uint8_t);
extern uint8_t
qla2x00_get_link_status(scsi_qla_host_t *, uint16_t, link_stat_t *, uint16_t *);
extern int extern int
qla2x00_lip_reset(scsi_qla_host_t *); qla2x00_lip_reset(scsi_qla_host_t *);
...@@ -223,19 +193,6 @@ qla2x00_full_login_lip(scsi_qla_host_t *ha); ...@@ -223,19 +193,6 @@ qla2x00_full_login_lip(scsi_qla_host_t *ha);
extern int extern int
qla2x00_get_id_list(scsi_qla_host_t *, void *, dma_addr_t, uint16_t *); qla2x00_get_id_list(scsi_qla_host_t *, void *, dma_addr_t, uint16_t *);
extern int
qla2x00_lun_reset(scsi_qla_host_t *, uint16_t, uint16_t);
extern int
qla2x00_send_rnid_mbx(scsi_qla_host_t *, uint16_t, uint8_t, dma_addr_t,
size_t, uint16_t *);
extern int
qla2x00_set_rnid_params_mbx(scsi_qla_host_t *, dma_addr_t, size_t, uint16_t *);
extern int
qla2x00_get_rnid_params_mbx(scsi_qla_host_t *, dma_addr_t, size_t, uint16_t *);
extern int extern int
qla2x00_get_resource_cnts(scsi_qla_host_t *, uint16_t *, uint16_t *, uint16_t *, qla2x00_get_resource_cnts(scsi_qla_host_t *, uint16_t *, uint16_t *, uint16_t *,
uint16_t *); uint16_t *);
......
This diff is collapsed.
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
static inline uint16_t qla2x00_get_cmd_direction(struct scsi_cmnd *cmd); static inline uint16_t qla2x00_get_cmd_direction(struct scsi_cmnd *cmd);
static inline cont_entry_t *qla2x00_prep_cont_type0_iocb(scsi_qla_host_t *); static inline cont_entry_t *qla2x00_prep_cont_type0_iocb(scsi_qla_host_t *);
static inline cont_a64_entry_t *qla2x00_prep_cont_type1_iocb(scsi_qla_host_t *); static inline cont_a64_entry_t *qla2x00_prep_cont_type1_iocb(scsi_qla_host_t *);
static request_t *qla2x00_req_pkt(scsi_qla_host_t *ha);
/** /**
* qla2x00_get_cmd_direction() - Determine control_flag data direction. * qla2x00_get_cmd_direction() - Determine control_flag data direction.
...@@ -544,7 +545,7 @@ qla2x00_marker(scsi_qla_host_t *ha, uint16_t loop_id, uint16_t lun, ...@@ -544,7 +545,7 @@ qla2x00_marker(scsi_qla_host_t *ha, uint16_t loop_id, uint16_t lun,
* *
* Returns NULL if function failed, else, a pointer to the request packet. * Returns NULL if function failed, else, a pointer to the request packet.
*/ */
request_t * static request_t *
qla2x00_req_pkt(scsi_qla_host_t *ha) qla2x00_req_pkt(scsi_qla_host_t *ha)
{ {
device_reg_t __iomem *reg = ha->iobase; device_reg_t __iomem *reg = ha->iobase;
...@@ -603,100 +604,6 @@ qla2x00_req_pkt(scsi_qla_host_t *ha) ...@@ -603,100 +604,6 @@ qla2x00_req_pkt(scsi_qla_host_t *ha)
return (pkt); return (pkt);
} }
/**
* qla2x00_ms_req_pkt() - Retrieve a Management Server request packet from
* the request ring.
* @ha: HA context
* @sp: pointer to handle post function call
*
* Note: The caller must hold the hardware lock before calling this routine.
*
* Returns NULL if function failed, else, a pointer to the request packet.
*/
request_t *
qla2x00_ms_req_pkt(scsi_qla_host_t *ha, srb_t *sp)
{
device_reg_t __iomem *reg = ha->iobase;
request_t *pkt = NULL;
uint16_t cnt, i, index;
uint32_t *dword_ptr;
uint32_t timer;
uint8_t found = 0;
uint16_t req_cnt = 1;
/* Wait 1 second for slot. */
for (timer = HZ; timer; timer--) {
if ((req_cnt + 2) >= ha->req_q_cnt) {
/* Calculate number of free request entries. */
cnt = qla2x00_debounce_register(ISP_REQ_Q_OUT(ha, reg));
if (ha->req_ring_index < cnt) {
ha->req_q_cnt = cnt - ha->req_ring_index;
} else {
ha->req_q_cnt = ha->request_q_length -
(ha->req_ring_index - cnt);
}
}
/* Check for room in outstanding command list. */
cnt = ha->current_outstanding_cmd;
for (index = 1; index < MAX_OUTSTANDING_COMMANDS; index++) {
cnt++;
if (cnt == MAX_OUTSTANDING_COMMANDS)
cnt = 1;
if (ha->outstanding_cmds[cnt] == 0) {
found = 1;
ha->current_outstanding_cmd = cnt;
break;
}
}
/* If room for request in request ring. */
if (found && (req_cnt + 2) < ha->req_q_cnt) {
pkt = ha->request_ring_ptr;
/* Zero out packet. */
dword_ptr = (uint32_t *)pkt;
for (i = 0; i < REQUEST_ENTRY_SIZE / 4; i++ )
*dword_ptr++ = 0;
DEBUG5(printk("%s(): putting sp=%p in "
"outstanding_cmds[%x]\n",
__func__,
sp, cnt));
ha->outstanding_cmds[cnt] = sp;
/* save the handle */
sp->cmd->host_scribble = (unsigned char *) (u_long) cnt;
CMD_SP(sp->cmd) = (void *)sp;
ha->req_q_cnt--;
pkt->handle = (uint32_t)cnt;
/* Set system defined field. */
pkt->sys_define = (uint8_t)ha->req_ring_index;
pkt->entry_status = 0;
break;
}
/* Release ring specific lock */
spin_unlock(&ha->hardware_lock);
udelay(20);
/* Check for pending interrupts. */
qla2x00_poll(ha);
spin_lock_irq(&ha->hardware_lock);
}
if (!pkt) {
DEBUG2_3(printk("%s(): **** FAILED ****\n", __func__));
}
return (pkt);
}
/** /**
* qla2x00_isp_cmd() - Modify the request ring pointer. * qla2x00_isp_cmd() - Modify the request ring pointer.
* @ha: HA context * @ha: HA context
......
This diff is collapsed.
...@@ -151,6 +151,8 @@ static void qla2x00_config_dma_addressing(scsi_qla_host_t *ha); ...@@ -151,6 +151,8 @@ static void qla2x00_config_dma_addressing(scsi_qla_host_t *ha);
* SCSI host template entry points * SCSI host template entry points
*/ */
static int qla2xxx_slave_configure(struct scsi_device * device); static int qla2xxx_slave_configure(struct scsi_device * device);
static int qla2x00_queuecommand(struct scsi_cmnd *cmd,
void (*fn)(struct scsi_cmnd *));
static int qla2xxx_eh_abort(struct scsi_cmnd *); static int qla2xxx_eh_abort(struct scsi_cmnd *);
static int qla2xxx_eh_device_reset(struct scsi_cmnd *); static int qla2xxx_eh_device_reset(struct scsi_cmnd *);
static int qla2xxx_eh_bus_reset(struct scsi_cmnd *); static int qla2xxx_eh_bus_reset(struct scsi_cmnd *);
...@@ -396,8 +398,9 @@ static void qla2x00_rst_aen(scsi_qla_host_t *); ...@@ -396,8 +398,9 @@ static void qla2x00_rst_aen(scsi_qla_host_t *);
static uint8_t qla2x00_mem_alloc(scsi_qla_host_t *); static uint8_t qla2x00_mem_alloc(scsi_qla_host_t *);
static void qla2x00_mem_free(scsi_qla_host_t *ha); static void qla2x00_mem_free(scsi_qla_host_t *ha);
int qla2x00_allocate_sp_pool( scsi_qla_host_t *ha); static int qla2x00_allocate_sp_pool( scsi_qla_host_t *ha);
void qla2x00_free_sp_pool(scsi_qla_host_t *ha); static void qla2x00_free_sp_pool(scsi_qla_host_t *ha);
static srb_t *qla2x00_get_new_sp(scsi_qla_host_t *ha);
static ssize_t qla2x00_sysfs_read_fw_dump(struct kobject *, char *, loff_t, static ssize_t qla2x00_sysfs_read_fw_dump(struct kobject *, char *, loff_t,
size_t); size_t);
...@@ -428,13 +431,6 @@ static struct bin_attribute sysfs_nvram_attr = { ...@@ -428,13 +431,6 @@ static struct bin_attribute sysfs_nvram_attr = {
.write = qla2x00_sysfs_write_nvram, .write = qla2x00_sysfs_write_nvram,
}; };
int
qla2x00_set_info(char *buffer, int length, struct Scsi_Host *shost)
{
return (-ENOSYS); /* Currently this is a no-op */
}
/* -------------------------------------------------------------------------- */ /* -------------------------------------------------------------------------- */
...@@ -583,7 +579,7 @@ static ssize_t qla2x00_sysfs_write_nvram(struct kobject *kobj, char *buf, ...@@ -583,7 +579,7 @@ static ssize_t qla2x00_sysfs_write_nvram(struct kobject *kobj, char *buf,
} }
/* -------------------------------------------------------------------------- */ /* -------------------------------------------------------------------------- */
char * static char *
qla2x00_get_pci_info_str(struct scsi_qla_host *ha, char *str) qla2x00_get_pci_info_str(struct scsi_qla_host *ha, char *str)
{ {
static char *pci_bus_modes[] = { static char *pci_bus_modes[] = {
...@@ -663,7 +659,7 @@ qla2x00_get_fw_version_str(struct scsi_qla_host *ha, char *str) ...@@ -663,7 +659,7 @@ qla2x00_get_fw_version_str(struct scsi_qla_host *ha, char *str)
* interrupt handler may call this routine as part of request-completion * interrupt handler may call this routine as part of request-completion
* handling). * handling).
**************************************************************************/ **************************************************************************/
int static int
qla2x00_queuecommand(struct scsi_cmnd *cmd, void (*fn)(struct scsi_cmnd *)) qla2x00_queuecommand(struct scsi_cmnd *cmd, void (*fn)(struct scsi_cmnd *))
{ {
fc_port_t *fcport; fc_port_t *fcport;
...@@ -794,7 +790,6 @@ qla2x00_queuecommand(struct scsi_cmnd *cmd, void (*fn)(struct scsi_cmnd *)) ...@@ -794,7 +790,6 @@ qla2x00_queuecommand(struct scsi_cmnd *cmd, void (*fn)(struct scsi_cmnd *))
} else } else
sp->flags |= SRB_TAPE; sp->flags |= SRB_TAPE;
DEBUG5(printk("scsi(%ld:%2d:%2d): (queuecmd) queue sp = %p, " DEBUG5(printk("scsi(%ld:%2d:%2d): (queuecmd) queue sp = %p, "
"flags=0x%x fo retry=%d, pid=%ld\n", "flags=0x%x fo retry=%d, pid=%ld\n",
ha->host_no, t, l, sp, sp->flags, sp->fo_retry_cnt, ha->host_no, t, l, sp, sp->flags, sp->fo_retry_cnt,
...@@ -956,7 +951,7 @@ qla2x00_eh_wait_on_command(scsi_qla_host_t *ha, struct scsi_cmnd *cmd) ...@@ -956,7 +951,7 @@ qla2x00_eh_wait_on_command(scsi_qla_host_t *ha, struct scsi_cmnd *cmd)
* Success (Adapter is online) : 0 * Success (Adapter is online) : 0
* Failed (Adapter is offline/disabled) : 1 * Failed (Adapter is offline/disabled) : 1
*/ */
int static int
qla2x00_wait_for_hba_online(scsi_qla_host_t *ha) qla2x00_wait_for_hba_online(scsi_qla_host_t *ha)
{ {
int return_status; int return_status;
...@@ -1290,7 +1285,7 @@ qla2xxx_eh_abort(struct scsi_cmnd *cmd) ...@@ -1290,7 +1285,7 @@ qla2xxx_eh_abort(struct scsi_cmnd *cmd)
* *
* Note: * Note:
**************************************************************************/ **************************************************************************/
int static int
qla2x00_eh_wait_for_pending_target_commands(scsi_qla_host_t *ha, unsigned int t) qla2x00_eh_wait_for_pending_target_commands(scsi_qla_host_t *ha, unsigned int t)
{ {
int cnt; int cnt;
...@@ -1502,7 +1497,7 @@ qla2xxx_eh_device_reset(struct scsi_cmnd *cmd) ...@@ -1502,7 +1497,7 @@ qla2xxx_eh_device_reset(struct scsi_cmnd *cmd)
* *
* Note: * Note:
**************************************************************************/ **************************************************************************/
int static int
qla2x00_eh_wait_for_pending_commands(scsi_qla_host_t *ha) qla2x00_eh_wait_for_pending_commands(scsi_qla_host_t *ha)
{ {
int cnt; int cnt;
...@@ -2322,7 +2317,7 @@ qla2x00_proc_info(struct Scsi_Host *shost, char *buffer, ...@@ -2322,7 +2317,7 @@ qla2x00_proc_info(struct Scsi_Host *shost, char *buffer,
"%s: has data been written to the file. \n", "%s: has data been written to the file. \n",
__func__);) __func__);)
return (qla2x00_set_info(buffer, length, shost)); return -ENOSYS;
} }
if (start) { if (start) {
...@@ -2342,8 +2337,6 @@ qla2x00_proc_info(struct Scsi_Host *shost, char *buffer, ...@@ -2342,8 +2337,6 @@ qla2x00_proc_info(struct Scsi_Host *shost, char *buffer,
copy_info(&info, "Driver version %s\n", qla2x00_version_str); copy_info(&info, "Driver version %s\n", qla2x00_version_str);
copy_info(&info, "Entry address = %p\n", qla2x00_set_info);
tmp_sn = ((ha->serial0 & 0x1f) << 16) | (ha->serial2 << 8) | tmp_sn = ((ha->serial0 & 0x1f) << 16) | (ha->serial2 << 8) |
ha->serial1; ha->serial1;
copy_info(&info, "ISP: %s, Serial# %c%05d\n", copy_info(&info, "ISP: %s, Serial# %c%05d\n",
...@@ -3146,7 +3139,7 @@ qla2x00_mem_free(scsi_qla_host_t *ha) ...@@ -3146,7 +3139,7 @@ qla2x00_mem_free(scsi_qla_host_t *ha)
* *
* Note: Sets the ref_count for non Null sp to one. * Note: Sets the ref_count for non Null sp to one.
*/ */
int static int
qla2x00_allocate_sp_pool(scsi_qla_host_t *ha) qla2x00_allocate_sp_pool(scsi_qla_host_t *ha)
{ {
int rval; int rval;
...@@ -3165,7 +3158,7 @@ qla2x00_allocate_sp_pool(scsi_qla_host_t *ha) ...@@ -3165,7 +3158,7 @@ qla2x00_allocate_sp_pool(scsi_qla_host_t *ha)
* This routine frees all adapter allocated memory. * This routine frees all adapter allocated memory.
* *
*/ */
void static void
qla2x00_free_sp_pool( scsi_qla_host_t *ha) qla2x00_free_sp_pool( scsi_qla_host_t *ha)
{ {
if (ha->srb_mempool) { if (ha->srb_mempool) {
...@@ -3626,7 +3619,7 @@ qla2x00_rst_aen(scsi_qla_host_t *ha) ...@@ -3626,7 +3619,7 @@ qla2x00_rst_aen(scsi_qla_host_t *ha)
* output: * output:
* srb_t * or NULL * srb_t * or NULL
*/ */
srb_t * static srb_t *
qla2x00_get_new_sp(scsi_qla_host_t *ha) qla2x00_get_new_sp(scsi_qla_host_t *ha)
{ {
srb_t *sp; srb_t *sp;
...@@ -3980,8 +3973,7 @@ qla2x00_cmd_timeout(srb_t *sp) ...@@ -3980,8 +3973,7 @@ qla2x00_cmd_timeout(srb_t *sp)
if (processed) { if (processed) {
qla2x00_done(dest_ha); qla2x00_done(dest_ha);
return;
return;
} }
spin_lock_irqsave(&dest_ha->list_lock, cpu_flags); spin_lock_irqsave(&dest_ha->list_lock, cpu_flags);
...@@ -4327,105 +4319,6 @@ qla2x00_next(scsi_qla_host_t *vis_ha) ...@@ -4327,105 +4319,6 @@ qla2x00_next(scsi_qla_host_t *vis_ha)
} }
} }
/**************************************************************************
* qla2x00_check_tgt_status
*
* Description:
* Checks to see if the target or loop is down.
*
* Input:
* cmd - pointer to Scsi cmd structure
*
* Returns:
* 1 - if target is present
* 0 - if target is not present
*
**************************************************************************/
int
qla2x00_check_tgt_status(scsi_qla_host_t *ha, struct scsi_cmnd *cmd)
{
os_lun_t *lq;
unsigned int b, t, l;
fc_port_t *fcport;
/* Generate LU queue on bus, target, LUN */
b = cmd->device->channel;
t = cmd->device->id;
l = cmd->device->lun;
if ((lq = GET_LU_Q(ha,t,l)) == NULL) {
return (QLA_FUNCTION_FAILED);
}
fcport = lq->fclun->fcport;
if (TGT_Q(ha, t) == NULL ||
l >= ha->max_luns ||
atomic_read(&fcport->state) == FCS_DEVICE_DEAD ||
atomic_read(&ha->loop_state) == LOOP_DEAD ||
(!atomic_read(&ha->loop_down_timer) &&
atomic_read(&ha->loop_state) == LOOP_DOWN) ||
test_bit(ABORT_ISP_ACTIVE, &ha->dpc_flags) ||
test_bit(ISP_ABORT_NEEDED, &ha->dpc_flags) ||
atomic_read(&ha->loop_state) != LOOP_READY) {
DEBUG(printk(KERN_INFO
"scsi(%ld:%2d:%2d:%2d): %s connection is down\n",
ha->host_no,
b, t, l,
__func__));
cmd->result = DID_NO_CONNECT << 16;
return (QLA_FUNCTION_FAILED);
}
return (QLA_SUCCESS);
}
/**************************************************************************
* qla2x00_check_port_status
*
* Description:
* Checks to see if the port or loop is down.
*
* Input:
* fcport - pointer to fc_port_t structure.
*
* Returns:
* 1 - if port is present
* 0 - if port is not present
*
**************************************************************************/
int
qla2x00_check_port_status(scsi_qla_host_t *ha, fc_port_t *fcport)
{
if (fcport == NULL) {
return (QLA_FUNCTION_FAILED);
}
if (atomic_read(&fcport->state) == FCS_DEVICE_DEAD ||
atomic_read(&ha->loop_state) == LOOP_DEAD) {
return (QLA_FUNCTION_FAILED);
}
if ((atomic_read(&fcport->state) != FCS_ONLINE) ||
(!atomic_read(&ha->loop_down_timer) &&
atomic_read(&ha->loop_state) == LOOP_DOWN) ||
(test_bit(ABORT_ISP_ACTIVE, &ha->dpc_flags)) ||
test_bit(CFG_ACTIVE, &ha->cfg_flags) ||
test_bit(ISP_ABORT_NEEDED, &ha->dpc_flags) ||
atomic_read(&ha->loop_state) != LOOP_READY) {
DEBUG(printk(KERN_INFO
"scsi(%ld): Connection is down. fcport=%p.\n",
ha->host_no, fcport));
return (QLA_BUSY);
}
return (QLA_SUCCESS);
}
/* XXX(hch): crude hack to emulate a down_timeout() */ /* XXX(hch): crude hack to emulate a down_timeout() */
int int
qla2x00_down_timeout(struct semaphore *sema, unsigned long timeout) qla2x00_down_timeout(struct semaphore *sema, unsigned long timeout)
...@@ -4530,9 +4423,7 @@ qla2x00_module_init(void) ...@@ -4530,9 +4423,7 @@ qla2x00_module_init(void)
if (!qla2xxx_transport_template) if (!qla2xxx_transport_template)
return -ENODEV; return -ENODEV;
printk(KERN_INFO printk(KERN_INFO "QLogic Fibre Channel HBA Driver\n");
"QLogic Fibre Channel HBA Driver (%p)\n", qla2x00_set_info);
return 0; return 0;
} }
......
...@@ -87,7 +87,7 @@ static int qla2x00_send_login_iocb_cb(scsi_qla_host_t *, struct io_descriptor *, ...@@ -87,7 +87,7 @@ static int qla2x00_send_login_iocb_cb(scsi_qla_host_t *, struct io_descriptor *,
/** /**
* Mailbox IOCB callback array. * Mailbox IOCB callback array.
**/ **/
int (*iocb_function_cb_list[LAST_IOCB_CB]) static int (*iocb_function_cb_list[LAST_IOCB_CB])
(scsi_qla_host_t *, struct io_descriptor *, struct mbx_entry *) = { (scsi_qla_host_t *, struct io_descriptor *, struct mbx_entry *) = {
qla2x00_send_abort_iocb_cb, qla2x00_send_abort_iocb_cb,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment