patch-1.3.76 linux/drivers/scsi/sr.c
Next file: linux/drivers/scsi/sr_ioctl.c
Previous file: linux/drivers/scsi/sd.c
Back to the patch index
Back to the overall index
- Lines: 40
- Date:
Mon Mar 18 11:54:26 1996
- Orig file:
v1.3.75/linux/drivers/scsi/sr.c
- Orig date:
Sat Feb 17 16:02:52 1996
diff -u --recursive --new-file v1.3.75/linux/drivers/scsi/sr.c linux/drivers/scsi/sr.c
@@ -1020,18 +1020,27 @@
(buffer[1] << 16) | (buffer[2] << 8) | buffer[3];
scsi_CDs[i].sector_size = (buffer[4] << 24) |
(buffer[5] << 16) | (buffer[6] << 8) | buffer[7];
- if(scsi_CDs[i].sector_size == 0) scsi_CDs[i].sector_size = 2048;
- /* Work around bug/feature in HP 4020i CD-Recorder... */
- if(scsi_CDs[i].sector_size == 2340) scsi_CDs[i].sector_size = 2048;
- if(scsi_CDs[i].sector_size != 2048 &&
- scsi_CDs[i].sector_size != 512) {
- printk ("scd%d : unsupported sector size %d.\n",
- i, scsi_CDs[i].sector_size);
- scsi_CDs[i].capacity = 0;
- scsi_CDs[i].needs_sector_size = 1;
- };
- if(scsi_CDs[i].sector_size == 2048)
- scsi_CDs[i].capacity *= 4;
+ switch (scsi_CDs[i].sector_size) {
+ /*
+ * HP 4020i CD-Recorder reports 2340 byte sectors
+ * Philips CD-Writers report 2352 byte sectors
+ *
+ * Use 2k sectors for them..
+ */
+ case 0: case 2340: case 2352:
+ scsi_CDs[i].sector_size = 2048;
+ /* fall through */
+ case 2048:
+ scsi_CDs[i].capacity *= 4;
+ /* fall through */
+ case 512:
+ break;
+ default:
+ printk ("scd%d : unsupported sector size %d.\n",
+ i, scsi_CDs[i].sector_size);
+ scsi_CDs[i].capacity = 0;
+ scsi_CDs[i].needs_sector_size = 1;
+ }
scsi_CDs[i].needs_sector_size = 0;
sr_sizes[i] = scsi_CDs[i].capacity;
};
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov
with Sam's (original) version of this