Re: usage of WIN_SMART

From: Ross Biro
Date: Tue Nov 30 2004 - 09:33:54 EST


As Ed said, you need the ATA spec to make sense of all that.
Fortunately, a draft copy is available online at t13.org. In
particular at http://www.t13.org/#Project_drafts The docs will
explain the register settings, but not the meanings of the output.

You can avoid the driver is you wish, but it's a really bad idea to do
so since you will change the state of the drive when the driver is not
expecting it. To safely access the drive from user space, you would
have to make sure the driver is disabled, disable interrupts, and then
poll the controller directly. The exact method would of course be
controller specific. You need to look at the ioperm man page and
/dev/port.

Finally, if all you want to do is access the SMART data, you should
look at smartsuite http://sourceforge.net/projects/smartsuite/ or
something similiar. It already includes much of the vendor specific
information and knows how to get along with the kernel.

Ross


On Tue, 30 Nov 2004 08:40:40 +0530, Jagadeesh Bhaskar P
<jbhaskar@xxxxxxxxxxxx> wrote:
> Dear Edward,
> I am grateful for such a descriptive reply. I was exploring through the
> ide-disk driver interface, which provides the SMART readings through the
> ioctl, using WIN_SMART. At the end its calling an inb and an outb to the
> regs, like u said, feature regs and all. Is it possible to do it
> directly with an inb and outb from a C program, avoiding the
> complexities involved in the WIN_SMART command.
>
> And, can u help me out with the syntax of WIN_SMART class of ioctl?
> I know that a buffer like
>
> buffer = {WIN_SMART, 0, SMART_READ_VALUES, 1};
> and it is passed to the ioctl.
>
> I have seen the significance of 1st element(WIN_SMART) and 3rd element
> (SMART_READ_VALUES) in the ide-disk module's code.
>
> What does the second argument and the fourth argument signify?
>
> Can u help me with this also, coz I've been digging for this a long
> time, and haven't been that successfull!!
>
> --
> Thanks & Regards,
>
> Jagadeesh Bhaskar P
> R&D Engineer
> HCL Infosystems Ltd
> Pondicherry
> INDIA
>
>
>
> -
> 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/
>
-
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/