• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /freebsd-12-stable/sys/dev/aic7xxx/

Lines Matching defs:ahd

61 static void	ahd_set_tran_settings(struct ahd_softc *ahd,
64 static void ahd_get_tran_settings(struct ahd_softc *ahd,
72 static void ahd_setup_data(struct ahd_softc *ahd, struct cam_sim *sim,
74 static void ahd_abort_ccb(struct ahd_softc *ahd, struct cam_sim *sim,
76 static int ahd_create_path(struct ahd_softc *ahd,
142 ahd_create_path(struct ahd_softc *ahd, char channel, u_int target,
147 path_id = cam_sim_path(ahd->platform_data->sim);
153 ahd_sysctl(struct ahd_softc *ahd)
158 sysctl_ctx_init(&ahd->sysctl_ctx[i]);
160 ahd->sysctl_tree[AHD_SYSCTL_ROOT] =
161 SYSCTL_ADD_NODE(&ahd->sysctl_ctx[AHD_SYSCTL_ROOT],
163 device_get_nameunit(ahd->dev_softc), CTLFLAG_RD, 0,
165 SYSCTL_ADD_PROC(&ahd->sysctl_ctx[AHD_SYSCTL_ROOT],
166 SYSCTL_CHILDREN(ahd->sysctl_tree[AHD_SYSCTL_ROOT]),
167 OID_AUTO, "clear", CTLTYPE_UINT | CTLFLAG_RW, ahd,
172 ahd->sysctl_tree[i] =
173 SYSCTL_ADD_NODE(&ahd->sysctl_ctx[i],
174 SYSCTL_CHILDREN(ahd->sysctl_tree[AHD_SYSCTL_ROOT]),
180 SYSCTL_ADD_UINT(&ahd->sysctl_ctx[AHD_SYSCTL_SUMMARY],
181 SYSCTL_CHILDREN(ahd->sysctl_tree[AHD_SYSCTL_SUMMARY]),
183 CTLFLAG_RD, &ahd->summerr[i], i,
185 SYSCTL_ADD_PROC(&ahd->sysctl_ctx[AHD_SYSCTL_DEBUG],
186 SYSCTL_CHILDREN(ahd->sysctl_tree[AHD_SYSCTL_DEBUG]),
188 CTLFLAG_RW | CTLTYPE_UINT, ahd, i,
195 ahd_map_int(struct ahd_softc *ahd)
200 error = bus_setup_intr(ahd->dev_softc, ahd->platform_data->irq,
202 ahd_platform_intr, ahd, &ahd->platform_data->ih);
204 device_printf(ahd->dev_softc, "bus_setup_intr() failed: %d\n",
213 ahd_attach(struct ahd_softc *ahd)
230 if (ahd_spawn_recovery_thread(ahd) != 0)
233 ahd_controller_info(ahd, ahd_info);
235 ahd_lock(ahd);
247 sim = cam_sim_alloc(ahd_action, ahd_poll, "ahd", ahd,
248 device_get_unit(ahd->dev_softc),
249 &ahd->platform_data->mtx, 1, /*XXX*/256, devq);
255 if (xpt_bus_register(sim, ahd->dev_softc, /*bus_id*/0) != CAM_SUCCESS) {
279 ahd->platform_data->sim = sim;
280 ahd->platform_data->path = path;
281 ahd_unlock(ahd);
284 ahd->platform_data->eh =
286 ahd, SHUTDOWN_PRI_DEFAULT);
287 ahd_intr_enable(ahd, TRUE);
300 struct ahd_softc *ahd;
302 ahd = (struct ahd_softc *)arg;
303 ahd_lock(ahd);
304 ahd_intr(ahd);
305 ahd_unlock(ahd);
314 ahd_done(struct ahd_softc *ahd, struct scb *scb)
335 bus_dmamap_sync(ahd->buffer_dmat, scb->dmamap, op);
336 bus_dmamap_unload(ahd->buffer_dmat, scb->dmamap);
350 if (ahd->pending_device != NULL
351 && xpt_path_comp(ahd->pending_device->path, ccb_path) == 0) {
354 ahd->pending_device = NULL;
365 ahd_free_scb(ahd, scb);
374 ahd->scb_data.recovery_scbs--;
380 if (ahd->scb_data.recovery_scbs == 0) {
387 &ahd->pending_scbs, pending_links) {
393 ahd_print_path(ahd, scb);
415 ahd_get_sense_buf(ahd, scb),
432 ahd_get_sense_buf(ahd, scb) + SIU_SENSE_OFFSET(siu),
449 ahd_free_scb(ahd, scb);
456 struct ahd_softc *ahd;
465 ahd = (struct ahd_softc *)cam_sim_softc(sim);
468 our_id = SIM_SCSI_ID(ahd, sim);
479 status = ahd_find_tmode_devs(ahd, sim, ccb, &tstate,
486 lstate = ahd->black_hole;
498 if ((ahd->flags & AHD_TQINFIFO_BLOCKED) != 0)
499 ahd_run_tqinfifo(ahd, /*paused*/FALSE);
522 if ((ahd->flags & AHD_INITIATORROLE) == 0
533 tinfo = ahd_fetch_transinfo(ahd, 'A', our_id,
543 if ((scb = ahd_get_scb(ahd, col_idx)) == NULL) {
546 ahd->flags |= AHD_RESOURCE_SHORTAGE;
566 hscb->scsiid = BUILD_SCSIID(ahd, sim, target_id, our_id);
580 if (ahd->pending_device == lstate)
600 ahd_setup_data(ahd, sim, &ccb->csio, scb);
612 status = ahd_find_tmode_devs(ahd, sim, ccb, &tstate,
623 ahd_send_lstate_events(ahd, lstate);
627 ahd_handle_en_lun(ahd, sim, ccb);
633 ahd_abort_ccb(ahd, sim, ccb);
638 ahd_set_tran_settings(ahd, SIM_SCSI_ID(ahd, sim),
639 SIM_CHANNEL(ahd, sim), &ccb->cts);
646 ahd_get_tran_settings(ahd, SIM_SCSI_ID(ahd, sim),
647 SIM_CHANNEL(ahd, sim), &ccb->cts);
653 aic_calc_geometry(&ccb->ccg, ahd->flags & AHD_EXTENDED_TRANS_A);
661 found = ahd_reset_channel(ahd, SIM_CHANNEL(ahd, sim),
664 xpt_print_path(SIM_PATH(ahd, sim));
683 if ((ahd->features & AHD_WIDE) != 0)
685 if ((ahd->features & AHD_TARGETMODE) != 0) {
694 cpi->max_target = (ahd->features & AHD_WIDE) ? 15 : 7;
696 cpi->initiator_id = ahd->our_id;
697 if ((ahd->flags & AHD_RESET_BUS_A) == 0) {
726 ahd_set_tran_settings(struct ahd_softc *ahd, int our_id, char channel,
740 ahd_compile_devinfo(&devinfo, SIM_SCSI_ID(ahd, sim),
743 SIM_CHANNEL(ahd, sim),
745 tinfo = ahd_fetch_transinfo(ahd, devinfo.channel,
759 discenable = &ahd->user_discenable;
760 tagenable = &ahd->user_tagenable;
783 ahd_validate_width(ahd, /*tinfo limit*/NULL,
785 ahd_set_width(ahd, &devinfo, spi->bus_width,
822 ahd_find_syncrate(ahd, &spi->sync_period,
824 ahd_validate_offset(ahd, /*tinfo limit*/NULL,
834 ahd_set_syncrate(ahd, &devinfo, spi->sync_period,
842 ahd_get_tran_settings(struct ahd_softc *ahd, int our_id, char channel,
858 targ_info = ahd_fetch_transinfo(ahd, devinfo.channel,
870 if ((ahd->user_discenable & devinfo.target_mask) != 0)
873 if ((ahd->user_tagenable & devinfo.target_mask) != 0)
910 struct ahd_softc *ahd;
914 ahd = (struct ahd_softc *)cam_sim_softc(sim);
920 ahd_compile_devinfo(&devinfo, SIM_SCSI_ID(ahd, sim),
923 SIM_CHANNEL(ahd, sim),
930 ahd_set_width(ahd, &devinfo, MSG_EXT_WDTR_BUS_8_BIT,
932 ahd_set_syncrate(ahd, &devinfo, /*period*/0, /*offset*/0,
948 struct ahd_softc *ahd;
955 ahd = scb->ahd_softc;
963 bus_dmamap_unload(ahd->buffer_dmat, scb->dmamap);
964 ahd_free_scb(ahd, scb);
977 sg = ahd_sg_setup(ahd, scb, sg, dm_segs->ds_addr,
988 bus_dmamap_sync(ahd->buffer_dmat, scb->dmamap, op);
1008 bus_dmamap_unload(ahd->buffer_dmat,
1010 ahd_free_scb(ahd, scb);
1015 tinfo = ahd_fetch_transinfo(ahd, SCSIID_CHANNEL(ahd, scb->hscb->scsiid),
1017 SCSIID_TARGET(ahd, scb->hscb->scsiid),
1020 mask = SCB_GET_TARGET_MASK(ahd, scb);
1043 LIST_INSERT_HEAD(&ahd->pending_scbs, scb, pending_links);
1051 ahd->scb_data.scbindex[SCB_GET_TAG(scb)] = scb;
1052 ahd_pause(ahd);
1053 ahd_set_scbptr(ahd, SCB_GET_TAG(scb));
1054 ahd_outb(ahd, RETURN_1, CONT_MSG_LOOP_TARG);
1055 ahd_unpause(ahd);
1057 ahd_queue_scb(ahd, scb);
1069 ahd_setup_data(struct ahd_softc *ahd, struct cam_sim *sim,
1095 ahd_free_scb(ahd, scb);
1115 ahd_free_scb(ahd, scb);
1124 error = bus_dmamap_load_ccb(ahd->buffer_dmat,
1140 ahd_abort_ccb(struct ahd_softc *ahd, struct cam_sim *sim, union ccb *ccb)
1156 status = ahd_find_tmode_devs(ahd, sim, abort_ccb, &tstate,
1225 ahd_send_async(struct ahd_softc *ahd, char channel, u_int target,
1234 error = ahd_create_path(ahd, channel, target, lun, &path);
1249 ahd_get_tran_settings(ahd, ahd->our_id, channel, &cts);
1271 ahd_platform_set_tags(struct ahd_softc *ahd,
1277 ahd_platform_alloc(struct ahd_softc *ahd, void *platform_arg)
1279 ahd->platform_data = malloc(sizeof(struct ahd_platform_data), M_DEVBUF,
1281 if (ahd->platform_data == NULL)
1287 ahd_platform_free(struct ahd_softc *ahd)
1291 pdata = ahd->platform_data;
1294 bus_release_resource(ahd->dev_softc,
1300 bus_release_resource(ahd->dev_softc,
1306 bus_release_resource(ahd->dev_softc,
1318 free(ahd->platform_data, M_DEVBUF);
1332 struct ahd_softc *ahd;
1335 ahd = device_get_softc(dev);
1336 ahd_lock(ahd);
1337 TAILQ_REMOVE(&ahd_tailq, ahd, links);
1338 ahd_intr_enable(ahd, FALSE);
1339 bus_teardown_intr(dev, ahd->platform_data->irq, ahd->platform_data->ih);
1340 ahd_unlock(ahd);
1341 ahd_free(ahd);
1382 "ahd",
1548 DECLARE_MODULE(ahd, ahd_mod, SI_SUB_DRIVERS, SI_ORDER_MIDDLE);
1549 MODULE_DEPEND(ahd, cam, 1, 1, 1);
1550 MODULE_VERSION(ahd, 1);