• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /asus-wl-520gu-7.0.1.45/src/linux/linux/drivers/ide/

Lines Matching defs:drive

371 static int check_in_drive_lists (ide_drive_t *drive, const char **list)
373 struct hd_driveid *id = drive->id;
400 static void hpt366_tune_chipset (ide_drive_t *drive, byte speed)
402 byte regtime = (drive->select.b.unit & 0x01) ? 0x44 : 0x40;
403 byte regfast = (HWIF(drive)->channel) ? 0x55 : 0x51;
415 pci_read_config_byte(HWIF(drive)->pci_dev, regfast, &drive_fast);
417 pci_write_config_byte(HWIF(drive)->pci_dev, regfast, drive_fast & ~0x20);
419 pci_read_config_dword(HWIF(drive)->pci_dev, regtime, &reg1);
443 pci_write_config_dword(HWIF(drive)->pci_dev, regtime, reg2);
446 static void hpt370_tune_chipset (ide_drive_t *drive, byte speed)
448 byte regfast = (HWIF(drive)->channel) ? 0x55 : 0x51;
452 byte drive_pci = 0x40 + (drive->dn * 4);
454 struct pci_dev *dev = HWIF(drive)->pci_dev;
473 pci_write_config_byte(HWIF(drive)->pci_dev, regfast, new_fast);
489 static int hpt3xx_tune_chipset (ide_drive_t *drive, byte speed)
491 if ((drive->media != ide_disk) && (speed < XFER_SW_DMA_0))
494 if (!drive->init_speed)
495 drive->init_speed = speed;
497 if (pci_rev_check_hpt3xx(HWIF(drive)->pci_dev)) {
498 hpt370_tune_chipset(drive, speed);
500 hpt366_tune_chipset(drive, speed);
502 drive->current_speed = speed;
503 return ((int) ide_config_drive_speed(drive, speed));
506 static void config_chipset_for_pio (ide_drive_t *drive)
509 unsigned short xfer_pio = drive->id->eide_pio_modes;
512 pio = ide_get_best_pio_mode(drive, 255, 5, NULL);
517 if (drive->id->eide_pio_iordy > 0) {
520 drive->id->eide_pio_iordy>eide_pio_timing[xfer_pio];
523 xfer_pio = (drive->id->eide_pio_modes & 4) ? 0x05 :
524 (drive->id->eide_pio_modes & 2) ? 0x04 :
525 (drive->id->eide_pio_modes & 1) ? 0x03 :
526 (drive->id->tPIO & 2) ? 0x02 :
527 (drive->id->tPIO & 1) ? 0x01 : xfer_pio;
538 speed = (!drive->id->tPIO) ? XFER_PIO_0 : XFER_PIO_SLOW;
541 (void) hpt3xx_tune_chipset(drive, speed);
544 static void hpt3xx_tune_drive (ide_drive_t *drive, byte pio)
554 (void) hpt3xx_tune_chipset(drive, speed);
560 * for cards that learn about the drive's UDMA, DMA, PIO capabilities
561 * after the drive is reported by the OS. Initally for designed for
564 * check_in_drive_lists(drive, bad_ata66_4)
565 * check_in_drive_lists(drive, bad_ata66_3)
566 * check_in_drive_lists(drive, bad_ata33)
569 static int config_chipset_for_dma (ide_drive_t *drive)
571 struct hd_driveid *id = drive->id;
573 byte ultra66 = eighty_ninty_three(drive);
576 if ((drive->media != ide_disk) && (speed < XFER_SW_DMA_0))
580 (!check_in_drive_lists(drive, bad_ata100_5)) &&
582 (pci_rev_check_hpt3xx(HWIF(drive)->pci_dev)) &&
586 (!check_in_drive_lists(drive, bad_ata66_4)) &&
591 (!check_in_drive_lists(drive, bad_ata66_3)) &&
595 } else if (id->dma_ultra && (!check_in_drive_lists(drive, bad_ata33))) {
613 (void) hpt3xx_tune_chipset(drive, speed);
622 int hpt3xx_quirkproc (ide_drive_t *drive)
624 return ((int) check_in_drive_lists(drive, quirk_drives));
627 void hpt3xx_intrproc (ide_drive_t *drive)
629 if (drive->quirk_list) {
632 OUT_BYTE((drive)->ctl|2, HWIF(drive)->io_ports[IDE_CONTROL_OFFSET]);
636 void hpt3xx_maskproc (ide_drive_t *drive, int mask)
638 if (drive->quirk_list) {
639 if (pci_rev_check_hpt3xx(HWIF(drive)->pci_dev)) {
641 pci_read_config_byte(HWIF(drive)->pci_dev, 0x5a, &reg5a);
643 pci_write_config_byte(HWIF(drive)->pci_dev, 0x5a, mask ? (reg5a | 0x10) : (reg5a & ~0x10));
646 disable_irq(HWIF(drive)->irq);
648 enable_irq(HWIF(drive)->irq);
653 OUT_BYTE(mask ? (drive->ctl | 2) : (drive->ctl & ~2), IDE_CONTROL_REG);
657 static int config_drive_xfer_rate (ide_drive_t *drive)
659 struct hd_driveid *id = drive->id;
662 if (id && (id->capability & 1) && HWIF(drive)->autodma) {
664 if (ide_dmaproc(ide_dma_bad_drive, drive)) {
672 dma_func = config_chipset_for_dma(drive);
681 dma_func = config_chipset_for_dma(drive);
685 } else if (ide_dmaproc(ide_dma_good_drive, drive)) {
690 dma_func = config_chipset_for_dma(drive);
701 config_chipset_for_pio(drive);
703 return HWIF(drive)->dmaproc(dma_func, drive);
707 * hpt366_dmaproc() initiates/aborts (U)DMA read/write operations on a drive.
712 int hpt366_dmaproc (ide_dma_action_t func, ide_drive_t *drive)
715 unsigned long dma_base = HWIF(drive)->dma_base;
719 return config_drive_xfer_rate(drive);
724 pci_read_config_byte(HWIF(drive)->pci_dev, 0x50, &reg50h);
725 pci_read_config_byte(HWIF(drive)->pci_dev, 0x52, &reg52h);
726 pci_read_config_byte(HWIF(drive)->pci_dev, 0x5a, &reg5ah);
728 drive->name,
732 pci_write_config_byte(HWIF(drive)->pci_dev, 0x5a, reg5ah & ~0x10);
739 return ide_dmaproc(func, drive); /* use standard DMA stuff */
742 int hpt370_dmaproc (ide_dma_action_t func, ide_drive_t *drive)
744 ide_hwif_t *hwif = HWIF(drive);
752 return config_drive_xfer_rate(drive);
773 printk("%s: %d bytes in FIFO\n", drive->name,
793 return ide_dmaproc(func, drive); /* use standard DMA stuff */
802 void hpt3xx_reset (ide_drive_t *drive)
806 static int hpt3xx_tristate (ide_drive_t * drive, int state)
808 ide_hwif_t *hwif = HWIF(drive);
824 (void) ide_do_reset(drive);
830 (void) ide_do_reset(drive);
836 * set/get power state for a drive.
838 * 1) soft-reset the drive
844 static int hpt370_busproc(ide_drive_t * drive, int state)
846 ide_hwif_t *hwif = HWIF(drive);
870 * make sure that the drive knows that it has failed if it's off */