[PATCH 21/21] ide: move PIO blacklist to ide-pio-blacklist.c

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Bartlomiej Zolnierkiewicz
Date: Wednesday, May 28, 2008 - 2:43 pm

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>
---
 drivers/ide/Makefile            |    3 -
 drivers/ide/ide-lib.c           |   96 ----------------------------------------
 drivers/ide/ide-pio-blacklist.c |   94 +++++++++++++++++++++++++++++++++++++++
 include/linux/ide.h             |    2 
 4 files changed, 98 insertions(+), 97 deletions(-)

Index: b/drivers/ide/Makefile
===================================================================
--- a/drivers/ide/Makefile
+++ b/drivers/ide/Makefile
@@ -11,7 +11,8 @@
 
 EXTRA_CFLAGS				+= -Idrivers/ide
 
-ide-core-y += ide.o ide-io.o ide-iops.o ide-lib.o ide-probe.o ide-taskfile.o
+ide-core-y += ide.o ide-io.o ide-iops.o ide-lib.o ide-probe.o ide-taskfile.o \
+	      ide-pio-blacklist.o
 
 # core IDE code
 ide-core-$(CONFIG_IDE_TIMINGS)		+= ide-timings.o
Index: b/drivers/ide/ide-lib.c
===================================================================
--- a/drivers/ide/ide-lib.c
+++ b/drivers/ide/ide-lib.c
@@ -75,102 +75,6 @@ static u8 ide_rate_filter(ide_drive_t *d
 	return min(speed, mode);
 }
 
