Commit c202927c authored by Matthew Dharm's avatar Matthew Dharm Committed by Linus Torvalds

[PATCH] unusual_devs fixups

This moves the initialization of the struct scsi_device fields
use_10_for_ms and use_10_for_rw into a central place.  This allows the
host's slave_configure() function to change them (with effect).  This
also collapses two identical sections of code into a single one.

This is needed by usb-storage, so we can resolve some Babble problems,
some device-crashing problems, and remove a great deal of troublesome
mode-sense-translation code.
parent 9ff05b1b
...@@ -686,6 +686,9 @@ static int scsi_add_lun(Scsi_Device *sdev, char *inq_result, int *bflags) ...@@ -686,6 +686,9 @@ static int scsi_add_lun(Scsi_Device *sdev, char *inq_result, int *bflags)
* function */ * function */
sdev->max_device_blocked = SCSI_DEFAULT_DEVICE_BLOCKED; sdev->max_device_blocked = SCSI_DEFAULT_DEVICE_BLOCKED;
sdev->use_10_for_rw = 1;
sdev->use_10_for_ms = 0;
if(sdev->host->hostt->slave_configure) if(sdev->host->hostt->slave_configure)
sdev->host->hostt->slave_configure(sdev); sdev->host->hostt->slave_configure(sdev);
......
...@@ -1265,8 +1265,6 @@ sd_init_onedisk(struct scsi_disk * sdkp, struct gendisk *disk) ...@@ -1265,8 +1265,6 @@ sd_init_onedisk(struct scsi_disk * sdkp, struct gendisk *disk)
if (sdkp->media_present) if (sdkp->media_present)
sd_read_cache_type(sdkp, disk->disk_name, SRpnt, buffer); sd_read_cache_type(sdkp, disk->disk_name, SRpnt, buffer);
SRpnt->sr_device->use_10_for_rw = 1;
SRpnt->sr_device->use_10_for_ms = 0;
SRpnt->sr_device->remap = 1; SRpnt->sr_device->remap = 1;
leave: leave:
......
...@@ -524,8 +524,6 @@ static int sr_probe(struct device *dev) ...@@ -524,8 +524,6 @@ static int sr_probe(struct device *dev)
sprintf(cd->cdi.name, "sr%d", minor); sprintf(cd->cdi.name, "sr%d", minor);
sdev->sector_size = 2048; /* A guess, just in case */ sdev->sector_size = 2048; /* A guess, just in case */
sdev->use_10_for_rw = 1;
sdev->use_10_for_ms = 0;
sdev->remap = 1; sdev->remap = 1;
/* FIXME: need to handle a get_capabilities failure properly ?? */ /* FIXME: need to handle a get_capabilities failure properly ?? */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment