Linux-Development-Sys Digest #48, Volume #7      Thu, 12 Aug 99 22:14:36 EDT

Contents:
  DRIVER for Toshiba DVD-RAM (only tested on kernel 2.0.36) ([EMAIL PROTECTED])

----------------------------------------------------------------------------

From: [EMAIL PROTECTED]
Subject: DRIVER for Toshiba DVD-RAM (only tested on kernel 2.0.36)
Date: 13 Aug 1999 00:28:06 GMT


Thanks to a clue in a post by Steve McIntyre in this group on 7/27/99
that the Toshiba SD-W1101 DVD-RAM doesn't like 6-byte SCSI I/O commands
(but DOES tolerate 10-byte commands), I was able to write a patch to get
the Toshiba to work.  I apologize for not having posted this sooner (I
could have posted on Monday), but I was holding out in the hopes of
testing on a more recent kernel than 2.0.36 (this is the latest kernel we
have installed here right now).  Having seen recent messages in this group
about the Toshiba, I figured I better post this now and wait on confirming
the patch with a newer kernel until a future date.

So, this is a patch for the Toshiba SD-W1101 DVD-RAM drive against Linux
kernel 2.0.36.  It consists of three files.  File #1 is a set of
instructions on how to install the patch / get things up and running.
In theory, if you type the non-comment lines in this file, things should
work.  (In theory.)  File #2 is the first of two patch files,
"dvd_scsi_patch-2.0.36-toshiba".  It is hacked from a similar file
residing at www.jaist.ac.jp/~sight95/linux/dvd-ram/dvd-ram-english.html,
which happens to be a patch for the Panasonic DVD-RAM.  Basically all it
is is the original patch with strings referring to "Panasonic", etc.,
replaced with "Toshiba", etc.  File #3, is the second patch file,
"2048dif-2.0.36-toshiba".  It is the "2048dif-2.0.36" patch referenced
by the above Panasonic DVD-RAM website, but with the sd.c patch modified
to drive the Toshiba with 10-byte, rather than 6-byte, SCSI commands.

This has ***ONLY*** been verified to work with the Tekram DC-390 SCSI
controller card + Linux kernel 2.0.36.  Certain other SCSI controller
cards may need patching (basically, any card whose driver contains
the words "WRITE_10", "WRITE_6", "READ_6", or "READ_10" is suspect.
You can easily look to see if this applies to your card by doing a grep
for these phrases in the drivers/scsi directory of your Linux source
directory).  Kernels newer than 2.0.36 *SHOULD* work, but again, I haven't
had an opportunity to verify any.

Would anyone be kind enough to tell me who I should submit this patch
to, to get it incorporated into the standard Linux kernel distributions?
Please e-mail:  [EMAIL PROTECTED]  Thanks in advance!

Good luck!!

---Reed Meyer
   [EMAIL PROTECTED]


============================================================================
File #1:  Installation instructions for Toshiba DVD-RAM + kernel 2.0.36
============================================================================


#  Patch instructions for Toshiba DVD-RAM / Linux kernel 2.0.36.
#  Reed D. Meyer, [EMAIL PROTECTED],  8/12/99.  Hacked from
#  instructions by [EMAIL PROTECTED] (found at:
#  www.jaist.ac.jp/~sight95/linux/dvd-ram/dvd-ram-english.html)
#
#  SCSI patch for blocksize 2048 + Toshiba patch was confirmed *ONLY*
#  for the Tekram DC-390 SCSI controller card!
#  Some other I/Fs may not work successfully, and then you need to make some
#  changes in the correspond driver to your I/F of the kernel source.
#
#  NOTE!  Change "$DVDRAM" to whatever directory to which you downloaded the
#  patch files "2048dif-2.0.36-toshiba" and "dvd_scsi_patch-2.0.36-toshiba".
#  ALSO NOTE!  Don't run this file as a batch file; you should
#  manually type each command on the command line (in case there's errors).

