Undid scottl's recent changes.

This commit is contained in:
Vinod Kashyap 2004-05-17 17:16:58 +00:00
parent b4c3fa62f8
commit 5bc4169411
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=129344
3 changed files with 41 additions and 2 deletions

View File

@ -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;

View File

@ -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;

View File

@ -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);
@ -502,6 +516,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.