Re: new tool: blktool

From: Jeff Garzik
Date: Sun Aug 15 2004 - 18:47:47 EST


Mark Lord wrote:
Supplementary or Alternatively, all of the ATA device commands issued by hdparm
can be supported in a driver by simply implementing the HDIO_DRIVE_CMD
ioctl -- This is only a few lines of code in a typical SATA/SCSI driver,
and I could easily supply a patch to implement it in libata.

Sure it's old, looks clunky, but it is simple code that works
and is used by many more tools than just hdparm today.


True but I'm wrestling with one of its design flaws... it doesn't provide the taskfile protocol.

I really really want to know before the command is submitted whether I am going to be receiving data, sending data, or neither. The current IDE driver "guesses" by virtue of DRQ flag behavior, but such a guess is impossible on modern SATA controllers.

You either have to provide a lookup table (command opcode -> protocol), or specify it through the userland API. HDIO_DRIVE_TASKFILE does this via 'data_phase'.

On a more general note, though, I certainly welcome libata patches from any and all sources. Hack away!

Jeff


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