From owner-p4-projects@FreeBSD.ORG Sat Dec 20 06:09:08 2008 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id A68FC1065676; Sat, 20 Dec 2008 06:09:08 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6ABEE106564A for ; Sat, 20 Dec 2008 06:09:08 +0000 (UTC) (envelope-from weongyo@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 581258FC13 for ; Sat, 20 Dec 2008 06:09:08 +0000 (UTC) (envelope-from weongyo@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id mBK6983O059155 for ; Sat, 20 Dec 2008 06:09:08 GMT (envelope-from weongyo@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id mBK698CP059153 for perforce@freebsd.org; Sat, 20 Dec 2008 06:09:08 GMT (envelope-from weongyo@FreeBSD.org) Date: Sat, 20 Dec 2008 06:09:08 GMT Message-Id: <200812200609.mBK698CP059153@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to weongyo@FreeBSD.org using -f From: Weongyo Jeong To: Perforce Change Reviews Cc: Subject: PERFORCE change 155041 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Dec 2008 06:09:09 -0000 http://perforce.freebsd.org/chv.cgi?CH=155041 Change 155041 by weongyo@weongyo_ws on 2008/12/20 06:08:47 discard a policy which didn't try to halt after attaching the device. From now the ndisulator try to call the halt function after attaching and it'll re-initialize the device wheh it's UPed. Affected files ... .. //depot/projects/ndisusb/sys/dev/if_ndis/if_ndis.c#12 edit Differences ... ==== //depot/projects/ndisusb/sys/dev/if_ndis/if_ndis.c#12 (text+ko) ==== @@ -96,11 +96,6 @@ #define DPRINTF(x) #endif -SYSCTL_DECL(_hw_ndisusb); -int ndisusb_reset = 0; -SYSCTL_INT(_hw_ndisusb, OID_AUTO, reset, CTLFLAG_RW, &ndisusb_reset, 0, - "Reset NDIS USB driver when it's UPed"); - MODULE_DEPEND(ndis, ether, 1, 1, 1); MODULE_DEPEND(ndis, wlan, 1, 1, 1); MODULE_DEPEND(ndis, ndisapi, 1, 1, 1); @@ -951,15 +946,8 @@ return (error); } - /* - * In cases of USB devices, it looks that many NDIS drivers doesn't - * work after calling HALT handler. Many drivers drive theirself to - * the kernel panic at ndis_init() if we halt NIC. Thus we prefer - * not to halt NIC in USB cases. - */ - if (sc->ndis_iftype != PNPBus) - /* We're done talking to the NIC for now; halt it. */ - ndis_halt_nic(sc); + /* We're done talking to the NIC for now; halt it. */ + ndis_halt_nic(sc); return(error); } @@ -1975,14 +1963,9 @@ */ ndis_stop(sc); - if (sc->ndis_iftype == PCIBus || sc->ndis_iftype == PCMCIABus) { - error = ndis_init_nic(sc); - if (error != 0) - return; - } else if (ndisusb_reset != 0) { - /* Reset USB NIC using NDIS's reset handler. */ - ndis_reset_nic(sc); - } + error = ndis_init_nic(sc); + if (error != 0) + return; /* Init our MAC address */ @@ -3190,14 +3173,8 @@ ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE); NDIS_UNLOCK(sc); - /* - * If we're detaching NIC we should call ndis_halt_nic() even if the - * driver is for USB. - */ - if (sc->ndis_iftype != PNPBus || - (sc->ndis_iftype == PNPBus && - sc->ndisusb_status & NDISUSB_STATUS_DETACH)) - ndis_halt_nic(sc); + /* If we're detaching NIC we should call ndis_halt_nic(). */ + ndis_halt_nic(sc); NDIS_LOCK(sc); for (i = 0; i < NDIS_EVENTS; i++) {