summaryrefslogtreecommitdiffstats
path: root/sys/dev/usb/if_kue.c
Commit message (Collapse)AuthorAgeFilesLines
* Make these depend on the usb module so they can use its symbols if theypeter2001-08-221-0/+2
| | | | are loaded as seperate .ko files
* Add the Abocom URE 450 ethernet adapter.n_hibma2001-04-091-0/+1
| | | | Submitted by: dima@bog.msu.su
* Add id for the IO Data ET/Tn_hibma2001-04-071-0/+1
| | | | | PR: 23877 Submitted by: Makoto MATSUSHITA <matusita@jp.freebsd.org>
* Convert if_multiaddrs from LIST to TAILQ so that it can be traversedphk2001-02-061-1/+1
| | | | | | backwards in the three drivers which want to do that. Reviewed by: mikeh
* 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
* Add a forgotten mutex_exit()/KUE_UNLOCK() to kue_init().wpaul2000-11-231-1/+3
|
* Convert the USB ethernet drivers to use mutexes. Also convertwpaul2000-10-241-38/+55
| | | | | | | | | 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
|
* Make all Ethernet drivers attach using ether_ifattach() and detach usingarchie2000-07-131-8/+4
| | | | | | | | | 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
* Handle watchdog timeouts better. We can't really call the foo_init()wpaul2000-06-011-4/+10
| | | | | | | | | | | | | routines from foo_watchdog() because foo_watchdog() is called at interrupt context, and that's a no-no due to the way the USB stack is currently set up. What we do now is call the TX end of frame handler manually to clear the completed transmission, then check the send queue and send off any frames that are pending. Also turned off the interrupt pipe stuff in if_aue, since it appears to tickle a bug in the USB stack that I haven't found yet.
* OpenBSD has a broken debugger that does not grok static. Use an_hibma2000-04-031-47/+47
| | | | | | #define Static static that the OpenBSD folks can define it to be empty if they like.
* Add vendor/product ID for two more KLSI-based devices, including awpaul2000-03-291-0/+2
| | | | USB ethernet adapter being handed out by @Home.
* Regenerate usbdevs files.wpaul2000-03-211-1/+4
| | | | | | Also add device entry in if_kue.c for the LINKSYS USB10T adapter. Also add calls to bpfdetach() in detach routines.
* Add another device/vendor code combination to support yet anotherwpaul2000-03-181-0/+1
| | | | KLSI-based device (Skymaster DHU-0404).
* More USB ethernet tweaks:wpaul2000-01-201-21/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - 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.
* Change the mechanism by which we detect that the firmware is alreadywpaul2000-01-171-24/+19
| | | | | | | | | | | running. It turns out that trying to read the MAC address when there's no firmware creates a zero length transfer. This apparently doesn't hurt anything on a UHCI controller, but OHCI controllers generate an IOERROR, and the device doesn't initialize. Instead, check the bcdDevice revision code. We know this will be different when the firmware is running, so if we detect the firmware's code instead of the bare hardware's code, we skip the firmware load.
* Remove device name strings from vendor/product lists since we don't usewpaul2000-01-161-27/+19
| | | | | them (they're read from the device directly). Also do a set_config command for the ADMtek and CATC drivers.
* 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-7/+14
|
* Bunch of updates:wpaul2000-01-131-31/+39
| | | | | | | | | | | | | | | - 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-3/+2
| | | | | | | | | | 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.
* Straighten out the logic in kue_setmulti() a little (the case where wewpaul2000-01-111-6/+5
| | | | have no multicast entries to add is not handled right).
* Attempt to fix a problem with receiving packets on USB ethernet interfaces.wpaul2000-01-101-21/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Leave the SOFS value (number of StartOfFrames to wait while fillingwpaul2000-01-081-0/+6
| | | | | | | an URB before sending ZLP) set to the default. Choosing a bad value can apparently cause a lockup on some machines/controllers. Reported by: Doug Ambrisko
* Add the vendor and device IDs for a whole bunch of additional USBwpaul2000-01-071-0/+8
| | | | | | | | | | | | | | | | | 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.
* Cleanups: remove stale comments left over from when I cloned the ADMtekwpaul2000-01-061-16/+1
| | | | | driver, remove unused member of kue_chain struct also left over from ADMtek driver.
* Update copyright date for Y2K (did the other files but forgot this one).wpaul2000-01-051-1/+5
| | | | | Also update comments to credit to Rob Furr with donating the adapter that I used for testing. No code changes.
* Correct the vendor ID for KLSI: it's actually 0x5e9. 0x3e8 is thewpaul2000-01-051-1/+1
| | | | | vendor ID for Aox Inc, which makes the controller engine and/or firmware for the KLSI chip.
* Doh. Forgot to add the entry for the 3Com 3c19250 to the supportedwpaul2000-01-051-0/+2
| | | | devices table.
* Do not attempt to load the firmware a second time. If you reboot yourwpaul2000-01-051-1/+59
| | | | | | | | | | | | | | | | | | | | machine but leave your KLSI adapter plugged into your USB port, it may stay powered on and retain its firmware in memory. Trying to load the firmware again in this case will wedge the chip. Try to detect this in the kue_load_fw() routine and bail if the firmware is already loaded and running. Also, in the probe/match routine, force the revision code to the hardware default and force a rescan of the quirk database. This is necessary because the adapter will return a different revision code if the firmware has been loaded. Without the firmware, the revision code is 0x002. With the firmware, the revision code is 0x202. This confuses the quirk mechanism, which won't match a quirk to a device unless the revision code agrees with the quirk table entry. This makes probe/attach of these devices somewhat more reliable. Also add a few comments about the device's operation.
* Add device driver support for USB ethernet adapters based on thewpaul2000-01-051-0/+1083
Kawasaki LSI KL5KUSB101B chip, including the LinkSys USB10T, the Entrega NET-USB-E45, the Peracom USB Ethernet Adapter, the 3Com 3c19250 and the ADS Technologies USB-10BT. This device is 10mbs half-duplex only, so there's miibus or ifmedia support. This device also requires firmware to be loaded into it, however KLSI allows redistribution of the firmware images (I specifically asked about this; they said it was ok). Special thanks to Annelise Anderson for getting me in touch with KLSI (eventually) and thanks to KLSI for providing the necessary programming info. Highlights: - Add driver files to /sys/dev/usb - update usbdevs and regenerate attendate files - update usb_quirks.c - Update HARDWARE.TXT and RELNOTES.TXT for i386 and alpha - Update LINT, GENERIC and others for i386, alpha and pc98 - Add man page - Add module - Update sysinstall and userconfig.c
OpenPOWER on IntegriCloud