This source file includes following definitions.
- ide_scan_pio_blacklist
- ide_get_best_pio_mode
1 #ifndef _IDE_MODES_H
2 #define _IDE_MODES_H
3
4
5
6
7
8
9
10
11
12
13
14
15
16 #if defined(CONFIG_BLK_DEV_CMD640) || defined(CONFIG_IDE_CHIPSETS)
17
18 #ifndef _IDE_C
19
20 int ide_scan_pio_blacklist (char *model);
21 unsigned int ide_get_best_pio_mode (ide_drive_t *drive);
22
23 #else
24
25
26
27
28
29 static struct ide_pio_info {
30 const char *name;
31 int pio;
32 } ide_pio_blacklist [] = {
33
34
35 { "WDC AC2700", 3 },
36 { "WDC AC2540", 3 },
37 { "WDC AC2420", 3 },
38 { "WDC AC2340", 3 },
39 { "WDC AC2250", 0 },
40 { "WDC AC2200", 0 },
41 { "WDC AC2120", 0 },
42 { "WDC AC2850", 3 },
43 { "WDC AC1270", 3 },
44 { "WDC AC1170", 3 },
45 { "WDC AC1210", 1 },
46 { "WDC AC280", 0 },
47
48 { "WDC AC31000", 3 },
49
50 { "WDC AC31200", 3 },
51
52
53 { "Maxtor 7131 AT", 1 },
54 { "Maxtor 7171 AT", 1 },
55 { "Maxtor 7213 AT", 1 },
56 { "Maxtor 7245 AT", 1 },
57 { "Maxtor 7345 AT", 1 },
58 { "Maxtor 7546 AT", 3 },
59 { "Maxtor 7540 AV", 3 },
60
61 { "SAMSUNG SHD-3121A", 1 },
62 { "SAMSUNG SHD-3122A", 1 },
63 { "SAMSUNG SHD-3172A", 1 },
64
65
66
67
68
69
70
71
72 { "ST5660A", 3 },
73 { "ST3660A", 3 },
74 { "ST3630A", 3 },
75 { "ST3655A", 3 },
76 { "ST3391A", 3 },
77 { "ST3390A", 1 },
78 { "ST3600A", 1 },
79 { "ST3290A", 0 },
80 { "ST3144A", 0 },
81
82 { "QUANTUM ELS127A", 0 },
83 { "QUANTUM ELS170A", 0 },
84 { "QUANTUM LPS240A", 0 },
85 { "QUANTUM LPS210A", 3 },
86 { "QUANTUM LPS270A", 3 },
87 { "QUANTUM LPS365A", 3 },
88 { "QUANTUM LPS540A", 3 },
89 { "QUANTUM FIREBALL", 3 },
90
91 { NULL, 0 }
92 };
93
94
95
96
97
98
99
100
101 int ide_scan_pio_blacklist (char *model)
102 {
103 struct ide_pio_info *p;
104
105 for (p = ide_pio_blacklist; p->name != NULL; p++) {
106 if (strncmp(p->name, model, strlen(p->name)) == 0)
107 return p->pio;
108 }
109 return -1;
110 }
111
112
113
114
115
116
117 unsigned int ide_get_best_pio_mode (ide_drive_t *drive)
118 {
119 unsigned int pio = 0;
120 struct hd_driveid *id = drive->id;
121
122 if (id != NULL) {
123 if (HWIF(drive)->chipset != ide_cmd640 && !strcmp("QUANTUM FIREBALL1080A", id->model))
124 pio = 4;
125 else
126 pio = ide_scan_pio_blacklist(id->model);
127 if (pio == -1) {
128 pio = (id->tPIO < 2) ? id->tPIO : 2;
129 if (id->field_valid & 2) {
130 byte modes = id->eide_pio_modes;
131 if (modes & 4) pio = 5;
132 else if (modes & 2) pio = 4;
133 else if (modes & 1) pio = 3;
134 }
135 }
136 }
137 return pio;
138 }
139
140 #endif
141 #endif
142 #endif