PERFORCE change 155052 for review
Weongyo Jeong
weongyo at FreeBSD.org
Sat Dec 20 02:45:51 PST 2008
http://perforce.freebsd.org/chv.cgi?CH=155052
Change 155052 by weongyo at weongyo_ws on 2008/12/20 10:45:43
introduce `ndisusb_halt' sysctl to control whether the ndisulator try
to halt after attaching. This is needed to solve some NDIS USB
driver's problems. For example ZyDAS 1211B NDIS driver doen't response
against GET_CONFIG_DESCRIPTOR messages after halting; don't know it's
NDIS driver's problem. Some NDIS drivers doesn't work for halting by
unknown problems.
Affected files ...
.. //depot/projects/ndisusb/sys/dev/if_ndis/if_ndis.c#14 edit
Differences ...
==== //depot/projects/ndisusb/sys/dev/if_ndis/if_ndis.c#14 (text+ko) ====
@@ -96,6 +96,11 @@
#define DPRINTF(x)
#endif
+SYSCTL_DECL(_hw_ndisusb);
+int ndisusb_halt = 1;
+SYSCTL_INT(_hw_ndisusb, OID_AUTO, halt, CTLFLAG_RW, &ndisusb_halt, 0,
+ "Halt NDIS USB driver when it's attached");
+
MODULE_DEPEND(ndis, ether, 1, 1, 1);
MODULE_DEPEND(ndis, wlan, 1, 1, 1);
MODULE_DEPEND(ndis, ndisapi, 1, 1, 1);
@@ -946,6 +951,9 @@
return (error);
}
+ if (sc->ndis_iftype == PNPBus && ndisusb_halt == 0)
+ return (error);
+
/* We're done talking to the NIC for now; halt it. */
ndis_halt_nic(sc);
@@ -1963,11 +1971,13 @@
*/
ndis_stop(sc);
- error = ndis_init_nic(sc);
- if (error != 0) {
- device_printf(sc->ndis_dev,
- "failed to initialize the device: %d\n", error);
- return;
+ if (!(sc->ndis_iftype == PNPBus && ndisusb_halt == 0)) {
+ error = ndis_init_nic(sc);
+ if (error != 0) {
+ device_printf(sc->ndis_dev,
+ "failed to initialize the device: %d\n", error);
+ return;
+ }
}
/* Init our MAC address */
@@ -3176,8 +3186,9 @@
ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE);
NDIS_UNLOCK(sc);
- /* If we're detaching NIC we should call ndis_halt_nic(). */
- ndis_halt_nic(sc);
+ if (!(sc->ndis_iftype == PNPBus && ndisusb_halt == 0) ||
+ sc->ndisusb_status & NDISUSB_STATUS_DETACH)
+ ndis_halt_nic(sc);
NDIS_LOCK(sc);
for (i = 0; i < NDIS_EVENTS; i++) {
More information about the p4-projects
mailing list