summaryrefslogtreecommitdiffstats
path: root/drivers/scsi/qla2xxx/qla_iocb.c
diff options
context:
space:
mode:
authorAndrew Vasquez <andrew.vasquez@qlogic.com>2009-03-24 09:07:55 -0700
committerJames Bottomley <James.Bottomley@HansenPartnership.com>2009-04-03 09:22:44 -0500
commit08029990b25b76b1bc167336358bd21812567f2a (patch)
tree87cb617366a61bd643818996cc6186e817e23b63 /drivers/scsi/qla2xxx/qla_iocb.c
parent534841b3c110b0f149513c7695751879951d3f22 (diff)
downloadop-kernel-dev-08029990b25b76b1bc167336358bd21812567f2a.zip
op-kernel-dev-08029990b25b76b1bc167336358bd21812567f2a.tar.gz
[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 2258152..a8abbb9 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)
req_cnt = qla24xx_calc_iocbs(tot_dsds);
if (req->cnt < (req_cnt + 2)) {
- cnt = ha->isp_ops->rd_req_reg(ha, req->id);
+ cnt = RD_REG_DWORD_RELAXED(req->req_q_out);
if (req->ring_index < cnt)
req->cnt = cnt - req->ring_index;
@@ -836,7 +836,8 @@ qla24xx_start_scsi(srb_t *sp)
sp->flags |= SRB_DMA_VALID;
/* Set chip new ring index. */
- ha->isp_ops->wrt_req_reg(ha, req->id, req->ring_index);
+ WRT_REG_DWORD(req->req_q_in, req->ring_index);
+ RD_REG_DWORD_RELAXED(&ha->iobase->isp24.hccr);
/* Manage unprocessed RIO/ZIO commands in response queue. */
if (vha->flags.process_response_queue &&
@@ -854,35 +855,3 @@ queuing_error:
return QLA_FUNCTION_FAILED;
}
-
-uint16_t
-qla24xx_rd_req_reg(struct qla_hw_data *ha, uint16_t id)
-{
- device_reg_t __iomem *reg = (void *) ha->iobase;
- return RD_REG_DWORD_RELAXED(&reg->isp24.req_q_out);
-}
-
-uint16_t
-qla25xx_rd_req_reg(struct qla_hw_data *ha, uint16_t id)
-{
- device_reg_t __iomem *reg = (void *) ha->mqiobase + QLA_QUE_PAGE * id;
- return RD_REG_DWORD_RELAXED(&reg->isp25mq.req_q_out);
-}
-
-void
-qla24xx_wrt_req_reg(struct qla_hw_data *ha, uint16_t id, uint16_t index)
-{
- device_reg_t __iomem *reg = (void *) ha->iobase;
- WRT_REG_DWORD(&reg->isp24.req_q_in, index);
- RD_REG_DWORD_RELAXED(&reg->isp24.req_q_in);
-}
-
-void
-qla25xx_wrt_req_reg(struct qla_hw_data *ha, uint16_t id, uint16_t index)
-{
- device_reg_t __iomem *reg = (void *) ha->mqiobase + QLA_QUE_PAGE * id;
- struct device_reg_2xxx __iomem *ioreg = &ha->iobase->isp;
- WRT_REG_DWORD(&reg->isp25mq.req_q_in, index);
- RD_REG_DWORD(&ioreg->hccr); /* PCI posting */
-}
-
OpenPOWER on IntegriCloud