Lines Matching refs:ahc

60 	NULL, "ahc", DV_DULL
71 ahc_attach(struct ahc_softc *ahc)
81 ahc_controller_info(ahc, ahc_info, sizeof ahc_info);
82 printf("%s: %s\n", ahc->sc_dev.dv_xname, ahc_info);
86 ahc_intr_enable(ahc, TRUE);
88 if (ahc->flags & AHC_RESET_BUS_A)
89 ahc_reset_channel(ahc, 'A', TRUE);
90 if ((ahc->features & AHC_TWIN) && ahc->flags & AHC_RESET_BUS_B)
91 ahc_reset_channel(ahc, 'B', TRUE);
93 saa.saa_adapter_buswidth = (ahc->features & AHC_WIDE) ? 16 :8;
94 saa.saa_adapter_softc = ahc;
98 saa.saa_pool = &ahc->sc_iopool;
101 if ((ahc->flags & AHC_PRIMARY_CHANNEL) == 0) {
102 saa.saa_adapter_target = ahc->our_id;
103 ahc->sc_child = (struct scsibus_softc *)config_found(
104 (void *)&ahc->sc_dev, &saa, scsiprint);
105 if (ahc->features & AHC_TWIN) {
106 saa.saa_adapter_target = ahc->our_id_b;
107 ahc->sc_child_b = (struct scsibus_softc *)config_found(
108 (void *)&ahc->sc_dev, &saa, scsiprint);
111 if (ahc->features & AHC_TWIN) {
112 saa.saa_adapter_target = ahc->our_id_b;
113 ahc->sc_child = (struct scsibus_softc *)config_found(
114 (void *)&ahc->sc_dev, &saa, scsiprint);
116 saa.saa_adapter_target = ahc->our_id;
117 ahc->sc_child_b = (struct scsibus_softc *)config_found(
118 (void *)&ahc->sc_dev, &saa, scsiprint);
131 struct ahc_softc *ahc = (struct ahc_softc *)arg;
133 bus_dmamap_sync(ahc->parent_dmat, ahc->scb_data->hscb_dmamap,
134 0, ahc->scb_data->hscb_dmamap->dm_mapsize,
137 return ahc_intr(ahc);
146 ahc_done(struct ahc_softc *ahc, struct scb *scb)
150 bus_dmamap_sync(ahc->parent_dmat, ahc->scb_data->hscb_dmamap,
151 0, ahc->scb_data->hscb_dmamap->dm_mapsize,
159 target_offset = SCB_GET_TARGET_OFFSET(ahc, scb);
160 untagged_q = &ahc->untagged_queues[target_offset];
163 ahc_run_untagged_queue(ahc, untagged_q);
175 bus_dmamap_sync(ahc->parent_dmat, scb->dmamap, 0,
177 bus_dmamap_unload(ahc->parent_dmat, scb->dmamap);
237 memcpy(&xs->sense, ahc_get_sense_buf(ahc, scb),
248 struct ahc_softc *ahc;
255 printf("%s: ahc_action\n", ahc_name(ahc));
257 ahc = xs->sc_link->bus->sb_adapter_softc;
260 our_id = SCSI_SCSI_ID(ahc, xs->sc_link);
272 ahc->scb_data->scbindex[hscb->tag] = NULL;
275 printf("%s: start scb(%p)\n", ahc_name(ahc), scb);
284 hscb->scsiid = BUILD_SCSIID(ahc, xs->sc_link, target_id, our_id);
294 ahc_setup_data(ahc, xs, scb);
302 struct ahc_softc *ahc;
313 ahc = xs->sc_link->bus->sb_adapter_softc;
348 bus_dmamap_sync(ahc->parent_dmat, scb->dmamap, 0,
354 bus_dmamap_sync(ahc->parent_dmat, scb->sg_map->sg_dmamap,
371 tinfo = ahc_fetch_transinfo(ahc, SCSIID_CHANNEL(ahc, scb->hscb->scsiid),
373 SCSIID_TARGET(ahc, scb->hscb->scsiid),
376 mask = SCB_GET_TARGET_MASK(ahc, scb);
394 bus_dmamap_sync(ahc->parent_dmat, ahc->scb_data->hscb_dmamap,
395 0, ahc->scb_data->hscb_dmamap->dm_mapsize,
398 LIST_INSERT_HEAD(&ahc->pending_scbs, scb, pending_links);
414 && (ahc->flags & AHC_SCB_BTT) == 0) {
418 target_offset = SCB_GET_TARGET_OFFSET(ahc, scb);
419 untagged_q = &(ahc->untagged_queues[target_offset]);
435 ahc->scb_data->scbindex[scb->hscb->tag] = scb;
436 ahc_pause(ahc);
437 if ((ahc->flags & AHC_PAGESCBS) == 0)
438 ahc_outb(ahc, SCBPTR, scb->hscb->tag);
439 ahc_outb(ahc, TARG_IMMEDIATE_SCB, scb->hscb->tag);
440 ahc_unpause(ahc);
442 ahc_queue_scb(ahc, scb);
446 if (ahc->inited_target[xs->sc_link->target] == 0) {
449 ahc_adapter_req_set_xfer_mode(ahc, scb);
450 ahc_scb_devinfo(ahc, &devinfo, scb);
451 ahc_update_neg_request(ahc, &devinfo, tstate, tinfo,
454 ahc->inited_target[xs->sc_link->target] = 1;
465 printf("%s: cmd_poll\n", ahc_name(ahc));
469 if (ahc_poll(ahc, xs->timeout)) {
481 ahc_poll(struct ahc_softc *ahc, int wait)
485 if (ahc_inb(ahc, INTSTAT) & INT_PEND)
490 printf("%s: board is not responding\n", ahc_name(ahc));
494 ahc_intr((void *)ahc);
499 ahc_setup_data(struct ahc_softc *ahc, struct scsi_xfer *xs,
526 error = bus_dmamap_load(ahc->parent_dmat,
535 ahc_name(ahc), error);
552 struct ahc_softc *ahc;
558 ahc = scb->xs->sc_link->bus->sb_adapter_softc;
563 printf("%s: SCB %d timed out\n", ahc_name(ahc), scb->hscb->tag);
564 ahc_dump_card_state(ahc);
567 ahc_pause(ahc);
570 channel = SCB_GET_CHANNEL(ahc, scb);
577 LIST_FOREACH(list_scb, &ahc->pending_scbs, pending_links) {
581 found = ahc_reset_channel(ahc, channel, /*Initiate Reset*/TRUE);
584 ahc_name(ahc), channel, found);
588 ahc_unpause(ahc);
594 ahc_platform_set_tags(struct ahc_softc *ahc,
599 ahc_fetch_transinfo(ahc, devinfo->channel, devinfo->our_scsiid,
622 ahc_send_async(struct ahc_softc *ahc, char channel, u_int target, u_int lun,
629 ahc_adapter_req_set_xfer_mode(struct ahc_softc *ahc, struct scb *scb)
641 ahc_scb_devinfo(ahc, &devinfo, scb);
643 tinfo = ahc_fetch_transinfo(ahc, devinfo.channel,
646 tstate->discenable |= (ahc->user_discenable & devinfo.target_mask);
650 else if (ahc->user_tagenable & devinfo.target_mask)
658 ahc_validate_width(ahc, NULL, &width, ROLE_UNKNOWN);
661 ahc_set_width(ahc, &devinfo, width, AHC_TRANS_GOAL, FALSE);
681 syncrate = ahc_find_syncrate(ahc, &period, &ppr_options,
683 ahc_validate_offset(ahc, NULL, syncrate, &offset, width,
696 ahc_set_syncrate(ahc, &devinfo, syncrate, period, offset, ppr_options,
708 struct ahc_softc *ahc = xahc;
711 mtx_enter(&ahc->sc_scb_mtx);
712 scb = SLIST_FIRST(&ahc->scb_data->free_scbs);
715 SLIST_REMOVE_HEAD(&ahc->scb_data->free_scbs, links.sle);
717 mtx_leave(&ahc->sc_scb_mtx);
728 struct ahc_softc *ahc = xahc;
734 ahc->scb_data->scbindex[hscb->tag] = NULL;
738 mtx_enter(&ahc->sc_scb_mtx);
739 SLIST_INSERT_HEAD(&ahc->scb_data->free_scbs, scb, links.sle);
740 mtx_leave(&ahc->sc_scb_mtx);
743 ahc_platform_scb_free(ahc, scb);