diff options
Diffstat (limited to 'drivers/scsi/scsi_error.c')
-rw-r--r-- | drivers/scsi/scsi_error.c | 30 |
1 files changed, 11 insertions, 19 deletions
diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c index 547e85aa414f..4f4edc388c07 100644 --- a/drivers/scsi/scsi_error.c +++ b/drivers/scsi/scsi_error.c | |||
@@ -617,29 +617,25 @@ void scsi_eh_prep_cmnd(struct scsi_cmnd *scmd, struct scsi_eh_save *ses, | |||
617 | ses->cmd_len = scmd->cmd_len; | 617 | ses->cmd_len = scmd->cmd_len; |
618 | memcpy(ses->cmnd, scmd->cmnd, sizeof(scmd->cmnd)); | 618 | memcpy(ses->cmnd, scmd->cmnd, sizeof(scmd->cmnd)); |
619 | ses->data_direction = scmd->sc_data_direction; | 619 | ses->data_direction = scmd->sc_data_direction; |
620 | ses->bufflen = scmd->request_bufflen; | 620 | ses->sdb = scmd->sdb; |
621 | ses->buffer = scmd->request_buffer; | ||
622 | ses->use_sg = scmd->use_sg; | ||
623 | ses->resid = scmd->resid; | ||
624 | ses->result = scmd->result; | 621 | ses->result = scmd->result; |
625 | 622 | ||
623 | memset(&scmd->sdb, 0, sizeof(scmd->sdb)); | ||
624 | |||
626 | if (sense_bytes) { | 625 | if (sense_bytes) { |
627 | scmd->request_bufflen = min_t(unsigned, | 626 | scmd->sdb.length = min_t(unsigned, SCSI_SENSE_BUFFERSIZE, |
628 | SCSI_SENSE_BUFFERSIZE, sense_bytes); | 627 | sense_bytes); |
629 | sg_init_one(&ses->sense_sgl, scmd->sense_buffer, | 628 | sg_init_one(&ses->sense_sgl, scmd->sense_buffer, |
630 | scmd->request_bufflen); | 629 | scmd->sdb.length); |
631 | scmd->request_buffer = &ses->sense_sgl; | 630 | scmd->sdb.table.sgl = &ses->sense_sgl; |
632 | scmd->sc_data_direction = DMA_FROM_DEVICE; | 631 | scmd->sc_data_direction = DMA_FROM_DEVICE; |
633 | scmd->use_sg = 1; | 632 | scmd->sdb.table.nents = 1; |
634 | memset(scmd->cmnd, 0, sizeof(scmd->cmnd)); | 633 | memset(scmd->cmnd, 0, sizeof(scmd->cmnd)); |
635 | scmd->cmnd[0] = REQUEST_SENSE; | 634 | scmd->cmnd[0] = REQUEST_SENSE; |
636 | scmd->cmnd[4] = scmd->request_bufflen; | 635 | scmd->cmnd[4] = scmd->sdb.length; |
637 | scmd->cmd_len = COMMAND_SIZE(scmd->cmnd[0]); | 636 | scmd->cmd_len = COMMAND_SIZE(scmd->cmnd[0]); |
638 | } else { | 637 | } else { |
639 | scmd->request_buffer = NULL; | ||
640 | scmd->request_bufflen = 0; | ||
641 | scmd->sc_data_direction = DMA_NONE; | 638 | scmd->sc_data_direction = DMA_NONE; |
642 | scmd->use_sg = 0; | ||
643 | if (cmnd) { | 639 | if (cmnd) { |
644 | memset(scmd->cmnd, 0, sizeof(scmd->cmnd)); | 640 | memset(scmd->cmnd, 0, sizeof(scmd->cmnd)); |
645 | memcpy(scmd->cmnd, cmnd, cmnd_size); | 641 | memcpy(scmd->cmnd, cmnd, cmnd_size); |
@@ -676,10 +672,7 @@ void scsi_eh_restore_cmnd(struct scsi_cmnd* scmd, struct scsi_eh_save *ses) | |||
676 | scmd->cmd_len = ses->cmd_len; | 672 | scmd->cmd_len = ses->cmd_len; |
677 | memcpy(scmd->cmnd, ses->cmnd, sizeof(scmd->cmnd)); | 673 | memcpy(scmd->cmnd, ses->cmnd, sizeof(scmd->cmnd)); |
678 | scmd->sc_data_direction = ses->data_direction; | 674 | scmd->sc_data_direction = ses->data_direction; |
679 | scmd->request_bufflen = ses->bufflen; | 675 | scmd->sdb = ses->sdb; |
680 | scmd->request_buffer = ses->buffer; | ||
681 | scmd->use_sg = ses->use_sg; | ||
682 | scmd->resid = ses->resid; | ||
683 | scmd->result = ses->result; | 676 | scmd->result = ses->result; |
684 | } | 677 | } |
685 | EXPORT_SYMBOL(scsi_eh_restore_cmnd); | 678 | EXPORT_SYMBOL(scsi_eh_restore_cmnd); |
@@ -1700,8 +1693,7 @@ scsi_reset_provider(struct scsi_device *dev, int flag) | |||
1700 | memset(&scmd->cmnd, '\0', sizeof(scmd->cmnd)); | 1693 | memset(&scmd->cmnd, '\0', sizeof(scmd->cmnd)); |
1701 | 1694 | ||
1702 | scmd->scsi_done = scsi_reset_provider_done_command; | 1695 | scmd->scsi_done = scsi_reset_provider_done_command; |
1703 | scmd->request_buffer = NULL; | 1696 | memset(&scmd->sdb, 0, sizeof(scmd->sdb)); |
1704 | scmd->request_bufflen = 0; | ||
1705 | 1697 | ||
1706 | scmd->cmd_len = 0; | 1698 | scmd->cmd_len = 0; |
1707 | 1699 | ||