Skip to content

Commit

Permalink
[SCSI] remove some dead code in qla2xxx
Browse files Browse the repository at this point in the history
Original from: Christoph Hellwig <hch@lst.de>

Modified and
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
  • Loading branch information
Andrew Vasquez authored and James Bottomley committed May 20, 2005
1 parent b86fff7 commit 354d6b2
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 204 deletions.
3 changes: 1 addition & 2 deletions drivers/scsi/qla2xxx/qla_dbg.c
Original file line number Diff line number Diff line change
Expand Up @@ -1063,8 +1063,7 @@ qla2x00_print_scsi_cmd(struct scsi_cmnd * cmd)
return;

printk(" sp flags=0x%x\n", sp->flags);
printk(" r_start=0x%lx, u_start=0x%lx, f_start=0x%lx, state=%d\n",
sp->r_start, sp->u_start, sp->f_start, sp->state);
printk(" state=%d\n", sp->state);
}

#if defined(QL_DEBUG_ROUTINES)
Expand Down
60 changes: 0 additions & 60 deletions drivers/scsi/qla2xxx/qla_def.h
Original file line number Diff line number Diff line change
Expand Up @@ -252,31 +252,12 @@ typedef struct srb {
/* Request state */
uint16_t state;

/* Timing counts. */
unsigned long e_start; /* Start of extend timeout */
unsigned long r_start; /* Start of request */
unsigned long u_start; /* When sent to RISC */
unsigned long f_start; /* When placed in FO queue*/

/* Single transfer DMA context */
dma_addr_t dma_handle;

uint32_t request_sense_length;
uint8_t *request_sense_ptr;

int ext_history;

/* Suspend delay */
int delay;

/* Raw completion info for use by failover ? */
uint8_t fo_retry_cnt; /* Retry count this request */
uint8_t err_id; /* error id */
#define SRB_ERR_PORT 1 /* Request failed -- "port down" */
#define SRB_ERR_LOOP 2 /* Request failed -- "loop down" */
#define SRB_ERR_DEVICE 3 /* Request failed -- "device error" */
#define SRB_ERR_OTHER 4

/* SRB magic number */
uint16_t magic;
#define SRB_MAGIC 0x10CB
Expand Down Expand Up @@ -2082,23 +2063,8 @@ typedef struct scsi_qla_host {
uint32_t current_outstanding_cmd;
srb_t *status_srb; /* Status continuation entry. */

unsigned long last_irq_cpu; /* cpu where we got our last irq */

uint16_t revision;
uint8_t ports;
u_long actthreads;
u_long ipreq_cnt;
u_long qthreads;

uint32_t total_isr_cnt; /* Interrupt count */
uint32_t total_isp_aborts; /* controller err cnt */
uint32_t total_lip_cnt; /* LIP cnt */
uint32_t total_dev_errs; /* device error cnt */
uint32_t total_ios; /* IO cnt */
uint64_t total_bytes; /* xfr byte cnt */
uint32_t total_mbx_timeout; /* mailbox timeout cnt */
uint32_t total_loop_resync; /* loop resyn cnt */
uint32_t dropped_frame_error_cnt;

/* ISP configuration data. */
uint16_t loop_id; /* Host adapter loop id */
Expand All @@ -2124,8 +2090,6 @@ typedef struct scsi_qla_host {
#define P2P_LOOP 3

uint8_t marker_needed;
uint8_t sns_retry_cnt;
uint8_t mem_err;

uint8_t interrupts_on;

Expand All @@ -2138,16 +2102,11 @@ typedef struct scsi_qla_host {
uint16_t nvram_base;

uint16_t loop_reset_delay;
uint16_t minimum_timeout;
uint8_t retry_count;
uint8_t login_timeout;
uint16_t r_a_tov;
int port_down_retry_count;
uint8_t loop_down_timeout;
uint8_t mbx_count;
uint16_t max_probe_luns;
uint16_t max_luns;
uint16_t max_targets;
uint16_t last_loop_id;

uint32_t login_retry_count;
Expand Down Expand Up @@ -2181,7 +2140,6 @@ typedef struct scsi_qla_host {
uint8_t dpc_active; /* DPC routine is active */

/* Timeout timers. */
uint8_t queue_restart_timer;
uint8_t loop_down_abort_time; /* port down timer */
atomic_t loop_down_timer; /* loop down timer */
uint8_t link_down_timeout; /* link down timeout */
Expand Down Expand Up @@ -2230,18 +2188,6 @@ typedef struct scsi_qla_host {

mbx_cmd_t mc;

uint8_t *cmdline;

uint32_t failover_type;
uint32_t failback_delay;
unsigned long cfg_flags;
#define CFG_ACTIVE 0 /* CFG during a failover, event update, or ioctl */
#define CFG_FAILOVER 1 /* CFG during path change */

uint32_t binding_type;
#define BIND_BY_PORT_NAME 0
#define BIND_BY_PORT_ID 1

/* Basic firmware related information. */
struct qla_board_info *brd_info;
uint16_t fw_major_version;
Expand Down Expand Up @@ -2274,12 +2220,6 @@ typedef struct scsi_qla_host {
uint8_t nvram_version;
uint32_t isp_abort_cnt;

/* Adapter I/O statistics for failover */
uint64_t IosRequested;
uint64_t BytesRequested;
uint64_t IosExecuted;
uint64_t BytesExecuted;

/* Needed for BEACON */
uint16_t beacon_blink_led;
uint16_t beacon_green_on;
Expand Down
14 changes: 0 additions & 14 deletions drivers/scsi/qla2xxx/qla_gbl.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,27 +53,13 @@ extern void qla2x00_reg_remote_port(scsi_qla_host_t *, fc_port_t *);
*/
extern char qla2x00_version_str[];

extern int num_hosts;
extern int apiHBAInstance;

extern struct _qla2x00stats qla2x00_stats;
extern int ql2xretrycount;
extern int ql2xlogintimeout;
extern int qlport_down_retry;
extern int ql2xmaxqdepth;
extern int displayConfig;
extern int ql2xplogiabsentdevice;
extern int ql2xenablezio;
extern int ql2xintrdelaytimer;
extern int ql2xloginretrycount;

extern int ConfigRequired;

extern int Bind;
extern int ql2xsuspendcount;
#if defined(MODULE)
extern char *ql2xopts;
#endif
extern void qla2x00_sp_compl(scsi_qla_host_t *, srb_t *);

extern char *qla2x00_get_fw_version_str(struct scsi_qla_host *, char *);
Expand Down
33 changes: 1 addition & 32 deletions drivers/scsi/qla2xxx/qla_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,7 @@ qla2x00_initialize_adapter(scsi_qla_host_t *ha)
atomic_set(&ha->loop_down_timer, LOOP_DOWN_TIME);
atomic_set(&ha->loop_state, LOOP_DOWN);
ha->device_flags = 0;
ha->sns_retry_cnt = 0;
ha->dpc_flags = 0;
ha->failback_delay = 0;
ha->flags.management_server_logged_in = 0;
ha->marker_needed = 0;
ha->mbx_flags = 0;
Expand Down Expand Up @@ -171,8 +169,6 @@ qla2x00_initialize_adapter(scsi_qla_host_t *ha)

if (wait_time == 0)
rval = QLA_FUNCTION_FAILED;
if (ha->mem_err)
restart_risc = 1;
} else if (ha->device_flags & DFLG_NO_CABLE)
/* If no cable, then all is good. */
rval = QLA_SUCCESS;
Expand Down Expand Up @@ -1410,13 +1406,8 @@ qla2x00_nvram_config(scsi_qla_host_t *ha)
/* Set minimum RATOV to 200 tenths of a second. */
ha->r_a_tov = 200;

ha->minimum_timeout =
(ha->login_timeout * ha->retry_count) + nv->port_down_retry_count;
ha->loop_reset_delay = nv->reset_delay;

/* Will get the value from NVRAM. */
ha->loop_down_timeout = LOOP_DOWN_TIMEOUT;

/* Link Down Timeout = 0:
*
* When Port Down timer expires we will start returning
Expand All @@ -1429,18 +1420,13 @@ qla2x00_nvram_config(scsi_qla_host_t *ha)
*/
if (nv->link_down_timeout == 0) {
ha->loop_down_abort_time =
(LOOP_DOWN_TIME - ha->loop_down_timeout);
(LOOP_DOWN_TIME - LOOP_DOWN_TIMEOUT);
} else {
ha->link_down_timeout = nv->link_down_timeout;
ha->loop_down_abort_time =
(LOOP_DOWN_TIME - ha->link_down_timeout);
}

ha->max_luns = MAX_LUNS;
ha->max_probe_luns = le16_to_cpu(nv->max_luns_per_target);
if (ha->max_probe_luns == 0)
ha->max_probe_luns = MIN_LUNS;

/*
* Need enough time to try and get the port back.
*/
Expand All @@ -1457,16 +1443,6 @@ qla2x00_nvram_config(scsi_qla_host_t *ha)
if (ql2xloginretrycount)
ha->login_retry_count = ql2xloginretrycount;

ha->binding_type = Bind;
if (ha->binding_type != BIND_BY_PORT_NAME &&
ha->binding_type != BIND_BY_PORT_ID) {
qla_printk(KERN_WARNING, ha,
"Invalid binding type specified (%d), "
"defaulting to BIND_BY_PORT_NAME!!!\n", ha->binding_type);

ha->binding_type = BIND_BY_PORT_NAME;
}

icb->lun_enables = __constant_cpu_to_le16(0);
icb->command_resource_count = 0;
icb->immediate_notify_resource_count = 0;
Expand Down Expand Up @@ -1578,7 +1554,6 @@ qla2x00_configure_loop(scsi_qla_host_t *ha)
*/
clear_bit(LOCAL_LOOP_UPDATE, &ha->dpc_flags);
clear_bit(RSCN_UPDATE, &ha->dpc_flags);
ha->mem_err = 0 ;

/* Determine what we need to do */
if (ha->current_topology == ISP_CFG_FL &&
Expand Down Expand Up @@ -2707,7 +2682,6 @@ qla2x00_loop_resync(scsi_qla_host_t *ha)
rval = QLA_SUCCESS;

atomic_set(&ha->loop_state, LOOP_UPDATE);
qla2x00_stats.loop_resync++;
clear_bit(ISP_ABORT_RETRY, &ha->dpc_flags);
if (ha->flags.online) {
if (!(rval = qla2x00_fw_ready(ha))) {
Expand Down Expand Up @@ -2786,9 +2760,6 @@ qla2x00_abort_isp(scsi_qla_host_t *ha)
if (ha->flags.online) {
ha->flags.online = 0;
clear_bit(ISP_ABORT_NEEDED, &ha->dpc_flags);
qla2x00_stats.ispAbort++;
ha->total_isp_aborts++; /* used by ioctl */
ha->sns_retry_cnt = 0;

qla_printk(KERN_INFO, ha,
"Performing ISP error recovery - ha= %p.\n", ha);
Expand All @@ -2810,8 +2781,6 @@ qla2x00_abort_isp(scsi_qla_host_t *ha)
sp = ha->outstanding_cmds[cnt];
if (sp) {
ha->outstanding_cmds[cnt] = NULL;
if (ha->actthreads)
ha->actthreads--;
sp->flags = 0;
sp->cmd->result = DID_RESET << 16;
sp->cmd->host_scribble = (unsigned char *)NULL;
Expand Down
3 changes: 0 additions & 3 deletions drivers/scsi/qla2xxx/qla_iocb.c
Original file line number Diff line number Diff line change
Expand Up @@ -433,11 +433,8 @@ qla2x00_start_scsi(srb_t *sp)
} else
ha->request_ring_ptr++;

ha->actthreads++;
ha->total_ios++;
sp->flags |= SRB_DMA_VALID;
sp->state = SRB_ACTIVE_STATE;
sp->u_start = jiffies;

/* Set chip new ring index. */
WRT_REG_WORD(ISP_REQ_Q_IN(ha, reg), ha->req_ring_index);
Expand Down
18 changes: 1 addition & 17 deletions drivers/scsi/qla2xxx/qla_isr.c
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,6 @@ qla2100_intr_handler(int irq, void *dev_id, struct pt_regs *regs)
}
spin_unlock_irqrestore(&ha->hardware_lock, flags);

ha->last_irq_cpu = _smp_processor_id();
ha->total_isr_cnt++;

if (test_bit(MBX_INTR_WAIT, &ha->mbx_cmd_flags) &&
(status & MBX_INTERRUPT) && ha->flags.mbox_int) {
spin_lock_irqsave(&ha->mbx_reg_lock, flags);
Expand Down Expand Up @@ -200,9 +197,6 @@ qla2300_intr_handler(int irq, void *dev_id, struct pt_regs *regs)
}
spin_unlock_irqrestore(&ha->hardware_lock, flags);

ha->last_irq_cpu = _smp_processor_id();
ha->total_isr_cnt++;

if (test_bit(MBX_INTR_WAIT, &ha->mbx_cmd_flags) &&
(status & MBX_INTERRUPT) && ha->flags.mbox_int) {
spin_lock_irqsave(&ha->mbx_reg_lock, flags);
Expand Down Expand Up @@ -417,7 +411,6 @@ qla2x00_async_event(scsi_qla_host_t *ha, uint32_t mbx)
/* Update AEN queue. */
qla2x00_enqueue_aen(ha, MBA_LIP_OCCURRED, NULL);

ha->total_lip_cnt++;
break;

case MBA_LOOP_UP: /* Loop Up Event */
Expand Down Expand Up @@ -485,7 +478,6 @@ qla2x00_async_event(scsi_qla_host_t *ha, uint32_t mbx)
/* Update AEN queue. */
qla2x00_enqueue_aen(ha, MBA_LIP_RESET, NULL);

ha->total_lip_cnt++;
break;

case MBA_POINT_TO_POINT: /* Point-to-Point */
Expand Down Expand Up @@ -695,14 +687,11 @@ qla2x00_process_completed_request(struct scsi_qla_host *ha, uint32_t index)
/* Free outstanding command slot. */
ha->outstanding_cmds[index] = NULL;

if (ha->actthreads)
ha->actthreads--;
CMD_COMPL_STATUS(sp->cmd) = 0L;
CMD_SCSI_STATUS(sp->cmd) = 0L;

/* Save ISP completion status */
sp->cmd->result = DID_OK << 16;
sp->fo_retry_cnt = 0;
qla2x00_sp_compl(ha, sp);
} else {
DEBUG2(printk("scsi(%ld): Invalid ISP SCSI completion handle\n",
Expand Down Expand Up @@ -865,9 +854,6 @@ qla2x00_status_entry(scsi_qla_host_t *ha, sts_entry_t *pkt)
return;
}

if (ha->actthreads)
ha->actthreads--;

comp_status = le16_to_cpu(pkt->comp_status);
/* Mask of reserved bits 12-15, before we examine the scsi status */
scsi_status = le16_to_cpu(pkt->scsi_status) & SS_MASK;
Expand Down Expand Up @@ -1026,7 +1012,6 @@ qla2x00_status_entry(scsi_qla_host_t *ha, sts_entry_t *pkt)
cp->request_bufflen));

cp->result = DID_BUS_BUSY << 16;
ha->dropped_frame_error_cnt++;
break;
}

Expand Down Expand Up @@ -1233,8 +1218,7 @@ qla2x00_error_entry(scsi_qla_host_t *ha, sts_entry_t *pkt)
if (sp) {
/* Free outstanding command slot. */
ha->outstanding_cmds[pkt->handle] = NULL;
if (ha->actthreads)
ha->actthreads--;

/* Bad payload or header */
if (pkt->entry_status &
(RF_INV_E_ORDER | RF_INV_E_COUNT |
Expand Down
6 changes: 1 addition & 5 deletions drivers/scsi/qla2xxx/qla_mbx.c
Original file line number Diff line number Diff line change
Expand Up @@ -219,10 +219,8 @@ qla2x00_mailbox_command(scsi_qla_host_t *ha, mbx_cmd_t *mcp)
ha->flags.mbox_int = 0;
clear_bit(MBX_INTERRUPT, &ha->mbx_cmd_flags);

if (ha->mailbox_out[0] != MBS_COMMAND_COMPLETE) {
qla2x00_stats.mboxerr++;
if (ha->mailbox_out[0] != MBS_COMMAND_COMPLETE)
rval = QLA_FUNCTION_FAILED;
}

/* Load return mailbox registers. */
iptr2 = mcp->mb;
Expand All @@ -249,8 +247,6 @@ qla2x00_mailbox_command(scsi_qla_host_t *ha, mbx_cmd_t *mcp)
qla2x00_dump_regs(ha);
#endif

qla2x00_stats.mboxtout++;
ha->total_mbx_timeout++;
rval = QLA_FUNCTION_TIMEOUT;
}

Expand Down
Loading

0 comments on commit 354d6b2

Please sign in to comment.