Skip to content

Commit

Permalink
[SCSI] qla2xxx: Trace-Control naming cleanups.
Browse files Browse the repository at this point in the history
In preparation for FCE (Fibre Channel Event) tracing support.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
  • Loading branch information
Andrew Vasquez authored and James Bottomley committed Jan 23, 2008
1 parent a824ebb commit 00b6bd2
Show file tree
Hide file tree
Showing 6 changed files with 50 additions and 20 deletions.
3 changes: 0 additions & 3 deletions drivers/scsi/qla2xxx/qla_def.h
Original file line number Diff line number Diff line change
Expand Up @@ -623,9 +623,6 @@ typedef struct {
#define MBC_GET_LINK_PRIV_STATS 0x6d /* Get link & private data. */
#define MBC_SET_VENDOR_ID 0x76 /* Set Vendor ID. */

#define TC_ENABLE 4
#define TC_DISABLE 5

/* Firmware return data sizes */
#define FCAL_MAP_SIZE 128

Expand Down
7 changes: 7 additions & 0 deletions drivers/scsi/qla2xxx/qla_fw.h
Original file line number Diff line number Diff line change
Expand Up @@ -952,6 +952,13 @@ struct device_reg_24xx {
uint32_t iobase_sdata;
};

/* Trace Control *************************************************************/

#define TC_AEN_DISABLE 0

#define TC_EFT_ENABLE 4
#define TC_EFT_DISABLE 5

/* MID Support ***************************************************************/

#define MIN_MULTI_ID_FABRIC 64 /* Must be power-of-2. */
Expand Down
4 changes: 3 additions & 1 deletion drivers/scsi/qla2xxx/qla_gbl.h
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,9 @@ extern int
qla2x00_stop_firmware(scsi_qla_host_t *);

extern int
qla2x00_trace_control(scsi_qla_host_t *, uint16_t, dma_addr_t, uint16_t);
qla2x00_enable_eft_trace(scsi_qla_host_t *, dma_addr_t, uint16_t);
extern int
qla2x00_disable_eft_trace(scsi_qla_host_t *);

extern int
qla2x00_read_sfp(scsi_qla_host_t *, dma_addr_t, uint16_t, uint16_t, uint16_t);
Expand Down
5 changes: 2 additions & 3 deletions drivers/scsi/qla2xxx/qla_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -766,8 +766,7 @@ qla2x00_alloc_fw_dump(scsi_qla_host_t *ha)
goto cont_alloc;
}

rval = qla2x00_trace_control(ha, TC_ENABLE, eft_dma,
EFT_NUM_BUFFERS);
rval = qla2x00_enable_eft_trace(ha, eft_dma, EFT_NUM_BUFFERS);
if (rval) {
qla_printk(KERN_WARNING, ha, "Unable to initialize "
"EFT (%d).\n", rval);
Expand Down Expand Up @@ -3240,7 +3239,7 @@ qla2x00_abort_isp(scsi_qla_host_t *ha)
clear_bit(ISP_ABORT_RETRY, &ha->dpc_flags);

if (ha->eft) {
rval = qla2x00_trace_control(ha, TC_ENABLE,
rval = qla2x00_enable_eft_trace(ha,
ha->eft_dma, EFT_NUM_BUFFERS);
if (rval) {
qla_printk(KERN_WARNING, ha,
Expand Down
49 changes: 37 additions & 12 deletions drivers/scsi/qla2xxx/qla_mbx.c
Original file line number Diff line number Diff line change
Expand Up @@ -2350,7 +2350,7 @@ qla2x00_stop_firmware(scsi_qla_host_t *ha)
}

int
qla2x00_trace_control(scsi_qla_host_t *ha, uint16_t ctrl, dma_addr_t eft_dma,
qla2x00_enable_eft_trace(scsi_qla_host_t *ha, dma_addr_t eft_dma,
uint16_t buffers)
{
int rval;
Expand All @@ -2363,22 +2363,47 @@ qla2x00_trace_control(scsi_qla_host_t *ha, uint16_t ctrl, dma_addr_t eft_dma,
DEBUG11(printk("%s(%ld): entered.\n", __func__, ha->host_no));

mcp->mb[0] = MBC_TRACE_CONTROL;
mcp->mb[1] = ctrl;
mcp->out_mb = MBX_1|MBX_0;
mcp->mb[1] = TC_EFT_ENABLE;
mcp->mb[2] = LSW(eft_dma);
mcp->mb[3] = MSW(eft_dma);
mcp->mb[4] = LSW(MSD(eft_dma));
mcp->mb[5] = MSW(MSD(eft_dma));
mcp->mb[6] = buffers;
mcp->mb[7] = TC_AEN_DISABLE;
mcp->out_mb = MBX_7|MBX_6|MBX_5|MBX_4|MBX_3|MBX_2|MBX_1|MBX_0;
mcp->in_mb = MBX_1|MBX_0;
if (ctrl == TC_ENABLE) {
mcp->mb[2] = LSW(eft_dma);
mcp->mb[3] = MSW(eft_dma);
mcp->mb[4] = LSW(MSD(eft_dma));
mcp->mb[5] = MSW(MSD(eft_dma));
mcp->mb[6] = buffers;
mcp->mb[7] = 0;
mcp->out_mb |= MBX_7|MBX_6|MBX_5|MBX_4|MBX_3|MBX_2;
}
mcp->tov = 30;
mcp->flags = 0;
rval = qla2x00_mailbox_command(ha, mcp);
if (rval != QLA_SUCCESS) {
DEBUG2_3_11(printk("%s(%ld): failed=%x mb[0]=%x mb[1]=%x.\n",
__func__, ha->host_no, rval, mcp->mb[0], mcp->mb[1]));
} else {
DEBUG11(printk("%s(%ld): done.\n", __func__, ha->host_no));
}

return rval;
}

int
qla2x00_disable_eft_trace(scsi_qla_host_t *ha)
{
int rval;
mbx_cmd_t mc;
mbx_cmd_t *mcp = &mc;

if (!IS_FWI2_CAPABLE(ha))
return QLA_FUNCTION_FAILED;

DEBUG11(printk("%s(%ld): entered.\n", __func__, ha->host_no));

mcp->mb[0] = MBC_TRACE_CONTROL;
mcp->mb[1] = TC_EFT_DISABLE;
mcp->out_mb = MBX_1|MBX_0;
mcp->in_mb = MBX_1|MBX_0;
mcp->tov = 30;
mcp->flags = 0;
rval = qla2x00_mailbox_command(ha, mcp);
if (rval != QLA_SUCCESS) {
DEBUG2_3_11(printk("%s(%ld): failed=%x mb[0]=%x mb[1]=%x.\n",
__func__, ha->host_no, rval, mcp->mb[0], mcp->mb[1]));
Expand Down
2 changes: 1 addition & 1 deletion drivers/scsi/qla2xxx/qla_os.c
Original file line number Diff line number Diff line change
Expand Up @@ -1856,7 +1856,7 @@ qla2x00_free_device(scsi_qla_host_t *ha)
}

if (ha->eft)
qla2x00_trace_control(ha, TC_DISABLE, 0, 0);
qla2x00_disable_eft_trace(ha);

ha->flags.online = 0;

Expand Down

0 comments on commit 00b6bd2

Please sign in to comment.