November 21, 2024, 09:36:22 PM

News : LinuxSolved.com Linux Help Community Forum..


Author Topic: HDD spin-up through ioctl  (Read 5871 times)

Offline starvijay

  • New Member
  • Posts: 1
HDD spin-up through ioctl
« on: May 08, 2010, 09:43:06 AM »
Hi,

I have used the following code for HDD spindown.

Quote
{
#ifndef WIN_STANDBYNOW1
#define WIN_STANDBYNOW1 0xE0
#endif
#ifndef WIN_STANDBYNOW2
#define WIN_STANDBYNOW2 0x94
#endif
unsigned char args1[4] = {WIN_STANDBYNOW1,0,0,0};
unsigned char args2[4] = {WIN_STANDBYNOW2,0,0,0};
int fd;

if ((fd = open(device, O_RDWR)) < 0)
return -1;

if (ioctl(fd, HDIO_DRIVE_CMD, &args1) &&
ioctl(fd, HDIO_DRIVE_CMD, &args2))
return -1;

return 0;
}


Is there any ioctl command to do HDD spin-up from spin-down? or Is there any way to HDD spin-up?

Regards,
Vijay