Hi All,

          I am trying to write a linux kernel module which can send/receive
ATA SMART cmds to a HDD. The kernel module will take a set of actions based
on the responses it receives from the HDD. I went through the ATA smart
cmds spec and the "smartctl" user space code which sends the ATA cmds from
user space via SG_IO ioctl cmd. I am not able to figure out how to open
/dev/sda from kernel and achieve similar functionalities line "smartctl"
tool from a kernel module.

   1.

   Can someone point me to any sample code which tries to send ATA smart
   cmds from a kernel module instead of user space via ioctl?
   2.

   Seems like I need to use some exported API from SG driver or libata. is
   this the right direction?
   3.

   Please feel free to suggest how can I achieve this.

Thanks, Sid
_______________________________________________
Kernelnewbies mailing list
[email protected]
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

Reply via email to