|
@@ -1854,7 +1854,7 @@ static void cciss_softirq_done(struct request *rq)
|
|
dev_dbg(&h->pdev->dev, "Done with %p\n", rq);
|
|
dev_dbg(&h->pdev->dev, "Done with %p\n", rq);
|
|
|
|
|
|
/* set the residual count for pc requests */
|
|
/* set the residual count for pc requests */
|
|
- if (rq->cmd_type == REQ_TYPE_BLOCK_PC)
|
|
|
|
|
|
+ if (blk_rq_is_passthrough(rq))
|
|
scsi_req(rq)->resid_len = c->err_info->ResidualCnt;
|
|
scsi_req(rq)->resid_len = c->err_info->ResidualCnt;
|
|
|
|
|
|
blk_end_request_all(rq, (rq->errors == 0) ? 0 : -EIO);
|
|
blk_end_request_all(rq, (rq->errors == 0) ? 0 : -EIO);
|
|
@@ -3083,7 +3083,7 @@ static inline int evaluate_target_status(ctlr_info_t *h,
|
|
driver_byte = DRIVER_OK;
|
|
driver_byte = DRIVER_OK;
|
|
msg_byte = cmd->err_info->CommandStatus; /* correct? seems too device specific */
|
|
msg_byte = cmd->err_info->CommandStatus; /* correct? seems too device specific */
|
|
|
|
|
|
- if (cmd->rq->cmd_type == REQ_TYPE_BLOCK_PC)
|
|
|
|
|
|
+ if (blk_rq_is_passthrough(cmd->rq))
|
|
host_byte = DID_PASSTHROUGH;
|
|
host_byte = DID_PASSTHROUGH;
|
|
else
|
|
else
|
|
host_byte = DID_OK;
|
|
host_byte = DID_OK;
|
|
@@ -3092,7 +3092,7 @@ static inline int evaluate_target_status(ctlr_info_t *h,
|
|
host_byte, driver_byte);
|
|
host_byte, driver_byte);
|
|
|
|
|
|
if (cmd->err_info->ScsiStatus != SAM_STAT_CHECK_CONDITION) {
|
|
if (cmd->err_info->ScsiStatus != SAM_STAT_CHECK_CONDITION) {
|
|
- if (cmd->rq->cmd_type != REQ_TYPE_BLOCK_PC)
|
|
|
|
|
|
+ if (!blk_rq_is_passthrough(cmd->rq))
|
|
dev_warn(&h->pdev->dev, "cmd %p "
|
|
dev_warn(&h->pdev->dev, "cmd %p "
|
|
"has SCSI Status 0x%x\n",
|
|
"has SCSI Status 0x%x\n",
|
|
cmd, cmd->err_info->ScsiStatus);
|
|
cmd, cmd->err_info->ScsiStatus);
|
|
@@ -3103,16 +3103,16 @@ static inline int evaluate_target_status(ctlr_info_t *h,
|
|
sense_key = 0xf & cmd->err_info->SenseInfo[2];
|
|
sense_key = 0xf & cmd->err_info->SenseInfo[2];
|
|
/* no status or recovered error */
|
|
/* no status or recovered error */
|
|
if (((sense_key == 0x0) || (sense_key == 0x1)) &&
|
|
if (((sense_key == 0x0) || (sense_key == 0x1)) &&
|
|
- (cmd->rq->cmd_type != REQ_TYPE_BLOCK_PC))
|
|
|
|
|
|
+ !blk_rq_is_passthrough(cmd->rq))
|
|
error_value = 0;
|
|
error_value = 0;
|
|
|
|
|
|
if (check_for_unit_attention(h, cmd)) {
|
|
if (check_for_unit_attention(h, cmd)) {
|
|
- *retry_cmd = !(cmd->rq->cmd_type == REQ_TYPE_BLOCK_PC);
|
|
|
|
|
|
+ *retry_cmd = !blk_rq_is_passthrough(cmd->rq);
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|
|
|
|
|
|
/* Not SG_IO or similar? */
|
|
/* Not SG_IO or similar? */
|
|
- if (cmd->rq->cmd_type != REQ_TYPE_BLOCK_PC) {
|
|
|
|
|
|
+ if (!blk_rq_is_passthrough(cmd->rq)) {
|
|
if (error_value != 0)
|
|
if (error_value != 0)
|
|
dev_warn(&h->pdev->dev, "cmd %p has CHECK CONDITION"
|
|
dev_warn(&h->pdev->dev, "cmd %p has CHECK CONDITION"
|
|
" sense key = 0x%x\n", cmd, sense_key);
|
|
" sense key = 0x%x\n", cmd, sense_key);
|
|
@@ -3146,14 +3146,14 @@ static inline void complete_command(ctlr_info_t *h, CommandList_struct *cmd,
|
|
rq->errors = evaluate_target_status(h, cmd, &retry_cmd);
|
|
rq->errors = evaluate_target_status(h, cmd, &retry_cmd);
|
|
break;
|
|
break;
|
|
case CMD_DATA_UNDERRUN:
|
|
case CMD_DATA_UNDERRUN:
|
|
- if (cmd->rq->cmd_type == REQ_TYPE_FS) {
|
|
|
|
|
|
+ if (!blk_rq_is_passthrough(cmd->rq)) {
|
|
dev_warn(&h->pdev->dev, "cmd %p has"
|
|
dev_warn(&h->pdev->dev, "cmd %p has"
|
|
" completed with data underrun "
|
|
" completed with data underrun "
|
|
"reported\n", cmd);
|
|
"reported\n", cmd);
|
|
}
|
|
}
|
|
break;
|
|
break;
|
|
case CMD_DATA_OVERRUN:
|
|
case CMD_DATA_OVERRUN:
|
|
- if (cmd->rq->cmd_type == REQ_TYPE_FS)
|
|
|
|
|
|
+ if (!blk_rq_is_passthrough(cmd->rq))
|
|
dev_warn(&h->pdev->dev, "cciss: cmd %p has"
|
|
dev_warn(&h->pdev->dev, "cciss: cmd %p has"
|
|
" completed with data overrun "
|
|
" completed with data overrun "
|
|
"reported\n", cmd);
|
|
"reported\n", cmd);
|
|
@@ -3163,7 +3163,7 @@ static inline void complete_command(ctlr_info_t *h, CommandList_struct *cmd,
|
|
"reported invalid\n", cmd);
|
|
"reported invalid\n", cmd);
|
|
rq->errors = make_status_bytes(SAM_STAT_GOOD,
|
|
rq->errors = make_status_bytes(SAM_STAT_GOOD,
|
|
cmd->err_info->CommandStatus, DRIVER_OK,
|
|
cmd->err_info->CommandStatus, DRIVER_OK,
|
|
- (cmd->rq->cmd_type == REQ_TYPE_BLOCK_PC) ?
|
|
|
|
|
|
+ blk_rq_is_passthrough(cmd->rq) ?
|
|
DID_PASSTHROUGH : DID_ERROR);
|
|
DID_PASSTHROUGH : DID_ERROR);
|
|
break;
|
|
break;
|
|
case CMD_PROTOCOL_ERR:
|
|
case CMD_PROTOCOL_ERR:
|
|
@@ -3171,7 +3171,7 @@ static inline void complete_command(ctlr_info_t *h, CommandList_struct *cmd,
|
|
"protocol error\n", cmd);
|
|
"protocol error\n", cmd);
|
|
rq->errors = make_status_bytes(SAM_STAT_GOOD,
|
|
rq->errors = make_status_bytes(SAM_STAT_GOOD,
|
|
cmd->err_info->CommandStatus, DRIVER_OK,
|
|
cmd->err_info->CommandStatus, DRIVER_OK,
|
|
- (cmd->rq->cmd_type == REQ_TYPE_BLOCK_PC) ?
|
|
|
|
|
|
+ blk_rq_is_passthrough(cmd->rq) ?
|
|
DID_PASSTHROUGH : DID_ERROR);
|
|
DID_PASSTHROUGH : DID_ERROR);
|
|
break;
|
|
break;
|
|
case CMD_HARDWARE_ERR:
|
|
case CMD_HARDWARE_ERR:
|
|
@@ -3179,7 +3179,7 @@ static inline void complete_command(ctlr_info_t *h, CommandList_struct *cmd,
|
|
" hardware error\n", cmd);
|
|
" hardware error\n", cmd);
|
|
rq->errors = make_status_bytes(SAM_STAT_GOOD,
|
|
rq->errors = make_status_bytes(SAM_STAT_GOOD,
|
|
cmd->err_info->CommandStatus, DRIVER_OK,
|
|
cmd->err_info->CommandStatus, DRIVER_OK,
|
|
- (cmd->rq->cmd_type == REQ_TYPE_BLOCK_PC) ?
|
|
|
|
|
|
+ blk_rq_is_passthrough(cmd->rq) ?
|
|
DID_PASSTHROUGH : DID_ERROR);
|
|
DID_PASSTHROUGH : DID_ERROR);
|
|
break;
|
|
break;
|
|
case CMD_CONNECTION_LOST:
|
|
case CMD_CONNECTION_LOST:
|
|
@@ -3187,7 +3187,7 @@ static inline void complete_command(ctlr_info_t *h, CommandList_struct *cmd,
|
|
"connection lost\n", cmd);
|
|
"connection lost\n", cmd);
|
|
rq->errors = make_status_bytes(SAM_STAT_GOOD,
|
|
rq->errors = make_status_bytes(SAM_STAT_GOOD,
|
|
cmd->err_info->CommandStatus, DRIVER_OK,
|
|
cmd->err_info->CommandStatus, DRIVER_OK,
|
|
- (cmd->rq->cmd_type == REQ_TYPE_BLOCK_PC) ?
|
|
|
|
|
|
+ blk_rq_is_passthrough(cmd->rq) ?
|
|
DID_PASSTHROUGH : DID_ERROR);
|
|
DID_PASSTHROUGH : DID_ERROR);
|
|
break;
|
|
break;
|
|
case CMD_ABORTED:
|
|
case CMD_ABORTED:
|
|
@@ -3195,7 +3195,7 @@ static inline void complete_command(ctlr_info_t *h, CommandList_struct *cmd,
|
|
"aborted\n", cmd);
|
|
"aborted\n", cmd);
|
|
rq->errors = make_status_bytes(SAM_STAT_GOOD,
|
|
rq->errors = make_status_bytes(SAM_STAT_GOOD,
|
|
cmd->err_info->CommandStatus, DRIVER_OK,
|
|
cmd->err_info->CommandStatus, DRIVER_OK,
|
|
- (cmd->rq->cmd_type == REQ_TYPE_BLOCK_PC) ?
|
|
|
|
|
|
+ blk_rq_is_passthrough(cmd->rq) ?
|
|
DID_PASSTHROUGH : DID_ABORT);
|
|
DID_PASSTHROUGH : DID_ABORT);
|
|
break;
|
|
break;
|
|
case CMD_ABORT_FAILED:
|
|
case CMD_ABORT_FAILED:
|
|
@@ -3203,7 +3203,7 @@ static inline void complete_command(ctlr_info_t *h, CommandList_struct *cmd,
|
|
"abort failed\n", cmd);
|
|
"abort failed\n", cmd);
|
|
rq->errors = make_status_bytes(SAM_STAT_GOOD,
|
|
rq->errors = make_status_bytes(SAM_STAT_GOOD,
|
|
cmd->err_info->CommandStatus, DRIVER_OK,
|
|
cmd->err_info->CommandStatus, DRIVER_OK,
|
|
- (cmd->rq->cmd_type == REQ_TYPE_BLOCK_PC) ?
|
|
|
|
|
|
+ blk_rq_is_passthrough(cmd->rq) ?
|
|
DID_PASSTHROUGH : DID_ERROR);
|
|
DID_PASSTHROUGH : DID_ERROR);
|
|
break;
|
|
break;
|
|
case CMD_UNSOLICITED_ABORT:
|
|
case CMD_UNSOLICITED_ABORT:
|
|
@@ -3218,21 +3218,21 @@ static inline void complete_command(ctlr_info_t *h, CommandList_struct *cmd,
|
|
"%p retried too many times\n", cmd);
|
|
"%p retried too many times\n", cmd);
|
|
rq->errors = make_status_bytes(SAM_STAT_GOOD,
|
|
rq->errors = make_status_bytes(SAM_STAT_GOOD,
|
|
cmd->err_info->CommandStatus, DRIVER_OK,
|
|
cmd->err_info->CommandStatus, DRIVER_OK,
|
|
- (cmd->rq->cmd_type == REQ_TYPE_BLOCK_PC) ?
|
|
|
|
|
|
+ blk_rq_is_passthrough(cmd->rq) ?
|
|
DID_PASSTHROUGH : DID_ABORT);
|
|
DID_PASSTHROUGH : DID_ABORT);
|
|
break;
|
|
break;
|
|
case CMD_TIMEOUT:
|
|
case CMD_TIMEOUT:
|
|
dev_warn(&h->pdev->dev, "cmd %p timedout\n", cmd);
|
|
dev_warn(&h->pdev->dev, "cmd %p timedout\n", cmd);
|
|
rq->errors = make_status_bytes(SAM_STAT_GOOD,
|
|
rq->errors = make_status_bytes(SAM_STAT_GOOD,
|
|
cmd->err_info->CommandStatus, DRIVER_OK,
|
|
cmd->err_info->CommandStatus, DRIVER_OK,
|
|
- (cmd->rq->cmd_type == REQ_TYPE_BLOCK_PC) ?
|
|
|
|
|
|
+ blk_rq_is_passthrough(cmd->rq) ?
|
|
DID_PASSTHROUGH : DID_ERROR);
|
|
DID_PASSTHROUGH : DID_ERROR);
|
|
break;
|
|
break;
|
|
case CMD_UNABORTABLE:
|
|
case CMD_UNABORTABLE:
|
|
dev_warn(&h->pdev->dev, "cmd %p unabortable\n", cmd);
|
|
dev_warn(&h->pdev->dev, "cmd %p unabortable\n", cmd);
|
|
rq->errors = make_status_bytes(SAM_STAT_GOOD,
|
|
rq->errors = make_status_bytes(SAM_STAT_GOOD,
|
|
cmd->err_info->CommandStatus, DRIVER_OK,
|
|
cmd->err_info->CommandStatus, DRIVER_OK,
|
|
- cmd->rq->cmd_type == REQ_TYPE_BLOCK_PC ?
|
|
|
|
|
|
+ blk_rq_is_passthrough(cmd->rq) ?
|
|
DID_PASSTHROUGH : DID_ERROR);
|
|
DID_PASSTHROUGH : DID_ERROR);
|
|
break;
|
|
break;
|
|
default:
|
|
default:
|
|
@@ -3241,7 +3241,7 @@ static inline void complete_command(ctlr_info_t *h, CommandList_struct *cmd,
|
|
cmd->err_info->CommandStatus);
|
|
cmd->err_info->CommandStatus);
|
|
rq->errors = make_status_bytes(SAM_STAT_GOOD,
|
|
rq->errors = make_status_bytes(SAM_STAT_GOOD,
|
|
cmd->err_info->CommandStatus, DRIVER_OK,
|
|
cmd->err_info->CommandStatus, DRIVER_OK,
|
|
- (cmd->rq->cmd_type == REQ_TYPE_BLOCK_PC) ?
|
|
|
|
|
|
+ blk_rq_is_passthrough(cmd->rq) ?
|
|
DID_PASSTHROUGH : DID_ERROR);
|
|
DID_PASSTHROUGH : DID_ERROR);
|
|
}
|
|
}
|
|
|
|
|