aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/qla2xxx/qla_iocb.c
diff options
context:
space:
mode:
authorAndrew Vasquez <andrew.vasquez@qlogic.com>2009-03-24 12:07:55 -0400
committerJames Bottomley <James.Bottomley@HansenPartnership.com>2009-04-03 10:22:44 -0400
commit08029990b25b76b1bc167336358bd21812567f2a (patch)
tree87cb617366a61bd643818996cc6186e817e23b63 /drivers/scsi/qla2xxx/qla_iocb.c
parent534841b3c110b0f149513c7695751879951d3f22 (diff)
[SCSI] qla2xxx: Refactor request/response-queue register handling.
Original code used an overabundance of indirect pointers to function helpers. Instead, the driver can exploit the immutable properties of a queue's ISP-association and ID, which are both known at queue initialization-time. Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'drivers/scsi/qla2xxx/qla_iocb.c')
-rw-r--r--drivers/scsi/qla2xxx/qla_iocb.c37
1 files changed, 3 insertions, 34 deletions
diff --git a/drivers/scsi/qla2xxx/qla_iocb.c b/drivers/scsi/qla2xxx/qla_iocb.c
index 2258152b1f41..a8abbb95730d 100644
--- a/drivers/scsi/qla2xxx/qla_iocb.c
+++ b/drivers/scsi/qla2xxx/qla_iocb.c
@@ -776,7 +776,7 @@ qla24xx_start_scsi(srb_t *sp)
776 776
777 req_cnt = qla24xx_calc_iocbs(tot_dsds); 777 req_cnt = qla24xx_calc_iocbs(tot_dsds);
778 if (req->cnt < (req_cnt + 2)) { 778 if (req->cnt < (req_cnt + 2)) {
779 cnt = ha->isp_ops->rd_req_reg(ha, req->id); 779 cnt = RD_REG_DWORD_RELAXED(req->req_q_out);
780 780
781 if (req->ring_index < cnt) 781 if (req->ring_index < cnt)
782 req->cnt = cnt - req->ring_index; 782 req->cnt = cnt - req->ring_index;
@@ -836,7 +836,8 @@ qla24xx_start_scsi(srb_t *sp)
836 sp->flags |= SRB_DMA_VALID; 836 sp->flags |= SRB_DMA_VALID;
837 837
838 /* Set chip new ring index. */ 838 /* Set chip new ring index. */
839 ha->isp_ops->wrt_req_reg(ha, req->id, req->ring_index); 839 WRT_REG_DWORD(req->req_q_in, req->ring_index);
840 RD_REG_DWORD_RELAXED(&ha->iobase->isp24.hccr);
840 841
841 /* Manage unprocessed RIO/ZIO commands in response queue. */ 842 /* Manage unprocessed RIO/ZIO commands in response queue. */
842 if (vha->flags.process_response_queue && 843 if (vha->flags.process_response_queue &&
@@ -854,35 +855,3 @@ queuing_error:
854 855
855 return QLA_FUNCTION_FAILED; 856 return QLA_FUNCTION_FAILED;
856} 857}
857
858uint16_t
859qla24xx_rd_req_reg(struct qla_hw_data *ha, uint16_t id)
860{
861 device_reg_t __iomem *reg = (void *) ha->iobase;
862 return RD_REG_DWORD_RELAXED(&reg->isp24.req_q_out);
863}
864
865uint16_t
866qla25xx_rd_req_reg(struct qla_hw_data *ha, uint16_t id)
867{
868 device_reg_t __iomem *reg = (void *) ha->mqiobase + QLA_QUE_PAGE * id;
869 return RD_REG_DWORD_RELAXED(&reg->isp25mq.req_q_out);
870}
871
872void
873qla24xx_wrt_req_reg(struct qla_hw_data *ha, uint16_t id, uint16_t index)
874{
875 device_reg_t __iomem *reg = (void *) ha->iobase;
876 WRT_REG_DWORD(&reg->isp24.req_q_in, index);
877 RD_REG_DWORD_RELAXED(&reg->isp24.req_q_in);
878}
879
880void
881qla25xx_wrt_req_reg(struct qla_hw_data *ha, uint16_t id, uint16_t index)
882{
883 device_reg_t __iomem *reg = (void *) ha->mqiobase + QLA_QUE_PAGE * id;
884 struct device_reg_2xxx __iomem *ioreg = &ha->iobase->isp;
885 WRT_REG_DWORD(&reg->isp25mq.req_q_in, index);
886 RD_REG_DWORD(&ioreg->hccr); /* PCI posting */
887}
888