-/*
- * Shared data/functions for determining best PIO mode for an IDE drive.
- * Most of this stuff originally lived in cmd640.c, and changes to the
- * ide_pio_blacklist[] table should be made with EXTREME CAUTION to avoid
- * breaking the fragile cmd640.c support.
- */
-
-/*
- * Black list. Some drives incorrectly report their maximal PIO mode,
- * at least in respect to CMD640. Here we keep info on some known drives.
- */
-static struct ide_pio_info {
-	const char	*name;
-	int		pio;
-} ide_pio_blacklist [] = {
-	{ "Conner Peripherals 540MB - CFS540A", 3 },
-
-	{ "WDC AC2700",  3 },
-	{ "WDC AC2540",  3 },
-	{ "WDC AC2420",  3 },
-	{ "WDC AC2340",  3 },
-	{ "WDC AC2250",  0 },
-	{ "WDC AC2200",  0 },
-	{ "WDC AC21200", 4 },
-	{ "WDC AC2120",  0 },
-	{ "WDC AC2850",  3 },
-	{ "WDC AC1270",  3 },
-	{ "WDC AC1170",  1 },
-	{ "WDC AC1210",  1 },
-	{ "WDC AC280",   0 },
-	{ "WDC AC31000", 3 },
-	{ "WDC AC31200", 3 },
-
-	{ "Maxtor 7131 AT", 1 },
-	{ "Maxtor 7171 AT", 1 },
-	{ "Maxtor 7213 AT", 1 },
-	{ "Maxtor 7245 AT", 1 },
-	{ "Maxtor 7345 AT", 1 },
-	{ "Maxtor 7546 AT", 3 },
-	{ "Maxtor 7540 AV", 3 },
-
-	{ "SAMSUNG SHD-3121A", 1 },
-	{ "SAMSUNG SHD-3122A", 1 },
-	{ "SAMSUNG SHD-3172A", 1 },
-
-	{ "ST5660A",  3 },
-	{ "ST3660A",  3 },
-	{ "ST3630A",  3 },
-	{ "ST3655A",  3 },
-	{ "ST3391A",  3 },
-	{ "ST3390A",  1 },
-	{ "ST3600A",  1 },
-	{ "ST3290A",  0 },
-	{ "ST3144A",  0 },
-	{ "ST3491A",  1 },	/* reports 3, should be 1 or 2 (depending on */	
-				/* drive) according to Seagates FIND-ATA program */
-
-	{ "QUANTUM ELS127A", 0 },
-	{ "QUANTUM ELS170A", 0 },
-	{ "QUANTUM LPS240A", 0 },
-	{ "QUANTUM LPS210A", 3 },
-	{ "QUANTUM LPS270A", 3 },
-	{ "QUANTUM LPS365A", 3 },
-	{ "QUANTUM LPS540A", 3 },
-	{ "QUANTUM LIGHTNING 540A", 3 },
-	{ "QUANTUM LIGHTNING 730A", 3 },
-
-        { "QUANTUM FIREBALL_540", 3 }, /* Older Quantum Fireballs don't work */
-        { "QUANTUM FIREBALL_640", 3 }, 
-        { "QUANTUM FIREBALL_1080", 3 },
-        { "QUANTUM FIREBALL_1280", 3 },
-	{ NULL,	0 }
-};
-
-/**
- *	ide_scan_pio_blacklist 	-	check for a blacklisted drive
- *	@model: Drive model string
- *
- *	This routine searches the ide_pio_blacklist for an entry
- *	matching the start/whole of the supplied model name.
- *
- *	Returns -1 if no match found.
- *	Otherwise returns the recommended PIO mode from ide_pio_blacklist[].
- */
-
-static int ide_scan_pio_blacklist (char *model)
-{
-	struct ide_pio_info *p;
-
-	for (p = ide_pio_blacklist; p->name != NULL; p++) {
-		if (strncmp(p->name, model, strlen(p->name)) == 0)
-			return p->pio;
-	}
-	return -1;
-}
-
 /**
  *	ide_get_best_pio_mode	-	get PIO mode from drive
  *	@drive: drive to consider
Index: b/drivers/ide/ide-pio-blacklist.c
===================================================================
--- /dev/null
+++ b/drivers/ide/ide-pio-blacklist.c
@@ -0,0 +1,94 @@
+/*
+ * PIO blacklist.  Some drives incorrectly report their maximal PIO mode,
+ * at least in respect to CMD640.  Here we keep info on some known drives.
+ *
+ * Changes to the ide_pio_blacklist[] should be made with EXTREME CAUTION
+ * to avoid breaking the fragile cmd640.c support.
+ */
+
+#include <linux/string.h>
+
+static struct ide_pio_info {
+	const char	*name;
+	int		pio;
+} ide_pio_blacklist [] = {
+	{ "Conner Peripherals 540MB - CFS540A", 3 },
+
+	{ "WDC AC2700",  3 },
+	{ "WDC AC2540",  3 },
+	{ "WDC AC2420",  3 },
+	{ "WDC AC2340",  3 },
+	{ "WDC AC2250",  0 },
+	{ "WDC AC2200",  0 },
+	{ "WDC AC21200", 4 },
+	{ "WDC AC2120",  0 },
+	{ "WDC AC2850",  3 },
+	{ "WDC AC1270",  3 },
+	{ "WDC AC1170",  1 },
+	{ "WDC AC1210",  1 },
+	{ "WDC AC280",   0 },
+	{ "WDC AC31000", 3 },
+	{ "WDC AC31200", 3 },
+
+	{ "Maxtor 7131 AT", 1 },
+	{ "Maxtor 7171 AT", 1 },
+	{ "Maxtor 7213 AT", 1 },
+	{ "Maxtor 7245 AT", 1 },
+	{ "Maxtor 7345 AT", 1 },
+	{ "Maxtor 7546 AT", 3 },
+	{ "Maxtor 7540 AV", 3 },
+
+	{ "SAMSUNG SHD-3121A", 1 },
+	{ "SAMSUNG SHD-3122A", 1 },
+	{ "SAMSUNG SHD-3172A", 1 },
+
+	{ "ST5660A",  3 },
+	{ "ST3660A",  3 },
+	{ "ST3630A",  3 },
+	{ "ST3655A",  3 },
+	{ "ST3391A",  3 },
+	{ "ST3390A",  1 },
+	{ "ST3600A",  1 },
+	{ "ST3290A",  0 },
+	{ "ST3144A",  0 },
+	{ "ST3491A",  1 }, /* reports 3, should be 1 or 2 (depending on drive)
+			      according to Seagate's FIND-ATA program */
+
+	{ "QUANTUM ELS127A", 0 },
+	{ "QUANTUM ELS170A", 0 },
+	{ "QUANTUM LPS240A", 0 },
+	{ "QUANTUM LPS210A", 3 },
+	{ "QUANTUM LPS270A", 3 },
+	{ "QUANTUM LPS365A", 3 },
+	{ "QUANTUM LPS540A", 3 },
+	{ "QUANTUM LIGHTNING 540A", 3 },
+	{ "QUANTUM LIGHTNING 730A", 3 },
+
+	{ "QUANTUM FIREBALL_540", 3 }, /* Older Quantum Fireballs don't work */
+	{ "QUANTUM FIREBALL_640", 3 },
+	{ "QUANTUM FIREBALL_1080", 3 },
+	{ "QUANTUM FIREBALL_1280", 3 },
+	{ NULL, 0 }
+};
+
+/**
+ *	ide_scan_pio_blacklist 	-	check for a blacklisted drive
+ *	@model: Drive model string
+ *
+ *	This routine searches the ide_pio_blacklist for an entry
+ *	matching the start/whole of the supplied model name.
+ *
+ *	Returns -1 if no match found.
+ *	Otherwise returns the recommended PIO mode from ide_pio_blacklist[].
+ */
+
+int ide_scan_pio_blacklist(char *model)
+{
+	struct ide_pio_info *p;
+
+	for (p = ide_pio_blacklist; p->name != NULL; p++) {
+		if (strncmp(p->name, model, strlen(p->name)) == 0)
+			return p->pio;
+	}
+	return -1;
+}
Index: b/include/linux/ide.h
===================================================================
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -1290,6 +1290,8 @@ void ide_timing_merge(struct ide_timing 
 		      struct ide_timing *, unsigned int);
 int ide_timing_compute(ide_drive_t *, u8, struct ide_timing *, int, int);
 
