Send/receive ATA cmds from a linux kernel module

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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
Kernelnewbies@xxxxxxxxxxxxxxxxx
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux