• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-WNDR4500v2-V1.0.0.60_1.0.38/src/linux/linux-2.6/drivers/ide/

Lines Matching refs:hwif

20  * Version 1.03		fix for (hwif->chipset == ide_4drives)
23 * Version 1.05 fix for (hwif->chipset == ide_pdc4030)
135 ide_hwif_t *hwif = HWIF(drive);
141 hwif->ata_input_data(drive, id, SECTOR_WORDS);
276 ide_hwif_t *hwif = HWIF(drive);
286 a = hwif->INB(IDE_ALTSTATUS_REG);
287 s = hwif->INB(IDE_STATUS_REG);
305 hwif->OUTB(0, IDE_FEATURE_REG);
308 hwif->OUTB(cmd, IDE_COMMAND_REG);
319 } while ((hwif->INB(hd_status)) & BUSY_STAT);
323 if (OK_STAT((hwif->INB(IDE_STATUS_REG)), DRQ_STAT, BAD_R_STAT)) {
333 (void) hwif->INB(IDE_STATUS_REG);
354 ide_hwif_t *hwif = HWIF(drive);
367 if (!hwif->irq) {
373 hwif->OUTB(ctl, IDE_CONTROL_REG);
381 hwif->OUTB(drive->ctl|2, IDE_CONTROL_REG);
383 (void) hwif->INB(IDE_STATUS_REG);
386 if (!hwif->irq) {
388 hwif->irq = irq;
426 ide_hwif_t *hwif = HWIF(drive);
445 if (hwif->INB(IDE_SELECT_REG) != drive->select.all && !drive->present) {
448 SELECT_DRIVE(&hwif->drives[0]);
456 if (OK_STAT((hwif->INB(IDE_STATUS_REG)), READY_STAT, BUSY_STAT) ||
463 if (hwif->INB(IDE_STATUS_REG) == (BUSY_STAT|READY_STAT))
472 hwif->INB(IDE_STATUS_REG));
474 hwif->OUTB(drive->select.all, IDE_SELECT_REG);
476 hwif->OUTB(WIN_SRST, IDE_COMMAND_REG);
478 while (((hwif->INB(IDE_STATUS_REG)) & BUSY_STAT) &&
485 drive->name, hwif->INB(IDE_STATUS_REG));
487 (void) hwif->INB(IDE_STATUS_REG);
494 SELECT_DRIVE(&hwif->drives[0]);
497 (void) hwif->INB(IDE_STATUS_REG);
507 ide_hwif_t *hwif = HWIF(drive);
510 printk("%s: enabling %s -- ", hwif->name, drive->id->model);
513 hwif->OUTB(EXABYTE_ENABLE_NEST, IDE_COMMAND_REG);
521 } while ((hwif->INB(IDE_STATUS_REG)) & BUSY_STAT);
525 if (!OK_STAT((hwif->INB(IDE_STATUS_REG)), 0, BAD_STAT)) {
526 printk("failed (status = 0x%02x)\n", hwif->INB(IDE_STATUS_REG));
618 ide_hwif_t *hwif = container_of(dev, ide_hwif_t, gendev);
620 complete(&hwif->gendev_rel_comp);
623 static void hwif_register (ide_hwif_t *hwif)
628 strlcpy(hwif->gendev.bus_id,hwif->name,BUS_ID_SIZE);
629 hwif->gendev.driver_data = hwif;
630 if (hwif->gendev.parent == NULL) {
631 if (hwif->pci_dev)
632 hwif->gendev.parent = &hwif->pci_dev->dev;
635 hwif->gendev.parent = NULL;
637 hwif->gendev.release = hwif_release_dev;
638 ret = device_register(&hwif->gendev);
644 static int wait_hwif_ready(ide_hwif_t *hwif)
648 printk(KERN_DEBUG "Probing IDE interface %s...\n", hwif->name);
658 rc = ide_wait_not_busy(hwif, 35000);
663 SELECT_DRIVE(&hwif->drives[0]);
664 hwif->OUTB(8, hwif->io_ports[IDE_CONTROL_OFFSET]);
666 rc = ide_wait_not_busy(hwif, 35000);
669 SELECT_DRIVE(&hwif->drives[1]);
670 hwif->OUTB(8, hwif->io_ports[IDE_CONTROL_OFFSET]);
672 rc = ide_wait_not_busy(hwif, 35000);
675 SELECT_DRIVE(&hwif->drives[0]);
682 * @hwif: interface
689 void ide_undecoded_slave(ide_hwif_t *hwif)
691 ide_drive_t *drive0 = &hwif->drives[0];
692 ide_drive_t *drive1 = &hwif->drives[1];
721 static void probe_hwif(ide_hwif_t *hwif, void (*fixup)(ide_hwif_t *hwif))
727 if (hwif->noprobe)
730 if ((hwif->chipset != ide_4drives || !hwif->mate || !hwif->mate->present) &&
731 (ide_hwif_request_regions(hwif))) {
734 ide_drive_t *drive = &hwif->drives[unit];
744 hwif->name);
752 irqd = hwif->irq;
754 disable_irq(hwif->irq);
777 if (wait_hwif_ready(hwif) == -EBUSY)
778 printk(KERN_DEBUG "%s: Wait for ready failed before probe !\n", hwif->name);
785 ide_drive_t *drive = &hwif->drives[unit];
786 drive->dn = (hwif->channel ? 2 : 0) + unit;
788 if (drive->present && !hwif->present) {
789 hwif->present = 1;
790 if (hwif->chipset != ide_4drives ||
791 !hwif->mate ||
792 !hwif->mate->present) {
793 hwif_register(hwif);
797 if (hwif->io_ports[IDE_CONTROL_OFFSET] && hwif->reset) {
801 printk(KERN_WARNING "%s: reset\n", hwif->name);
802 hwif->OUTB(12, hwif->io_ports[IDE_CONTROL_OFFSET]);
804 hwif->OUTB(8, hwif->io_ports[IDE_CONTROL_OFFSET]);
807 stat = hwif->INB(hwif->io_ports[IDE_STATUS_OFFSET]);
819 if (!hwif->present) {
820 ide_hwif_release_regions(hwif);
825 fixup(hwif);
828 ide_drive_t *drive = &hwif->drives[unit];
831 if (hwif->tuneproc != NULL &&
834 hwif->tuneproc(drive, 255);
845 // drive->autodma = hwif->autodma;
846 if (hwif->ide_dma_check) {
853 hwif->dma_off_quietly(drive);
863 ide_drive_t *drive = &hwif->drives[unit];
865 if (hwif->no_io_32bit)
872 static int hwif_init(ide_hwif_t *hwif);
874 int probe_hwif_init_with_fixup(ide_hwif_t *hwif, void (*fixup)(ide_hwif_t *hwif))
876 probe_hwif(hwif, fixup);
878 if (!hwif_init(hwif)) {
880 hwif->name);
884 if (hwif->present) {
889 ide_drive_t *drive = &hwif->drives[unit];
905 int probe_hwif_init(ide_hwif_t *hwif)
907 return probe_hwif_init_with_fixup(hwif, NULL);
917 * hwif's irq until after that hwif is actually probed/initialized..
918 * This could be a problem for the case where an hwif is on a
920 * hwif using one of the same irqs is initialized beforehand.
924 static void save_match(ide_hwif_t *hwif, ide_hwif_t *new, ide_hwif_t **match)
932 hwif->name, new->name, m->name);
934 if (!m || m->irq != hwif->irq) /* don't undo a prior perfect match */
945 ide_hwif_t *hwif = HWIF(drive);
957 q = blk_init_queue_node(do_ide_request, &ide_lock, hwif_to_node(hwif));
964 if (!hwif->rqsize) {
965 if (hwif->no_lba48 || hwif->no_lba48_dma)
966 hwif->rqsize = 256;
968 hwif->rqsize = 65536;
970 if (hwif->rqsize < max_sectors)
971 max_sectors = hwif->rqsize;
993 * hwgroup for the irq/hwif if none was previously assigned.
1004 static int init_irq (ide_hwif_t *hwif)
1013 BUG_ON(hwif == NULL);
1016 hwif->hwgroup = NULL;
1023 if (h->hwgroup) { /* scan only initialized hwif's */
1024 if (hwif->irq == h->irq) {
1025 hwif->sharing_irq = h->sharing_irq = 1;
1026 if (hwif->chipset != ide_pci ||
1028 save_match(hwif, h, &match);
1031 if (hwif->serialized) {
1032 if (hwif->mate && hwif->mate->irq == h->irq)
1033 save_match(hwif, h, &match);
1036 if (h->mate && hwif->irq == h->mate->irq)
1037 save_match(hwif, h, &match);
1047 hwif->hwgroup = hwgroup;
1051 * can find the hwif and prevent irq storms.
1052 * No drives are attached to the new hwif, choose_drive
1054 * Add ourself as the 2nd entry to the hwgroup->hwif
1055 * linked list, the first entry is the hwif that owns
1059 hwif->next = hwgroup->hwif->next;
1060 hwgroup->hwif->next = hwif;
1064 hwif_to_node(hwif->drives[0].hwif));
1068 hwif->hwgroup = hwgroup;
1071 hwgroup->hwif = hwif->next = hwif;
1082 * Allocate the irq, if not already obtained for another hwif
1084 if (!match || match->irq != hwif->irq) {
1090 if (IDE_CHIPSET_IS_PCI(hwif->chipset)) {
1097 if (hwif->io_ports[IDE_CONTROL_OFFSET])
1099 hwif->OUTB(0x08, hwif->io_ports[IDE_CONTROL_OFFSET]);
1101 if (request_irq(hwif->irq,&ide_intr,sa,hwif->name,hwgroup))
1111 ide_drive_t *drive = &hwif->drives[index];
1123 hwgroup->hwif = HWIF(hwgroup->drive);
1132 printk("%s at 0x%03lx-0x%03lx,0x%03lx on irq %d", hwif->name,
1133 hwif->io_ports[IDE_DATA_OFFSET],
1134 hwif->io_ports[IDE_DATA_OFFSET]+7,
1135 hwif->io_ports[IDE_CONTROL_OFFSET], hwif->irq);
1137 printk("%s at 0x%08lx on irq %d", hwif->name,
1138 hwif->io_ports[IDE_DATA_OFFSET], hwif->irq);
1142 hwif->sharing_irq ? "shar" : "serializ", match->name);
1148 if (hwif->next == hwif) {
1150 BUG_ON(hwgroup->hwif != hwif);
1154 g = hwgroup->hwif;
1155 while (g->next != hwif)
1157 g->next = hwif->next;
1158 if (hwgroup->hwif == hwif) {
1160 printk(KERN_ERR "Duh. Uninitialized hwif listed as active hwif.\n");
1161 hwgroup->hwif = g;
1163 BUG_ON(hwgroup->hwif == hwif);
1178 ide_hwif_t *hwif = data;
1180 ide_drive_t *drive = &hwif->drives[unit];
1232 ide_hwif_t *hwif = drive->hwif;
1235 disk->major = hwif->major;
1237 sprintf(disk->disk_name, "hd%c", 'a' + hwif->index * MAX_DRIVES + unit);
1245 ide_hwgroup_t *hwgroup = drive->hwif->hwgroup;
1260 hwgroup->hwif = hwgroup->drive->hwif;
1291 static void init_gendisk (ide_hwif_t *hwif)
1296 ide_drive_t * drive = &hwif->drives[unit];
1299 hwif->index,unit);
1300 drive->gendev.parent = &hwif->gendev;
1305 blk_register_region(MKDEV(hwif->major, 0), MAX_DRIVES << PARTN_BITS,
1306 THIS_MODULE, ata_probe, ata_lock, hwif);
1309 static int hwif_init(ide_hwif_t *hwif)
1314 if (!hwif->present)
1317 if (!hwif->irq) {
1318 if (!(hwif->irq = ide_default_irq(hwif->io_ports[IDE_DATA_OFFSET])))
1320 printk("%s: DISABLED, NO IRQ\n", hwif->name);
1321 return (hwif->present = 0);
1325 if (hwif->irq == HD_IRQ && hwif->io_ports[IDE_DATA_OFFSET] != HD_DATA) {
1327 "HARDDISK DRIVER (hd.c)\n", hwif->name);
1328 return (hwif->present = 0);
1333 hwif->present = 0;
1335 if (register_blkdev(hwif->major, hwif->name))
1338 if (!hwif->sg_max_nents)
1339 hwif->sg_max_nents = PRD_ENTRIES;
1341 hwif->sg_table = kmalloc(sizeof(struct scatterlist)*hwif->sg_max_nents,
1343 if (!hwif->sg_table) {
1344 printk(KERN_ERR "%s: unable to allocate SG table.\n", hwif->name);
1348 if (init_irq(hwif) == 0)
1351 old_irq = hwif->irq;
1356 if (!(hwif->irq = ide_default_irq(hwif->io_ports[IDE_DATA_OFFSET]))) {
1358 hwif->name, old_irq);
1361 if (init_irq(hwif)) {
1363 hwif->name, old_irq, hwif->irq);
1367 hwif->name, hwif->irq);
1370 init_gendisk(hwif);
1372 ide_acpi_init(hwif);
1374 hwif->present = 1; /* success */
1378 unregister_blkdev(hwif->major, hwif->name);
1399 ide_hwif_t *hwif = &ide_hwifs[index];
1401 if (!hwif->present)
1403 if (hwif->chipset == ide_unknown || hwif->chipset == ide_forced)
1404 hwif->chipset = ide_generic;
1406 if (hwif->drives[unit].present) {
1408 &hwif->drives[unit].gendev);