diff options
-rw-r--r-- | drivers/usb/storage/cypress_atacb.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/drivers/usb/storage/cypress_atacb.c b/drivers/usb/storage/cypress_atacb.c index 898e67d30e56..9466a99baab6 100644 --- a/drivers/usb/storage/cypress_atacb.c +++ b/drivers/usb/storage/cypress_atacb.c | |||
@@ -133,19 +133,18 @@ void cypress_atacb_passthrough(struct scsi_cmnd *srb, struct us_data *us) | |||
133 | 133 | ||
134 | /* build the command for | 134 | /* build the command for |
135 | * reading the ATA registers */ | 135 | * reading the ATA registers */ |
136 | scsi_eh_prep_cmnd(srb, &ses, NULL, 0, 0); | 136 | scsi_eh_prep_cmnd(srb, &ses, NULL, 0, sizeof(regs)); |
137 | srb->sdb.length = sizeof(regs); | 137 | |
138 | sg_init_one(&ses.sense_sgl, regs, srb->sdb.length); | ||
139 | srb->sdb.table.sgl = &ses.sense_sgl; | ||
140 | srb->sc_data_direction = DMA_FROM_DEVICE; | ||
141 | srb->sdb.table.nents = 1; | ||
142 | /* we use the same command as before, but we set | 138 | /* we use the same command as before, but we set |
143 | * the read taskfile bit, for not executing atacb command, | 139 | * the read taskfile bit, for not executing atacb command, |
144 | * but reading register selected in srb->cmnd[4] | 140 | * but reading register selected in srb->cmnd[4] |
145 | */ | 141 | */ |
142 | srb->cmd_len = 16; | ||
143 | srb->cmnd = ses.cmnd; | ||
146 | srb->cmnd[2] = 1; | 144 | srb->cmnd[2] = 1; |
147 | 145 | ||
148 | usb_stor_transparent_scsi_command(srb, us); | 146 | usb_stor_transparent_scsi_command(srb, us); |
147 | memcpy(regs, srb->sense_buffer, sizeof(regs)); | ||
149 | tmp_result = srb->result; | 148 | tmp_result = srb->result; |
150 | scsi_eh_restore_cmnd(srb, &ses); | 149 | scsi_eh_restore_cmnd(srb, &ses); |
151 | /* we fail to get registers, report invalid command */ | 150 | /* we fail to get registers, report invalid command */ |
@@ -162,8 +161,8 @@ void cypress_atacb_passthrough(struct scsi_cmnd *srb, struct us_data *us) | |||
162 | 161 | ||
163 | /* XXX we should generate sk, asc, ascq from status and error | 162 | /* XXX we should generate sk, asc, ascq from status and error |
164 | * regs | 163 | * regs |
165 | * (see 11.1 Error translation ATA device error to SCSI error map) | 164 | * (see 11.1 Error translation ATA device error to SCSI error |
166 | * and ata_to_sense_error from libata. | 165 | * map, and ata_to_sense_error from libata.) |
167 | */ | 166 | */ |
168 | 167 | ||
169 | /* Sense data is current and format is descriptor. */ | 168 | /* Sense data is current and format is descriptor. */ |