Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 20 Dec 2008 06:09:08 GMT
From:      Weongyo Jeong <weongyo@FreeBSD.org>
To:        Perforce Change Reviews <perforce@FreeBSD.org>
Subject:   PERFORCE change 155041 for review
Message-ID:  <200812200609.mBK698CP059153@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
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++) {



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200812200609.mBK698CP059153>