aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVinod Kashyap <vkashyap@FreeBSD.org>2004-05-17 17:16:58 +0000
committerVinod Kashyap <vkashyap@FreeBSD.org>2004-05-17 17:16:58 +0000
commit5bc41694118829c30fe87fbfb8223943007f735e (patch)
tree4c1f4f33174c84dd229a5b452fdb4a4a1292b7f2
parentb4c3fa62f8e12d6b5687d01842708d6a853381ec (diff)
downloadsrc-5bc41694118829c30fe87fbfb8223943007f735e.tar.gz
src-5bc41694118829c30fe87fbfb8223943007f735e.zip
Undid scottl's recent changes.
Notes
Notes: svn path=/head/; revision=129344
-rw-r--r--sys/dev/twa/twa.h1
-rw-r--r--sys/dev/twa/twa_cam.c2
-rw-r--r--sys/dev/twa/twa_freebsd.c40
3 files changed, 41 insertions, 2 deletions
diff --git a/sys/dev/twa/twa.h b/sys/dev/twa/twa.h
index 0fee37ecdb9f..5f49b496c0c5 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 b0caafe65fd5..b8505e988e4b 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 b1138aff879c..9879448f9441 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.
*