su
cd /usr/src
patch -p0 < $DVDRAM/2048dif-2.0.36-toshiba
cd /usr/src/linux/drivers/scsi
patch -p0 < $DVDRAM/dvd_scsi_patch-2.0.36-toshiba
cd /usr/src/linux
make menuconfig
# Check "Support SCSI" to Y or M.
make dep; make clean; make bzImage; make modules; make modules_install
# Do the following only if you're sure you want to copy the new
# vmlinuz + modules to the standard area.
mv System.map /boot
mv arch/i386/boot/bzImage /boot/vmlinuz
# Regenerate the master boot record (re-run the LILO configuration)
# (Make sure to edit /etc/lilo.conf as necessary!)
/sbin/lilo
# Reboot your Linux system.  After the reboot...
#   Make a partition using "fdisk".
#  Make sure that the head sector number of each partition is a multiple of 4
#  if there's more than one partition (the logical sector size is 512 bytes but
#  the physical block size is 2048 so there'd be problems otherwise).
fdisk /dev/sda
   n (make new partition)
   p (primary) 
   1 (select 1 at primary) 
   1 (start cylinder) 
   303 (last cylinder: if only make 1 partition.) 
   w (write & quit) 
# Then, format.  Note the -b 2048 option to mke2fs!  Also, note that
# we use /dev/sda, *NOT* /dev/sda1!
# (If making an MSDOS partition is desired, you might want to try
# passing the option "-s 32" to mkdosfs.)
mke2fs -c -b 2048 /dev/sda
#  Make a mount point.
mkdir /dvdram
# Now, you test mount.
mount /dev/sda /dvdram
# (After the test you may modify /etc/fstab. General user can mount using
# the command "mount /dvdram".)
vi /etc/fstab
# Add line:
   /dev/sda  /dvdram  ext2  user,noauto,rw,suid,exec 0 0


============================================================================
File #2:  dvd_scsi_patch-2.0.36-toshiba
============================================================================


*** scsi.c.original     Sat Jan  2 01:55:05 1999
--- scsi.c      Sat Jan  2 02:34:21 1999
***************
*** 539,544 ****
--- 539,546 ----
    struct Scsi_Device_Template *sdtpnt;
    Scsi_Device * SDtail, *SDpnt=*SDpnt2;
    int bflags, type=-1;
+   static int TOSH_DVD_RAM[2] = {-1,-1};
+   int org_lun = lun;
  
    SDtail = scsi_devices;
    if (scsi_devices)
***************
*** 551,556 ****
--- 553,568 ----
    SDpnt->lun = lun;
    SDpnt->channel = channel;
  
+   /* Toshiba SD-W1101 DVD-RAM adapted from the Panasonic model */
+   if (TOSH_DVD_RAM[0] == channel && TOSH_DVD_RAM[1] == dev && lun == 1) {
+     /* get CD-ROM type */
+     SDpnt->lun = lun = 0;
+   } else {
+     /* clear status */
+     TOSH_DVD_RAM[0] = -1;
+     TOSH_DVD_RAM[1] = -1;
+   }
+ 
    /* Some low level driver could use device->type (DB) */
    SDpnt->type = -1;
  
***************
*** 651,656 ****
--- 663,683 ----
      scsi_result[1] |= 0x80;     /* removable */
    }
  
