Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 110586
b: refs/heads/master
c: 49fd462
h: refs/heads/master
v: v3
  • Loading branch information
Harish Zunjarrao authored and James Bottomley committed Oct 3, 2008
1 parent 45f9d27 commit 903622d
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ac26d41dee65167109e7cdcd0289b44ca61cd741
refs/heads/master: 49fd462a1ba4a1b9bfbfe01d279d506017d85492
2 changes: 2 additions & 0 deletions trunk/drivers/scsi/qla2xxx/qla_attr.c
Original file line number Diff line number Diff line change
Expand Up @@ -1065,6 +1065,8 @@ qla2x00_get_fc_host_stats(struct Scsi_Host *shost)
pfc_host_stat->dumped_frames = stats->dumped_frames;
pfc_host_stat->nos_count = stats->nos_rcvd;
}
pfc_host_stat->fcp_input_megabytes = ha->qla_stats.input_bytes >> 20;
pfc_host_stat->fcp_output_megabytes = ha->qla_stats.output_bytes >> 20;

done_free:
dma_pool_free(ha->s_dma_pool, stats, stats_dma);
Expand Down
2 changes: 2 additions & 0 deletions trunk/drivers/scsi/qla2xxx/qla_def.h
Original file line number Diff line number Diff line change
Expand Up @@ -2156,6 +2156,8 @@ struct qla_chip_state_84xx {

struct qla_statistics {
uint32_t total_isp_aborts;
uint64_t input_bytes;
uint64_t output_bytes;
};

/*
Expand Down
24 changes: 17 additions & 7 deletions trunk/drivers/scsi/qla2xxx/qla_iocb.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,22 @@ static void qla2x00_isp_cmd(scsi_qla_host_t *ha);
* Returns the proper CF_* direction based on CDB.
*/
static inline uint16_t
qla2x00_get_cmd_direction(struct scsi_cmnd *cmd)
qla2x00_get_cmd_direction(srb_t *sp)
{
uint16_t cflags;

cflags = 0;

/* Set transfer direction */
if (cmd->sc_data_direction == DMA_TO_DEVICE)
if (sp->cmd->sc_data_direction == DMA_TO_DEVICE) {
cflags = CF_WRITE;
else if (cmd->sc_data_direction == DMA_FROM_DEVICE)
sp->fcport->ha->qla_stats.output_bytes +=
scsi_bufflen(sp->cmd);
} else if (sp->cmd->sc_data_direction == DMA_FROM_DEVICE) {
cflags = CF_READ;
sp->fcport->ha->qla_stats.input_bytes +=
scsi_bufflen(sp->cmd);
}
return (cflags);
}

Expand Down Expand Up @@ -169,7 +174,7 @@ void qla2x00_build_scsi_iocbs_32(srb_t *sp, cmd_entry_t *cmd_pkt,

ha = sp->ha;

cmd_pkt->control_flags |= cpu_to_le16(qla2x00_get_cmd_direction(cmd));
cmd_pkt->control_flags |= cpu_to_le16(qla2x00_get_cmd_direction(sp));

/* Three DSDs are available in the Command Type 2 IOCB */
avail_dsds = 3;
Expand Down Expand Up @@ -228,7 +233,7 @@ void qla2x00_build_scsi_iocbs_64(srb_t *sp, cmd_entry_t *cmd_pkt,

ha = sp->ha;

cmd_pkt->control_flags |= cpu_to_le16(qla2x00_get_cmd_direction(cmd));
cmd_pkt->control_flags |= cpu_to_le16(qla2x00_get_cmd_direction(sp));

/* Two DSDs are available in the Command Type 3 IOCB */
avail_dsds = 2;
Expand Down Expand Up @@ -625,12 +630,17 @@ qla24xx_build_scsi_iocbs(srb_t *sp, struct cmd_type_7 *cmd_pkt,
ha = sp->ha;

/* Set transfer direction */
if (cmd->sc_data_direction == DMA_TO_DEVICE)
if (cmd->sc_data_direction == DMA_TO_DEVICE) {
cmd_pkt->task_mgmt_flags =
__constant_cpu_to_le16(TMF_WRITE_DATA);
else if (cmd->sc_data_direction == DMA_FROM_DEVICE)
sp->fcport->ha->qla_stats.output_bytes +=
scsi_bufflen(sp->cmd);
} else if (cmd->sc_data_direction == DMA_FROM_DEVICE) {
cmd_pkt->task_mgmt_flags =
__constant_cpu_to_le16(TMF_READ_DATA);
sp->fcport->ha->qla_stats.input_bytes +=
scsi_bufflen(sp->cmd);
}

/* One DSD is available in the Command Type 3 IOCB */
avail_dsds = 1;
Expand Down

0 comments on commit 903622d

Please sign in to comment.