1 #include <linux/types.h>
2 #include <linux/string.h>
3 #include <linux/kernel.h>
4 #include <linux/export.h>
7 #include <linux/bitops.h>
9 static const char *udma_str[] =
10 {
"UDMA/16",
"UDMA/25",
"UDMA/33",
"UDMA/44",
11 "UDMA/66",
"UDMA/100",
"UDMA/133",
"UDMA7" };
12 static const char *mwdma_str[] =
13 {
"MWDMA0",
"MWDMA1",
"MWDMA2",
"MWDMA3",
"MWDMA4" };
14 static const char *swdma_str[] =
15 {
"SWDMA0",
"SWDMA1",
"SWDMA2" };
16 static const char *pio_str[] =
17 {
"PIO0",
"PIO1",
"PIO2",
"PIO3",
"PIO4",
"PIO5",
"PIO6" };
65 int pio_mode = -1, overridden = 0;
67 if (mode_wanted != 255)
68 return min_t(
u8, mode_wanted, max_mode);
84 pio_mode = 4 +
min_t(
int, 2,
85 id[ATA_ID_CFA_MODES] & 7);
89 if (
id[ATA_ID_PIO_MODES] & 4)
91 else if (
id[ATA_ID_PIO_MODES] & 2)
104 if (pio_mode > max_mode)
118 return ata_id_pio_need_iordy(drive->
id, pio);
196 pio = ide_get_best_pio_mode(drive, req_pio, host_pio);
204 drive->
name, host_pio, req_pio,
205 req_pio == 255 ?
"(auto-tune)" :
"", pio);
236 return min(speed, mode);
258 rate = ide_rate_filter(drive, rate);