• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-R7000-V1.0.7.12_1.2.5/components/opensource/linux/linux-2.6.36/drivers/scsi/aic7xxx/

Lines Matching refs: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, const 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) {
342 ahd_name(ahd));
343 devconfig = ahd_pci_read_config(ahd->dev_softc,
346 ahd_pci_write_config(ahd->dev_softc, DEVCONFIG,
351 command = ahd_pci_read_config(ahd->dev_softc, PCIR_COMMAND, /*bytes*/2);
353 ahd_pci_write_config(ahd->dev_softc, PCIR_COMMAND, command, /*bytes*/2);
355 error = ahd_softc_init(ahd);
359 ahd->bus_intr = ahd_pci_intr;
361 error = ahd_reset(ahd, /*reinit*/FALSE);
365 ahd->pci_cachesize =
366 ahd_pci_read_config(ahd->dev_softc, CSIZE_LATTIME,
368 ahd->pci_cachesize *= 4;
370 ahd_set_modes(ahd, AHD_MODE_SCSI, AHD_MODE_SCSI);
372 error = ahd_check_extport(ahd);
377 error = ahd_init(ahd);
380 ahd->init_level++;
385 return ahd_pci_map_int(ahd);
390 ahd_pci_suspend(struct ahd_softc *ahd)
396 ahd->suspend_state.pci_state.devconfig =
397 ahd_pci_read_config(ahd->dev_softc, DEVCONFIG, /*bytes*/4);
398 ahd->suspend_state.pci_state.command =
399 ahd_pci_read_config(ahd->dev_softc, PCIR_COMMAND, /*bytes*/1);
400 ahd->suspend_state.pci_state.csize_lattime =
401 ahd_pci_read_config(ahd->dev_softc, CSIZE_LATTIME, /*bytes*/1);
406 ahd_pci_resume(struct ahd_softc *ahd)
408 ahd_pci_write_config(ahd->dev_softc, DEVCONFIG,
409 ahd->suspend_state.pci_state.devconfig, /*bytes*/4);
410 ahd_pci_write_config(ahd->dev_softc, PCIR_COMMAND,
411 ahd->suspend_state.pci_state.command, /*bytes*/1);
412 ahd_pci_write_config(ahd->dev_softc, CSIZE_LATTIME,
413 ahd->suspend_state.pci_state.csize_lattime, /*bytes*/1);
422 ahd_pci_test_register_access(struct ahd_softc *ahd)
436 cmd = ahd_pci_read_config(ahd->dev_softc, PCIR_COMMAND, /*bytes*/2);
437 ahd_pci_write_config(ahd->dev_softc, PCIR_COMMAND,
448 hcntrl = ahd_inb(ahd, HCNTRL);
461 ahd_outb(ahd, HCNTRL, hcntrl|PAUSE);
462 while (ahd_is_paused(ahd) == 0)
466 ahd_set_modes(ahd, AHD_MODE_CFG, AHD_MODE_CFG);
467 targpcistat = ahd_inb(ahd, TARGPCISTAT);
468 ahd_outb(ahd, TARGPCISTAT, targpcistat);
469 pci_status1 = ahd_pci_read_config(ahd->dev_softc,
471 ahd_pci_write_config(ahd->dev_softc, PCIR_STATUS + 1,
473 ahd_set_modes(ahd, AHD_MODE_SCSI, AHD_MODE_SCSI);
474 ahd_outb(ahd, CLRINT, CLRPCIINT);
476 ahd_outb(ahd, SEQCTL0, PERRORDIS);
477 ahd_outl(ahd, SRAM_BASE, 0x5aa555aa);
478 if (ahd_inl(ahd, SRAM_BASE) != 0x5aa555aa)
481 if ((ahd_inb(ahd, INTSTAT) & PCIINT) != 0) {
482 ahd_set_modes(ahd, AHD_MODE_CFG, AHD_MODE_CFG);
483 targpcistat = ahd_inb(ahd, TARGPCISTAT);
491 if ((ahd_inb(ahd, INTSTAT) & PCIINT) != 0) {
493 ahd_set_modes(ahd, AHD_MODE_CFG, AHD_MODE_CFG);
494 targpcistat = ahd_inb(ahd, TARGPCISTAT);
497 ahd_outb(ahd, TARGPCISTAT, targpcistat);
498 pci_status1 = ahd_pci_read_config(ahd->dev_softc,
500 ahd_pci_write_config(ahd->dev_softc, PCIR_STATUS + 1,
502 ahd_outb(ahd, CLRINT, CLRPCIINT);
504 ahd_outb(ahd, SEQCTL0, PERRORDIS|FAILDIS);
505 ahd_pci_write_config(ahd->dev_softc, PCIR_COMMAND, cmd, /*bytes*/2);
514 ahd_check_extport(struct ahd_softc *ahd)
522 sc = ahd->seep_config;
523 have_seeprom = ahd_acquire_seeprom(ahd);
532 ahd_name(ahd));
536 + (sizeof(vpd) * (ahd->channel - 'A'))) / 2;
538 error = ahd_read_seeprom(ahd, (uint16_t *)&vpd,
542 error = ahd_parse_vpddata(ahd, &vpd);
545 ahd_name(ahd),
549 printk("%s: Reading SEEPROM...", ahd_name(ahd));
552 start_addr = (sizeof(*sc) / 2) * (ahd->channel - 'A');
554 error = ahd_read_seeprom(ahd, (uint16_t *)sc,
571 ahd_release_seeprom(ahd);
584 ahd_set_scbptr(ahd, 0xFF);
585 nvram_scb = ahd_inb_scbram(ahd, SCB_BASE + NVRAM_SCB_OFFSET);
587 && ((ahd_inb_scbram(ahd, SCB_BASE + 0) == 'A'
588 && ahd_inb_scbram(ahd, SCB_BASE + 1) == 'D'
589 && ahd_inb_scbram(ahd, SCB_BASE + 2) == 'P'
590 && ahd_inb_scbram(ahd, SCB_BASE + 3) == 'T')
591 || (ahd_inb_scbram(ahd, SCB_BASE + 0) == 'B'
592 && ahd_inb_scbram(ahd, SCB_BASE + 1) == 'I'
593 && ahd_inb_scbram(ahd, SCB_BASE + 2) == 'O'
594 && ahd_inb_scbram(ahd, SCB_BASE + 3) == 'S')
595 || (ahd_inb_scbram(ahd, SCB_BASE + 0) == 'A'
596 && ahd_inb_scbram(ahd, SCB_BASE + 1) == 'S'
597 && ahd_inb_scbram(ahd, SCB_BASE + 2) == 'P'
598 && ahd_inb_scbram(ahd, SCB_BASE + 3) == 'I'))) {
602 ahd_set_scbptr(ahd, nvram_scb);
605 *sc_data++ = ahd_inw_scbram(ahd, SCB_BASE+i);
608 ahd->flags |= AHD_SCB_CONFIG_USED;
618 printk("%s: Seeprom Contents:", ahd_name(ahd));
628 printk("%s: No SEEPROM available.\n", ahd_name(ahd));
629 ahd->flags |= AHD_USEDEFAULTS;
630 error = ahd_default_config(ahd);
632 kfree(ahd->seep_config);
633 ahd->seep_config = NULL;
635 error = ahd_parse_cfgdata(ahd, sc);
641 ahd_configure_termination(ahd, adapter_control);
647 ahd_configure_termination(struct ahd_softc *ahd, u_int adapter_control)
654 devconfig = ahd_pci_read_config(ahd->dev_softc, DEVCONFIG, /*bytes*/4);
656 if ((ahd->flags & AHD_STPWLEVEL_A) != 0)
660 ahd_name(ahd), (devconfig & STPWLEVEL) ? "on" : "off");
661 ahd_pci_write_config(ahd->dev_softc, DEVCONFIG, devconfig, /*bytes*/4);
664 if ((ahd->flags & AHD_CURRENT_SENSING) != 0) {
665 (void)ahd_write_flexport(ahd, FLXADDR_ROMSTAT_CURSENSECTL, 0);
671 error = ahd_read_flexport(ahd, FLXADDR_TERMCTL, &termctl);
675 ahd_name(ahd));
683 "Using Defaults.\n", ahd_name(ahd));
690 ahd_name(ahd));
698 "Using Defaults.\n", ahd_name(ahd));
705 sxfrctl1 = ahd_inb(ahd, SXFRCTL1) & ~STPWEN;
706 ahd->flags &= ~AHD_TERM_ENB_A;
708 ahd->flags |= AHD_TERM_ENB_A;
712 ahd_outb(ahd, SXFRCTL1, sxfrctl1|STPWEN);
713 ahd_outb(ahd, SXFRCTL1, sxfrctl1);
715 error = ahd_write_flexport(ahd, FLXADDR_TERMCTL, termctl);
718 ahd_name(ahd));
721 ahd_name(ahd),
725 ahd_name(ahd),
729 ahd_name(ahd),
733 ahd_name(ahd),
791 ahd_pci_intr(struct ahd_softc *ahd)
800 intstat = ahd_inb(ahd, INTSTAT);
803 ahd_pci_split_intr(ahd, intstat);
808 printk("%s: PCI error Interrupt\n", ahd_name(ahd));
809 saved_modes = ahd_save_modes(ahd);
810 ahd_dump_card_state(ahd);
811 ahd_set_modes(ahd, AHD_MODE_CFG, AHD_MODE_CFG);
816 pci_status[i] = ahd_inb(ahd, reg);
818 ahd_outb(ahd, reg, pci_status[i]);
835 printk(s, ahd_name(ahd), pci_status_source[i]);
839 pci_status1 = ahd_pci_read_config(ahd->dev_softc,
841 ahd_pci_write_config(ahd->dev_softc, PCIR_STATUS + 1,
843 ahd_restore_modes(ahd, saved_modes);
844 ahd_outb(ahd, CLRINT, CLRPCIINT);
845 ahd_unpause(ahd);
849 ahd_pci_split_intr(struct ahd_softc *ahd, u_int intstat)
863 pcix_status = ahd_pci_read_config(ahd->dev_softc, PCIXR_STATUS,
866 ahd_name(ahd), pcix_status);
867 saved_modes = ahd_save_modes(ahd);
869 ahd_set_modes(ahd, i, i);
871 split_status[i] = ahd_inb(ahd, DCHSPLTSTAT0);
872 split_status1[i] = ahd_inb(ahd, DCHSPLTSTAT1);
874 ahd_outb(ahd, DCHSPLTSTAT0, split_status[i]);
875 ahd_outb(ahd, DCHSPLTSTAT1, split_status1[i]);
878 sg_split_status[i] = ahd_inb(ahd, SGSPLTSTAT0);
879 sg_split_status1[i] = ahd_inb(ahd, SGSPLTSTAT1);
881 ahd_outb(ahd, SGSPLTSTAT0, sg_split_status[i]);
882 ahd_outb(ahd, SGSPLTSTAT1, sg_split_status1[i]);
894 printk(s, ahd_name(ahd),
905 printk(s, ahd_name(ahd), "SG");
912 ahd_pci_write_config(ahd->dev_softc, PCIXR_STATUS,
914 ahd_outb(ahd, CLRINT, CLRSPLTINT);
915 ahd_restore_modes(ahd, saved_modes);
919 ahd_aic7901_setup(struct ahd_softc *ahd)
922 ahd->chip = AHD_AIC7901;
923 ahd->features = AHD_AIC7901_FE;
924 return (ahd_aic790X_setup(ahd));
928 ahd_aic7901A_setup(struct ahd_softc *ahd)
931 ahd->chip = AHD_AIC7901A;
932 ahd->features = AHD_AIC7901A_FE;
933 return (ahd_aic790X_setup(ahd));
937 ahd_aic7902_setup(struct ahd_softc *ahd)
939 ahd->chip = AHD_AIC7902;
940 ahd->features = AHD_AIC7902_FE;
941 return (ahd_aic790X_setup(ahd));
945 ahd_aic790X_setup(struct ahd_softc *ahd)
950 pci = ahd->dev_softc;
954 ahd_name(ahd), rev);
958 ahd->channel = ahd_get_pci_function(pci) + 'A';
963 ahd->bugs |= AHD_SENT_SCB_UPDATE_BUG|AHD_ABORT_LQI_BUG
978 AHD_SET_PRECOMP(ahd, AHD_PRECOMP_CUTBACK_29);
980 if ((ahd->flags & AHD_HP_BOARD) == 0)
981 AHD_SET_SLEWRATE(ahd, AHD_SLEWRATE_DEF_REVA);
987 ahd->features |= AHD_RTI|AHD_NEW_IOCELL_OPTS
990 ahd->bugs |= AHD_LQOOVERRUN_BUG|AHD_EARLY_REQ_BUG;
994 ahd->features |= AHD_AIC79XXB_SLOWCRC;
999 if ((ahd->features & AHD_MULTI_FUNC) != 0)
1000 ahd->bugs |= AHD_INTCOLLISION_BUG|AHD_ABORT_LQI_BUG;
1005 AHD_SET_PRECOMP(ahd, AHD_PRECOMP_CUTBACK_29);
1006 AHD_SET_SLEWRATE(ahd, AHD_SLEWRATE_DEF_REVB);
1007 AHD_SET_AMPLITUDE(ahd, AHD_AMPLITUDE_DEF);