[PATCH] Small fix to ide.c for large disk handling

From: Andries Brouwer (aeb@veritas.com)
Date: Sat Sep 09 2000 - 17:10:30 EDT

  • Next message: Andi Kleen: "Re: ECN configuration not working"

    Linus, Andre, all:

    Below a tiny patch to ide.c in the handling of the
    HDIO_DRIVE_TASK ioctl. It makes sure that the
    command goes to the right device.

    (The current version obliges user space to keep track
    of master/slave, which is inconvenient. Given this
    patch I can release some disk utilities without
    asking the user to edit the source before using them.)

    Andries

    [The present code was written by me (except of course
    the #ifdef DEBUG part). This patch does not influence
    normal disk I/O, only enables special handling of Zip
    and Orb disks, or certain disks larger than 32 GB.]

    Andre: This HDIO_DRIVE_TASK (a.k.a. HDIO_DRIVE_CMD_AEB)
    ioctl is fairly general for the no-data version.
    But we also need a version with data. For example,
    in some cases the disk, or part of the disk, is locked
    using a password.

    diff -u --recursive --new-file ../linux-2.4.0test8/linux/drivers/ide/ide.c ./linux/drivers/ide/ide.c
    --- ../linux-2.4.0test8/linux/drivers/ide/ide.c Sat Sep 9 15:04:12 2000
    +++ ./linux/drivers/ide/ide.c Sat Sep 9 17:09:18 2000
    @@ -1082,7 +1082,7 @@
     {
             byte *args = rq->buffer;
             if (args && rq->cmd == IDE_DRIVE_TASK) {
    -
    + byte sel;
     #ifdef DEBUG
                     printk("%s: DRIVE_TASK_CMD data=x%02x cmd=0x%02x fr=0x%02x ns=0x%02x sc=0x%02x lcyl=0x%02x hcyl=0x%02x sel=0x%02x\n",
                             drive->name, args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
    @@ -1091,7 +1091,10 @@
                     OUT_BYTE(args[3], IDE_SECTOR_REG);
                     OUT_BYTE(args[4], IDE_LCYL_REG);
                     OUT_BYTE(args[5], IDE_HCYL_REG);
    - OUT_BYTE(args[6], IDE_SELECT_REG);
    + sel = (args[6] & ~0x10);
    + if (drive->select.b.unit)
    + sel |= 0x10;
    + OUT_BYTE(sel, IDE_SELECT_REG);
                     ide_cmd(drive, args[0], args[2], &drive_cmd_intr);
                     return ide_started;
             } else if (args) {

    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    Please read the FAQ at http://www.tux.org/lkml/



    This archive was generated by hypermail 2b29 : Sat Sep 09 2000 - 17:17:41 EDT