Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 21896
b: refs/heads/master
c: 75f554b
h: refs/heads/master
v: v3
  • Loading branch information
Tejun Heo authored and Jeff Garzik committed Mar 12, 2006
1 parent fbfd23d commit 7c4349a
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 91 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a6d5a51cf1bf5d83ddd2e06fd372a79b395fb393
refs/heads/master: 75f554bc139461a5a926fad6a6fa90433a00a117
108 changes: 18 additions & 90 deletions trunk/drivers/scsi/libata-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ static void ata_set_mode(struct ata_port *ap);
static void ata_dev_set_xfermode(struct ata_port *ap, struct ata_device *dev);
static unsigned int ata_dev_xfermask(struct ata_port *ap,
struct ata_device *dev);
static int fgb(u32 bitmap);

static unsigned int ata_unique_id = 1;
static struct workqueue_struct *ata_wq;
Expand Down Expand Up @@ -331,25 +330,6 @@ static int ata_xfer_mode2shift(unsigned int xfer_mode)
return -1;
}

static const char * const xfer_mode_str[] = {
"PIO0",
"PIO1",
"PIO2",
"PIO3",
"PIO4",
"MWDMA0",
"MWDMA1",
"MWDMA2",
"UDMA/16",
"UDMA/25",
"UDMA/33",
"UDMA/44",
"UDMA/66",
"UDMA/100",
"UDMA/133",
"UDMA7",
};

/**
* ata_mode_string - convert xfer_mask to string
* @xfer_mask: mask of bits supported; only highest bit counts.
Expand All @@ -364,9 +344,26 @@ static const char * const xfer_mode_str[] = {
* Constant C string representing highest speed listed in
* @mode_mask, or the constant C string "<n/a>".
*/

static const char *ata_mode_string(unsigned int xfer_mask)
{
static const char * const xfer_mode_str[] = {
"PIO0",
"PIO1",
"PIO2",
"PIO3",
"PIO4",
"MWDMA0",
"MWDMA1",
"MWDMA2",
"UDMA/16",
"UDMA/25",
"UDMA/33",
"UDMA/44",
"UDMA/66",
"UDMA/100",
"UDMA/133",
"UDMA7",
};
int highbit;

highbit = fls(xfer_mask) - 1;
Expand Down Expand Up @@ -827,35 +824,6 @@ static unsigned int ata_id_xfermask(const u16 *id)
return ata_pack_xfermask(pio_mask, mwdma_mask, udma_mask);
}

/*
* Compute the PIO modes available for this device. This is not as
* trivial as it seems if we must consider early devices correctly.
*
* FIXME: pre IDE drive timing (do we care ?).
*/

static unsigned int ata_pio_modes(const struct ata_device *adev)
{
u16 modes;

/* Usual case. Word 53 indicates word 64 is valid */
if (adev->id[ATA_ID_FIELD_VALID] & (1 << 1)) {
modes = adev->id[ATA_ID_PIO_MODES] & 0x03;
modes <<= 3;
modes |= 0x7;
return modes;
}

/* If word 64 isn't valid then Word 51 high byte holds the PIO timing
number for the maximum. Turn it into a mask and return it */
modes = (2 << ((adev->id[ATA_ID_OLD_PIO_MODES] >> 8) & 0xFF)) - 1 ;
return modes;
/* But wait.. there's more. Design your standards by committee and
you too can get a free iordy field to process. However its the
speeds not the modes that are supported... Note drivers using the
timing API will get this right anyway */
}

/**
* ata_port_queue_task - Queue port_task
* @ap: The ata_port to queue port_task for
Expand Down Expand Up @@ -1728,26 +1696,6 @@ int ata_timing_compute(struct ata_device *adev, unsigned short speed,
return 0;
}

static const struct {
unsigned int shift;
u8 base;
} xfer_mode_classes[] = {
{ ATA_SHIFT_UDMA, XFER_UDMA_0 },
{ ATA_SHIFT_MWDMA, XFER_MW_DMA_0 },
{ ATA_SHIFT_PIO, XFER_PIO_0 },
};

static u8 base_from_shift(unsigned int shift)
{
int i;

for (i = 0; i < ARRAY_SIZE(xfer_mode_classes); i++)
if (xfer_mode_classes[i].shift == shift)
return xfer_mode_classes[i].base;

return 0xff;
}

static void ata_dev_set_mode(struct ata_port *ap, struct ata_device *dev)
{
if (!ata_dev_present(dev) || (ap->flags & ATA_FLAG_PORT_DISABLED))
Expand Down Expand Up @@ -2596,13 +2544,6 @@ int ata_dev_revalidate(struct ata_port *ap, struct ata_device *dev,
return rc;
}

static void ata_pr_blacklisted(const struct ata_port *ap,
const struct ata_device *dev)
{
printk(KERN_WARNING "ata%u: dev %u is on DMA blacklist, disabling DMA\n",
ap->id, dev->devno);
}

static const char * const ata_dma_blacklist [] = {
"WDC AC11000H",
"WDC AC22100H",
Expand Down Expand Up @@ -2690,19 +2631,6 @@ static unsigned int ata_dev_xfermask(struct ata_port *ap,
return xfer_mask;
}

/* find greatest bit */
static int fgb(u32 bitmap)
{
unsigned int i;
int x = -1;

for (i = 0; i < 32; i++)
if (bitmap & (1 << i))
x = i;

return x;
}

/**
* ata_dev_set_xfermode - Issue SET FEATURES - XFER MODE command
* @ap: Port associated with device @dev
Expand Down

0 comments on commit 7c4349a

Please sign in to comment.