Code scrubbing.
- Remove trailing whitespace from driver files.
- Remove unused #defines and inlines.
- Standardize on C comments (// -> /* */)
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
fw->hccr = RD_REG_WORD(®->hccr);
/* Pause RISC. */
- WRT_REG_WORD(®->hccr, HCCR_PAUSE_RISC);
+ WRT_REG_WORD(®->hccr, HCCR_PAUSE_RISC);
if (IS_QLA2300(ha)) {
for (cnt = 30000;
(RD_REG_WORD(®->hccr) & HCCR_RISC_PAUSE) == 0 &&
if (rval == QLA_SUCCESS) {
dmp_reg = (uint16_t __iomem *)(reg + 0);
- for (cnt = 0; cnt < sizeof(fw->pbiu_reg) / 2; cnt++)
+ for (cnt = 0; cnt < sizeof(fw->pbiu_reg) / 2; cnt++)
fw->pbiu_reg[cnt] = RD_REG_WORD(dmp_reg++);
dmp_reg = (uint16_t __iomem *)((uint8_t __iomem *)reg + 0x10);
- for (cnt = 0; cnt < sizeof(fw->risc_host_reg) / 2; cnt++)
+ for (cnt = 0; cnt < sizeof(fw->risc_host_reg) / 2; cnt++)
fw->risc_host_reg[cnt] = RD_REG_WORD(dmp_reg++);
dmp_reg = (uint16_t __iomem *)((uint8_t __iomem *)reg + 0x40);
- for (cnt = 0; cnt < sizeof(fw->mailbox_reg) / 2; cnt++)
+ for (cnt = 0; cnt < sizeof(fw->mailbox_reg) / 2; cnt++)
fw->mailbox_reg[cnt] = RD_REG_WORD(dmp_reg++);
WRT_REG_WORD(®->ctrl_status, 0x40);
dmp_reg = (uint16_t __iomem *)((uint8_t __iomem *)reg + 0x80);
- for (cnt = 0; cnt < sizeof(fw->resp_dma_reg) / 2; cnt++)
+ for (cnt = 0; cnt < sizeof(fw->resp_dma_reg) / 2; cnt++)
fw->resp_dma_reg[cnt] = RD_REG_WORD(dmp_reg++);
WRT_REG_WORD(®->ctrl_status, 0x50);
dmp_reg = (uint16_t __iomem *)((uint8_t __iomem *)reg + 0x80);
- for (cnt = 0; cnt < sizeof(fw->dma_reg) / 2; cnt++)
+ for (cnt = 0; cnt < sizeof(fw->dma_reg) / 2; cnt++)
fw->dma_reg[cnt] = RD_REG_WORD(dmp_reg++);
WRT_REG_WORD(®->ctrl_status, 0x00);
dmp_reg = (uint16_t __iomem *)((uint8_t __iomem *)reg + 0xA0);
- for (cnt = 0; cnt < sizeof(fw->risc_hdw_reg) / 2; cnt++)
+ for (cnt = 0; cnt < sizeof(fw->risc_hdw_reg) / 2; cnt++)
fw->risc_hdw_reg[cnt] = RD_REG_WORD(dmp_reg++);
- WRT_REG_WORD(®->pcr, 0x2000);
+ WRT_REG_WORD(®->pcr, 0x2000);
dmp_reg = (uint16_t __iomem *)((uint8_t __iomem *)reg + 0x80);
- for (cnt = 0; cnt < sizeof(fw->risc_gp0_reg) / 2; cnt++)
+ for (cnt = 0; cnt < sizeof(fw->risc_gp0_reg) / 2; cnt++)
fw->risc_gp0_reg[cnt] = RD_REG_WORD(dmp_reg++);
- WRT_REG_WORD(®->pcr, 0x2200);
+ WRT_REG_WORD(®->pcr, 0x2200);
dmp_reg = (uint16_t __iomem *)((uint8_t __iomem *)reg + 0x80);
- for (cnt = 0; cnt < sizeof(fw->risc_gp1_reg) / 2; cnt++)
+ for (cnt = 0; cnt < sizeof(fw->risc_gp1_reg) / 2; cnt++)
fw->risc_gp1_reg[cnt] = RD_REG_WORD(dmp_reg++);
- WRT_REG_WORD(®->pcr, 0x2400);
+ WRT_REG_WORD(®->pcr, 0x2400);
dmp_reg = (uint16_t __iomem *)((uint8_t __iomem *)reg + 0x80);
- for (cnt = 0; cnt < sizeof(fw->risc_gp2_reg) / 2; cnt++)
+ for (cnt = 0; cnt < sizeof(fw->risc_gp2_reg) / 2; cnt++)
fw->risc_gp2_reg[cnt] = RD_REG_WORD(dmp_reg++);
- WRT_REG_WORD(®->pcr, 0x2600);
+ WRT_REG_WORD(®->pcr, 0x2600);
dmp_reg = (uint16_t __iomem *)((uint8_t __iomem *)reg + 0x80);
- for (cnt = 0; cnt < sizeof(fw->risc_gp3_reg) / 2; cnt++)
+ for (cnt = 0; cnt < sizeof(fw->risc_gp3_reg) / 2; cnt++)
fw->risc_gp3_reg[cnt] = RD_REG_WORD(dmp_reg++);
- WRT_REG_WORD(®->pcr, 0x2800);
+ WRT_REG_WORD(®->pcr, 0x2800);
dmp_reg = (uint16_t __iomem *)((uint8_t __iomem *)reg + 0x80);
- for (cnt = 0; cnt < sizeof(fw->risc_gp4_reg) / 2; cnt++)
+ for (cnt = 0; cnt < sizeof(fw->risc_gp4_reg) / 2; cnt++)
fw->risc_gp4_reg[cnt] = RD_REG_WORD(dmp_reg++);
- WRT_REG_WORD(®->pcr, 0x2A00);
+ WRT_REG_WORD(®->pcr, 0x2A00);
dmp_reg = (uint16_t __iomem *)((uint8_t __iomem *)reg + 0x80);
- for (cnt = 0; cnt < sizeof(fw->risc_gp5_reg) / 2; cnt++)
+ for (cnt = 0; cnt < sizeof(fw->risc_gp5_reg) / 2; cnt++)
fw->risc_gp5_reg[cnt] = RD_REG_WORD(dmp_reg++);
- WRT_REG_WORD(®->pcr, 0x2C00);
+ WRT_REG_WORD(®->pcr, 0x2C00);
dmp_reg = (uint16_t __iomem *)((uint8_t __iomem *)reg + 0x80);
- for (cnt = 0; cnt < sizeof(fw->risc_gp6_reg) / 2; cnt++)
+ for (cnt = 0; cnt < sizeof(fw->risc_gp6_reg) / 2; cnt++)
fw->risc_gp6_reg[cnt] = RD_REG_WORD(dmp_reg++);
- WRT_REG_WORD(®->pcr, 0x2E00);
+ WRT_REG_WORD(®->pcr, 0x2E00);
dmp_reg = (uint16_t __iomem *)((uint8_t __iomem *)reg + 0x80);
- for (cnt = 0; cnt < sizeof(fw->risc_gp7_reg) / 2; cnt++)
+ for (cnt = 0; cnt < sizeof(fw->risc_gp7_reg) / 2; cnt++)
fw->risc_gp7_reg[cnt] = RD_REG_WORD(dmp_reg++);
- WRT_REG_WORD(®->ctrl_status, 0x10);
+ WRT_REG_WORD(®->ctrl_status, 0x10);
dmp_reg = (uint16_t __iomem *)((uint8_t __iomem *)reg + 0x80);
- for (cnt = 0; cnt < sizeof(fw->frame_buf_hdw_reg) / 2; cnt++)
+ for (cnt = 0; cnt < sizeof(fw->frame_buf_hdw_reg) / 2; cnt++)
fw->frame_buf_hdw_reg[cnt] = RD_REG_WORD(dmp_reg++);
- WRT_REG_WORD(®->ctrl_status, 0x20);
+ WRT_REG_WORD(®->ctrl_status, 0x20);
dmp_reg = (uint16_t __iomem *)((uint8_t __iomem *)reg + 0x80);
- for (cnt = 0; cnt < sizeof(fw->fpm_b0_reg) / 2; cnt++)
+ for (cnt = 0; cnt < sizeof(fw->fpm_b0_reg) / 2; cnt++)
fw->fpm_b0_reg[cnt] = RD_REG_WORD(dmp_reg++);
- WRT_REG_WORD(®->ctrl_status, 0x30);
+ WRT_REG_WORD(®->ctrl_status, 0x30);
dmp_reg = (uint16_t __iomem *)((uint8_t __iomem *)reg + 0x80);
- for (cnt = 0; cnt < sizeof(fw->fpm_b1_reg) / 2; cnt++)
+ for (cnt = 0; cnt < sizeof(fw->fpm_b1_reg) / 2; cnt++)
fw->fpm_b1_reg[cnt] = RD_REG_WORD(dmp_reg++);
/* Reset RISC. */
fw->hccr = RD_REG_WORD(®->hccr);
/* Pause RISC. */
- WRT_REG_WORD(®->hccr, HCCR_PAUSE_RISC);
+ WRT_REG_WORD(®->hccr, HCCR_PAUSE_RISC);
for (cnt = 30000; (RD_REG_WORD(®->hccr) & HCCR_RISC_PAUSE) == 0 &&
rval == QLA_SUCCESS; cnt--) {
if (cnt)
}
if (rval == QLA_SUCCESS) {
dmp_reg = (uint16_t __iomem *)(reg + 0);
- for (cnt = 0; cnt < sizeof(fw->pbiu_reg) / 2; cnt++)
+ for (cnt = 0; cnt < sizeof(fw->pbiu_reg) / 2; cnt++)
fw->pbiu_reg[cnt] = RD_REG_WORD(dmp_reg++);
dmp_reg = (uint16_t __iomem *)((uint8_t __iomem *)reg + 0x10);
}
dmp_reg = (uint16_t __iomem *)((uint8_t __iomem *)reg + 0x20);
- for (cnt = 0; cnt < sizeof(fw->dma_reg) / 2; cnt++)
+ for (cnt = 0; cnt < sizeof(fw->dma_reg) / 2; cnt++)
fw->dma_reg[cnt] = RD_REG_WORD(dmp_reg++);
WRT_REG_WORD(®->ctrl_status, 0x00);
dmp_reg = (uint16_t __iomem *)((uint8_t __iomem *)reg + 0xA0);
- for (cnt = 0; cnt < sizeof(fw->risc_hdw_reg) / 2; cnt++)
+ for (cnt = 0; cnt < sizeof(fw->risc_hdw_reg) / 2; cnt++)
fw->risc_hdw_reg[cnt] = RD_REG_WORD(dmp_reg++);
- WRT_REG_WORD(®->pcr, 0x2000);
+ WRT_REG_WORD(®->pcr, 0x2000);
dmp_reg = (uint16_t __iomem *)((uint8_t __iomem *)reg + 0x80);
- for (cnt = 0; cnt < sizeof(fw->risc_gp0_reg) / 2; cnt++)
+ for (cnt = 0; cnt < sizeof(fw->risc_gp0_reg) / 2; cnt++)
fw->risc_gp0_reg[cnt] = RD_REG_WORD(dmp_reg++);
- WRT_REG_WORD(®->pcr, 0x2100);
+ WRT_REG_WORD(®->pcr, 0x2100);
dmp_reg = (uint16_t __iomem *)((uint8_t __iomem *)reg + 0x80);
- for (cnt = 0; cnt < sizeof(fw->risc_gp1_reg) / 2; cnt++)
+ for (cnt = 0; cnt < sizeof(fw->risc_gp1_reg) / 2; cnt++)
fw->risc_gp1_reg[cnt] = RD_REG_WORD(dmp_reg++);
- WRT_REG_WORD(®->pcr, 0x2200);
+ WRT_REG_WORD(®->pcr, 0x2200);
dmp_reg = (uint16_t __iomem *)((uint8_t __iomem *)reg + 0x80);
- for (cnt = 0; cnt < sizeof(fw->risc_gp2_reg) / 2; cnt++)
+ for (cnt = 0; cnt < sizeof(fw->risc_gp2_reg) / 2; cnt++)
fw->risc_gp2_reg[cnt] = RD_REG_WORD(dmp_reg++);
- WRT_REG_WORD(®->pcr, 0x2300);
+ WRT_REG_WORD(®->pcr, 0x2300);
dmp_reg = (uint16_t __iomem *)((uint8_t __iomem *)reg + 0x80);
- for (cnt = 0; cnt < sizeof(fw->risc_gp3_reg) / 2; cnt++)
+ for (cnt = 0; cnt < sizeof(fw->risc_gp3_reg) / 2; cnt++)
fw->risc_gp3_reg[cnt] = RD_REG_WORD(dmp_reg++);
- WRT_REG_WORD(®->pcr, 0x2400);
+ WRT_REG_WORD(®->pcr, 0x2400);
dmp_reg = (uint16_t __iomem *)((uint8_t __iomem *)reg + 0x80);
- for (cnt = 0; cnt < sizeof(fw->risc_gp4_reg) / 2; cnt++)
+ for (cnt = 0; cnt < sizeof(fw->risc_gp4_reg) / 2; cnt++)
fw->risc_gp4_reg[cnt] = RD_REG_WORD(dmp_reg++);
- WRT_REG_WORD(®->pcr, 0x2500);
+ WRT_REG_WORD(®->pcr, 0x2500);
dmp_reg = (uint16_t __iomem *)((uint8_t __iomem *)reg + 0x80);
- for (cnt = 0; cnt < sizeof(fw->risc_gp5_reg) / 2; cnt++)
+ for (cnt = 0; cnt < sizeof(fw->risc_gp5_reg) / 2; cnt++)
fw->risc_gp5_reg[cnt] = RD_REG_WORD(dmp_reg++);
- WRT_REG_WORD(®->pcr, 0x2600);
+ WRT_REG_WORD(®->pcr, 0x2600);
dmp_reg = (uint16_t __iomem *)((uint8_t __iomem *)reg + 0x80);
- for (cnt = 0; cnt < sizeof(fw->risc_gp6_reg) / 2; cnt++)
+ for (cnt = 0; cnt < sizeof(fw->risc_gp6_reg) / 2; cnt++)
fw->risc_gp6_reg[cnt] = RD_REG_WORD(dmp_reg++);
- WRT_REG_WORD(®->pcr, 0x2700);
+ WRT_REG_WORD(®->pcr, 0x2700);
dmp_reg = (uint16_t __iomem *)((uint8_t __iomem *)reg + 0x80);
- for (cnt = 0; cnt < sizeof(fw->risc_gp7_reg) / 2; cnt++)
+ for (cnt = 0; cnt < sizeof(fw->risc_gp7_reg) / 2; cnt++)
fw->risc_gp7_reg[cnt] = RD_REG_WORD(dmp_reg++);
- WRT_REG_WORD(®->ctrl_status, 0x10);
+ WRT_REG_WORD(®->ctrl_status, 0x10);
dmp_reg = (uint16_t __iomem *)((uint8_t __iomem *)reg + 0x80);
- for (cnt = 0; cnt < sizeof(fw->frame_buf_hdw_reg) / 2; cnt++)
+ for (cnt = 0; cnt < sizeof(fw->frame_buf_hdw_reg) / 2; cnt++)
fw->frame_buf_hdw_reg[cnt] = RD_REG_WORD(dmp_reg++);
- WRT_REG_WORD(®->ctrl_status, 0x20);
+ WRT_REG_WORD(®->ctrl_status, 0x20);
dmp_reg = (uint16_t __iomem *)((uint8_t __iomem *)reg + 0x80);
- for (cnt = 0; cnt < sizeof(fw->fpm_b0_reg) / 2; cnt++)
+ for (cnt = 0; cnt < sizeof(fw->fpm_b0_reg) / 2; cnt++)
fw->fpm_b0_reg[cnt] = RD_REG_WORD(dmp_reg++);
- WRT_REG_WORD(®->ctrl_status, 0x30);
+ WRT_REG_WORD(®->ctrl_status, 0x30);
dmp_reg = (uint16_t __iomem *)((uint8_t __iomem *)reg + 0x80);
- for (cnt = 0; cnt < sizeof(fw->fpm_b1_reg) / 2; cnt++)
+ for (cnt = 0; cnt < sizeof(fw->fpm_b1_reg) / 2; cnt++)
fw->fpm_b1_reg[cnt] = RD_REG_WORD(dmp_reg++);
/* Reset the ISP. */
if (rval == QLA_SUCCESS && (IS_QLA2200(ha) || (IS_QLA2100(ha) &&
(RD_REG_WORD(®->mctr) & (BIT_1 | BIT_0)) != 0))) {
- WRT_REG_WORD(®->hccr, HCCR_PAUSE_RISC);
+ WRT_REG_WORD(®->hccr, HCCR_PAUSE_RISC);
for (cnt = 30000;
(RD_REG_WORD(®->hccr) & HCCR_RISC_PAUSE) == 0 &&
rval == QLA_SUCCESS; cnt--) {
int iter, len;
char buf[128];
va_list args;
-
+
va_start(args, fmt);
len = vsprintf(buf, fmt, args);
va_end(args);
/* Driver Debug Functions. */
/****************************************************************************/
-void
-qla2x00_dump_regs(scsi_qla_host_t *ha)
+void
+qla2x00_dump_regs(scsi_qla_host_t *ha)
{
struct device_reg_2xxx __iomem *reg = &ha->iobase->isp;
void
-qla2x00_dump_buffer(uint8_t * b, uint32_t size)
+qla2x00_dump_buffer(uint8_t * b, uint32_t size)
{
uint32_t cnt;
uint8_t c;
/**************************************************************************
* qla2x00_print_scsi_cmd
* Dumps out info about the scsi cmd and srb.
- * Input
+ * Input
* cmd : struct scsi_cmnd
**************************************************************************/
void
-qla2x00_print_scsi_cmd(struct scsi_cmnd * cmd)
+qla2x00_print_scsi_cmd(struct scsi_cmnd * cmd)
{
int i;
struct scsi_qla_host *ha;
cmd->request_buffer, cmd->request_bufflen);
printk(" tag=%d, transfersize=0x%x\n",
cmd->tag, cmd->transfersize);
- printk(" serial_number=%lx, SP=%p\n", cmd->serial_number, sp);
+ printk(" serial_number=%lx, SP=%p\n", cmd->serial_number, sp);
printk(" data direction=%d\n", cmd->sc_data_direction);
if (!sp)
* count = number of words.
*/
void
-qla2x00_formatted_dump_buffer(char *string, uint8_t * buffer,
- uint8_t wd_size, uint32_t count)
+qla2x00_formatted_dump_buffer(char *string, uint8_t * buffer,
+ uint8_t wd_size, uint32_t count)
{
uint32_t cnt;
uint16_t *buf16;
#include "qla_settings.h"
-/*
+/*
* Data bit definitions
*/
#define BIT_0 0x1
#define MAX_TARGETS MAX_FIBRE_DEVICES
#define MIN_LUNS 8
#define MAX_LUNS MAX_FIBRE_LUNS
-#define MAX_CMDS_PER_LUN 255
-
+#define MAX_CMDS_PER_LUN 255
+
/*
* Fibre Channel device definitions.
*/
#define RESPONSE_ENTRY_CNT_2300 512 /* Number of response entries.*/
/*
- * SCSI Request Block
+ * SCSI Request Block
*/
typedef struct srb {
struct list_head list;
struct scsi_cmnd *cmd; /* Linux SCSI command pkt */
struct timer_list timer; /* Command timer */
- atomic_t ref_count; /* Reference count for this structure */
+ atomic_t ref_count; /* Reference count for this structure */
uint16_t flags;
/* Request state */
uint16_t flash_data; /* Flash BIOS data */
uint16_t unused_1[1]; /* Gap */
uint16_t ctrl_status; /* Control/Status */
-#define CSR_FLASH_64K_BANK BIT_3 /* Flash upper 64K bank select */
+#define CSR_FLASH_64K_BANK BIT_3 /* Flash upper 64K bank select */
#define CSR_FLASH_ENABLE BIT_1 /* Flash BIOS Read/Write enable */
#define CSR_ISP_SOFT_RESET BIT_0 /* ISP soft reset */
uint16_t rsp_q_out; /* Out-Pointer */
/* RISC to Host Status */
- uint32_t host_status;
+ uint32_t host_status;
#define HSR_RISC_INT BIT_15 /* RISC interrupt */
#define HSR_RISC_PAUSED BIT_8 /* RISC Paused */
/* Host to Host Semaphore */
- uint16_t host_semaphore;
+ uint16_t host_semaphore;
uint16_t unused_3[17]; /* Gap */
uint16_t mailbox0;
uint16_t mailbox1;
* LSB BIT 5 = Rx Sensitivity 1G bit 1
* LSB BIT 6 = Rx Sensitivity 1G bit 2
* LSB BIT 7 = Rx Sensitivity 1G bit 3
- *
+ *
* MSB BIT 0 = Tx Sensitivity 2G bit 0
* MSB BIT 1 = Tx Sensitivity 2G bit 1
* MSB BIT 2 = Tx Sensitivity 2G bit 2
* LSB BIT 5 = Output Swing 2G bit 0
* LSB BIT 6 = Output Swing 2G bit 1
* LSB BIT 7 = Output Swing 2G bit 2
- *
+ *
* MSB BIT 0 = Output Emphasis 2G bit 0
* MSB BIT 1 = Output Emphasis 2G bit 1
* MSB BIT 2 = Output Enable
struct gid_list_info {
uint8_t al_pa;
uint8_t area;
- uint8_t domain;
+ uint8_t domain;
uint8_t loop_id_2100; /* ISP2100/ISP2200 -- 4 bytes. */
uint16_t loop_id; /* ISP23XX -- 6 bytes. */
uint16_t reserved_1; /* ISP24XX -- 8 bytes. */
#define ISP_ABORT_RETRY 20 /* ISP aborted. */
#define FCPORT_RESCAN_NEEDED 21 /* IO descriptor processing needed */
#define IODESC_PROCESS_NEEDED 22 /* IO descriptor processing needed */
-#define IOCTL_ERROR_RECOVERY 23
+#define IOCTL_ERROR_RECOVERY 23
#define LOOP_RESET_NEEDED 24
#define BEACON_BLINK_NEEDED 25
#define SRB_MIN_REQ 128
mempool_t *srb_mempool;
- /* This spinlock is used to protect "io transactions", you must
+ /* This spinlock is used to protect "io transactions", you must
* aquire it before doing any IO to the card, eg with RD_REG*() and
* WRT_REG*() for the duration of your entire commandtransaction.
*
response_t *response_ring_ptr; /* Current address. */
uint16_t rsp_ring_index; /* Current index. */
uint16_t response_q_length;
-
+
struct isp_operations isp_ops;
/* Outstandings ISP commands. */
srb_t *outstanding_cmds[MAX_OUTSTANDING_COMMANDS];
- uint32_t current_outstanding_cmd;
+ uint32_t current_outstanding_cmd;
srb_t *status_srb; /* Status continuation entry. */
uint16_t revision;
#define LOOP_P2P 2
#define P2P_LOOP 3
- uint8_t marker_needed;
+ uint8_t marker_needed;
uint8_t interrupts_on;
uint8_t mbx_count;
uint16_t last_loop_id;
- uint32_t login_retry_count;
+ uint32_t login_retry_count;
/* Fibre Channel Device List. */
struct list_head fcports;
dma_addr_t rlc_rsp_dma;
rpt_lun_cmd_rsp_t *rlc_rsp;
- /* Small DMA pool allocations -- maximum 256 bytes in length. */
+ /* Small DMA pool allocations -- maximum 256 bytes in length. */
#define DMA_POOL_SIZE 256
struct dma_pool *s_dma_pool;
uint32_t mbx_flags;
#define MBX_IN_PROGRESS BIT_0
#define MBX_BUSY BIT_1 /* Got the Access */
-#define MBX_SLEEPING_ON_SEM BIT_2
+#define MBX_SLEEPING_ON_SEM BIT_2
#define MBX_POLLING_FOR_COMP BIT_3
#define MBX_COMPLETED BIT_4
-#define MBX_TIMEDOUT BIT_5
+#define MBX_TIMEDOUT BIT_5
#define MBX_ACCESS_TIMEDOUT BIT_6
mbx_cmd_t mc;
test_bit(LOOP_RESYNC_NEEDED, &ha->dpc_flags) || \
test_bit(LOOP_RESYNC_ACTIVE, &ha->dpc_flags)) || \
atomic_read(&ha->loop_state) == LOOP_DOWN)
-
+
#define LOOP_RDY(ha) (!LOOP_NOT_READY(ha))
#define TGT_Q(ha, t) (ha->otgt[t])
#ifndef __QLA_FW_H
#define __QLA_FW_H
-// ISP24xx
-
#define RISC_SADDRESS 0x100000
#define MBS_CHECKSUM_ERROR 0x4010
#define PDS_PORT_UNAVAILABLE 0x07
#define PDS_PRLO_PENDING 0x09
#define PDS_LOGO_PENDING 0x11
-//FIXME
#define PDS_PRLI2_PENDING 0x12
uint8_t hard_address[3];
* single call. Return a failed status, and let GA_NXT handle
* the overload.
*/
- if (i == MAX_FIBRE_DEVICES)
+ if (i == MAX_FIBRE_DEVICES)
rval = QLA_FUNCTION_FAILED;
}
/* Prepare CT arguments -- node_name, symbolic node_name, size */
memcpy(ct_req->req.rsnn_nn.node_name, ha->node_name, WWN_SIZE);
-
+
/* Prepare the Symbolic Node Name */
/* Board type */
snn = ct_req->req.rsnn_nn.sym_node_name;
* single call. Return a failed status, and let GA_NXT handle
* the overload.
*/
- if (i == MAX_FIBRE_DEVICES)
+ if (i == MAX_FIBRE_DEVICES)
rval = QLA_FUNCTION_FAILED;
}
(rval = qla2x00_init_rings(ha)) == QLA_SUCCESS) {
check_fw_ready_again:
/*
- * Wait for a successful LIP up to a maximum
+ * Wait for a successful LIP up to a maximum
* of (in seconds): RISC login timeout value,
* RISC retry count value, and port down retry
- * value OR a minimum of 4 seconds OR If no
+ * value OR a minimum of 4 seconds OR If no
* cable, only 5 seconds.
*/
rval = qla2x00_fw_ready(ha);
int rval;
/* Assume loading risc code */
- rval = QLA_FUNCTION_FAILED;
+ rval = QLA_FUNCTION_FAILED;
if (ha->flags.disable_risc_code_load) {
DEBUG2(printk("scsi(%ld): RISC CODE NOT loaded\n",
* Returns 0 on success.
*/
void
-qla2x00_reset_chip(scsi_qla_host_t *ha)
+qla2x00_reset_chip(scsi_qla_host_t *ha)
{
unsigned long flags = 0;
struct device_reg_2xxx __iomem *reg = &ha->iobase->isp;
for (cnt = 6000000; cnt && (data == MBS_BUSY); cnt--) {
udelay(5);
data = RD_MAILBOX_REG(ha, reg, 0);
- barrier();
+ barrier();
}
} else
udelay(10);
emphasis = (ha->fw_seriallink_options[2] &
(BIT_4 | BIT_3)) >> 3;
tx_sens = ha->fw_seriallink_options[0] &
- (BIT_3 | BIT_2 | BIT_1 | BIT_0);
+ (BIT_3 | BIT_2 | BIT_1 | BIT_0);
rx_sens = (ha->fw_seriallink_options[0] &
(BIT_7 | BIT_6 | BIT_5 | BIT_4)) >> 4;
ha->fw_options[10] = (emphasis << 14) | (swing << 8);
(BIT_7 | BIT_6 | BIT_5)) >> 5;
emphasis = ha->fw_seriallink_options[3] & (BIT_1 | BIT_0);
tx_sens = ha->fw_seriallink_options[1] &
- (BIT_3 | BIT_2 | BIT_1 | BIT_0);
+ (BIT_3 | BIT_2 | BIT_1 | BIT_0);
rx_sens = (ha->fw_seriallink_options[1] &
(BIT_7 | BIT_6 | BIT_5 | BIT_4)) >> 4;
ha->fw_options[11] = (emphasis << 14) | (swing << 8);
rval = QLA_SUCCESS;
/* 20 seconds for loop down. */
- min_wait = 20;
+ min_wait = 20;
/*
* Firmware should take at most one RATOV to login, plus 5 seconds for
(fw_state >= FSTATE_LOSS_OF_SYNC ||
fw_state == FSTATE_WAIT_AL_PA)) {
/* Loop down. Timeout on min_wait for states
- * other than Wait for Login.
- */
+ * other than Wait for Login.
+ */
if (time_after_eq(jiffies, mtime)) {
qla_printk(KERN_INFO, ha,
"Cable is unplugged...\n");
*
* The driver waits for the link to come up after link down
* before returning I/Os to OS with "DID_NO_CONNECT".
- */
+ */
if (nv->link_down_timeout == 0) {
ha->loop_down_abort_time =
(LOOP_DOWN_TIME - LOOP_DOWN_TIMEOUT);
ha->link_down_timeout = nv->link_down_timeout;
ha->loop_down_abort_time =
(LOOP_DOWN_TIME - ha->link_down_timeout);
- }
+ }
/*
* Need enough time to try and get the port back.
* 2 = database was full and device was not configured.
*/
static int
-qla2x00_configure_loop(scsi_qla_host_t *ha)
+qla2x00_configure_loop(scsi_qla_host_t *ha)
{
int rval;
unsigned long flags, save_flags;
* 0 = success.
*/
static int
-qla2x00_configure_local_loop(scsi_qla_host_t *ha)
+qla2x00_configure_local_loop(scsi_qla_host_t *ha)
{
int rval, rval2;
int found_devs;
}
static void
-qla2x00_probe_for_all_luns(scsi_qla_host_t *ha)
+qla2x00_probe_for_all_luns(scsi_qla_host_t *ha)
{
fc_port_t *fcport;
- qla2x00_mark_all_devices_lost(ha);
+ qla2x00_mark_all_devices_lost(ha);
list_for_each_entry(fcport, &ha->fcports, list) {
if (fcport->port_type != FCT_TARGET)
continue;
- qla2x00_update_fcport(ha, fcport);
+ qla2x00_update_fcport(ha, fcport);
}
}
* Kernel context.
*/
static int
-qla2x00_device_resync(scsi_qla_host_t *ha)
+qla2x00_device_resync(scsi_qla_host_t *ha)
{
int rval;
int rval2;
* unrecoverable / not handled error
*/
DEBUG2(printk("%s(%ld): failed=%x port_id=%02x%02x%02x "
- "loop_id=%x jiffies=%lx.\n",
- __func__, ha->host_no, mb[0],
+ "loop_id=%x jiffies=%lx.\n",
+ __func__, ha->host_no, mb[0],
fcport->d_id.b.domain, fcport->d_id.b.area,
fcport->d_id.b.al_pa, fcport->loop_id, jiffies));
* 0 = success
*/
int
-qla2x00_loop_resync(scsi_qla_host_t *ha)
+qla2x00_loop_resync(scsi_qla_host_t *ha)
{
int rval;
uint32_t wait_time;
rescan_done = 1;
}
- qla2x00_probe_for_all_luns(ha);
+ qla2x00_probe_for_all_luns(ha);
}
/*
ha->isp_ops.enable_intrs(ha);
- ha->isp_abort_cnt = 0;
+ ha->isp_abort_cnt = 0;
clear_bit(ISP_ABORT_RETRY, &ha->dpc_flags);
} else { /* failed the ISP abort */
ha->flags.online = 1;
qla_printk(KERN_WARNING, ha,
"ISP error recovery failed - "
"board disabled\n");
- /*
+ /*
* The next call disables the board
* completely.
*/
status = 1;
}
}
-
+
}
if (status) {
}
spin_unlock_irqrestore(&ha->hardware_lock, flags);
-
+
status = qla2x00_setup_chip(ha);
spin_lock_irqsave(&ha->hardware_lock, flags);
-
+
if (!IS_QLA24XX(ha) && !IS_QLA25XX(ha)) {
/* Enable proper parity */
if (IS_QLA2300(ha))
}
/* if no cable then assume it's good */
- if ((ha->device_flags & DFLG_NO_CABLE))
+ if ((ha->device_flags & DFLG_NO_CABLE))
status = 0;
DEBUG(printk("%s(): Configure loop done, status = 0x%x\n",
* register value.
*/
static __inline__ uint16_t
-qla2x00_debounce_register(volatile uint16_t __iomem *addr)
+qla2x00_debounce_register(volatile uint16_t __iomem *addr)
{
volatile uint16_t first;
volatile uint16_t second;
* ffffabc1ffffeeee (0x100000000 + e_addr)
* ffffabc100000000 (0x100000000 + e_addr) & ~(0xffffffff)
* ffffabc100000000 (ne_addr)
- *
+ *
* Compute length of second DMA segment:
*
* 00000000ffffeeee (e_addr & 0xffffffff)
}
static __inline__ void qla2x00_poll(scsi_qla_host_t *);
-static inline void
+static inline void
qla2x00_poll(scsi_qla_host_t *ha)
{
ha->isp_ops.intr_handler(0, ha, NULL);
}
-static __inline__ int qla2x00_is_wwn_zero(uint8_t *);
-
-/*
- * qla2x00_is_wwn_zero - Check for zero node name
- *
- * Input:
- * wwn = Pointer to WW name to check
- *
- * Returns:
- * 1 if name is 0x00 else 0
- *
- * Context:
- * Kernel context.
- */
-static __inline__ int
-qla2x00_is_wwn_zero(uint8_t *wwn)
-{
- int cnt;
-
- for (cnt = 0; cnt < WWN_SIZE ; cnt++, wwn++) {
- if (*wwn != 0)
- break;
- }
- /* if zero return 1 */
- if (cnt == WWN_SIZE)
- return (1);
- else
- return (0);
-}
-
static __inline__ void qla2x00_check_fabric_devices(scsi_qla_host_t *);
/*
* This routine will wait for fabric devices for
* the reset delay.
*/
-static __inline__ void qla2x00_check_fabric_devices(scsi_qla_host_t *ha)
+static __inline__ void qla2x00_check_fabric_devices(scsi_qla_host_t *ha)
{
uint16_t fw_state;
return (QLA_SUCCESS);
}
-static __inline__ void qla2x00_add_timer_to_cmd(srb_t *, int);
-static __inline__ void qla2x00_delete_timer_from_cmd(srb_t *);
-
-/**************************************************************************
-* qla2x00_add_timer_to_cmd
-*
-* Description:
-* Creates a timer for the specified command. The timeout is usually
-* the command time from kernel minus 2 secs.
-*
-* Input:
-* sp - pointer to validate
-*
-* Returns:
-* None.
-**************************************************************************/
-static inline void
-qla2x00_add_timer_to_cmd(srb_t *sp, int timeout)
-{
- init_timer(&sp->timer);
- sp->timer.expires = jiffies + timeout * HZ;
- sp->timer.data = (unsigned long) sp;
- sp->timer.function = (void (*) (unsigned long))qla2x00_cmd_timeout;
- add_timer(&sp->timer);
-}
-
-/**************************************************************************
-* qla2x00_delete_timer_from_cmd
-*
-* Description:
-* Delete the timer for the specified command.
-*
-* Input:
-* sp - pointer to validate
-*
-* Returns:
-* None.
-**************************************************************************/
-static inline void
-qla2x00_delete_timer_from_cmd(srb_t *sp)
-{
- if (sp->timer.function != NULL) {
- del_timer(&sp->timer);
- sp->timer.function = NULL;
- sp->timer.data = (unsigned long) NULL;
- }
-}
-
static inline uint8_t *host_to_fcp_swap(uint8_t *, uint32_t);
static inline uint8_t *
host_to_fcp_swap(uint8_t *fcp, uint32_t bsize)
*
* Returns non-zero if a failure occured, else zero.
*/
-int
+int
__qla2x00_marker(scsi_qla_host_t *ha, uint16_t loop_id, uint16_t lun,
uint8_t type)
{
return (QLA_SUCCESS);
}
-int
+int
qla2x00_marker(scsi_qla_host_t *ha, uint16_t loop_id, uint16_t lun,
uint8_t type)
{
wptr = (uint16_t __iomem *)MAILBOX_REG(ha, reg, 1);
for (cnt = 1; cnt < ha->mbx_count; cnt++) {
- if (IS_QLA2200(ha) && cnt == 8)
+ if (IS_QLA2200(ha) && cnt == 8)
wptr = (uint16_t __iomem *)MAILBOX_REG(ha, reg, 8);
if (cnt == 4 || cnt == 5)
ha->mailbox_out[cnt] = qla2x00_debounce_register(wptr);
else
ha->mailbox_out[cnt] = RD_REG_WORD(wptr);
-
+
wptr++;
}
"Configuration change detected: value=%x.\n", mb[1]);
if (atomic_read(&ha->loop_state) != LOOP_DOWN) {
- atomic_set(&ha->loop_state, LOOP_DOWN);
+ atomic_set(&ha->loop_state, LOOP_DOWN);
if (!atomic_read(&ha->loop_down_timer))
atomic_set(&ha->loop_down_timer,
LOOP_DOWN_TIME);
qla_printk(KERN_WARNING, ha, "Status Entry invalid handle.\n");
set_bit(ISP_ABORT_NEEDED, &ha->dpc_flags);
- if (ha->dpc_wait && !ha->dpc_active)
+ if (ha->dpc_wait && !ha->dpc_active)
up(ha->dpc_wait);
return;
}
/*
- * Check to see if SCSI Status is non zero. If so report SCSI
+ * Check to see if SCSI Status is non zero. If so report SCSI
* Status.
*/
if (lscsi_status != 0) {
sp->request_sense_length = sense_len;
sp->request_sense_ptr = cp->sense_buffer;
- if (sp->request_sense_length > 32)
+ if (sp->request_sense_length > 32)
sense_len = 32;
memcpy(cp->sense_buffer, sense_data, sense_len);
break;
case CS_ABORTED:
- /*
+ /*
* hv2.19.12 - DID_ABORT does not retry the request if we
* aborted this request then abort otherwise it must be a
* reset.
/* SCSI Mid-Layer handles device queue full */
- cp->result = DID_OK << 16 | lscsi_status;
+ cp->result = DID_OK << 16 | lscsi_status;
break;
"sp=%p sp->state:%d\n", __func__, sp, sp->state));
qla_printk(KERN_INFO, ha,
"cmd is NULL: already returned to OS (sp=%p)\n",
- sp);
+ sp);
ha->status_srb = NULL;
return;
else if (pkt->entry_status & RF_INV_E_COUNT)
qla_printk(KERN_ERR, ha, "%s: Invalid Entry Count\n", __func__);
else if (pkt->entry_status & RF_INV_E_PARAM)
- qla_printk(KERN_ERR, ha,
+ qla_printk(KERN_ERR, ha,
"%s: Invalid Entry Parameter\n", __func__);
else if (pkt->entry_status & RF_INV_E_TYPE)
qla_printk(KERN_ERR, ha, "%s: Invalid Entry Type\n", __func__);
DEBUG3(printk(KERN_INFO
"scsi(%ld): Process error entry.\n", ha->host_no));
- //FIXME
qla2x00_error_entry(ha, (sts_entry_t *) pkt);
((response_t *)pkt)->signature = RESPONSE_PROCESSED;
wmb();
"Mailbox command timeout occured. Scheduling ISP "
"abort.\n");
set_bit(ISP_ABORT_NEEDED, &ha->dpc_flags);
- if (ha->dpc_wait && !ha->dpc_active)
+ if (ha->dpc_wait && !ha->dpc_active)
up(ha->dpc_wait);
} else if (!abort_active) {
/*
* qla2x00_login_local_device
* Issue login loop port mailbox command.
- *
+ *
* Input:
* ha = adapter block pointer.
* loop_id = device loop ID.
* opt = command options.
- *
+ *
* Returns:
* Return status code.
- *
+ *
* Context:
* Kernel context.
- *
+ *
*/
int
qla2x00_login_local_device(scsi_qla_host_t *ha, uint16_t loop_id,
} else {
DEBUG11(printk("%s(%ld): done. mb1=%x mb2=%x mb3=%x mb6=%x "
"mb7=%x mb10=%x.\n", __func__, ha->host_no,
- mcp->mb[1], mcp->mb[2], mcp->mb[3], mcp->mb[6], mcp->mb[7],
+ mcp->mb[1], mcp->mb[2], mcp->mb[3], mcp->mb[6], mcp->mb[7],
mcp->mb[10]));
if (cur_xchg_cnt)
int ql2xenablezio = 0;
module_param(ql2xenablezio, int, S_IRUGO|S_IRUSR);
MODULE_PARM_DESC(ql2xenablezio,
- "Option to enable ZIO:If 1 then enable it otherwise"
+ "Option to enable ZIO:If 1 then enable it otherwise"
" use the default set in the NVRAM."
" Default is 0 : disabled");
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_alloc(struct scsi_device *);
qla2x00_fw_version_str(struct scsi_qla_host *ha, char *str)
{
char un_str[10];
-
+
sprintf(str, "%d.%02d.%02d ", ha->fw_major_version,
ha->fw_minor_version,
ha->fw_subminor_version);
/*
* qla2x00_wait_for_hba_online
- * Wait till the HBA is online after going through
+ * Wait till the HBA is online after going through
* <= MAX_RETRIES_OF_ISP_ABORT or
* finally HBA is disabled ie marked offline
*
* Input:
* ha - pointer to host adapter structure
- *
- * Note:
+ *
+ * Note:
* Does context switching-Release SPIN_LOCK
* (if any) before calling this routine.
*
* Success (Adapter is online) : 0
* Failed (Adapter is offline/disabled) : 1
*/
-static int
+static int
qla2x00_wait_for_hba_online(scsi_qla_host_t *ha)
{
int return_status;
unsigned long wait_online;
- wait_online = jiffies + (MAX_LOOP_TIMEOUT * HZ);
+ wait_online = jiffies + (MAX_LOOP_TIMEOUT * HZ);
while (((test_bit(ISP_ABORT_NEEDED, &ha->dpc_flags)) ||
test_bit(ABORT_ISP_ACTIVE, &ha->dpc_flags) ||
test_bit(ISP_ABORT_RETRY, &ha->dpc_flags) ||
msleep(1000);
}
- if (ha->flags.online)
- return_status = QLA_SUCCESS;
+ if (ha->flags.online)
+ return_status = QLA_SUCCESS;
else
return_status = QLA_FUNCTION_FAILED;
/*
* qla2x00_wait_for_loop_ready
* Wait for MAX_LOOP_TIMEOUT(5 min) value for loop
- * to be in LOOP_READY state.
+ * to be in LOOP_READY state.
* Input:
* ha - pointer to host adapter structure
- *
- * Note:
+ *
+ * Note:
* Does context switching-Release SPIN_LOCK
* (if any) before calling this routine.
- *
+ *
*
* Return:
* Success (LOOP_READY) : 0
* Failed (LOOP_NOT_READY) : 1
*/
-static inline int
+static inline int
qla2x00_wait_for_loop_ready(scsi_qla_host_t *ha)
{
int return_status = QLA_SUCCESS;
unsigned long loop_timeout ;
/* wait for 5 min at the max for loop to be ready */
- loop_timeout = jiffies + (MAX_LOOP_TIMEOUT * HZ);
+ loop_timeout = jiffies + (MAX_LOOP_TIMEOUT * HZ);
while ((!atomic_read(&ha->loop_down_timer) &&
atomic_read(&ha->loop_state) == LOOP_DOWN) ||
break;
}
}
- return (return_status);
+ return (return_status);
}
/**************************************************************************
/* Wait for the command to be returned. */
if (ret == SUCCESS) {
if (qla2x00_eh_wait_on_command(ha, cmd) != QLA_SUCCESS) {
- qla_printk(KERN_ERR, ha,
+ qla_printk(KERN_ERR, ha,
"scsi(%ld:%d:%d): Abort handler timed out -- %lx "
"%x.\n", ha->host_no, id, lun, serial, ret);
}
}
- qla_printk(KERN_INFO, ha,
+ qla_printk(KERN_INFO, ha,
"scsi(%ld:%d:%d): Abort command issued -- %lx %x.\n", ha->host_no,
id, lun, serial, ret);
*
* Input:
* ha - pointer to scsi_qla_host structure.
-* t - target
+* t - target
* Returns:
* Either SUCCESS or FAILED.
*
* executing commands.
*
* NOTE: The use of SP is undefined within this context. Do *NOT*
-* attempt to use this value, even if you determine it is
+* attempt to use this value, even if you determine it is
* non-null.
*
* Input:
"commands\n", __func__, ha->host_no));
qla_printk(KERN_INFO, ha,
"%s: failed while waiting for commands\n",
- __func__);
+ __func__);
goto eh_dev_reset_done;
}
/*
* Fixme-may be dpc thread is active and processing
- * loop_resync,so wait a while for it to
+ * loop_resync,so wait a while for it to
* be completed and then issue big hammer.Otherwise
* it may cause I/O failure as big hammer marks the
* devices as lost kicking of the port_down_timer
if (qla2x00_wait_for_hba_online(ha) != QLA_SUCCESS)
goto eh_host_reset_lock;
- }
+ }
clear_bit(ABORT_ISP_ACTIVE, &ha->dpc_flags);
/* Waiting for our command in done_queue to be returned to OS.*/
}
if (status == QLA_SUCCESS &&
- ((!ha->flags.enable_target_reset &&
+ ((!ha->flags.enable_target_reset &&
!ha->flags.enable_lip_reset) ||
ha->flags.enable_lip_full_login)) {
if (pci_set_consistent_dma_mask(ha->pdev,
DMA_64BIT_MASK)) {
- qla_printk(KERN_DEBUG, ha,
+ qla_printk(KERN_DEBUG, ha,
"Failed to set 64 bit PCI consistent mask; "
"using 32 bit.\n");
pci_set_consistent_dma_mask(ha->pdev,
{
if (atomic_read(&fcport->state) == FCS_ONLINE && fcport->rport)
fc_remote_port_block(fcport->rport);
- /*
+ /*
* We may need to retry the login, so don't change the state of the
* port but do the retries.
*/
* Context:
*/
void
-qla2x00_mark_all_devices_lost(scsi_qla_host_t *ha)
+qla2x00_mark_all_devices_lost(scsi_qla_host_t *ha)
{
fc_port_t *fcport;
*
* Context:
* Kernel context.
- *
+ *
* Note: Sets the ref_count for non Null sp to one.
*/
static int
-qla2x00_allocate_sp_pool(scsi_qla_host_t *ha)
+qla2x00_allocate_sp_pool(scsi_qla_host_t *ha)
{
int rval;
/*
* This routine frees all adapter allocated memory.
- *
+ *
*/
static void
-qla2x00_free_sp_pool( scsi_qla_host_t *ha)
+qla2x00_free_sp_pool( scsi_qla_host_t *ha)
{
if (ha->srb_mempool) {
mempool_destroy(ha->srb_mempool);
DEBUG(printk("scsi(%ld): port login OK: logged in ID 0x%x\n",
ha->host_no, fcport->loop_id));
-
+
fcport->port_login_retry_count =
ha->port_down_retry_count * PORT_RETRY_TIME;
atomic_set(&fcport->state, FCS_ONLINE);
clear_bit(LOGIN_RETRY_NEEDED, &ha->dpc_flags);
DEBUG(printk("scsi(%ld): qla2x00_login_retry()\n",
ha->host_no));
-
+
set_bit(LOOP_RESYNC_NEEDED, &ha->dpc_flags);
DEBUG(printk("scsi(%ld): qla2x00_login_retry - end\n",
* ha = adapter block pointer.
*/
static void
-qla2x00_rst_aen(scsi_qla_host_t *ha)
+qla2x00_rst_aen(scsi_qla_host_t *ha)
{
if (ha->flags.online && !ha->flags.reset_active &&
!atomic_read(&ha->loop_down_timer) &&
*
* Whenever, a port is in the LOST state we start decrementing its port
* down timer every second until it reaches zero. Once it reaches zero
- * the port it marked DEAD.
+ * the port it marked DEAD.
*/
t = 0;
list_for_each_entry(fcport, &ha->fcports, list) {
if (atomic_read(&fcport->port_down_timer) == 0)
continue;
- if (atomic_dec_and_test(&fcport->port_down_timer) != 0)
+ if (atomic_dec_and_test(&fcport->port_down_timer) != 0)
atomic_set(&fcport->state, FCS_DEVICE_DEAD);
-
+
DEBUG(printk("scsi(%ld): fcport-%d - port retry count: "
"%d remaining\n",
ha->host_no,
ha->host_no));
if (!IS_QLA2100(ha) && ha->link_down_timeout)
- atomic_set(&ha->loop_state, LOOP_DEAD);
+ atomic_set(&ha->loop_state, LOOP_DEAD);
/* Schedule an ISP abort to return any tape commands. */
spin_lock_irqsave(&ha->hardware_lock, cpu_flags);
static int qla2x00_send_login_iocb_cb(scsi_qla_host_t *, struct io_descriptor *,
struct mbx_entry *);
-/**
+/**
* Mailbox IOCB callback array.
**/
static int (*iocb_function_cb_list[LAST_IOCB_CB])
};
-/**
+/**
* Generic IO descriptor handle routines.
**/
}
-/**
+/**
* IO descriptor allocation routines.
**/
}
-/**
+/**
* IO descriptor timer routines.
**/
add_timer(&iodesc->timer);
}
-/**
+/**
* IO descriptor support routines.
**/
}
-/**
+/**
* Mailbox IOCB commands.
**/
* Returns QLA_SUCCESS if the IOCB was issued.
*/
static int
-qla2x00_send_abort_iocb(scsi_qla_host_t *ha, struct io_descriptor *iodesc,
+qla2x00_send_abort_iocb(scsi_qla_host_t *ha, struct io_descriptor *iodesc,
uint32_t handle_to_abort, int ha_locked)
{
unsigned long flags = 0;
/* Only process the last command. */
if (remote_fcport->iodesc_idx_sent != iodesc->idx) {
DEBUG14(printk("scsi(%ld): Login IOCB -- ignoring, sent to "
- "[%02x%02x%02x], expected %x, received %x.\n",
+ "[%02x%02x%02x], expected %x, received %x.\n",
ha->host_no, iodesc->d_id.b.domain, iodesc->d_id.b.area,
iodesc->d_id.b.al_pa, remote_fcport->iodesc_idx_sent,
iodesc->idx));
DEBUG14(printk("scsi(%ld): Login IOCB -- status=%x mb1=%x pn="
"%02x%02x%02x%02x%02x%02x%02x%02x.\n", ha->host_no, status,
- mb[1], mbxstat->port_name[0], mbxstat->port_name[1],
- mbxstat->port_name[2], mbxstat->port_name[3],
- mbxstat->port_name[4], mbxstat->port_name[5],
+ mb[1], mbxstat->port_name[0], mbxstat->port_name[1],
+ mbxstat->port_name[2], mbxstat->port_name[3],
+ mbxstat->port_name[4], mbxstat->port_name[5],
mbxstat->port_name[6], mbxstat->port_name[7]));
memcpy(remote_fcport->node_name, mbxstat->node_name, WWN_SIZE);
}
-/**
+/**
* IO descriptor processing routines.
**/
remote_fcport = rscn_fcport;
}
- /*
+ /*
* If the port is already in our fcport list and online, send an ADISC
* to see if it's still alive. Issue login if a new fcport or the known
* fcport is currently offline.
}
return (QLA_SUCCESS);
}
-
+
/* Send ADISC if the fcport is online */
if (atomic_read(&remote_fcport->state) == FCS_ONLINE ||
remote_fcport->iodesc_idx_sent == IODESC_ADISC_NEEDED) {
* abort.
*/
uint32_t handle_to_abort;
-
+
iodesc = &ha->io_descriptors[
remote_fcport->iodesc_idx_sent];
qla2x00_remove_iodesc_timer(iodesc);
*/
#define DEBUG_QLA2100 0 /* For Debug of qla2x00 */
-#define STOP_ON_RESET 0
#define USE_ABORT_TGT 1 /* Use Abort Target mbx cmd */
-#define VSA 0 /* Volume Set Addressing */
-
-/* Failover options */
-#define MAX_RECOVERYTIME 10 /*
- * Max suspend time for a lun recovery
- * time
- */
-#define MAX_FAILBACKTIME 5 /* Max suspend time before fail back */
-
-#define QLA_CMD_TIMER_DELTA 3
-
-/*
- * When a lun is suspended for the "Not Ready" condition then it will suspend
- * the lun for increments of 6 sec delays. SUSPEND_COUNT is that count.
- */
-#define SUSPEND_COUNT 10 /* 6 secs * 10 retries = 60 secs */
-
-/*
- * Defines the time in seconds that the driver extends the command timeout to
- * get around the problem where the mid-layer only allows 5 retries for
- * commands that return BUS_BUSY
- */
-#define EXTEND_CMD_TIMEOUT 60
-
#define MAX_RETRIES_OF_ISP_ABORT 5
/* Max time to wait for the loop to be in LOOP_READY state */
*/
/**
- * qla2x00_lock_nvram_access() -
+ * qla2x00_lock_nvram_access() -
* @ha: HA context
*/
void
}
/**
- * qla2x00_unlock_nvram_access() -
+ * qla2x00_unlock_nvram_access() -
* @ha: HA context
*/
void
conf_addr = flash_conf_to_access_addr(0x03d8);
switch (man_id) {
- case 0xbf: // STT flash
+ case 0xbf: /* STT flash. */
rest_addr = 0x1fff;
sec_mask = 0x3e000;
if (flash_id == 0x80)
conf_addr = flash_conf_to_access_addr(0x0352);
break;
- case 0x13: // ST M25P80
+ case 0x13: /* ST M25P80. */
rest_addr = 0x3fff;
sec_mask = 0x3c000;
break;
default:
- // Default to 64 kb sector size
+ /* Default to 64 kb sector size. */
rest_addr = 0x3fff;
sec_mask = 0x3c000;
break;
*
******************************************************************************/
/*
- * Driver version
+ * Driver version
*/
#define QLA2XXX_VERSION "8.00.02b5-k"