PERFORCE change 155117 for review
Weongyo Jeong
weongyo at FreeBSD.org
Mon Dec 22 04:42:06 PST 2008
http://perforce.freebsd.org/chv.cgi?CH=155117
Change 155117 by weongyo at weongyo_ws on 2008/12/22 12:41:27
change our tactics to detach USB NDIS driver already attached and
working to send a `SURPRISE REMOVED' PNP event to the NDIS driver's
handler if they have then try to cacel timers for buggy NDIS driver.
As last, it try to halt the device using ndis_halt_nic().
Until the previous version, most drivers I've tested worked to attach
the device but there were problems to detach, for example, panics,
page faults or unknown system hang (serial-console didn't work to
enter DDB). Now it looks it becomes more stable to detach USB
adapters.
Affected files ...
.. //depot/projects/ndisusb/sys/dev/if_ndis/if_ndis_usb.c#5 edit
Differences ...
==== //depot/projects/ndisusb/sys/dev/if_ndis/if_ndis_usb.c#5 (text+ko) ====
@@ -65,6 +65,7 @@
#include <compat/ndis/resource_var.h>
#include <compat/ndis/ntoskrnl_var.h>
#include <compat/ndis/ndis_var.h>
+#include <compat/ndis/usbd_var.h>
#include <dev/if_ndis/if_ndisvar.h>
SYSCTL_NODE(_hw, OID_AUTO, ndisusb, CTLFLAG_RD, 0, "NDIS USB driver parameters");
@@ -233,6 +234,9 @@
sc->ndisusb_iin_buf = NULL;
}
+ ndis_pnpevent_nic(self, NDIS_PNP_EVENT_SURPRISE_REMOVED);
+ ndis_cancel_timerlist();
+
usbd_add_drv_event(USB_EVENT_DRIVER_DETACH, uaa->device, self);
return ndis_detach(self);
More information about the p4-projects
mailing list