+   if (!strncmp (scsi_result + 8, "TOSHIBA", 7) &&
+       !strncmp (scsi_result + 16, "SD-W1101", 8) &&
+       scsi_result[0] == TYPE_ROM) {
+     if (TOSH_DVD_RAM[0] == channel && TOSH_DVD_RAM[1] == dev && org_lun == 1) {
+       /* Toshiba SD-W1101 DVD-RAM treats as ROM */
+       lun = 1;
+     } else {
+       /* Toshiba SD-W1101 DVD-RAM treats as MOD */
+       scsi_result[0] = TYPE_MOD;
+       scsi_result[1] |= 0x80;     /* removable */
+       TOSH_DVD_RAM[0] = channel;
+       TOSH_DVD_RAM[1] = dev;
+     }
+   }
+ 
    if (!strncmp (scsi_result + 8, "NEC", 3)) {
      if (!strncmp (scsi_result + 16, "CD-ROM DRIVE:84 ", 16) ||
          !strncmp (scsi_result + 16, "CD-ROM DRIVE:25", 15))
***************
*** 824,829 ****
--- 851,862 ----
     */
    if (bflags & BLIST_MAX5LUN) {
      *max_dev_lun = 5;
+     return 1;
+   }
+ 
+   /* Toshiba SD-W1101 DVD-RAM */
+   if (TOSH_DVD_RAM[0] == channel && TOSH_DVD_RAM[1] == dev && org_lun == 1) {
+     *max_dev_lun = 2;
      return 1;
    }
  


============================================================================
File #3:  2048dif-2.0.36-toshiba
============================================================================


diff -u --recursive --new-file linux-2.0.36/drivers/block/genhd.c 
linux-2.0.36-2048/drivers/block/genhd.c
--- linux-2.0.36/drivers/block/genhd.c  Thu Jun  4 07:17:47 1998
+++ linux-2.0.36-2048/drivers/block/genhd.c     Thu Nov 26 22:29:28 1998
@@ -24,9 +24,9 @@
 #include <linux/kernel.h>
 #include <linux/major.h>
 #include <linux/string.h>
-#ifdef CONFIG_BLK_DEV_INITRD
+/* #ifdef CONFIG_BLK_DEV_INITRD */
 #include <linux/blk.h>
-#endif
+/* #endif */
 
 #include <asm/system.h>
 
@@ -125,6 +125,7 @@
        unsigned long first_sector, first_size, this_sector, this_size;
        int mask = (1 << hd->minor_shift) - 1;
        int i;
+       int block_size;
 
        first_sector = hd->part[MINOR(dev)].start_sect;
        first_size = hd->part[MINOR(dev)].nr_sects;
@@ -133,8 +134,13 @@
        while (1) {
                if ((current_minor & mask) == 0)
                        return;
-               if (!(bh = bread(dev,0,1024)))
-                       return;
+               if (blksize_size[MAJOR(dev)] &&
+                   blksize_size[MAJOR(dev)][MINOR(dev)] == 2048)
+                       block_size=2048;
+               else
+                       block_size=1024;
+               if (!(bh = bread(dev,0,block_size)))
+                               return;
          /*
           * This block is from a device that we're about to stomp on.
           * So make sure nobody thinks this block is usable.
@@ -249,12 +255,15 @@
        struct partition *p;
        unsigned char *data;
        int mask = (1 << hd->minor_shift) - 1;
+       int block_size = 1024;
 #ifdef CONFIG_BLK_DEV_IDE
        int tested_for_xlate = 0;
 
 read_mbr:
 #endif
-       if (!(bh = bread(dev,0,1024))) {
+       if (blksize_size[MAJOR(dev)] &&  blksize_size[MAJOR(dev)][MINOR(dev)] == 2048)
+               block_size = 2048;
+       if (!(bh = bread(dev,0,block_size))) {
                printk(" unable to read partition table\n");
                return -1;
        }
@@ -662,6 +671,10 @@
        if (msdos_partition(hd, dev, first_sector))
                return;
 #endif
+       if (blksize_size[MAJOR(dev)] &&
+           blksize_size[MAJOR(dev)][MINOR(dev)] == 2048)
+               printk(" unknown partition table (2048 byte/sector)\n");
+       else {
 #ifdef CONFIG_OSF_PARTITION
        if (osf_partition(hd, dev, first_sector))
                return;
@@ -675,6 +688,7 @@
                return;
 #endif
        printk(" unknown partition table\n");
+       }
 }
 
 /* This function is used to re-read partition tables for removable disks.
diff -u --recursive --new-file linux-2.0.36/drivers/scsi/BusLogic.c 
linux-2.0.36-2048/drivers/scsi/BusLogic.c
--- linux-2.0.36/drivers/scsi/BusLogic.c        Mon Nov 16 03:33:05 1998
+++ linux-2.0.36-2048/drivers/scsi/BusLogic.c   Thu Nov 26 22:29:28 1998
@@ -4139,7 +4139,11 @@
   /*
     Attempt to read the first 1024 bytes from the disk device.
   */
-  BufferHead = bread(MKDEV(MAJOR(Device), MINOR(Device) & ~0x0F), 0, 1024);
+  if (blksize_size[MAJOR(Device)] &&
+      blksize_size[MAJOR(Device)][MINOR(Device)] == 2048)
+    BufferHead = bread(MKDEV(MAJOR(Device), MINOR(Device) & ~0x0F), 0, 2048);
+  else
+    BufferHead = bread(MKDEV(MAJOR(Device), MINOR(Device) & ~0x0F), 0, 1024);
   if (BufferHead == NULL) return 0;
   /*
     If the boot sector partition table flag is valid, search for a partition
diff -u --recursive --new-file linux-2.0.36/drivers/scsi/scsicam.c 
linux-2.0.36-2048/drivers/scsi/scsicam.c
--- linux-2.0.36/drivers/scsi/scsicam.c Mon Nov 16 03:33:10 1998
+++ linux-2.0.36-2048/drivers/scsi/scsicam.c    Thu Nov 26 22:37:00 1998
@@ -48,11 +48,16 @@
        int *ip                 /* Heads, sectors, cylinders in that order */) {
 
     struct buffer_head *bh;
-    int ret_code;
+    int ret_code, block_size;
     int size = disk->capacity;
     unsigned long temp_cyl;
 
-    if (!(bh = bread(MKDEV(MAJOR(dev), MINOR(dev)&~0xf), 0, 1024)))
+    if (blksize_size[MAJOR(dev)]
+       && blksize_size[MAJOR(dev)][MINOR(dev)] == 2048)
+       block_size = 2048;
+    else
+       block_size = 1024;
+    if (!(bh = bread(MKDEV(MAJOR(dev), MINOR(dev)&~0xf), 0, block_size)))
        return -1;
 
     /* try to infer mapping from partition table */
diff -u --recursive --new-file linux-2.0.36/fs/ext2/super.c 
linux-2.0.36-2048/fs/ext2/super.c
--- linux-2.0.36/fs/ext2/super.c        Sun Jul  7 17:06:53 1996
+++ linux-2.0.36-2048/fs/ext2/super.c   Thu Nov 26 22:29:28 1998
@@ -374,6 +374,8 @@
        kdev_t dev = sb->s_dev;
        int db_count;
        int i, j;
+       int block_size = BLOCK_SIZE;
+       extern int *blksize_size[];
 
        sb->u.ext2_sb.s_mount_opt = 0;
        set_opt (sb->u.ext2_sb.s_mount_opt, CHECK_NORMAL);
@@ -385,8 +387,14 @@
 
        MOD_INC_USE_COUNT;
        lock_super (sb);
-       set_blocksize (dev, BLOCK_SIZE);
-       if (!(bh = bread (dev, sb_block, BLOCK_SIZE))) {
+       if (blksize_size[MAJOR(dev)]
+           && blksize_size[MAJOR(dev)][MINOR(dev)] == 2048){
+         block_size = 2048;
+         sb_block = 0;
+         logic_sb_block = 0;
+       }
+       set_blocksize (dev, block_size);
+       if (!(bh = bread (dev, sb_block, block_size))) {
                sb->s_dev = 0;
                unlock_super (sb);
                printk ("EXT2-fs: unable to read superblock\n");
@@ -398,6 +406,8 @@
         * some ext2 macro-instructions depend on its value
         */
        es = (struct ext2_super_block *) bh->b_data;
+       if (block_size == 2048)
+               es = (struct ext2_super_block *)((char *)es + 1024);
        sb->u.ext2_sb.s_es = es;
        sb->s_magic = es->s_magic;
        if (sb->s_magic != EXT2_SUPER_MAGIC) {
@@ -429,7 +439,7 @@
        }
        sb->s_blocksize_bits = sb->u.ext2_sb.s_es->s_log_block_size + 10;
        sb->s_blocksize = 1 << sb->s_blocksize_bits;
-       if (sb->s_blocksize != BLOCK_SIZE && 
+       if (sb->s_blocksize != block_size && 
            (sb->s_blocksize == 1024 || sb->s_blocksize == 2048 ||  
             sb->s_blocksize == 4096)) {
                unsigned long offset;
diff -u --recursive --new-file linux-2.0.36/fs/fat/buffer.c 
linux-2.0.36-2048/fs/fat/buffer.c
--- linux-2.0.36/fs/fat/buffer.c        Thu Jun  4 07:17:49 1998
+++ linux-2.0.36-2048/fs/fat/buffer.c   Thu Nov 26 22:29:28 1998
@@ -28,6 +28,25 @@
           or just plain wrong. */
        if (sb->s_blocksize == 512) {
                ret = bread (sb->s_dev,block,512);
+       } else if (sb->s_blocksize == 2048) {
+               struct buffer_head *real = bread (sb->s_dev,block>>2,2048);
+
+               if (real != NULL){
+                       ret = (struct buffer_head *)
+                         kmalloc (sizeof(struct buffer_head), GFP_KERNEL);
+                       if (ret != NULL) {
+                               /*
+                                       The memset is there only to catch errors. The 
+msdos
+                                       fs is only using b_data
+                               */
+                               memset (ret,0,sizeof(*ret));
+                               ret->b_data = real->b_data;
+                               ret->b_data += 512 * (block % 4);
+                               ret->b_next = real;
+                       }else{
+                               brelse (real);
+                       }
+               }
        } else {
                struct buffer_head *real = bread (sb->s_dev,block>>1,1024);
 
diff -u --recursive --new-file linux-2.0.36/fs/fat/inode.c 
linux-2.0.36-2048/fs/fat/inode.c
--- linux-2.0.36/fs/fat/inode.c Thu Jun  4 07:17:49 1998
+++ linux-2.0.36-2048/fs/fat/inode.c    Thu Nov 26 22:29:28 1998
@@ -92,7 +92,11 @@
                fat_clusters_flush(sb);
        }
        fat_cache_inval_dev(sb->s_dev);
-       set_blocksize (sb->s_dev,BLOCK_SIZE);
+        if (blksize_size[MAJOR(sb->s_dev)]
+            &&  blksize_size[MAJOR(sb->s_dev)][MINOR(sb->s_dev)] == 2048)
+          set_blocksize (sb->s_dev,2048);
+        else
+          set_blocksize (sb->s_dev,BLOCK_SIZE);
        if (MSDOS_SB(sb)->nls_disk) {
                unload_nls(MSDOS_SB(sb)->nls_disk);
                MSDOS_SB(sb)->nls_disk = NULL;
@@ -211,8 +215,8 @@
                else if (!strcmp(this_char,"blocksize")) {
                        *blksize = simple_strtoul(value,&value,0);
                        if (*value) ret = 0;
-                       else if (*blksize != 512 && *blksize != 1024){
-                               printk ("MSDOS FS: Invalid blocksize (512 or 1024)\n");
+                       else if (*blksize != 512 && *blksize != 1024 && *blksize != 
+2048){
+                               printk ("MSDOS FS: Invalid blocksize (512 or 1024 or 
+2048)\n");
                        }
                }
                else if (!strcmp(this_char,"sys_immutable")) {
@@ -271,16 +275,21 @@
        }
        opts.isvfat = MSDOS_SB(sb)->options.isvfat;
        if (!parse_options((char *) data, &fat, &blksize, &debug, &opts)
-               || (blksize != 512 && blksize != 1024)) {
+               || (blksize != 512 && blksize != 1024 && blksize != 2048)) {
                sb->s_dev = 0;
                MOD_DEC_USE_COUNT;
                return NULL;
        }
        cache_init();
        lock_super(sb);
-       /* The first read is always 1024 bytes */
-       sb->s_blocksize = 1024;
-       set_blocksize(sb->s_dev, 1024);
+       if (blksize == 2048){
+         sb->s_blocksize = 2048;
+         set_blocksize(sb->s_dev, 2048);
+       } else {
+         /* The first read is always 1024 bytes */
+         sb->s_blocksize = 1024;
+         set_blocksize(sb->s_dev, 1024);
+       }
        bh = fat_bread(sb, 0);
        unlock_super(sb);
        if (bh == NULL || !fat_is_uptodate(sb,bh)) {
@@ -601,9 +610,9 @@
                       !is_exec(raw_entry->ext)))
                        ? S_IRUGO|S_IWUGO : S_IRWXUGO)
                    & ~MSDOS_SB(sb)->options.fs_umask) | S_IFREG;
-               inode->i_op = (sb->s_blocksize == 1024)
-                       ? &fat_file_inode_operations_1024
-                       : &fat_file_inode_operations;
+               inode->i_op = (sb->s_blocksize == 512)
+                       ? &fat_file_inode_operations
+                       : &fat_file_inode_operations_1024;
                MSDOS_I(inode)->i_start = CF_LE_W(raw_entry->start);
                if (MSDOS_SB(sb)->fat_bits == 32) {
                        MSDOS_I(inode)->i_start |=
diff -u --recursive --new-file linux-2.0.36/drivers/scsi/sd.c 
linux-2.0.36-2048/drivers/scsi/sd.c
--- linux-2.0.36/drivers/scsi/sd.c      Mon Nov 16 03:33:10 1998
+++ linux-2.0.36-2048/drivers/scsi/sd.c Thu Nov 26 22:29:28 1998
@@ -14,6 +14,15 @@
  *
  *       Modified by Eric Youngdale [EMAIL PROTECTED] to support loadable
  *       low-level scsi drivers.
+ *
+ *       Modified by Reed Meyer <[EMAIL PROTECTED]> to support the Toshiba
+ *       SD-W1101 DVD-RAM (which doesn't like 6-byte commands).  Changed the
+ *       default I/O to 10-byte commands, with the minor side-effect that
+ *       the driver doesn't use the slightly-faster(?) 6-byte commands
+ *       when circumstances allow.  I did this so I wouldn't have to write
+ *       code specific to the Toshiba DVD-RAM.  If you don't like this
+ *       approach, flame me.  I have no idea whether it makes a substantial
+ *       speed improvement by sticking to 6-byte commands.
  */
 
 #include <linux/module.h>
@@ -59,7 +68,7 @@
  */
 
 #define SD_TIMEOUT (20 * HZ)
-#define SD_MOD_TIMEOUT (25 * HZ)
+#define SD_MOD_TIMEOUT (75 * HZ)
 
 #define CLUSTERABLE_DEVICE(SC) (SC->host->use_clustering && \
                                SC->device->type != TYPE_MOD)
@@ -249,6 +258,10 @@
            error_sector <<= 1;
            if (block_sectors < 2) block_sectors = 2;
          }
+        else if (sector_size == 2048){
+          error_sector <<= 2;
+          if (block_sectors < 4) block_sectors = 4;
+        }
        else if (sector_size == 256)
          error_sector >>= 1;
        error_sector -= sd[MINOR(SCpnt->request.rq_dev)].start_sect;
@@ -637,13 +650,20 @@
      * and not force the scsi disk driver to use bounce buffers
      * for this.
      */
-    if (rscsi_disks[dev].sector_size == 1024)
+    if (rscsi_disks[dev].sector_size == 1024){
        if((block & 1) || (SCpnt->request.nr_sectors & 1)) {
            printk("sd.c:Bad block number requested");
            SCpnt = end_scsi_request(SCpnt, 0, SCpnt->request.nr_sectors);
            goto repeat;
        }
-    
+    } else if (rscsi_disks[dev].sector_size == 2048){
+       if((block & 3) || (SCpnt->request.nr_sectors & 3)) {
+           printk("sd.c:Bad block number requested (2048)");
+           SCpnt = end_scsi_request(SCpnt, 0, SCpnt->request.nr_sectors);
+           goto repeat;
+       }
+    }
+
     switch (SCpnt->request.cmd)
     {
     case WRITE :
@@ -652,10 +672,10 @@
            SCpnt = end_scsi_request(SCpnt, 0, SCpnt->request.nr_sectors);
            goto repeat;
        }
-       cmd[0] = WRITE_6;
+       cmd[0] = WRITE_10;
        break;
     case READ :
-       cmd[0] = READ_6;
+       cmd[0] = READ_10;
        break;
     default :
        panic ("Unknown sd command %d\n", SCpnt->request.cmd);
@@ -910,6 +930,12 @@
     
     cmd[1] = (SCpnt->lun << 5) & 0xe0;
     
+    if (rscsi_disks[dev].sector_size == 2048){
+       if(block & 3) panic("sd.c:Bad block number requested(2048)");
+       if(this_count & 3) panic("sd.c:Bad block number requested(2048)");
+       block = block >> 2;
+       this_count = this_count >> 2;
+    }
     if (rscsi_disks[dev].sector_size == 1024){
        if(block & 1) panic("sd.c:Bad block number requested");
        if(this_count & 1) panic("sd.c:Bad block number requested");
@@ -922,12 +948,11 @@
        this_count = this_count << 1;
     }
     
-    if (((this_count > 0xff) ||  (block > 0x1fffff)) && rscsi_disks[dev].ten)
+    if (rscsi_disks[dev].ten)   /* Can handle ten-byte commands */
     {
        if (this_count > 0xffff)
            this_count = 0xffff;
        
-       cmd[0] += READ_10 - READ_6 ;
        cmd[2] = (unsigned char) (block >> 24) & 0xff;
        cmd[3] = (unsigned char) (block >> 16) & 0xff;
        cmd[4] = (unsigned char) (block >> 8) & 0xff;
@@ -936,11 +961,12 @@
        cmd[7] = (unsigned char) (this_count >> 8) & 0xff;
        cmd[8] = (unsigned char) this_count & 0xff;
     }
-    else
+    else        /* Can't handle ten-byte commands */
     {
        if (this_count > 0xff)
            this_count = 0xff;
        
+       cmd[0] -= READ_10 - READ_6 ;
        cmd[1] |= (unsigned char) ((block >> 16) & 0x1f);
        cmd[2] = (unsigned char) ((block >> 8) & 0xff);
        cmd[3] = (unsigned char) block & 0xff;
@@ -1217,6 +1243,7 @@
        
        if (rscsi_disks[i].sector_size != 512 &&
            rscsi_disks[i].sector_size != 1024 &&
+            rscsi_disks[i].sector_size != 2048 &&
            rscsi_disks[i].sector_size != 256)
        {
            printk ("sd%c : unsupported sector size %d.\n",
@@ -1254,8 +1281,21 @@
                i+'a', hard_sector, rscsi_disks[i].capacity, 
                 mb, sz_quot, sz_rem);
     }
+        if (rscsi_disks[i].sector_size == 2048){
+            int m, n;
+
+            /* There are 16 minors allocated for each major device */
+            m = i << 4;
+            n = 16;
+            while (--n >= 0){
+                set_blocksize(MKDEV(MAJOR_NR, m), 2048);
+                m++;
+            }
+        }
        if(rscsi_disks[i].sector_size == 1024)
            rscsi_disks[i].capacity <<= 1;  /* Change into 512 byte sectors */
+        if(rscsi_disks[i].sector_size == 2048)
+            rscsi_disks[i].capacity <<= 2;  /* Change into 512 byte sectors */
        if(rscsi_disks[i].sector_size == 256)
            rscsi_disks[i].capacity >>= 1;  /* Change into 512 byte sectors */
     }
@@ -1502,7 +1542,7 @@
          * Reset the blocksize for everything so that we can read
          * the partition table.
          */
-        blksize_size[MAJOR_NR][minor] = 1024;
+        set_blocksize(devi, 1024);
     }
     
 #ifdef MAYBE_REINIT


============================================================================
END OF FILES.
============================================================================

------------------------------


** FOR YOUR REFERENCE **

The service address, to which questions about the list itself and requests
to be added to or deleted from it should be directed, is:

    Internet: [EMAIL PROTECTED]

You can send mail to the entire list (and comp.os.linux.development.system) via:

    Internet: [EMAIL PROTECTED]

Linux may be obtained via one of these FTP sites:
    ftp.funet.fi                                pub/Linux
    tsx-11.mit.edu                              pub/linux
    sunsite.unc.edu                             pub/Linux

End of Linux-Development-System Digest
******************************

Reply via email to