Commit Graph

9 Commits

Author SHA1 Message Date
Bill Paul
e562c84330 Fix instance of AUE_BUFSZ that should have been AUE_CUTOFF. 2000-01-13 23:40:00 +00:00
Bill Paul
c76ce56239 Remove debug printf I left in by mistake. 2000-01-13 20:53:49 +00:00
Bill Paul
4f0a6f0403 Bunch of updates:
- 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.
2000-01-13 20:13:58 +00:00
Bill Paul
502c509ce0 Apply the same netisr mechanism to transmissions as well. In order to
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.
2000-01-12 17:46:40 +00:00
Bill Paul
a0067d7b89 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
2000-01-10 23:12:54 +00:00
Bill Paul
61ebfeecad Add the vendor/device IDs for the LinkSys USB100TX.
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.
2000-01-08 07:32:48 +00:00
Bill Paul
dd3e57dac6 Be a bit more discriminating when trying to decide when to screen out
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.
2000-01-08 06:52:36 +00:00
Bill Paul
d04bb221f3 Add the vendor and device IDs for a whole bunch of additional USB
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.
2000-01-07 22:18:49 +00:00
Bill Paul
ed63a7aaef This commit adds device driver support for the ADMtek AN986 Pegasus
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
1999-12-28 02:01:18 +00:00