summaryrefslogtreecommitdiffstats
path: root/sys/dev/usb/usb_ethersubr.c
Commit message (Collapse)AuthorAgeFilesLines
* Remove duplicatejohan2003-11-141-3/+0
| | | | | | | #include <sys/cdefs.h> __FBSDID(...); Leave the one matching the other files in this directory.
* o add a flags parameter to netisr_register that is used to specifysam2003-11-081-1/+1
| | | | | | | | | | | | | | | | whether or not the isr needs to hold Giant when running; Giant-less operation is also controlled by the setting of debug_mpsafenet o mark all netisr's except NETISR_IP as needing Giant o add a GIANT_REQUIRED assertion to the top of netisr's that need Giant o pickup Giant (when debug_mpsafenet is 1) inside ip_input before calling up with a packet o change netisr handling so swi_net runs w/o Giant; instead we grab Giant before invoking handlers based on whether the handler needs Giant o change netisr handling so that netisr's that are marked MPSAFE may have multiple instances active at a time o add netisr statistics for packets dropped because the isr is inactive Supported by: FreeBSD Foundation
* Use __FBSDID().obrien2003-08-241-0/+3
| | | | Also some minor style cleanups.
* Use __FBSDID rather than rcsid[].obrien2003-04-031-7/+3
|
* Update netisr handling; Each SWI now registers its queue, and all queuejlemon2003-03-041-3/+3
| | | | | | | | | | drain routines are done by swi_net, which allows for better queue control at some future point. Packets may also be directly dispatched to a netisr instead of queued, this may be of interest at some installations, but currently defaults to off. Reviewed by: hsu, silby, jayanth, sam Sponsored by: DARPA, NAI Labs
* network interface driver changes:sam2002-11-141-4/+1
| | | | | | | | | | | | | | o don't strip the Ethernet header from inbound packets; pass packets up the stack intact (required significant changes to some drivers) o reference common definitions in net/ethernet.h (e.g. ETHER_ALIGN) o track ether_ifattach/ether_ifdetach API changes o track bpf changes (use BPF_TAP and BPF_MTAP) o track vlan changes (ifnet capabilities, revised processing scheme, etc.) o use if_input to pass packets "up" o call ether_ioctl for default handling of ioctls Reviewed by: many Approved by: re
* Change callers of mtx_init() to pass in an appropriate lock type name. Injhb2002-04-041-2/+2
| | | | | | | most cases NULL is passed, but in some cases such as network driver locks (which use the MTX_NETWORK_LOCK macro) and UMA zone locks, a name is used. Tested on: i386, alpha, sparc64
* Remove __P.alfred2002-03-201-1/+1
|
* Lock down the network interface queues. The queue mutex must be obtainedjlemon2000-11-251-12/+2
| | | | | | | | | | | | | | before adding/removing packets from the queue. Also, the if_obytes and if_omcasts fields should only be manipulated under protection of the mutex. IF_ENQUEUE, IF_PREPEND, and IF_DEQUEUE perform all necessary locking on the queue. An IF_LOCK macro is provided, as well as the old (mutex-less) versions of the macros in the form _IF_ENQUEUE, _IF_QFULL, for code which needs them, but their use is discouraged. Two new macros are introduced: IF_DRAIN() to drain a queue, and IF_HANDOFF, which takes care of locking/enqueue, and also statistics updating/start if necessary.
* Convert the USB ethernet drivers to use mutexes. Also convertwpaul2000-10-241-11/+18
| | | | | | | | | usb_ethersubr.c. This module maintains two queues for packets which are each protected with one mutex. These are all the changes I can do for now. Removing the USBD_NO_TSLEEP flag doesn't work yet: when I tried it, the system would usually freeze up after a NIC had been operating for a while. The usb_ethersubr module itself ought to go away; this is the next thing I need to test.
* Move code to handle BPF and bridging for incoming Ethernet packets outarchie2000-05-141-18/+0
| | | | | | | | | | | | | | | of the individual drivers and into the common routine ether_input(). Also, remove the (incomplete) hack for matching ethernet headers in the ip_fw code. The good news: net result of 1016 lines removed, and this should make bridging now work with *all* Ethernet drivers. The bad news: it's nearly impossible to test every driver, especially for bridging, and I was unable to get much testing help on the mailing lists. Reviewed by: freebsd-net
* Remove unneeded #include <sys/kernel.h>phk2000-04-291-1/+0
|
* OpenBSD has a broken debugger that does not grok static. Use an_hibma2000-04-031-5/+5
| | | | | | #define Static static that the OpenBSD folks can define it to be empty if they like.
* Pull my head out of my ass and actually make the tx netisr stuff work right.wpaul2000-01-141-39/+17
| | | | | | | | | Do not not not call m_freem() in the txeof routines. Let the netisr routine do it. This also makes the tx netisr queuing much simpler (I can just use another ifqueue instead of the mess I had before.) Thanks to Bosko Milekic for making me actually think about what I was doing for a minute.
* Bunch of updates:wpaul2000-01-131-1/+26
| | | | | | | | | | | | | | | - Add vendor/device ID for Corega USB-T ethernet adapter to necessary places so that it will work with the kue driver. - Add vendor/device ID for CATC Netmate devices for driver to be added soon. - Get really crazy about netisr stuff: avoid doing any mbuf allocations or deallocations at splbio/splusb. - Fix if_aue driver so that it works with LinkSys USB100TX: you need to flip the GPIO bits just the right way to put the PHY in the right mode.
* Apply the same netisr mechanism to transmissions as well. In order towpaul2000-01-121-2/+54
| | | | | | | | | | drive the transmitter, we have to check the interface's send queue in the TX end of frame handler (i.e. the usb bulk out callback) and push out new transmissions if the queue has packets in it and the transmitter is ready. But the txeof handler is also called from a USB callback running at splusb() too. Grrr.
* Attempt to fix a problem with receiving packets on USB ethernet interfaces.wpaul2000-01-101-0/+118
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
OpenPOWER on IntegriCloud