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", 1 },
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 LIGHTNING 540A", 3 },
90 { "QUANTUM FIREBALL", 3 },
91
92 { NULL, 0 }
93 };
94
95
96
97
98
99
100
101
102 int ide_scan_pio_blacklist (char *model)
103 {
104 struct ide_pio_info *p;
105
106 for (p = ide_pio_blacklist; p->name != NULL; p++) {
107 if (strncmp(p->name, model, strlen(p->name)) == 0)
108 return p->pio;
109 }
110 return -1;
111 }
112
113
114
115
116
117
118 unsigned int ide_get_best_pio_mode (ide_drive_t *drive)
119 {
120 unsigned int pio = 0;
121 struct hd_driveid *id = drive->id;
122
123 if (id != NULL) {
124 if (HWIF(drive)->chipset != ide_cmd640 && !strcmp("QUANTUM FIREBALL1080A", id->model))
125 pio = 4;
126 else
127 pio = ide_scan_pio_blacklist(id->model);
128 if (pio == -1) {
129 pio = (id->tPIO < 2) ? id->tPIO : 2;
130 if (id->field_valid & 2) {
131 byte modes = id->eide_pio_modes;
132 if (modes & 4) pio = 5;
133 else if (modes & 2) pio = 4;
134 else if (modes & 1) pio = 3;
135 }
136 }
137 }
138 return pio;
139 }
140
141 #endif
142 #endif
143 #endif