summaryrefslogtreecommitdiffstats
path: root/sys/modules/usb
diff options
context:
space:
mode:
authorwpaul <wpaul@FreeBSD.org>2000-01-10 23:12:54 +0000
committerwpaul <wpaul@FreeBSD.org>2000-01-10 23:12:54 +0000
commitcf16a7efdbcb91d113076438baa91ee5e3eb9f0f (patch)
treedcd5228d2a569c3fab5287bd12de2d2971210693 /sys/modules/usb
parent6ee166cb62b0355ec455077af6de4c02e59540a4 (diff)
downloadFreeBSD-src-cf16a7efdbcb91d113076438baa91ee5e3eb9f0f.zip
FreeBSD-src-cf16a7efdbcb91d113076438baa91ee5e3eb9f0f.tar.gz
Attempt to fix a problem with receiving packets on USB ethernet interfaces.
Packets are received inside USB bulk transfer callbacks, which run at splusb() (actually splbio()). The packet input queues are meant to be manipulated at splimp(). However the locking apparently breaks down under certain circumstances and the input queues can get trampled. There's a similar problem with if_ppp, which is driven by hardware/tty interrupts from the serial driver, but which must also manipulate the packet input queues at splimp(). The fix there is to use a netisr, and that's the fix I used here. (I can hear you groaning back there. Hush up.) The usb_ethersubr module maintains a single queue of its own. When a packet is received in the USB callback routine, it's placed on this queue with usb_ether_input(). This routine also schedules a soft net interrupt with schednetisr(). The ISR routine then runs later, at splnet, outside of the USB callback/interrupt context, and passes the packet to ether_input(), hopefully in a safe manner. The reason this is implemented as a separate module is that there are a limited number of NETISRs that we can use, and snarfing one up for each driver that needs it is wasteful (there will be three once I get the CATC driver done). It also reduces code duplication to a certain small extent. Unfortunately, it also needs to be linked in with the usb.ko module in order for the USB ethernet drivers to share it. Also removed some uneeded includes from if_aue.c and if_kue.c Fix suggested by: peter Not rejected as a hairbrained idea by: n_hibma
Diffstat (limited to 'sys/modules/usb')
-rw-r--r--sys/modules/usb/Makefile3
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/modules/usb/Makefile b/sys/modules/usb/Makefile
index e372b73..ff49f89 100644
--- a/sys/modules/usb/Makefile
+++ b/sys/modules/usb/Makefile
@@ -17,7 +17,8 @@ SRCS = bus_if.h device_if.h usb_if.h usb_if.c \
usb_subr.c \
usbdevs.h usbdevs_data.h \
usbdi.c usbdi.h usbdivar.h \
- usbdi_util.c usbdi_util.h
+ usbdi_util.c usbdi_util.h \
+ usb_ethersubr.c
SRCS += uhci_pci.c uhci.c uhcireg.h uhcivar.h
SRCS += ohci_pci.c ohci.c ohcireg.h ohcivar.h
OpenPOWER on IntegriCloud