PERFORCE change 155041 for review
Weongyo Jeong
weongyo at FreeBSD.org
Fri Dec 19 22:09:09 PST 2008
http://perforce.freebsd.org/chv.cgi?CH=155041
Change 155041 by weongyo at 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++) {
More information about the p4-projects
mailing list