Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 56442
b: refs/heads/master
c: 4728d54
h: refs/heads/master
v: v3
  • Loading branch information
Bartlomiej Zolnierkiewicz committed May 15, 2007
1 parent b6bee97 commit 8e18382
Show file tree
Hide file tree
Showing 10 changed files with 12 additions and 102 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: 46cedc9b773795b6190c31e5d32de5207b55a356
refs/heads/master: 4728d546d7137ad5350cc2e53d4748fd26f61a60
5 changes: 3 additions & 2 deletions trunk/drivers/ide/ide-dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -792,9 +792,10 @@ int ide_tune_dma(ide_drive_t *drive)
if (!speed)
return 0;

drive->hwif->speedproc(drive, speed);
if (drive->hwif->speedproc(drive, speed))
return 0;

return ide_dma_enable(drive);
return 1;
}

EXPORT_SYMBOL_GPL(ide_tune_dma);
Expand Down
12 changes: 0 additions & 12 deletions trunk/drivers/ide/ide-lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -111,18 +111,6 @@ u8 ide_rate_filter(ide_drive_t *drive, u8 speed)

EXPORT_SYMBOL(ide_rate_filter);

int ide_dma_enable (ide_drive_t *drive)
{
ide_hwif_t *hwif = HWIF(drive);
struct hd_driveid *id = drive->id;

return ((int) ((((id->dma_ultra >> 8) & hwif->ultra_mask) ||
((id->dma_mword >> 8) & hwif->mwdma_mask) ||
((id->dma_1word >> 8) & hwif->swdma_mask)) ? 1 : 0));
}

EXPORT_SYMBOL(ide_dma_enable);

int ide_use_fast_pio(ide_drive_t *drive)
{
struct hd_driveid *id = drive->id;
Expand Down
15 changes: 1 addition & 14 deletions trunk/drivers/ide/pci/cmd64x.c
Original file line number Diff line number Diff line change
Expand Up @@ -352,22 +352,9 @@ static int cmd64x_tune_chipset (ide_drive_t *drive, u8 speed)
return ide_config_drive_speed(drive, speed);
}

static int config_chipset_for_dma (ide_drive_t *drive)
{
u8 speed = ide_max_dma_mode(drive);

if (!speed)
return 0;

if (cmd64x_tune_chipset(drive, speed))
return 0;

return ide_dma_enable(drive);
}

static int cmd64x_config_drive_for_dma (ide_drive_t *drive)
{
if (ide_use_dma(drive) && config_chipset_for_dma(drive))
if (ide_tune_dma(drive))
return 0;

if (ide_use_fast_pio(drive))
Expand Down
8 changes: 2 additions & 6 deletions trunk/drivers/ide/pci/cs5530.c
Original file line number Diff line number Diff line change
Expand Up @@ -137,12 +137,8 @@ static u8 cs5530_udma_filter(ide_drive_t *drive)

static int cs5530_config_dma(ide_drive_t *drive)
{
if (ide_use_dma(drive)) {
u8 mode = ide_max_dma_mode(drive);

if (mode && drive->hwif->speedproc(drive, mode) == 0)
return 0;
}
if (ide_tune_dma(drive))
return 0;

return 1;
}
Expand Down
8 changes: 2 additions & 6 deletions trunk/drivers/ide/pci/sc1200.c
Original file line number Diff line number Diff line change
Expand Up @@ -240,12 +240,8 @@ static int sc1200_tune_chipset(ide_drive_t *drive, u8 mode)
*/
static int sc1200_config_dma (ide_drive_t *drive)
{
if (ide_use_dma(drive)) {
u8 mode = ide_max_dma_mode(drive);

if (mode && drive->hwif->speedproc(drive, mode) == 0)
return 0;
}
if (ide_tune_dma(drive))
return 0;

return 1;
}
Expand Down
22 changes: 1 addition & 21 deletions trunk/drivers/ide/pci/scc_pata.c
Original file line number Diff line number Diff line change
Expand Up @@ -321,26 +321,6 @@ static int scc_tune_chipset(ide_drive_t *drive, byte xferspeed)
return ide_config_drive_speed(drive, speed);
}

