diff options
Diffstat (limited to 'drivers/scsi/qla2xxx/qla_mbx.c')
-rw-r--r-- | drivers/scsi/qla2xxx/qla_mbx.c | 43 |
1 files changed, 34 insertions, 9 deletions
diff --git a/drivers/scsi/qla2xxx/qla_mbx.c b/drivers/scsi/qla2xxx/qla_mbx.c index f94ffbb98e95..4aab7acf7525 100644 --- a/drivers/scsi/qla2xxx/qla_mbx.c +++ b/drivers/scsi/qla2xxx/qla_mbx.c | |||
@@ -2685,6 +2685,7 @@ qla24xx_report_id_acquisition(scsi_qla_host_t *vha, | |||
2685 | uint16_t stat = le16_to_cpu(rptid_entry->vp_idx); | 2685 | uint16_t stat = le16_to_cpu(rptid_entry->vp_idx); |
2686 | struct qla_hw_data *ha = vha->hw; | 2686 | struct qla_hw_data *ha = vha->hw; |
2687 | scsi_qla_host_t *vp; | 2687 | scsi_qla_host_t *vp; |
2688 | scsi_qla_host_t *tvp; | ||
2688 | 2689 | ||
2689 | if (rptid_entry->entry_status != 0) | 2690 | if (rptid_entry->entry_status != 0) |
2690 | return; | 2691 | return; |
@@ -2710,7 +2711,7 @@ qla24xx_report_id_acquisition(scsi_qla_host_t *vha, | |||
2710 | if (MSB(stat) == 1) | 2711 | if (MSB(stat) == 1) |
2711 | return; | 2712 | return; |
2712 | 2713 | ||
2713 | list_for_each_entry(vp, &ha->vp_list, list) | 2714 | list_for_each_entry_safe(vp, tvp, &ha->vp_list, list) |
2714 | if (vp_idx == vp->vp_idx) | 2715 | if (vp_idx == vp->vp_idx) |
2715 | break; | 2716 | break; |
2716 | if (!vp) | 2717 | if (!vp) |
@@ -3090,8 +3091,7 @@ verify_done: | |||
3090 | } | 3091 | } |
3091 | 3092 | ||
3092 | int | 3093 | int |
3093 | qla25xx_init_req_que(struct scsi_qla_host *vha, struct req_que *req, | 3094 | qla25xx_init_req_que(struct scsi_qla_host *vha, struct req_que *req) |
3094 | uint8_t options) | ||
3095 | { | 3095 | { |
3096 | int rval; | 3096 | int rval; |
3097 | unsigned long flags; | 3097 | unsigned long flags; |
@@ -3101,7 +3101,7 @@ qla25xx_init_req_que(struct scsi_qla_host *vha, struct req_que *req, | |||
3101 | struct qla_hw_data *ha = vha->hw; | 3101 | struct qla_hw_data *ha = vha->hw; |
3102 | 3102 | ||
3103 | mcp->mb[0] = MBC_INITIALIZE_MULTIQ; | 3103 | mcp->mb[0] = MBC_INITIALIZE_MULTIQ; |
3104 | mcp->mb[1] = options; | 3104 | mcp->mb[1] = req->options; |
3105 | mcp->mb[2] = MSW(LSD(req->dma)); | 3105 | mcp->mb[2] = MSW(LSD(req->dma)); |
3106 | mcp->mb[3] = LSW(LSD(req->dma)); | 3106 | mcp->mb[3] = LSW(LSD(req->dma)); |
3107 | mcp->mb[6] = MSW(MSD(req->dma)); | 3107 | mcp->mb[6] = MSW(MSD(req->dma)); |
@@ -3128,7 +3128,7 @@ qla25xx_init_req_que(struct scsi_qla_host *vha, struct req_que *req, | |||
3128 | mcp->tov = 60; | 3128 | mcp->tov = 60; |
3129 | 3129 | ||
3130 | spin_lock_irqsave(&ha->hardware_lock, flags); | 3130 | spin_lock_irqsave(&ha->hardware_lock, flags); |
3131 | if (!(options & BIT_0)) { | 3131 | if (!(req->options & BIT_0)) { |
3132 | WRT_REG_DWORD(®->req_q_in, 0); | 3132 | WRT_REG_DWORD(®->req_q_in, 0); |
3133 | WRT_REG_DWORD(®->req_q_out, 0); | 3133 | WRT_REG_DWORD(®->req_q_out, 0); |
3134 | } | 3134 | } |
@@ -3142,8 +3142,7 @@ qla25xx_init_req_que(struct scsi_qla_host *vha, struct req_que *req, | |||
3142 | } | 3142 | } |
3143 | 3143 | ||
3144 | int | 3144 | int |
3145 | qla25xx_init_rsp_que(struct scsi_qla_host *vha, struct rsp_que *rsp, | 3145 | qla25xx_init_rsp_que(struct scsi_qla_host *vha, struct rsp_que *rsp) |
3146 | uint8_t options) | ||
3147 | { | 3146 | { |
3148 | int rval; | 3147 | int rval; |
3149 | unsigned long flags; | 3148 | unsigned long flags; |
@@ -3153,7 +3152,7 @@ qla25xx_init_rsp_que(struct scsi_qla_host *vha, struct rsp_que *rsp, | |||
3153 | struct qla_hw_data *ha = vha->hw; | 3152 | struct qla_hw_data *ha = vha->hw; |
3154 | 3153 | ||
3155 | mcp->mb[0] = MBC_INITIALIZE_MULTIQ; | 3154 | mcp->mb[0] = MBC_INITIALIZE_MULTIQ; |
3156 | mcp->mb[1] = options; | 3155 | mcp->mb[1] = rsp->options; |
3157 | mcp->mb[2] = MSW(LSD(rsp->dma)); | 3156 | mcp->mb[2] = MSW(LSD(rsp->dma)); |
3158 | mcp->mb[3] = LSW(LSD(rsp->dma)); | 3157 | mcp->mb[3] = LSW(LSD(rsp->dma)); |
3159 | mcp->mb[6] = MSW(MSD(rsp->dma)); | 3158 | mcp->mb[6] = MSW(MSD(rsp->dma)); |
@@ -3178,7 +3177,7 @@ qla25xx_init_rsp_que(struct scsi_qla_host *vha, struct rsp_que *rsp, | |||
3178 | mcp->tov = 60; | 3177 | mcp->tov = 60; |
3179 | 3178 | ||
3180 | spin_lock_irqsave(&ha->hardware_lock, flags); | 3179 | spin_lock_irqsave(&ha->hardware_lock, flags); |
3181 | if (!(options & BIT_0)) { | 3180 | if (!(rsp->options & BIT_0)) { |
3182 | WRT_REG_DWORD(®->rsp_q_out, 0); | 3181 | WRT_REG_DWORD(®->rsp_q_out, 0); |
3183 | WRT_REG_DWORD(®->rsp_q_in, 0); | 3182 | WRT_REG_DWORD(®->rsp_q_in, 0); |
3184 | } | 3183 | } |
@@ -3193,3 +3192,29 @@ qla25xx_init_rsp_que(struct scsi_qla_host *vha, struct rsp_que *rsp, | |||
3193 | return rval; | 3192 | return rval; |
3194 | } | 3193 | } |
3195 | 3194 | ||
3195 | int | ||
3196 | qla81xx_idc_ack(scsi_qla_host_t *vha, uint16_t *mb) | ||
3197 | { | ||
3198 | int rval; | ||
3199 | mbx_cmd_t mc; | ||
3200 | mbx_cmd_t *mcp = &mc; | ||
3201 | |||
3202 | DEBUG11(printk("%s(%ld): entered.\n", __func__, vha->host_no)); | ||
3203 | |||
3204 | mcp->mb[0] = MBC_IDC_ACK; | ||
3205 | memcpy(&mcp->mb[1], mb, QLA_IDC_ACK_REGS * sizeof(uint16_t)); | ||
3206 | mcp->out_mb = MBX_7|MBX_6|MBX_5|MBX_4|MBX_3|MBX_2|MBX_1|MBX_0; | ||
3207 | mcp->in_mb = MBX_0; | ||
3208 | mcp->tov = MBX_TOV_SECONDS; | ||
3209 | mcp->flags = 0; | ||
3210 | rval = qla2x00_mailbox_command(vha, mcp); | ||
3211 | |||
3212 | if (rval != QLA_SUCCESS) { | ||
3213 | DEBUG2_3_11(printk("%s(%ld): failed=%x (%x).\n", __func__, | ||
3214 | vha->host_no, rval, mcp->mb[0])); | ||
3215 | } else { | ||
3216 | DEBUG11(printk("%s(%ld): done.\n", __func__, vha->host_no)); | ||
3217 | } | ||
3218 | |||
3219 | return rval; | ||
3220 | } | ||