X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=drivers%2Fscsi%2Fqla2xxx%2Fqla_iocb.c;h=0baccf130294417d40a7a8981aa2179d500d9e69;hb=9213980e6a70d8473e0ffd4b39ab5b6caaba9ff5;hp=78a1c57eee94b13a7cb27a09c3b8d050c04b9619;hpb=c449269f45c2cdf53af08c8d0af37472f66539d9;p=linux-2.6.git diff --git a/drivers/scsi/qla2xxx/qla_iocb.c b/drivers/scsi/qla2xxx/qla_iocb.c index 78a1c57ee..0baccf130 100644 --- a/drivers/scsi/qla2xxx/qla_iocb.c +++ b/drivers/scsi/qla2xxx/qla_iocb.c @@ -124,7 +124,7 @@ qla2x00_prep_cont_type0_iocb(scsi_qla_host_t *ha) /* Adjust ring index. */ ha->req_ring_index++; - if (ha->req_ring_index == REQUEST_ENTRY_CNT) { + if (ha->req_ring_index == ha->request_q_length) { ha->req_ring_index = 0; ha->request_ring_ptr = ha->request_ring; } else { @@ -153,7 +153,7 @@ qla2x00_prep_cont_type1_iocb(scsi_qla_host_t *ha) /* Adjust ring index. */ ha->req_ring_index++; - if (ha->req_ring_index == REQUEST_ENTRY_CNT) { + if (ha->req_ring_index == ha->request_q_length) { ha->req_ring_index = 0; ha->request_ring_ptr = ha->request_ring; } else { @@ -390,11 +390,11 @@ qla2x00_start_scsi(srb_t *sp) if (ha->req_q_cnt < (sp->req_cnt + 2)) { /* Calculate number of free request entries */ - cnt = RD_REG_WORD(ISP_REQ_Q_OUT(ha, reg)); + cnt = RD_REG_WORD_RELAXED(ISP_REQ_Q_OUT(ha, reg)); if (ha->req_ring_index < cnt) ha->req_q_cnt = cnt - ha->req_ring_index; else - ha->req_q_cnt = REQUEST_ENTRY_CNT - + ha->req_q_cnt = ha->request_q_length - (ha->req_ring_index - cnt); } @@ -484,7 +484,7 @@ qla2x00_start_scsi(srb_t *sp) /* Adjust ring index. */ ha->req_ring_index++; - if (ha->req_ring_index == REQUEST_ENTRY_CNT) { + if (ha->req_ring_index == ha->request_q_length) { ha->req_ring_index = 0; ha->request_ring_ptr = ha->request_ring; } else @@ -499,7 +499,7 @@ qla2x00_start_scsi(srb_t *sp) /* Set chip new ring index. */ WRT_REG_WORD(ISP_REQ_Q_IN(ha, reg), ha->req_ring_index); - RD_REG_WORD(ISP_REQ_Q_IN(ha, reg)); /* PCI Posting. */ + RD_REG_WORD_RELAXED(ISP_REQ_Q_IN(ha, reg)); /* PCI Posting. */ spin_unlock_irqrestore(&ha->hardware_lock, flags); return (QLA_SUCCESS); @@ -588,7 +588,7 @@ qla2x00_req_pkt(scsi_qla_host_t *ha) if (ha->req_ring_index < cnt) ha->req_q_cnt = cnt - ha->req_ring_index; else - ha->req_q_cnt = REQUEST_ENTRY_CNT - + ha->req_q_cnt = ha->request_q_length - (ha->req_ring_index - cnt); } /* If room for request in request ring. */ @@ -658,7 +658,7 @@ qla2x00_ms_req_pkt(scsi_qla_host_t *ha, srb_t *sp) if (ha->req_ring_index < cnt) { ha->req_q_cnt = cnt - ha->req_ring_index; } else { - ha->req_q_cnt = REQUEST_ENTRY_CNT - + ha->req_q_cnt = ha->request_q_length - (ha->req_ring_index - cnt); } } @@ -740,7 +740,7 @@ qla2x00_isp_cmd(scsi_qla_host_t *ha) /* Adjust ring index. */ ha->req_ring_index++; - if (ha->req_ring_index == REQUEST_ENTRY_CNT) { + if (ha->req_ring_index == ha->request_q_length) { ha->req_ring_index = 0; ha->request_ring_ptr = ha->request_ring; } else @@ -748,5 +748,5 @@ qla2x00_isp_cmd(scsi_qla_host_t *ha) /* Set chip new ring index. */ WRT_REG_WORD(ISP_REQ_Q_IN(ha, reg), ha->req_ring_index); - RD_REG_WORD(ISP_REQ_Q_IN(ha, reg)); /* PCI Posting. */ + RD_REG_WORD_RELAXED(ISP_REQ_Q_IN(ha, reg)); /* PCI Posting. */ }