aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/libata-core.c
diff options
context:
space:
mode:
authorTejun Heo <htejun@gmail.com>2006-03-05 14:31:57 -0500
committerJeff Garzik <jeff@garzik.org>2006-03-11 19:03:39 -0500
commit75f554bc139461a5a926fad6a6fa90433a00a117 (patch)
tree6b2366e670df743e0cd17e5e01c4807d92b6c163 /drivers/scsi/libata-core.c
parenta6d5a51cf1bf5d83ddd2e06fd372a79b395fb393 (diff)
[PATCH] libata: kill unused xfer_mode functions
Preceding xfer_mask changes make the following functions unused. ata_pio_modes(), base_from_shift(), ata_pr_blacklisted(), fgb() Kill them. Also, as xfer_mode_str[] is now only used by ata_mode_string(), move it into the function. Signed-off-by: Tejun Heo <htejun@gmail.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/scsi/libata-core.c')
-rw-r--r--drivers/scsi/libata-core.c108
1 files changed, 18 insertions, 90 deletions
diff --git a/drivers/scsi/libata-core.c b/drivers/scsi/libata-core.c
index d211f0b1d721..5acb0798534c 100644
--- a/drivers/scsi/libata-core.c
+++ b/drivers/scsi/libata-core.c
@@ -67,7 +67,6 @@ static void ata_set_mode(struct ata_port *ap);
67static void ata_dev_set_xfermode(struct ata_port *ap, struct ata_device *dev); 67static void ata_dev_set_xfermode(struct ata_port *ap, struct ata_device *dev);
68static unsigned int ata_dev_xfermask(struct ata_port *ap, 68static unsigned int ata_dev_xfermask(struct ata_port *ap,
69 struct ata_device *dev); 69 struct ata_device *dev);
70static int fgb(u32 bitmap);
71 70
72static unsigned int ata_unique_id = 1; 71static unsigned int ata_unique_id = 1;
73static struct workqueue_struct *ata_wq; 72static struct workqueue_struct *ata_wq;
@@ -331,25 +330,6 @@ static int ata_xfer_mode2shift(unsigned int xfer_mode)
331 return -1; 330 return -1;
332} 331}
333 332
334static const char * const xfer_mode_str[] = {
335 "PIO0",
336 "PIO1",
337 "PIO2",
338 "PIO3",
339 "PIO4",
340 "MWDMA0",
341 "MWDMA1",
342 "MWDMA2",
343 "UDMA/16",
344 "UDMA/25",
345 "UDMA/33",
346 "UDMA/44",
347 "UDMA/66",
348 "UDMA/100",
349 "UDMA/133",
350 "UDMA7",
351};
352
353/** 333/**
354 * ata_mode_string - convert xfer_mask to string 334 * ata_mode_string - convert xfer_mask to string
355 * @xfer_mask: mask of bits supported; only highest bit counts. 335 * @xfer_mask: mask of bits supported; only highest bit counts.
@@ -364,9 +344,26 @@ static const char * const xfer_mode_str[] = {
364 * Constant C string representing highest speed listed in 344 * Constant C string representing highest speed listed in
365 * @mode_mask, or the constant C string "<n/a>". 345 * @mode_mask, or the constant C string "<n/a>".
366 */ 346 */
367
368static const char *ata_mode_string(unsigned int xfer_mask) 347static const char *ata_mode_string(unsigned int xfer_mask)
369{ 348{
349 static const char * const xfer_mode_str[] = {
350 "PIO0",
351 "PIO1",
352 "PIO2",
353 "PIO3",
354 "PIO4",
355 "MWDMA0",
356 "MWDMA1",
357 "MWDMA2",
358 "UDMA/16",
359 "UDMA/25",
360 "UDMA/33",
361 "UDMA/44",
362 "UDMA/66",
363 "UDMA/100",
364 "UDMA/133",
365 "UDMA7",
366 };
370 int highbit; 367 int highbit;
371 368
372 highbit = fls(xfer_mask) - 1; 369 highbit = fls(xfer_mask) - 1;
@@ -827,35 +824,6 @@ static unsigned int ata_id_xfermask(const u16 *id)
827 return ata_pack_xfermask(pio_mask, mwdma_mask, udma_mask); 824 return ata_pack_xfermask(pio_mask, mwdma_mask, udma_mask);
828} 825}
829 826
830/*
831 * Compute the PIO modes available for this device. This is not as
832 * trivial as it seems if we must consider early devices correctly.
833 *
834 * FIXME: pre IDE drive timing (do we care ?).
835 */
836
837static unsigned int ata_pio_modes(const struct ata_device *adev)
838{
839 u16 modes;
840
841 /* Usual case. Word 53 indicates word 64 is valid */
842 if (adev->id[ATA_ID_FIELD_VALID] & (1 << 1)) {
843 modes = adev->id[ATA_ID_PIO_MODES] & 0x03;
844 modes <<= 3;
845 modes |= 0x7;
846 return modes;
847 }
848
849 /* If word 64 isn't valid then Word 51 high byte holds the PIO timing
850 number for the maximum. Turn it into a mask and return it */
851 modes = (2 << ((adev->id[ATA_ID_OLD_PIO_MODES] >> 8) & 0xFF)) - 1 ;
852 return modes;
853 /* But wait.. there's more. Design your standards by committee and
854 you too can get a free iordy field to process. However its the
855 speeds not the modes that are supported... Note drivers using the
856 timing API will get this right anyway */
857}
858
859/** 827/**
860 * ata_port_queue_task - Queue port_task 828 * ata_port_queue_task - Queue port_task
861 * @ap: The ata_port to queue port_task for 829 * @ap: The ata_port to queue port_task for
@@ -1728,26 +1696,6 @@ int ata_timing_compute(struct ata_device *adev, unsigned short speed,
1728 return 0; 1696 return 0;
1729} 1697}
1730 1698
1731static const struct {
1732 unsigned int shift;
1733 u8 base;
1734} xfer_mode_classes[] = {
1735 { ATA_SHIFT_UDMA, XFER_UDMA_0 },
1736 { ATA_SHIFT_MWDMA, XFER_MW_DMA_0 },
1737 { ATA_SHIFT_PIO, XFER_PIO_0 },
1738};
1739
1740static u8 base_from_shift(unsigned int shift)
1741{
1742 int i;
1743
1744 for (i = 0; i < ARRAY_SIZE(xfer_mode_classes); i++)
1745 if (xfer_mode_classes[i].shift == shift)
1746 return xfer_mode_classes[i].base;
1747
1748 return 0xff;
1749}
1750
1751static void ata_dev_set_mode(struct ata_port *ap, struct ata_device *dev) 1699static void ata_dev_set_mode(struct ata_port *ap, struct ata_device *dev)
1752{ 1700{
1753 if (!ata_dev_present(dev) || (ap->flags & ATA_FLAG_PORT_DISABLED)) 1701 if (!ata_dev_present(dev) || (ap->flags & ATA_FLAG_PORT_DISABLED))
@@ -2596,13 +2544,6 @@ int ata_dev_revalidate(struct ata_port *ap, struct ata_device *dev,
2596 return rc; 2544 return rc;
2597} 2545}
2598 2546
2599static void ata_pr_blacklisted(const struct ata_port *ap,
2600 const struct ata_device *dev)
2601{
2602 printk(KERN_WARNING "ata%u: dev %u is on DMA blacklist, disabling DMA\n",
2603 ap->id, dev->devno);
2604}
2605
2606static const char * const ata_dma_blacklist [] = { 2547static const char * const ata_dma_blacklist [] = {
2607 "WDC AC11000H", 2548 "WDC AC11000H",
2608 "WDC AC22100H", 2549 "WDC AC22100H",
@@ -2690,19 +2631,6 @@ static unsigned int ata_dev_xfermask(struct ata_port *ap,
2690 return xfer_mask; 2631 return xfer_mask;
2691} 2632}
2692 2633
2693/* find greatest bit */
2694static int fgb(u32 bitmap)
2695{
2696 unsigned int i;
2697 int x = -1;
2698
2699 for (i = 0; i < 32; i++)
2700 if (bitmap & (1 << i))
2701 x = i;
2702
2703 return x;
2704}
2705
2706/** 2634/**
2707 * ata_dev_set_xfermode - Issue SET FEATURES - XFER MODE command 2635 * ata_dev_set_xfermode - Issue SET FEATURES - XFER MODE command
2708 * @ap: Port associated with device @dev 2636 * @ap: Port associated with device @dev