kernelnewbies.kernelnewbies.org archive mirror
 help / color / mirror / Atom feed
* Send/receive ATA cmds from a linux kernel module
@ 2017-01-30 19:38 Siddhartha Baral
  2017-02-02  7:11 ` Greg KH
  0 siblings, 1 reply; 10+ messages in thread
From: Siddhartha Baral @ 2017-01-30 19:38 UTC (permalink / raw)
  To: kernelnewbies

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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20170130/90b72956/attachment.html 

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2017-02-02 17:39 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-01-30 19:38 Send/receive ATA cmds from a linux kernel module Siddhartha Baral
2017-02-02  7:11 ` Greg KH
2017-02-02 14:54   ` Siddhartha Baral
2017-02-02 15:03     ` Greg KH
2017-02-02 16:28     ` valdis.kletnieks at vt.edu
2017-02-02 16:32       ` Siddhartha Baral
2017-02-02 16:57         ` Greg KH
2017-02-02 17:27           ` Siddhartha Baral
2017-02-02 17:35             ` Greg KH
2017-02-02 17:39               ` Siddhartha Baral

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).