lkml.org 
[lkml]   [2000]   [Sep]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] Small fix to ide.c for large disk handling
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/

\
 
 \ /
  Last update: 2005-03-22 12:38    [W:0.050 / U:0.364 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site