kernels/linux-2.4.0/drivers/ide/sl82c105.c
/*
 * We only deal with PIO mode here - DMA mode 'using_dma' is not
 * initialised at the point that this function is called.
 */
We only deal with PIO mode here - DMA mode 'using_dma' is not
initialised at the point that this function is called.
We only deal with PIO mode here - DMA mode ' using_dma ' is not initialised at the point that this function is called .
static void tune_sl82c105(ide_drive_t *drive, byte pio)
{
	ide_hwif_t *hwif = HWIF(drive);
	struct pci_dev *dev = hwif->pci_dev;
	ide_pio_data_t p;
	unsigned short drv_ctrl = 0x909;
	unsigned int xfer_mode, reg;
	reg = (hwif->channel ? 0x4c : 0x44) + (drive->select.b.unit ? 4 : 0);
	pio = ide_get_best_pio_mode(drive, pio, 5, &p);
	switch (pio) {
	default:
	case 0:		xfer_mode = XFER_PIO_0;		break;
	case 1:		xfer_mode = XFER_PIO_1;		break;
	case 2:		xfer_mode = XFER_PIO_2;		break;
	case 3:		xfer_mode = XFER_PIO_3;		break;
	case 4:		xfer_mode = XFER_PIO_4;		break;
	}
	if (ide_config_drive_speed(drive, xfer_mode) == 0)
		drv_ctrl = get_timing_sl82c105(&p);
	pci_write_config_word(dev, reg, drv_ctrl);
	pci_read_config_word(dev, reg, &drv_ctrl);
	printk("%s: selected %s (%dns) (%04X)\n", drive->name,
	       ide_xfer_verbose(xfer_mode), p.cycle_time, drv_ctrl);
}
static void tune_sl82c105 ( ide_drive_t * drive , byte pio ) { ide_hwif_t * hwif = HWIF ( drive ) ; struct pci_dev * dev = hwif -> pci_dev ; ide_pio_data_t p ; unsigned short drv_ctrl = 0x909 ; unsigned int xfer_mode , reg ; reg = ( hwif -> channel ? 0x4c : 0x44 ) + ( drive -> select . b . unit ? 4 : 0 ) ; pio = ide_get_best_pio_mode ( drive , pio , 5 , & p ) ; switch ( pio ) { default : case 0 : xfer_mode = XFER_PIO_0 ; break ; case 1 : xfer_mode = XFER_PIO_1 ; break ; case 2 : xfer_mode = XFER_PIO_2 ; break ; case 3 : xfer_mode = XFER_PIO_3 ; break ; case 4 : xfer_mode = XFER_PIO_4 ; break ; } if ( ide_config_drive_speed ( drive , xfer_mode ) == 0 ) drv_ctrl = get_timing_sl82c105 ( & p ) ; pci_write_config_word ( dev , reg , drv_ctrl ) ; pci_read_config_word ( dev , reg , & drv_ctrl ) ; printk ( " \n " , drive -> name , ide_xfer_verbose ( xfer_mode ) , p . cycle_time , drv_ctrl ) ; }
We only deal with PIO mode here - DMA mode 'using_dma' is not
 initialised at the point that this function is called.
We only deal with PIO mode here - DMA mode ' using_dma ' is not initialised at the point that this function is called .