• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-WNDR4500-V1.0.1.40_1.0.68/src/linux/linux-2.6/drivers/scsi/aic7xxx/

Lines Matching defs:ahd

250 static int	ahd_check_extport(struct ahd_softc *ahd);
251 static void ahd_configure_termination(struct ahd_softc *ahd,
253 static void ahd_pci_split_intr(struct ahd_softc *ahd, u_int intstat);
254 static void ahd_pci_intr(struct ahd_softc *ahd);
295 ahd_pci_config(struct ahd_softc *ahd, struct ahd_pci_identity *entry)
304 ahd->description = entry->name;
308 subvendor = ahd_pci_read_config(ahd->dev_softc,
311 ahd->flags |= AHD_HP_BOARD;
313 error = entry->setup(ahd);
317 devconfig = ahd_pci_read_config(ahd->dev_softc, DEVCONFIG, /*bytes*/4);
319 ahd->chip |= AHD_PCI;
321 ahd->bugs &= ~AHD_PCIX_BUG_MASK;
323 ahd->chip |= AHD_PCIX;
325 ahd->bus_description = pci_bus_modes[PCI_BUS_MODES_INDEX(devconfig)];
327 ahd_power_state_change(ahd, AHD_POWER_STATE_D0);
329 error = ahd_pci_map_registers(ahd);
339 if ((ahd->flags & (AHD_39BIT_ADDRESSING|AHD_64BIT_ADDRESSING)) != 0) {
344 ahd_name(ahd));
345 devconfig = ahd_pci_read_config(ahd->dev_softc,
348 ahd_pci_write_config(ahd->dev_softc, DEVCONFIG,
353 command = ahd_pci_read_config(ahd->dev_softc, PCIR_COMMAND, /*bytes*/2);
355 ahd_pci_write_config(ahd->dev_softc, PCIR_COMMAND, command, /*bytes*/2);
357 error = ahd_softc_init(ahd);
361 ahd->bus_intr = ahd_pci_intr;
363 error = ahd_reset(ahd, /*reinit*/FALSE);
367 ahd->pci_cachesize =
368 ahd_pci_read_config(ahd->dev_softc, CSIZE_LATTIME,
370 ahd->pci_cachesize *= 4;
372 ahd_set_modes(ahd, AHD_MODE_SCSI, AHD_MODE_SCSI);
374 error = ahd_check_extport(ahd);
379 error = ahd_init(ahd);
386 error = ahd_pci_map_int(ahd);
388 ahd->init_level++;
397 ahd_pci_test_register_access(struct ahd_softc *ahd)
411 cmd = ahd_pci_read_config(ahd->dev_softc, PCIR_COMMAND, /*bytes*/2);
412 ahd_pci_write_config(ahd->dev_softc, PCIR_COMMAND,
423 hcntrl = ahd_inb(ahd, HCNTRL);
436 ahd_outb(ahd, HCNTRL, hcntrl|PAUSE);
437 while (ahd_is_paused(ahd) == 0)
441 ahd_set_modes(ahd, AHD_MODE_CFG, AHD_MODE_CFG);
442 targpcistat = ahd_inb(ahd, TARGPCISTAT);
443 ahd_outb(ahd, TARGPCISTAT, targpcistat);
444 pci_status1 = ahd_pci_read_config(ahd->dev_softc,
446 ahd_pci_write_config(ahd->dev_softc, PCIR_STATUS + 1,
448 ahd_set_modes(ahd, AHD_MODE_SCSI, AHD_MODE_SCSI);
449 ahd_outb(ahd, CLRINT, CLRPCIINT);
451 ahd_outb(ahd, SEQCTL0, PERRORDIS);
452 ahd_outl(ahd, SRAM_BASE, 0x5aa555aa);
453 if (ahd_inl(ahd, SRAM_BASE) != 0x5aa555aa)
456 if ((ahd_inb(ahd, INTSTAT) & PCIINT) != 0) {
459 ahd_set_modes(ahd, AHD_MODE_CFG, AHD_MODE_CFG);
460 targpcistat = ahd_inb(ahd, TARGPCISTAT);
468 if ((ahd_inb(ahd, INTSTAT) & PCIINT) != 0) {
470 ahd_set_modes(ahd, AHD_MODE_CFG, AHD_MODE_CFG);
471 targpcistat = ahd_inb(ahd, TARGPCISTAT);
474 ahd_outb(ahd, TARGPCISTAT, targpcistat);
475 pci_status1 = ahd_pci_read_config(ahd->dev_softc,
477 ahd_pci_write_config(ahd->dev_softc, PCIR_STATUS + 1,
479 ahd_outb(ahd, CLRINT, CLRPCIINT);
481 ahd_outb(ahd, SEQCTL0, PERRORDIS|FAILDIS);
482 ahd_pci_write_config(ahd->dev_softc, PCIR_COMMAND, cmd, /*bytes*/2);
491 ahd_check_extport(struct ahd_softc *ahd)
499 sc = ahd->seep_config;
500 have_seeprom = ahd_acquire_seeprom(ahd);
509 ahd_name(ahd));
513 + (sizeof(vpd) * (ahd->channel - 'A'))) / 2;
515 error = ahd_read_seeprom(ahd, (uint16_t *)&vpd,
519 error = ahd_parse_vpddata(ahd, &vpd);
522 ahd_name(ahd),
526 printf("%s: Reading SEEPROM...", ahd_name(ahd));
529 start_addr = (sizeof(*sc) / 2) * (ahd->channel - 'A');
531 error = ahd_read_seeprom(ahd, (uint16_t *)sc,
548 ahd_release_seeprom(ahd);
561 ahd_set_scbptr(ahd, 0xFF);
562 nvram_scb = ahd_inb_scbram(ahd, SCB_BASE + NVRAM_SCB_OFFSET);
564 && ((ahd_inb_scbram(ahd, SCB_BASE + 0) == 'A'
565 && ahd_inb_scbram(ahd, SCB_BASE + 1) == 'D'
566 && ahd_inb_scbram(ahd, SCB_BASE + 2) == 'P'
567 && ahd_inb_scbram(ahd, SCB_BASE + 3) == 'T')
568 || (ahd_inb_scbram(ahd, SCB_BASE + 0) == 'B'
569 && ahd_inb_scbram(ahd, SCB_BASE + 1) == 'I'
570 && ahd_inb_scbram(ahd, SCB_BASE + 2) == 'O'
571 && ahd_inb_scbram(ahd, SCB_BASE + 3) == 'S')
572 || (ahd_inb_scbram(ahd, SCB_BASE + 0) == 'A'
573 && ahd_inb_scbram(ahd, SCB_BASE + 1) == 'S'
574 && ahd_inb_scbram(ahd, SCB_BASE + 2) == 'P'
575 && ahd_inb_scbram(ahd, SCB_BASE + 3) == 'I'))) {
579 ahd_set_scbptr(ahd, nvram_scb);
582 *sc_data++ = ahd_inw_scbram(ahd, SCB_BASE+i);
585 ahd->flags |= AHD_SCB_CONFIG_USED;
595 printf("%s: Seeprom Contents:", ahd_name(ahd));
605 printf("%s: No SEEPROM available.\n", ahd_name(ahd));
606 ahd->flags |= AHD_USEDEFAULTS;
607 error = ahd_default_config(ahd);
609 free(ahd->seep_config, M_DEVBUF);
610 ahd->seep_config = NULL;
612 error = ahd_parse_cfgdata(ahd, sc);
618 ahd_configure_termination(ahd, adapter_control);
624 ahd_configure_termination(struct ahd_softc *ahd, u_int adapter_control)
631 devconfig = ahd_pci_read_config(ahd->dev_softc, DEVCONFIG, /*bytes*/4);
633 if ((ahd->flags & AHD_STPWLEVEL_A) != 0)
637 ahd_name(ahd), (devconfig & STPWLEVEL) ? "on" : "off");
638 ahd_pci_write_config(ahd->dev_softc, DEVCONFIG, devconfig, /*bytes*/4);
641 if ((ahd->flags & AHD_CURRENT_SENSING) != 0) {
642 (void)ahd_write_flexport(ahd, FLXADDR_ROMSTAT_CURSENSECTL, 0);
648 error = ahd_read_flexport(ahd, FLXADDR_TERMCTL, &termctl);
652 ahd_name(ahd));
660 "Using Defaults.\n", ahd_name(ahd));
667 ahd_name(ahd));
675 "Using Defaults.\n", ahd_name(ahd));
682 sxfrctl1 = ahd_inb(ahd, SXFRCTL1) & ~STPWEN;
683 ahd->flags &= ~AHD_TERM_ENB_A;
685 ahd->flags |= AHD_TERM_ENB_A;
689 ahd_outb(ahd, SXFRCTL1, sxfrctl1|STPWEN);
690 ahd_outb(ahd, SXFRCTL1, sxfrctl1);
692 error = ahd_write_flexport(ahd, FLXADDR_TERMCTL, termctl);
695 ahd_name(ahd));
698 ahd_name(ahd),
702 ahd_name(ahd),
706 ahd_name(ahd),
710 ahd_name(ahd),
768 ahd_pci_intr(struct ahd_softc *ahd)
777 intstat = ahd_inb(ahd, INTSTAT);
780 ahd_pci_split_intr(ahd, intstat);
785 printf("%s: PCI error Interrupt\n", ahd_name(ahd));
786 saved_modes = ahd_save_modes(ahd);
787 ahd_dump_card_state(ahd);
788 ahd_set_modes(ahd, AHD_MODE_CFG, AHD_MODE_CFG);
793 pci_status[i] = ahd_inb(ahd, reg);
795 ahd_outb(ahd, reg, pci_status[i]);
812 printf(s, ahd_name(ahd), pci_status_source[i]);
816 pci_status1 = ahd_pci_read_config(ahd->dev_softc,
818 ahd_pci_write_config(ahd->dev_softc, PCIR_STATUS + 1,
820 ahd_restore_modes(ahd, saved_modes);
821 ahd_outb(ahd, CLRINT, CLRPCIINT);
822 ahd_unpause(ahd);
826 ahd_pci_split_intr(struct ahd_softc *ahd, u_int intstat)
840 pcix_status = ahd_pci_read_config(ahd->dev_softc, PCIXR_STATUS,
843 ahd_name(ahd), pcix_status);
844 saved_modes = ahd_save_modes(ahd);
846 ahd_set_modes(ahd, i, i);
848 split_status[i] = ahd_inb(ahd, DCHSPLTSTAT0);
849 split_status1[i] = ahd_inb(ahd, DCHSPLTSTAT1);
851 ahd_outb(ahd, DCHSPLTSTAT0, split_status[i]);
852 ahd_outb(ahd, DCHSPLTSTAT1, split_status1[i]);
855 sg_split_status[i] = ahd_inb(ahd, SGSPLTSTAT0);
856 sg_split_status1[i] = ahd_inb(ahd, SGSPLTSTAT1);
858 ahd_outb(ahd, SGSPLTSTAT0, sg_split_status[i]);
859 ahd_outb(ahd, SGSPLTSTAT1, sg_split_status1[i]);
871 printf(s, ahd_name(ahd),
882 printf(s, ahd_name(ahd), "SG");
889 ahd_pci_write_config(ahd->dev_softc, PCIXR_STATUS,
891 ahd_outb(ahd, CLRINT, CLRSPLTINT);
892 ahd_restore_modes(ahd, saved_modes);
896 ahd_aic7901_setup(struct ahd_softc *ahd)
899 ahd->chip = AHD_AIC7901;
900 ahd->features = AHD_AIC7901_FE;
901 return (ahd_aic790X_setup(ahd));
905 ahd_aic7901A_setup(struct ahd_softc *ahd)
908 ahd->chip = AHD_AIC7901A;
909 ahd->features = AHD_AIC7901A_FE;
910 return (ahd_aic790X_setup(ahd));
914 ahd_aic7902_setup(struct ahd_softc *ahd)
916 ahd->chip = AHD_AIC7902;
917 ahd->features = AHD_AIC7902_FE;
918 return (ahd_aic790X_setup(ahd));
922 ahd_aic790X_setup(struct ahd_softc *ahd)
927 pci = ahd->dev_softc;
931 ahd_name(ahd), rev);
935 ahd->channel = ahd_get_pci_function(pci) + 'A';
940 ahd->bugs |= AHD_SENT_SCB_UPDATE_BUG|AHD_ABORT_LQI_BUG
955 AHD_SET_PRECOMP(ahd, AHD_PRECOMP_CUTBACK_29);
957 if ((ahd->flags & AHD_HP_BOARD) == 0)
958 AHD_SET_SLEWRATE(ahd, AHD_SLEWRATE_DEF_REVA);
964 ahd->features |= AHD_RTI|AHD_NEW_IOCELL_OPTS
967 ahd->bugs |= AHD_LQOOVERRUN_BUG|AHD_EARLY_REQ_BUG;
971 ahd->features |= AHD_AIC79XXB_SLOWCRC;
976 if ((ahd->features & AHD_MULTI_FUNC) != 0)
977 ahd->bugs |= AHD_INTCOLLISION_BUG|AHD_ABORT_LQI_BUG;
982 AHD_SET_PRECOMP(ahd, AHD_PRECOMP_CUTBACK_29);
983 AHD_SET_SLEWRATE(ahd, AHD_SLEWRATE_DEF_REVB);
984 AHD_SET_AMPLITUDE(ahd, AHD_AMPLITUDE_DEF);