6 #include <SupportDefs.h>
9 /* why isn't that documented ? */
10 #define IDE_GET_STATUS 0x2711
17 } _PACKED ide_status_t
;
19 char *dma_status_strings
[] = {
20 "drive does not support dma",
22 "dma disabled by user config",
23 "dma disabled by safe mode",
24 "ide controller does not support dma",
25 "driver disabled dma due to inproper drive configuration",
26 "dma disabled after dma failure"
29 char *dma_mode_strings
[] = {
30 "Multiword DMA Mode 0 - 4.2 MB/s",
31 "Multiword DMA Mode 1 - 13.3 MB/s",
32 "Multiword DMA Mode 2 - 16.7 MB/s",
46 "Ultra DMA Mode 0 - 16.7 MB/s",
47 "Ultra DMA Mode 1 - 25 MB/s",
48 "Ultra DMA Mode 2 - 33.3 MB/s",
49 "Ultra DMA Mode 3 - 44.4 MB/s",
50 "Ultra DMA Mode 4 - 66.7 MB/s",
51 "Ultra DMA Mode 5 - 100 MB/s",
52 "Ultra DMA Mode 6 - 133 MB/s"
55 int main(int argc
, char **argv
)
58 ide_status_t st
= {0x01, 0x00, 0x00, 0x80}; /* God knows... */
60 fprintf(stderr
, "use: %s devicename\n", argv
[0]);
63 fd
= open(argv
[1], O_RDONLY
);
65 fprintf(stderr
, "could not open %s, %s\n", argv
[1], strerror(errno
));
68 if (ioctl(fd
, IDE_GET_STATUS
, &st
, sizeof(ide_status_t
*)) < 0) {
69 fprintf(stderr
, "could not get ide status for %s\n", argv
[1]);
72 if (st
.dma_status
> 6)
73 printf("dma_status bad\n");
75 printf("dma_status: %s\n", dma_status_strings
[st
.dma_status
]);
76 printf("pio mode: %d\n", st
.pio_mode
);
77 printf("dma mode: %s\n", dma_mode_strings
[st
.dma_mode
]);