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