/**
* scc_config_chipset_for_dma - configure for DMA
* @drive: drive to configure
*
* Called by scc_config_drive_for_dma().
*/

static int scc_config_chipset_for_dma(ide_drive_t *drive)
{
u8 speed = ide_max_dma_mode(drive);

if (!speed)
return 0;

if (scc_tune_chipset(drive, speed))
return 0;

return ide_dma_enable(drive);
}

/**
* scc_configure_drive_for_dma - set up for DMA transfers
* @drive: drive we are going to set up
Expand All @@ -354,7 +334,7 @@ static int scc_config_chipset_for_dma(ide_drive_t *drive)

static int scc_config_drive_for_dma(ide_drive_t *drive)
{
if (ide_use_dma(drive) && scc_config_chipset_for_dma(drive))
if (ide_tune_dma(drive))
return 0;

if (ide_use_fast_pio(drive))
Expand Down
24 changes: 1 addition & 23 deletions trunk/drivers/ide/pci/siimage.c
Original file line number Diff line number Diff line change
Expand Up @@ -374,28 +374,6 @@ static int siimage_tune_chipset (ide_drive_t *drive, byte xferspeed)
return (ide_config_drive_speed(drive, speed));
}

/**
* config_chipset_for_dma - configure for DMA
* @drive: drive to configure
*
* Called by the IDE layer when it wants the timings set up.
* For the CMD680 we also need to set up the PIO timings and
* enable DMA.
*/

static int config_chipset_for_dma (ide_drive_t *drive)
{
u8 speed = ide_max_dma_mode(drive);

if (!speed)
return 0;

if (siimage_tune_chipset(drive, speed))
return 0;

return ide_dma_enable(drive);
}

/**
* siimage_configure_drive_for_dma - set up for DMA transfers
* @drive: drive we are going to set up
Expand All @@ -408,7 +386,7 @@ static int config_chipset_for_dma (ide_drive_t *drive)

static int siimage_config_drive_for_dma (ide_drive_t *drive)
{
if (ide_use_dma(drive) && config_chipset_for_dma(drive))
if (ide_tune_dma(drive))
return 0;

if (ide_use_fast_pio(drive))
Expand Down
17 changes: 1 addition & 16 deletions trunk/drivers/ide/pci/sl82c105.c
Original file line number Diff line number Diff line change
Expand Up @@ -158,29 +158,14 @@ static int sl82c105_tune_chipset(ide_drive_t *drive, u8 speed)
return ide_config_drive_speed(drive, speed);
}

/*
* Configure the drive for DMA.
*/
static int config_for_dma(ide_drive_t *drive)
{
u8 speed = ide_max_dma_mode(drive);

DBG(("config_for_dma(drive:%s)\n", drive->name));

if (!speed || sl82c105_tune_chipset(drive, speed))
return 0;

return ide_dma_enable(drive);
}

/*
* Check to see if the drive and chipset are capable of DMA mode.
*/
static int sl82c105_ide_dma_check(ide_drive_t *drive)
{
DBG(("sl82c105_ide_dma_check(drive:%s)\n", drive->name));

if (ide_use_dma(drive) && config_for_dma(drive))
if (ide_tune_dma(drive))
return 0;

return -1;
Expand Down
1 change: 0 additions & 1 deletion trunk/include/linux/ide.h
Original file line number Diff line number Diff line change
Expand Up @@ -1357,7 +1357,6 @@ static inline void ide_set_hwifdata (ide_hwif_t * hwif, void *data)

/* ide-lib.c */
u8 ide_rate_filter(ide_drive_t *, u8);
extern int ide_dma_enable(ide_drive_t *drive);
extern char *ide_xfer_verbose(u8 xfer_rate);
extern void ide_toggle_bounce(ide_drive_t *drive, int on);
extern int ide_set_xfer_rate(ide_drive_t *drive, u8 rate);
Expand Down

0 comments on commit 8e18382

Please sign in to comment.