summaryrefslogtreecommitdiffstats
path: root/sys/dev/usb/if_aue.c
Commit message (Collapse)AuthorAgeFilesLines
...
* Another round of the <sys/queue.h> FOREACH transmogriffer.phk2001-02-041-2/+1
| | | | | Created with: sed(1) Reviewed by: md5(1)
* Use LIST_FOREACH() to traverse ifp->if_multiaddrs list, instead ofphk2001-02-031-2/+1
| | | | | | | <sys/queue.h> implementation details. Created with: /usr/sbin/sed Reviewed with: /sbin/md5
* Implement MTX_RECURSE flag for mtx_init().bmilekic2001-01-191-1/+2
| | | | | | | | | | | | | | | | | | | All calls to mtx_init() for mutexes that recurse must now include the MTX_RECURSE bit in the flag argument variable. This change is in preparation for an upcoming (further) mutex API cleanup. The witness code will call panic() if a lock is found to recurse but the MTX_RECURSE bit was not set during the lock's initialization. The old MTX_RECURSE "state" bit (in mtx_lock) has been renamed to MTX_RECURSED, which is more appropriate given its meaning. The following locks have been made "recursive," thus far: eventhandler, Giant, callout, sched_lock, possibly some others declared in the architecture-specific code, all of the network card driver locks in pci/, as well as some other locks in dev/ stuff that I've found to be recursive. Reviewed by: jhb
* Readd the id removed by sheldon in the previous commit to uscanner.c.n_hibma2001-01-041-1/+1
| | | | Change the ID in if_aue.c to match the new name in usbdevs.h.
* Close PR #21078: the aue driver was not correctly programming thewpaul2000-11-011-1/+1
| | | | | | | | multicast filter on the Pegasus chip. Since IPv6 depends a lot on multicasting, this caused several failures for people trying to use IPv6 with Pegasus USB ethernet devices. Submitted by: Jun Kuriyama <kuriyama@FreeBSD.org>
* Convert the USB ethernet drivers to use mutexes. Also convertwpaul2000-10-241-66/+81
| | | | | | | | | 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.
* Remove unneeded #include <machine/clock.h>phk2000-10-151-1/+0
|
* Add missing comma at the end of line.kuriyama2000-10-111-1/+1
|
* Add support for the Kingston KNU101TX 10/100 USB ethernet adapter. We'rewpaul2000-10-101-0/+1
| | | | up to 11 of these now.
* Tweak the aue driver so that the homePNA PHYs will be detected andwpaul2000-09-221-0/+2
| | | | | | attached by the pnaphy driver. This seems to work fine with my sample ADMtek adapter (which has both 10/100 ethernet and homePNA connectors and hardware).
* Add support for D-Link DSB-650 USB ethernet adapter.wpaul2000-09-061-2/+7
|
* Make all Ethernet drivers attach using ether_ifattach() and detach usingarchie2000-07-131-6/+3
| | | | | | | | | ether_ifdetach(). The former consolidates the operations of if_attach(), ng_ether_attach(), and bpfattach(). The latter consolidates the corresponding detach operations. Reviewed by: julian, freebsd-net
* Darn it... left if_aue.c out of the last commit. (Fix watchdog timeoutwpaul2000-06-011-5/+24
| | | | handling, turn of interrupt pipe stuff.)
* Depend on miibus.peter2000-04-291-0/+2
| | | | | | | | Note that if_aue doesn't strictly depend on usb because it uses the method interface for calls rather than using internal symbols, and because it's a child driver of usb and therefore will not try and do anything unless the parent usb code is loaded at some point. if_aue does strictly depend on miibus as it will fail to link if it is missing.
* OpenBSD has a broken debugger that does not grok static. Use an_hibma2000-04-031-68/+68
| | | | | | #define Static static that the OpenBSD folks can define it to be empty if they like.
* Add support for the LinkSys USB10T network adapter thatjmb2000-04-021-2/+6
| | | | | | | contains the ADMtek Pegasus AN986 USB chipset. The adapter supports both 10BaseT and 100BaseT (including full-duplex). The product code for these adapters is 0x2206.
* Regenerate usbdevs files.wpaul2000-03-211-0/+1
| | | | | | Also add device entry in if_kue.c for the LINKSYS USB10T adapter. Also add calls to bpfdetach() in detach routines.
* Add vendor/device ID for Corega FEther USB-TX.gehenna2000-03-091-0/+1
| | | | | Submitted by: iwasaki Approved by: jkh
* Minor tweak: the D-Link 10/100 USB ethernet adapter is apparently usingwpaul2000-01-291-4/+8
| | | | | the same design as the LinkSys adapter and needs the same special handling to enable its PHY.
* Fix a bug in the uhci driver that breaks large bulk IN transfers. Thewpaul2000-01-281-37/+3
| | | | | | | | | | | | | | uhci_check_intr() routine needs to be more careful about deciding when the end of a transfer has been detected. This allows me to remove the nasty workaround code from if_aue and if_cue. Receive performance is now much better for these adapters (500KB/sec vs. 350KB/sec). Also removed unused KUE_CUTOFF define from if_kuereg.h. Submitted by: Lennart Augustsson Reviewed by: n_hibma
* Fix test for deciding when a bulk IN transfer got truncated. I thoughtwpaul2000-01-201-1/+1
| | | | | I fixed this last night, but apparently I only applied the patch to the copy of the code in /dev/brain0.
* More USB ethernet tweaks:wpaul2000-01-201-25/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Sync ohci, uhci and usbdi modules with NetBSD in order to obtain the following improvements: o New USBD_NO_TSLEEP flag can be used in place of UQ_NO_TSLEEP quirk. This allows drivers to specify busy waiting only for certain transfers (namely control transfers for reading/writing registers and stuff). o New USBD_FORCE_SHORT_XFER flag can be used to deal with devices like the ADMtek Pegasus that sense the end of bulk OUT transfers in a special way (if a transfer is exactly a multiple of 64 bytes in size, you need to send an extra empty packet to terminate the transfer). o usbd_open_pipe_intr() now accepts an interval argument which can be used to change the rate at which the interrupt callback routine is invoked. Specifying USBD_DEFAULT_INTERVAL uses the value specified in the device's config data, but drivers can override it if needed. - Change if_aue to use USBD_FORCE_SHORT_XFER for packet transmissions. - Change if_aue, if_kue and if_cue to use USBD_NO_TSLEEP for all control transfers. We no longer force the non-tsleep hack for bulk transfers since these are done asynchronously anyway. - Removed quirk entry fiddling from if_aue and if_kue since we don't need it anymore now that we have the USBD_NO_TSLEEP flag. - Tweak ulpt, uhid, ums and ukbd drivers to use the new arg to usbd_open_pipe_intr(). - Add a flag to the softc struct in the ethernet drivers to indicate when a device has been detached, and use this flag to perform tests to prevent the drivers from trying to do control transfers if this is the case. This is necessary because calling if_detach() with INET6 enabled will eventually result in a call to the driver's ioctl() routine to delete the multicast groups on the interface, which will result in attempts to perform control transfers. (It's possible this also happens even without INET6 support enabled.) This is pointless since we know that if the detach method has been called, the hardware has been unplugged. - Changed watchdog timeout routines to just call the driver init routines to initialize the device states without trying to close and re-open the pipes. This is partly because we don't want to frob things at interrupt context, but also because this doesn't seem to work right and I don't want to panic the system just because a USB device may have stopped responding. - Fix aue_rxeof() to be a little smarter about detecting when a double transfer is needed. Unfortunately, the design of the chip makes it hard to get this exactly right. Hopefully, this will go away once either Nick or Lennart finds the bug in the uhci driver that makes this ugly hack necessary. - Also sync usbdevs with NetBSD.
* Fix a couple of bugs:wpaul2000-01-191-1/+1
| | | | | | | | | - The busy wait hack in usbdi.c was doing its timeout in microseconds instead of milliseconds. - if_aue.c:aue_intr() is creating a bitmask by and'ing two bits when it should be or'ing them. Submitted by: Lennart Augustsson
* Remove device name strings from vendor/product lists since we don't usewpaul2000-01-161-21/+20
| | | | | them (they're read from the device directly). Also do a set_config command for the ADMtek and CATC drivers.
* Minor enhancement: set the 'dual link LED' bit in the auxmode registerwpaul2000-01-151-0/+12
| | | | | | | | | | | | | of the Broadcom BCM5201 PHY on the LinkSys USB100TX adapter so that the link LED correctly (lights up amber for 10mbps link, green for 100mbps link). Note that the sticker on the bottom of the adapter says amber for 10 and green for 100, but the appendix in the manual that comes with the adapter says green for 10 and amber for 100. Given that there doesn't seem to be any way to make the hardware produce the latter combination, I think it's safe to say the sticker is right and the manual is wrong. I'm just shocked, shocked I tell you.
* Pull my head out of my ass and actually make the tx netisr stuff work right.wpaul2000-01-141-3/+2
| | | | | | | | | 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.
* Clean up rxeof routines a little.wpaul2000-01-141-2/+3
|
* Fix instance of AUE_BUFSZ that should have been AUE_CUTOFF.wpaul2000-01-131-1/+1
|
* Remove debug printf I left in by mistake.wpaul2000-01-131-2/+0
|
* Bunch of updates:wpaul2000-01-131-27/+48
| | | | | | | | | | | | | | | - 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/+1
| | | | | | | | | | 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-23/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Add the vendor/device IDs for the LinkSys USB100TX.wpaul2000-01-081-0/+2
| | | | | | | | | | Note: the .INF file for LinkSys's driver says the vendor ID is 0x66b, however this does not agree with the vendor ID listed for LinkSys in the company list from www.usb.org. In fact, 0x66b doesn't seem to appear in the company list at all. Furthermore, this same vendor ID crops up in some of the D-Link .INF files. Frankly I don't know what the heck is going on here, but I need to add 0x66b to usbdevs and call it something, so here we are.
* Be a bit more discriminating when trying to decide when to screen outwpaul2000-01-081-7/+20
| | | | | | | | | | certain PHY addresses in aue_miibus_readreg(). Not all adapters based on the Pegasus chip may have their PHYs wired for the same MII bus addresses: the logic that I used for my ADMtek eval board might not apply to other adapters, so make sure to only use it if this is really an ADMtek eval board (check the vendor/device ID). This will hopefully make the LinkSys USB100TX adapter work correctly.
* Add the vendor and device IDs for a whole bunch of additional USBwpaul2000-01-071-0/+6
| | | | | | | | | | | | | | | | | ethernet adapters that are supported by the aue and kue drivers. There are actually a couple more out there from Accton, Asante and EXP Computer, however I was not able to find any Windows device drivers for these on their servers, and hence could not harvest their vendor/device ID info. If somebody has one of these things and can look in the .inf file that comes with the Windows driver, I'd appreciate knowing what it says for 'VID' and 'PID.' Additional adapters include: the D-Link DSB-650 and DSB-650TX, the SMC 2102USB, 2104USB and 2202USB, the ATen UC10T, and the Netgear EA101. These are all mentioned in the man pages, relnotes and LINT. Also correct the date in the kue(4) man page. I wrote this thing on Jan, 4 2000, not 1999.
* This commit adds device driver support for the ADMtek AN986 Pegasuswpaul1999-12-281-0/+1517
USB ethernet chip. Adapters that use this chip include the LinkSys USB100TX. There are a few others, but I'm not certain of their availability in the U.S. I used an ADMtek eval board for development. Note that while the ADMtek chip is a 100Mbps device, you can't really get 100Mbps speeds over USB. Regardless, this driver uses miibus to allow speed and duplex mode selection as well as autonegotiation. Building and kldloading the driver as a module is also supported. Note that in order to make this driver work, I had to make what some may consider an ugly hack to sys/dev/usb/usbdi.c. The usbd_transfer() function will use tsleep() for synchronous transfers that don't complete right away. This is a problem since there are times when we need to do sync transfers from an interrupt context (i.e. when reading registers from the MAC via the control endpoint), where tsleep() us a no-no. My hack allows the driver to have the code poll for transfer completion subject to the xfer->timeout timeout rather that calling tsleep(). This hack is controlled by a quirk entry and is only enabled for the ADMtek device. Now, I'm sure there are a few of you out there ready to jump on me and suggest some other approach that doesn't involve a busy wait. The only solution that might work is to handle the interrupts in a kernel thread, where you may have something resembling a process context that makes it okay to tsleep(). This is lovely, except we don't have any mechanism like that now, and I'm not about to implement such a thing myself since it's beyond the scope of driver development. (Translation: I'll be damned if I know how to do it.) If FreeBSD ever aquires such a mechanism, I'll be glad to revisit the driver to take advantage of it. In the meantime, I settled for what I perceived to be the solution that involved the least amount of code changes. In general, the hit is pretty light. Also note that my only USB test box has a UHCI controller: I haven't I don't have a machine with an OHCI controller available. Highlights: - Updated usb_quirks.* to add UQ_NO_TSLEEP quirk for ADMtek part. - Updated usbdevs and regenerated generated files - Updated HARDWARE.TXT and RELNOTES.TXT files - Updated sysinstall/device.c and userconfig.c - Updated kernel configs -- device aue0 is commented out by default - Updated /sys/conf/files - Added new kld module directory
OpenPOWER on IntegriCloud