Home | History | Annotate | Download | only in ic

Lines Matching defs:ahd

59 static int	ahd_poll(struct ahd_softc *ahd, int wait);
60 static void ahd_setup_data(struct ahd_softc *ahd, struct scsipi_xfer *xs,
64 static void ahd_set_recoveryscb(struct ahd_softc *ahd, struct scb *scb);
75 ahd_attach(struct ahd_softc *ahd)
80 ahd_controller_info(ahd, ahd_info, sizeof(ahd_info));
81 aprint_normal("%s: %s\n", ahd_name(ahd), ahd_info);
83 ahd_lock(ahd, &s);
85 ahd->sc_adapter.adapt_dev = ahd->sc_dev;
86 ahd->sc_adapter.adapt_nchannels = 1;
88 ahd->sc_adapter.adapt_openings = ahd->scb_data.numscbs - 1;
89 ahd->sc_adapter.adapt_max_periph = 32;
91 ahd->sc_adapter.adapt_ioctl = ahd_ioctl;
92 ahd->sc_adapter.adapt_minphys = ahd_minphys;
93 ahd->sc_adapter.adapt_request = ahd_action;
95 ahd->sc_channel.chan_adapter = &ahd->sc_adapter;
96 ahd->sc_channel.chan_bustype = &scsi_bustype;
97 ahd->sc_channel.chan_channel = 0;
98 ahd->sc_channel.chan_ntargets = AHD_NUM_TARGETS;
99 ahd->sc_channel.chan_nluns = 8 /*AHD_NUM_LUNS*/;
100 ahd->sc_channel.chan_id = ahd->our_id;
101 ahd->sc_channel.chan_flags |= SCSIPI_CHAN_CANGROW;
103 ahd->sc_child = config_found(ahd->sc_dev, &ahd->sc_channel, scsiprint,
106 ahd_intr_enable(ahd, TRUE);
108 if (ahd->flags & AHD_RESET_BUS_A)
109 ahd_reset_channel(ahd, 'A', TRUE);
111 if (!pmf_device_register1(ahd->sc_dev,
113 aprint_error_dev(ahd->sc_dev,
116 ahd_unlock(ahd, &s);
160 struct ahd_softc *ahd;
163 ahd = device_private(channel->chan_adapter->adapt_dev);
168 ahd_reset_channel(ahd, channel->chan_channel == 1 ? 'B' : 'A', TRUE);
185 struct ahd_softc *ahd;
187 ahd = arg;
189 printf("%s; ahd_platform_intr\n", ahd_name(ahd));
191 ahd_intr(ahd);
199 ahd_done(struct ahd_softc *ahd, struct scb *scb)
220 bus_dmamap_sync(ahd->parent_dmat, scb->dmamap, 0,
222 bus_dmamap_unload(ahd->parent_dmat, scb->dmamap);
237 LIST_FOREACH(list_scb, &ahd->pending_scbs, pending_links) {
253 ahd_name(ahd), xs->status);
262 ahd_name(ahd), SCB_GET_TARGET(ahd,scb), SCB_GET_LUN(scb), SCB_GET_TAG(scb));
276 memcpy(&xs->sense.scsi_sense, ahd_get_sense_buf(ahd, scb),
313 ahd_lock(ahd, &s);
314 ahd_free_scb(ahd, scb);
315 ahd_unlock(ahd, &s);
323 struct ahd_softc *ahd;
327 ahd = device_private(chan->chan_adapter->adapt_dev);
349 our_id = ahd->our_id;
355 ahd_lock(ahd, &s);
356 tinfo = ahd_fetch_transinfo(ahd, channel, our_id,
366 if ((scb = ahd_get_scb(ahd, col_idx)) == NULL) {
368 ahd_unlock(ahd, &s);
372 ahd_unlock(ahd, &s);
383 hscb->scsiid = BUILD_SCSIID(ahd, sim, target_id, our_id);
395 ahd_setup_data(ahd, xs, scb);
401 printf("%s: ADAPTER_REQ_GROW_RESOURCES\n", ahd_name(ahd));
403 chan->chan_adapter->adapt_openings += ahd_alloc_scbs(ahd);
404 if (ahd->scb_data.numscbs >= AHD_SCB_MAX_ALLOC)
423 tinfo = ahd_fetch_transinfo(ahd, channel, our_id, target_id,
437 if (ahd->inited_target[target_id] == 0) {
443 (ahd->user_tagenable & devinfo.target_mask);
445 (ahd->user_discenable & devinfo.target_mask);
446 ahd->inited_target[target_id] = 1;
456 ahd_validate_width(ahd, NULL, &width, ROLE_UNKNOWN);
459 ahd_set_width(ahd, &devinfo, width, AHD_TRANS_GOAL, FALSE);
478 (ahd->user_tagenable & devinfo.target_mask))
483 ahd_find_syncrate(ahd, &period, &ppr_options, AHD_SYNCRATE_MAX);
484 ahd_validate_offset(ahd, NULL, period, &offset,
498 ahd_set_syncrate(ahd, &devinfo, period, offset,
532 struct ahd_softc *ahd;
543 ahd = device_private(
552 ahd_setup_data_scb(ahd, scb);
557 sg = ahd_sg_setup(ahd, scb, sg, dm_segs->ds_addr,
568 bus_dmamap_sync(ahd->parent_dmat, scb->dmamap, 0,
572 ahd_lock(ahd, &s);
580 bus_dmamap_unload(ahd->parent_dmat,
582 ahd_free_scb(ahd, scb);
583 ahd_unlock(ahd, &s);
587 tinfo = ahd_fetch_transinfo(ahd, SCSIID_CHANNEL(ahd, scb->hscb->scsiid),
589 SCSIID_TARGET(ahd, scb->hscb->scsiid),
592 mask = SCB_GET_TARGET_MASK(ahd, scb);
620 LIST_INSERT_HEAD(&ahd->pending_scbs, scb, pending_links);
632 ahd->scb_data.scbindex[SCB_GET_TAG(scb)] = scb;
633 ahd_pause(ahd);
634 ahd_set_scbptr(ahd, SCB_GET_TAG(scb));
635 ahd_outb(ahd, RETURN_1, CONT_MSG_LOOP_TARG);
636 ahd_unpause(ahd);
638 ahd_queue_scb(ahd, scb);
642 ahd_unlock(ahd, &s);
650 if (ahd_poll(ahd, xs->timeout)) {
658 ahd_unlock(ahd, &s);
662 ahd_poll(struct ahd_softc *ahd, int wait)
667 if (ahd_inb(ahd, INTSTAT) & INT_PEND)
672 printf("%s: board is not responding\n", ahd_name(ahd));
676 ahd_intr(ahd);
682 ahd_setup_data(struct ahd_softc *ahd, struct scsipi_xfer *xs,
701 ahd_lock(ahd, &s);
702 ahd_free_scb(ahd, scb);
703 ahd_unlock(ahd, &s);
712 error = bus_dmamap_load(ahd->parent_dmat,
724 ahd_name(ahd), error);
742 struct ahd_softc *ahd;
746 ahd = scb->ahd_softc;
748 printf("%s: ahd_timeout\n", ahd_name(ahd));
750 ahd_lock(ahd, &s);
752 ahd_pause_and_flushwork(ahd);
753 (void)ahd_save_modes(ahd);
755 ahd_set_modes(ahd, AHD_MODE_SCSI, AHD_MODE_SCSI);
756 ahd_outb(ahd, SCSISIGO, ACKO);
758 ahd_outb(ahd, SCSISIGO, 0);
760 ahd_restore_modes(ahd, saved_modes);
765 "Interrupts may not be functioning.\n", ahd_name(ahd));
766 ahd_unpause(ahd);
767 ahd_unlock(ahd, &s);
771 ahd_print_path(ahd, scb);
773 ahd_dump_card_state(ahd);
774 ahd_reset_channel(ahd, SIM_CHANNEL(ahd, sim),
776 ahd_unlock(ahd, &s);
781 ahd_platform_alloc(struct ahd_softc *ahd, void *platform_arg)
783 ahd->platform_data = malloc(sizeof(struct ahd_platform_data), M_DEVBUF,
789 ahd_platform_free(struct ahd_softc *ahd)
791 free(ahd->platform_data, M_DEVBUF);
802 ahd_detach(struct ahd_softc *ahd, int flags)
806 if (ahd->sc_child != NULL)
807 rv = config_detach(ahd->sc_child, flags);
809 pmf_device_deregister(ahd->sc_dev);
811 ahd_free(ahd);
817 ahd_platform_set_tags(struct ahd_softc *ahd,
822 ahd_fetch_transinfo(ahd, devinfo->channel, devinfo->our_scsiid,
832 ahd_send_async(struct ahd_softc *ahd, char channel, u_int target, u_int lun,
845 chan = &ahd->sc_channel;
848 tinfo = ahd_fetch_transinfo(ahd, channel, ahd->our_id, target,
850 ahd_compile_devinfo(&devinfo, ahd->our_id, target, lun,