Linux Forums - Linux Help,Advice & support community:LinuxSolved.com

Linux in General => Linux Development & Programming => Topic started by: starvijay on May 08, 2010, 09:43:06 AM

Title: HDD spin-up through ioctl
Post by: starvijay 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