@@ -172,8 +172,15 @@ static unsigned int sr_get_events(struct scsi_device *sdev)
struct scsi_sense_hdr sshdr;
int result;
- result = scsi_execute_req(sdev, cmd, DMA_FROM_DEVICE, buf, sizeof(buf),
- &sshdr, SR_TIMEOUT, MAX_RETRIES, NULL);
+ result = scsi_exec_req(((struct scsi_exec_args) {
+ .sdev = sdev,
+ .cmd = cmd,
+ .data_dir = DMA_FROM_DEVICE,
+ .buf = buf,
+ .buf_len = sizeof(buf),
+ .sshdr = &sshdr,
+ .timeout = SR_TIMEOUT,
+ .retries = MAX_RETRIES }));
if (scsi_sense_valid(&sshdr) && sshdr.sense_key == UNIT_ATTENTION)
return DISK_EVENT_MEDIA_CHANGE;
@@ -730,9 +737,14 @@ static void get_sectorsize(struct scsi_cd *cd)
memset(buffer, 0, sizeof(buffer));
/* Do the command and wait.. */
- the_result = scsi_execute_req(cd->device, cmd, DMA_FROM_DEVICE,
- buffer, sizeof(buffer), NULL,
- SR_TIMEOUT, MAX_RETRIES, NULL);
+ the_result = scsi_exec_req(((struct scsi_exec_args) {
+ .sdev = cd->device,
+ .cmd = cmd,
+ .data_dir = DMA_FROM_DEVICE,
+ .buf = buffer,
+ .buf_len = sizeof(buffer),
+ .timeout = SR_TIMEOUT,
+ .retries = MAX_RETRIES }));
retries--;
@@ -202,10 +202,15 @@ int sr_do_ioctl(Scsi_CD *cd, struct packet_command *cgc)
goto out;
}
- result = scsi_execute(SDev, cgc->cmd, cgc->data_direction,
- cgc->buffer, cgc->buflen, NULL, sshdr,
- cgc->timeout, IOCTL_RETRIES, 0, 0, NULL);
-
+ result = scsi_exec_req(((struct scsi_exec_args) {
+ .sdev = SDev,
+ .cmd = cgc->cmd,
+ .data_dir = cgc->data_direction,
+ .buf = cgc->buffer,
+ .buf_len = cgc->buflen,
+ .sshdr = sshdr,
+ .timeout = cgc->timeout,
+ .retries = IOCTL_RETRIES }));
/* Minimal error checking. Ignore cases we know about, and report the rest. */
if (result < 0) {
err = result;