diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-07-16 14:33:39 -0400 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-07-16 14:33:39 -0400 |
commit | 9ad540937554a3779c5fe7af13aa390b1d2aeb3e (patch) | |
tree | 9ed83a58e8fb0d57ebbfacb92c62d40db185a8a8 /drivers/ide/ide-pio-blacklist.c | |
parent | 3e153cfb5e38ae237ff27a10a833946ac95db8a4 (diff) |
ide: move PIO blacklist to ide-pio-blacklist.c
Move PIO blacklist to ide-pio-blacklist.c.
While at it:
- fix comment
- fix whitespace damage
There should be no functional changes caused by this patch.
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/ide-pio-blacklist.c')
-rw-r--r-- | drivers/ide/ide-pio-blacklist.c | 94 |
1 files changed, 94 insertions, 0 deletions
diff --git a/drivers/ide/ide-pio-blacklist.c b/drivers/ide/ide-pio-blacklist.c new file mode 100644 index 000000000000..a8c2c8f8660a --- /dev/null +++ b/drivers/ide/ide-pio-blacklist.c | |||
@@ -0,0 +1,94 @@ | |||
1 | /* | ||
2 | * PIO blacklist. Some drives incorrectly report their maximal PIO mode, | ||
3 | * at least in respect to CMD640. Here we keep info on some known drives. | ||
4 | * | ||
5 | * Changes to the ide_pio_blacklist[] should be made with EXTREME CAUTION | ||
6 | * to avoid breaking the fragile cmd640.c support. | ||
7 | */ | ||
8 | |||
9 | #include <linux/string.h> | ||
10 | |||
11 | static struct ide_pio_info { | ||
12 | const char *name; | ||
13 | int pio; | ||
14 | } ide_pio_blacklist [] = { | ||
15 | { "Conner Peripherals 540MB - CFS540A", 3 }, | ||
16 | |||
17 | { "WDC AC2700", 3 }, | ||
18 | { "WDC AC2540", 3 }, | ||
19 | { "WDC AC2420", 3 }, | ||
20 | { "WDC AC2340", 3 }, | ||
21 | { "WDC AC2250", 0 }, | ||
22 | { "WDC AC2200", 0 }, | ||
23 | { "WDC AC21200", 4 }, | ||
24 | { "WDC AC2120", 0 }, | ||
25 | { "WDC AC2850", 3 }, | ||
26 | { "WDC AC1270", 3 }, | ||
27 | { "WDC AC1170", 1 }, | ||
28 | { "WDC AC1210", 1 }, | ||
29 | { "WDC AC280", 0 }, | ||
30 | { "WDC AC31000", 3 }, | ||
31 | { "WDC AC31200", 3 }, | ||
32 | |||
33 | { "Maxtor 7131 AT", 1 }, | ||
34 | { "Maxtor 7171 AT", 1 }, | ||
35 | { "Maxtor 7213 AT", 1 }, | ||
36 | { "Maxtor 7245 AT", 1 }, | ||
37 | { "Maxtor 7345 AT", 1 }, | ||
38 | { "Maxtor 7546 AT", 3 }, | ||
39 | { "Maxtor 7540 AV", 3 }, | ||
40 | |||
41 | { "SAMSUNG SHD-3121A", 1 }, | ||
42 | { "SAMSUNG SHD-3122A", 1 }, | ||
43 | { "SAMSUNG SHD-3172A", 1 }, | ||
44 | |||
45 | { "ST5660A", 3 }, | ||
46 | { "ST3660A", 3 }, | ||
47 | { "ST3630A", 3 }, | ||
48 | { "ST3655A", 3 }, | ||
49 | { "ST3391A", 3 }, | ||
50 | { "ST3390A", 1 }, | ||
51 | { "ST3600A", 1 }, | ||
52 | { "ST3290A", 0 }, | ||
53 | { "ST3144A", 0 }, | ||
54 | { "ST3491A", 1 }, /* reports 3, should be 1 or 2 (depending on drive) | ||
55 | according to Seagate's FIND-ATA program */ | ||
56 | |||
57 | { "QUANTUM ELS127A", 0 }, | ||
58 | { "QUANTUM ELS170A", 0 }, | ||
59 | { "QUANTUM LPS240A", 0 }, | ||
60 | { "QUANTUM LPS210A", 3 }, | ||
61 | { "QUANTUM LPS270A", 3 }, | ||
62 | { "QUANTUM LPS365A", 3 }, | ||
63 | { "QUANTUM LPS540A", 3 }, | ||
64 | { "QUANTUM LIGHTNING 540A", 3 }, | ||
65 | { "QUANTUM LIGHTNING 730A", 3 }, | ||
66 | |||
67 | { "QUANTUM FIREBALL_540", 3 }, /* Older Quantum Fireballs don't work */ | ||
68 | { "QUANTUM FIREBALL_640", 3 }, | ||
69 | { "QUANTUM FIREBALL_1080", 3 }, | ||
70 | { "QUANTUM FIREBALL_1280", 3 }, | ||
71 | { NULL, 0 } | ||
72 | }; | ||
73 | |||
74 | /** | ||
75 | * ide_scan_pio_blacklist - check for a blacklisted drive | ||
76 | * @model: Drive model string | ||
77 | * | ||
78 | * This routine searches the ide_pio_blacklist for an entry | ||
79 | * matching the start/whole of the supplied model name. | ||
80 | * | ||
81 | * Returns -1 if no match found. | ||
82 | * Otherwise returns the recommended PIO mode from ide_pio_blacklist[]. | ||
83 | */ | ||
84 | |||
85 | int ide_scan_pio_blacklist(char *model) | ||
86 | { | ||
87 | struct ide_pio_info *p; | ||
88 | |||
89 | for (p = ide_pio_blacklist; p->name != NULL; p++) { | ||
90 | if (strncmp(p->name, model, strlen(p->name)) == 0) | ||
91 | return p->pio; | ||
92 | } | ||
93 | return -1; | ||
94 | } | ||