diff -cNr orig_snv104/rum.c rum_suspend_resume/rum.c *** orig_snv104/rum.c Wed Dec 24 02:18:05 2008 --- rum_suspend_resume/rum.c Wed Dec 24 02:24:26 2008 *************** *** 2211,2219 **** RAL_DEBUG(RAL_DBG_MSG, "rum_attach()\n"); ! if (cmd != DDI_ATTACH) ! return (DDI_FAILURE); ! instance = ddi_get_instance(devinfo); if (ddi_soft_state_zalloc(rum_soft_state_p, instance) != DDI_SUCCESS) { --- 2211,2232 ---- RAL_DEBUG(RAL_DBG_MSG, "rum_attach()\n"); ! switch (cmd) { ! case DDI_ATTACH: ! break; ! case DDI_RESUME: ! sc = ddi_get_soft_state(rum_soft_state_p, ! ddi_get_instance(devinfo)); ! (void) rum_init(sc); ! mutex_enter(&sc->sc_genlock); ! sc->sc_flags &= ~(1 << 7); ! mutex_exit(&sc->sc_genlock); ! ieee80211_new_state(&sc->sc_ic, IEEE80211_S_INIT, -1); ! return (DDI_SUCCESS); ! default: ! return (DDI_FAILURE); ! } ! instance = ddi_get_instance(devinfo); if (ddi_soft_state_zalloc(rum_soft_state_p, instance) != DDI_SUCCESS) { *************** *** 2422,2429 **** RAL_DEBUG(RAL_DBG_MSG, "rum_detach()\n"); sc = ddi_get_soft_state(rum_soft_state_p, ddi_get_instance(devinfo)); ! if (cmd != DDI_DETACH) ! return (DDI_FAILURE); rum_stop(sc); usb_unregister_hotplug_cbs(devinfo); --- 2435,2454 ---- RAL_DEBUG(RAL_DBG_MSG, "rum_detach()\n"); sc = ddi_get_soft_state(rum_soft_state_p, ddi_get_instance(devinfo)); ! switch (cmd) { ! case DDI_DETACH: ! break; ! case DDI_SUSPEND: ! if (sc->sc_flags & RAL_FLAG_RUNNING) { ! rum_stop(sc); ! } ! mutex_enter(&sc->sc_genlock); ! sc->sc_flags |= (1 << 7); ! mutex_exit(&sc->sc_genlock); ! return (DDI_SUCCESS); ! default: ! return (DDI_FAILURE); ! } rum_stop(sc); usb_unregister_hotplug_cbs(devinfo);