lkml.org 
[lkml]   [2004]   [Sep]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Changes to ide-probe.c in 2.6.9-rc2 causing improper detection
On Tue, Sep 14 2004, Jens Axboe wrote:
> They do support it, they just don't flag the support in the capability
> flags. And of course some don't support it at all, you can try this on
> your drives if you want to know for sure.

Forgot to attach the code, here it is...

#include <stdio.h>
#include <unistd.h>
#include <fcntl.h>
#include <string.h>
#include <sys/ioctl.h>
#include <linux/hdreg.h>

int main(int argc, char *argv[])
{
char args[7];
int fd;

if (argc < 2) {
printf("%s: <dev>\n", argv[0]);
return 1;
}

fd = open(argv[1], O_RDONLY | O_NONBLOCK);
if (fd == -1) {
perror("open");
return 2;
}

memset(args, 0, 7);
args[0] = 0xE7;

printf("issuing FLUSH_CACHE: ");
if (ioctl(fd, HDIO_DRIVE_TASK, args) == -1)
printf("failed 0x%x/0x%x!\n", args[0], args[1]);
else
printf("worked\n");

memset(args, 0, 7);
args[0] = 0xEA;

printf("issuing FLUSH_CACHE_EXT: ");
if (ioctl(fd, HDIO_DRIVE_TASK, args) == -1)
printf("failed 0x%x/0x%x!\n", args[0], args[1]);
else
printf("worked\n");

close(fd);
return 0;
}

--
Jens Axboe

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 14:06    [W:0.080 / U:1.008 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site