+int ide_scan_pio_blacklist(char *);
+
 u8 ide_get_best_pio_mode(ide_drive_t *, u8, u8);
 
 int ide_set_pio_mode(ide_drive_t *, u8);
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 00/21] ide: convert ide-timing.h to ide-timings.c l ..., Bartlomiej Zolnierki ..., (Wed May 28, 2:39 pm)
[PATCH 01/21] ide: remove needless includes from ide-lib.c, Bartlomiej Zolnierki ..., (Wed May 28, 2:39 pm)
[PATCH 02/21] ide: remove unused XFER_UDMA_SLOW, Bartlomiej Zolnierki ..., (Wed May 28, 2:40 pm)
[PATCH 03/21] ide: use u8 for xfer modes in ide-timing.h, Bartlomiej Zolnierki ..., (Wed May 28, 2:40 pm)
[PATCH 04/21] ide: move some bits from ide-timing.h to &lt;li ..., Bartlomiej Zolnierki ..., (Wed May 28, 2:40 pm)
[PATCH 05/21] ide: remove XFER_* masks from ide-timing.h, Bartlomiej Zolnierki ..., (Wed May 28, 2:40 pm)
[PATCH 06/21] ide: checkpatch.pl fixes for ide-timing.h, Bartlomiej Zolnierki ..., (Wed May 28, 2:40 pm)
[PATCH 07/21] ide: convert ide-timing.h to ide-timings.c l ..., Bartlomiej Zolnierki ..., (Wed May 28, 2:40 pm)
[PATCH 08/21] ali14xx: convert to use ide_timing_find_mode(), Bartlomiej Zolnierki ..., (Wed May 28, 2:40 pm)
[PATCH 09/21] ht6560b: convert to use ide_timing_find_mode(), Bartlomiej Zolnierki ..., (Wed May 28, 2:41 pm)
[PATCH 10/21] qd65xx: convert to use ide_timing_find_mode(), Bartlomiej Zolnierki ..., (Wed May 28, 2:42 pm)
[PATCH 11/21] alim15x3: convert to use ide_timing_find_mode(), Bartlomiej Zolnierki ..., (Wed May 28, 2:42 pm)
[PATCH 12/21] cmd640: convert to use ide_timing_find_mode(), Bartlomiej Zolnierki ..., (Wed May 28, 2:42 pm)
[PATCH 13/21] cmd64x: convert to use ide_timing_find_mode(), Bartlomiej Zolnierki ..., (Wed May 28, 2:42 pm)
[PATCH 14/21] cy82c693: convert to use ide_timing_find_mode(), Bartlomiej Zolnierki ..., (Wed May 28, 2:42 pm)
[PATCH 15/21] opti621: convert to use ide_timing_find_mode(), Bartlomiej Zolnierki ..., (Wed May 28, 2:42 pm)
[PATCH 16/21] sl82c105: convert to use ide_timing_find_mode(), Bartlomiej Zolnierki ..., (Wed May 28, 2:42 pm)
[PATCH 17/21] ide-mpc8xx: convert to use ide_timing_find_m ..., Bartlomiej Zolnierki ..., (Wed May 28, 2:43 pm)
[PATCH 18/21] ide-pmac: convert to use ide_timing_find_mode(), Bartlomiej Zolnierki ..., (Wed May 28, 2:43 pm)
[PATCH 19/21] ide: move ide_pio_cycle_time() to ide-timings.c, Bartlomiej Zolnierki ..., (Wed May 28, 2:43 pm)
[PATCH 20/21] ide: remove no longer used ide_pio_timings[], Bartlomiej Zolnierki ..., (Wed May 28, 2:43 pm)
[PATCH 21/21] ide: move PIO blacklist to ide-pio-blacklist.c, Bartlomiej Zolnierki ..., (Wed May 28, 2:43 pm)
Re: [PATCH 05/21] ide: remove XFER_* masks from ide-timing.h, Sergei Shtylyov, (Fri May 30, 4:46 am)
Re: [PATCH 06/21] ide: checkpatch.pl fixes for ide-timing.h, Sergei Shtylyov, (Fri May 30, 4:46 am)
Re: [PATCH 02/21] ide: remove unused XFER_UDMA_SLOW, Sergei Shtylyov, (Mon Jun 2, 4:43 am)