diff options
author | vkashyap <vkashyap@FreeBSD.org> | 2004-05-17 17:16:58 +0000 |
---|---|---|
committer | vkashyap <vkashyap@FreeBSD.org> | 2004-05-17 17:16:58 +0000 |
commit | 858adca10f16b52166830f034daf42bbdb337d6a (patch) | |
tree | 4c1f4f33174c84dd229a5b452fdb4a4a1292b7f2 /sys | |
parent | 26acde6f962c21f83a4910a6df96f930cb1df858 (diff) | |
download | FreeBSD-src-858adca10f16b52166830f034daf42bbdb337d6a.zip FreeBSD-src-858adca10f16b52166830f034daf42bbdb337d6a.tar.gz |
Undid scottl's recent changes.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/twa/twa.h | 1 | ||||
-rw-r--r-- | sys/dev/twa/twa_cam.c | 2 | ||||
-rw-r--r-- | sys/dev/twa/twa_freebsd.c | 40 |
3 files changed, 41 insertions, 2 deletions
diff --git a/sys/dev/twa/twa.h b/sys/dev/twa/twa.h index 0fee37e..5f49b49 100644 --- a/sys/dev/twa/twa.h +++ b/sys/dev/twa/twa.h @@ -183,6 +183,7 @@ struct twa_softc { bus_addr_t twa_cmd_pkt_phys;/* phys addr of first of array of cmd pkts */ struct resource *twa_irq_res; /* interrupt resource*/ void *twa_intr_handle;/* interrupt handle */ + struct intr_config_hook twa_ich; /* delayed-startup hook */ struct sysctl_ctx_list twa_sysctl_ctx; struct sysctl_oid *twa_sysctl_tree; diff --git a/sys/dev/twa/twa_cam.c b/sys/dev/twa/twa_cam.c index b0caafe..b8505e9 100644 --- a/sys/dev/twa/twa_cam.c +++ b/sys/dev/twa/twa_cam.c @@ -405,7 +405,7 @@ twa_action(struct cam_sim *sim, union ccb *ccb) twa_dbg_dprint(3, sc, "XPT_PATH_INQ request"); path_inq->version_num = 1; - path_inq->hba_inquiry = PI_WIDE_16; + path_inq->hba_inquiry = 0; path_inq->target_sprt = 0; path_inq->hba_misc = 0; path_inq->hba_eng_cnt = 0; diff --git a/sys/dev/twa/twa_freebsd.c b/sys/dev/twa/twa_freebsd.c index b1138af..9879448 100644 --- a/sys/dev/twa/twa_freebsd.c +++ b/sys/dev/twa/twa_freebsd.c @@ -146,6 +146,7 @@ static int twa_shutdown (device_t dev); static int twa_suspend (device_t dev); static int twa_resume (device_t dev); static void twa_pci_intr(void *arg); +static void twa_intrhook (void *arg); static device_method_t twa_methods[] = { /* Device interface */ @@ -291,7 +292,20 @@ twa_attach(device_t dev) UID_ROOT, GID_OPERATOR, S_IRUSR | S_IWUSR, "twa%d", device_get_unit(sc->twa_bus_dev)); sc->twa_ctrl_dev->si_drv1 = sc; - twa_enable_interrupts(sc); + + /* + * Schedule ourselves to bring the controller up once interrupts are + * available. This isn't strictly necessary, since we disable + * interrupts while probing the controller, but it is more in keeping + * with common practice for other disk devices. + */ + sc->twa_ich.ich_func = twa_intrhook; + sc->twa_ich.ich_arg = sc; + if (config_intrhook_establish(&sc->twa_ich) != 0) { + twa_printf(sc, "Can't establish configuration hook.\n"); + twa_free(sc); + return(ENXIO); + } if ((error = twa_cam_setup(sc))) { twa_free(sc); @@ -503,6 +517,30 @@ twa_pci_intr(void *arg) /* + * Function name: twa_intrhook + * Description: Callback for us to enable interrupts. + * + * Input: arg -- ptr to per ctlr structure + * Output: None + * Return value: None + */ +static void +twa_intrhook(void *arg) +{ + struct twa_softc *sc = (struct twa_softc *)arg; + + twa_dbg_dprint(4, sc, "twa_intrhook Entered"); + + /* Pull ourselves off the intrhook chain. */ + config_intrhook_disestablish(&sc->twa_ich); + + /* Enable interrupts. */ + twa_enable_interrupts(sc); +} + + + +/* * Function name: twa_write_pci_config * Description: Writes to the PCI config space. * |