/* Returns the proper CF_* direction based on CDB.  */
static uint16_t qla2x00_get_cmd_direction(srb_t *sp)
/* Returns the proper CF_* direction based on CDB.  */
static uint16_t qla2x00_get_cmd_direction(srb_t *sp)
{
	uint16_t cflags;
	cflags = 0;
	if (sp->cmd->sc_data_direction == DMA_TO_DEVICE) {
		cflags = CF_WRITE;
		sp->fcport->vha->hw->qla_stats.output_bytes +=
		    scsi_bufflen(sp->cmd);
	} else if (sp->cmd->sc_data_direction == DMA_FROM_DEVICE) {
		cflags = CF_READ;
		sp->fcport->vha->hw->qla_stats.input_bytes +=
		    scsi_bufflen(sp->cmd);
	}
	return (cflags);
}