display the DMA mode along with the theoretical transfer speed

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30226 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
David McPaul 2009-04-17 10:09:04 +00:00
parent 4f797d0b59
commit 718e31e37a
2 changed files with 53 additions and 2 deletions

View File

@ -31,6 +31,31 @@ typedef struct {
#define kNotSupported "not supported" #define kNotSupported "not supported"
#define kSupported "supported" #define kSupported "supported"
char *dma_mode_strings[] = {
"Multiword DMA Mode 0 - 4.2 MB/s",
"Multiword DMA Mode 1 - 13.3 MB/s",
"Multiword DMA Mode 2 - 16.7 MB/s",
"Invalid",
"Invalid",
"Invalid",
"Invalid",
"Invalid",
"Invalid",
"Invalid",
"Invalid",
"Invalid",
"Invalid",
"Invalid",
"Invalid",
"Invalid",
"Ultra DMA Mode 0 - 16.7 MB/s",
"Ultra DMA Mode 1 - 25 MB/s",
"Ultra DMA Mode 2 - 33.3 MB/s",
"Ultra DMA Mode 3 - 44.4 MB/s",
"Ultra DMA Mode 4 - 66.7 MB/s",
"Ultra DMA Mode 5 - 100 MB/s",
"Ultra DMA Mode 6 - 133 MB/s"
};
static void static void
sizeAsString(off_t size, char *string) sizeAsString(off_t size, char *string)
@ -117,7 +142,7 @@ main(int argc, char **argv)
if (st.dma_status > 6) if (st.dma_status > 6)
printf("Bad dma_status field\n"); printf("Bad dma_status field\n");
else else
printf("DMA mode: 0x%02x\n", st.dma_mode); printf("DMA mode: %s\n", dma_mode_strings[st.dma_mode]);
} }
printf("READ/WRITE DMA QUEUED: %s\n", printf("READ/WRITE DMA QUEUED: %s\n",

View File

@ -26,6 +26,32 @@ char *dma_status_strings[] = {
"dma disabled after dma failure" "dma disabled after dma failure"
}; };
char *dma_mode_strings[] = {
"Multiword DMA Mode 0 - 4.2 MB/s",
"Multiword DMA Mode 1 - 13.3 MB/s",
"Multiword DMA Mode 2 - 16.7 MB/s",
"Invalid",
"Invalid",
"Invalid",
"Invalid",
"Invalid",
"Invalid",
"Invalid",
"Invalid",
"Invalid",
"Invalid",
"Invalid",
"Invalid",
"Invalid",
"Ultra DMA Mode 0 - 16.7 MB/s",
"Ultra DMA Mode 1 - 25 MB/s",
"Ultra DMA Mode 2 - 33.3 MB/s",
"Ultra DMA Mode 3 - 44.4 MB/s",
"Ultra DMA Mode 4 - 66.7 MB/s",
"Ultra DMA Mode 5 - 100 MB/s",
"Ultra DMA Mode 6 - 133 MB/s"
};
int main(int argc, char **argv) int main(int argc, char **argv)
{ {
int fd; int fd;
@ -48,7 +74,7 @@ int main(int argc, char **argv)
else else
printf("dma_status: %s\n", dma_status_strings[st.dma_status]); printf("dma_status: %s\n", dma_status_strings[st.dma_status]);
printf("pio mode: %d\n", st.pio_mode); printf("pio mode: %d\n", st.pio_mode);
printf("dma mode: 0x%02x\n", st.dma_mode); printf("dma mode: %s\n", dma_mode_strings[st.dma_mode]);
close(fd); close(fd);
return 0; return 0;
} }