ide-pio-blacklist.c 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  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. #include <linux/string.h>
  9. #include <linux/ide.h>
  10. static struct ide_pio_info {
  11. const char *name;
  12. int pio;
  13. } ide_pio_blacklist [] = {
  14. { "Conner Peripherals 540MB - CFS540A", 3 },
  15. { "WDC AC2700", 3 },
  16. { "WDC AC2540", 3 },
  17. { "WDC AC2420", 3 },
  18. { "WDC AC2340", 3 },
  19. { "WDC AC2250", 0 },
  20. { "WDC AC2200", 0 },
  21. { "WDC AC21200", 4 },
  22. { "WDC AC2120", 0 },
  23. { "WDC AC2850", 3 },
  24. { "WDC AC1270", 3 },
  25. { "WDC AC1170", 1 },
  26. { "WDC AC1210", 1 },
  27. { "WDC AC280", 0 },
  28. { "WDC AC31000", 3 },
  29. { "WDC AC31200", 3 },
  30. { "Maxtor 7131 AT", 1 },
  31. { "Maxtor 7171 AT", 1 },
  32. { "Maxtor 7213 AT", 1 },
  33. { "Maxtor 7245 AT", 1 },
  34. { "Maxtor 7345 AT", 1 },
  35. { "Maxtor 7546 AT", 3 },
  36. { "Maxtor 7540 AV", 3 },
  37. { "SAMSUNG SHD-3121A", 1 },
  38. { "SAMSUNG SHD-3122A", 1 },
  39. { "SAMSUNG SHD-3172A", 1 },
  40. { "ST5660A", 3 },
  41. { "ST3660A", 3 },
  42. { "ST3630A", 3 },
  43. { "ST3655A", 3 },
  44. { "ST3391A", 3 },
  45. { "ST3390A", 1 },
  46. { "ST3600A", 1 },
  47. { "ST3290A", 0 },
  48. { "ST3144A", 0 },
  49. { "ST3491A", 1 }, /* reports 3, should be 1 or 2 (depending on drive)
  50. according to Seagate's FIND-ATA program */
  51. { "QUANTUM ELS127A", 0 },
  52. { "QUANTUM ELS170A", 0 },
  53. { "QUANTUM LPS240A", 0 },
  54. { "QUANTUM LPS210A", 3 },
  55. { "QUANTUM LPS270A", 3 },
  56. { "QUANTUM LPS365A", 3 },
  57. { "QUANTUM LPS540A", 3 },
  58. { "QUANTUM LIGHTNING 540A", 3 },
  59. { "QUANTUM LIGHTNING 730A", 3 },
  60. { "QUANTUM FIREBALL_540", 3 }, /* Older Quantum Fireballs don't work */
  61. { "QUANTUM FIREBALL_640", 3 },
  62. { "QUANTUM FIREBALL_1080", 3 },
  63. { "QUANTUM FIREBALL_1280", 3 },
  64. { NULL, 0 }
  65. };
  66. /**
  67. * ide_scan_pio_blacklist - check for a blacklisted drive
  68. * @model: Drive model string
  69. *
  70. * This routine searches the ide_pio_blacklist for an entry
  71. * matching the start/whole of the supplied model name.
  72. *
  73. * Returns -1 if no match found.
  74. * Otherwise returns the recommended PIO mode from ide_pio_blacklist[].
  75. */
  76. int ide_scan_pio_blacklist(char *model)
  77. {
  78. struct ide_pio_info *p;
  79. for (p = ide_pio_blacklist; p->name != NULL; p++) {
  80. if (strncmp(p->name, model, strlen(p->name)) == 0)
  81. return p->pio;
  82. }
  83. return -1;
  84. }