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
This commit is contained in:
Bill Paul 1999-12-28 02:01:18 +00:00
parent f9fe4786ef
commit ed63a7aaef
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=55162
31 changed files with 2072 additions and 31 deletions

View File

@ -85,6 +85,7 @@ static struct _devname {
{ DEVICE_TYPE_DISK, "ramrd%d", "AMI MegaRAID drive", 133, 65538, 8, 4, 'c' },
{ DEVICE_TYPE_FLOPPY, "fd%d", "floppy drive unit A", 2, 0, 64, 4, 'b' },
{ DEVICE_TYPE_FLOPPY, "worm%d", "SCSI optical disk / CDR", 23, 0, 1, 4, 'b' },
{ DEVICE_TYPE_NETWORK, "aue", "ADMtek USB ethernet adapter" },
{ DEVICE_TYPE_NETWORK, "fpa", "DEC DEFPA PCI FDDI card" },
{ DEVICE_TYPE_NETWORK, "sr", "SDL T1/E1 sync serial PCI card" },
{ DEVICE_TYPE_NETWORK, "cc3i", "SDL HSSI sync serial PCI card" },

View File

@ -366,6 +366,10 @@ Texas Instruments ThunderLAN PCI NICs, including the following:
ADMtek AL981-based PCI fast ethernet NICs
ADMtek AN985-based PCI fast ethernet NICs
ADMtek Inc. AN986-based USB ethernet NICs including the following:
LinkSys USB100TX
Billionton USB100
Melco Inc. LU-ATX
ASIX Electronics AX88140A PCI NICs, including the following:
Alfa Inc. GFC2204

View File

@ -77,18 +77,19 @@ Driver support has been added for PCI fast ethernet cards based
on the ADMtek Inc. AL981 Comet chipset. [MERGED]
Driver support has been added for PCI fast ethernet cards based
on the ADMtek Inc. AN985 Centaur chipset.
on the ADMtek Inc. AN985 Centaur chipset. [MERGED]
Support has been added for the Rise mP6 processor. [MERGED]
Driver support has been added for SysKonnect SK-984x PCI gigabit
ethernet adapters.
ethernet adapters. [MERGED]
Driver support has been added for Adaptec Duralink PCI ethernet adapters
based on the Adaptec AIC-6915 fast ethernet controller.
based on the Adaptec AIC-6915 fast ethernet controller. [MERGED]
Driver support has been added for PCI fast ethernet adapters based on
the Sundance Technologies ST201 controller, including the D-Link DFE-550TX.
[MERGED]
Driver support has been added for the 3Com 3c905C-TX. [MERGED]
@ -104,6 +105,7 @@ syslog(3) to log all messages to /var/log/security.
Driver support has been added for PCI fast ethernet adapters based on
the Silicon Integrated Systems SiS 900 and SiS 7016 ethernet controllers.
[MERGED]
Driver support has been added for PCI fast ethernet adapters based on
the Davicom DM9100 and DM9102 ethernet controllers, including the Jaton
@ -127,6 +129,12 @@ with a single driver (`dc') in order to reduce code duplication. The
new driver handles all chipsets supported by the older driver, and it
offers improved support for 10/100 cards based on the DEC/Intel 21143.
Driver support has been added for the 3Com 3c450-TX HomeConnect
PCI ethernet NIC. [MERGED]
Driver support has been added for USB ethernet adapters based on
the ADMtek AN986 Pegasus chip, including the LinkSys USB100TX.
1.2. SECURITY FIXES
-------------------
@ -353,6 +361,10 @@ Texas Instruments ThunderLAN PCI NICs, including the following:
ADMtek Inc. AL981-based PCI fast ethernet NICs
ADMtek Inc. AN985-based PCI fast ethernet NICs
ADMtek Inc. AN986-based USB ethernet NICs including the following:
LinkSys USB100TX
Billionton USB100
Melco Inc. LU-ATX
ASIX Electronics AX88140A PCI NICs, including the following:
Alfa Inc. GFC2204

View File

@ -490,6 +490,10 @@ Texas Instruments ThunderLAN PCI NICs, including the following:
ADMtek AL981-based PCI fast ethernet NICs
ADMtek AN985-based PCI fast ethernet NICs
ADMtek Inc. AN986-based USB ethernet NICs including the following:
LinkSys USB100TX
Billionton USB100
Melco Inc. LU-ATX
ASIX Electronics AX88140A PCI NICs, including the following:
Alfa Inc. GFC2204

View File

@ -79,18 +79,19 @@ Driver support has been added for PCI fast ethernet cards based
on the ADMtek Inc. AL981 Comet chipset. [MERGED]
Driver support has been added for PCI fast ethernet cards based
on the ADMtek Inc. AL985 Centaur chipset.
on the ADMtek Inc. AL985 Centaur chipset. [MERGED]
Support has been added for the Rise mP6 processor. [MERGED]
Driver support has been added for SysKonnect SK-984x PCI gigabit
ethernet adapters.
ethernet adapters. [MERGED]
Driver support has been added for Adaptec Duralink PCI ethernet adapters
based on the Adaptec AIC-6915 fast ethernet controller.
based on the Adaptec AIC-6915 fast ethernet controller. [MERGED]
Driver support has been added for PCI fast ethernet adapters based on
the Sundance Technologies ST201 controller, including the D-Link DFE-550TX.
[MERGED]
Driver support has been added for the 3Com 3c905C-TX. [MERGED]
@ -106,6 +107,7 @@ syslog(3) to log all messages to /var/log/security.
Driver support has been added for PCI fast ethernet adapters based on
the Silicon Integrated Systems SiS 900 and SiS 7016 ethernet controllers.
[MERGED]
Driver support has been added for PCI fast ethernet adapters based on
the Davicom DM9100 and DM9102 ethernet controllers, including the Jaton
@ -129,6 +131,12 @@ with a single driver (`dc') in order to reduce code duplication. The
new driver handles all chipsets supported by the older drivers, and it
offers improved support for 10/100 cards based on the DEC/Intel 21143.
Driver support has been added for the 3Com 3c450-TX HomeConnect
PCI ethernet NIC. [MERGED]
Driver support has been added for USB ethernet adapters based on
the ADMtek AN986 Pegasus chip, including the LinkSys USB100TX.
1.2. SECURITY FIXES
-------------------
@ -359,6 +367,10 @@ Texas Instruments ThunderLAN PCI NICs, including the following:
ADMtek Inc. AL981-based PCI fast ethernet NICs
ADMtek Inc. AN985-based PCI fast ethernet NICs
ADMtek Inc. AN986-based USB ethernet NICs including the following:
LinkSys USB100TX
Billionton USB100
Melco Inc. LU-ATX
ASIX Electronics AX88140A PCI NICs, including the following:
Alfa Inc. GFC2204

View File

@ -1,7 +1,7 @@
# @(#)Makefile 8.1 (Berkeley) 6/18/93
# $FreeBSD$
MAN4= ahc.4 alpm.4 amd.4 atkbd.4 atkbdc.4 blackhole.4 bpf.4 \
MAN4= ahc.4 alpm.4 amd.4 atkbd.4 atkbdc.4 aue.4 blackhole.4 bpf.4 \
bridge.4 ccd.4 cd.4 ch.4 da.4 dc.4 ddb.4 de.4 \
divert.4 drum.4 dummynet.4 fd.4 fdc.4 fpa.4 fxp.4 \
icmp.4 ifmib.4 iic.4 iicbb.4 iicbus.4 iicsmb.4 \

142
share/man/man4/aue.4 Normal file
View File

@ -0,0 +1,142 @@
.\" Copyright (c) 1997, 1998, 1999
.\" Bill Paul <wpaul@ee.columbia.edu>. All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in the
.\" documentation and/or other materials provided with the distribution.
.\" 3. All advertising materials mentioning features or use of this software
.\" must display the following acknowledgement:
.\" This product includes software developed by Bill Paul.
.\" 4. Neither the name of the author nor the names of any co-contributors
.\" may be used to endorse or promote products derived from this software
.\" without specific prior written permission.
.\"
.\" THIS SOFTWARE IS PROVIDED BY Bill Paul AND CONTRIBUTORS ``AS IS'' AND
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
.\" ARE DISCLAIMED. IN NO EVENT SHALL Bill Paul OR THE VOICES IN HIS HEAD
.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
.\" THE POSSIBILITY OF SUCH DAMAGE.
.\"
.\" $FreeBSD$
.\"
.Dd December 25, 1999
.Dt AUE 4 i386
.Os FreeBSD
.Sh NAME
.Nm aue
.Nd
ADMtek AN986 Pegasus USB Ethernet driver
.Sh SYNOPSIS
.Cd "controller uhci0"
.Cd "controller ohci0"
.Cd "controller usb0"
.Cd "controller miibus0"
.Cd "device aue0"
.Sh DESCRIPTION
The
.Nm
driver provides support for USB ethernet adapters based on the ADMtek
AN986 Pegasus chipset, including the LinkSys USB100TX, the Billionton
Systems USB100 and the Melco Inc. LU-ATX. The Pegasus contains a 10/100
ethernet MAC with MII interface and is designed to work with both
ethernet and HomePNA transceivers. Although designed to interface with
100Mbps peripherals, the existing USB standard specifies a maximum
transfer speed of 12Mbps. Users should therefore not expect to actually
achieve 100Mbps speeds with these devices.
.Pp
The Pegasus supports a 64-bit multicast hash table, single perfect
filter entry for the station address and promiscuous mode. Packets are
received and transmitted over separate USB bulk transfer endpoints.
.Pp
The
.Nm
driver supports the following media types:
.Pp
.Bl -tag -width xxxxxxxxxxxxxxxxxxxx
.It autoselect
Enable autoselection of the media type and options.
The user can manually override
the autoselected mode by adding media options to the
.Pa /etc/rc.conf
file.
.It 10baseT/UTP
Set 10Mbps operation. The
.Ar mediaopt
option can also be used to enable
.Ar full-duplex
operation. Not specifying
.Ar full duplex
implies
.Ar half-duplex
mode.
.It 100baseTX
Set 100Mbps (fast ethernet) operation. The
.Ar mediaopt
option can also be used to enable
.Ar full-duplex
operation. Not specifying
.Ar full duplex
implies
.Ar half-duplex
mode.
.El
.Pp
The
.Nm
driver supports the following media options:
.Pp
.Bl -tag -width xxxxxxxxxxxxxxxxxxxx
.It full-duplex
Force full duplex operation. The interface will operate in
half duplex mode if this media option is not specified.
.El
.Pp
For more information on configuring this device, see
.Xr ifconfig 8 .
.Sh DIAGNOSTICS
.Bl -diag
.It "aue%d: watchdog timeout"
A packet was queued for transmission and a transmit command was
issued, however the device failed to acknowledge the transmission
before a timeout expired.
.It "aue%d: no memory for rx list"
The driver failed to allocate an mbuf for the receiver ring.
.El
.Sh SEE ALSO
.Xr arp 4 ,
.Xr netintro 4 ,
.Xr ifconfig 8
.Rs
.%T ADMtek AN986 data sheet
.%O http://www.admtek.com.tw
.Re
.Sh HISTORY
The
.Nm
device driver first appeared in
.Fx 4.0 .
.Sh AUTHORS
The
.Nm
driver was written by
.An Bill Paul Aq wpaul@ee.columbia.edu .
.Sh BUGS
For some reason, outgoing bulk transfers (i.e. packet transmissions)
fail if the transfer is exactly a multiple of 64 bytes in size. The
.Nm
driver works around this by padding such transfers up by one additional
byte. This does not affect connectivity, however it does cause packets
to occasionaly appear on the wire with one additional byte for no good
reason. It is not known if this bug is due to a problem with Pegasus
chip itself or some peculiarity of the underlying USB support.

View File

@ -153,3 +153,4 @@ pseudo-device bpf #Berkeley packet filter
#device ulpt0 # Printer
#controller umass0 # Disks/Mass storage - Requires scbus and da0
#device ums0 # Mouse
#device aue0 # ADMtek USB ethernet

View File

@ -153,3 +153,4 @@ pseudo-device bpf #Berkeley packet filter
#device ulpt0 # Printer
#controller umass0 # Disks/Mass storage - Requires scbus and da0
#device ums0 # Mouse
#device aue0 # ADMtek USB ethernet

View File

@ -214,3 +214,4 @@ pseudo-device bpf #Berkeley packet filter
#device ulpt0 # Printer
#controller umass0 # Disks/Mass storage - Requires scbus and da0
#device ums0 # Mouse
#device aue0 # ADMtek USB ethernet

View File

@ -166,7 +166,7 @@ ukbd_load="NO" # Keyboard
ulpt_load="NO" # Printer
ums_load="NO" # Mouse
umass_load="NO" # Mass Storage Devices
if_aue_load="NO" # ADMtek USB ethernet
##############################################################
### Other modules ##########################################

View File

@ -2328,6 +2328,10 @@ controller umass0
# USB mouse
device ums0
#
# ADMtek USB ethernet. Supports the LinkSys USB100TX,
# the Billionton USB100 and the Melco LU-ATX NICs. Also
# works with the ADMtek AN986 Pegasus eval board.
device aue0
# debugging options for the USB subsystem
#

View File

@ -877,6 +877,7 @@ dev/usb/ulpt.c optional ulpt
dev/usb/ukbd.c optional ukbd
dev/usb/umass.c optional umass
dev/usb/uhub.c optional usb
dev/usb/if_aue.c optional aue
isa_if.o optional isa \
dependency "isa_if.c isa_if.h" \
compile-with "${NORMAL_C}" \

1517
sys/dev/usb/if_aue.c Normal file

File diff suppressed because it is too large Load Diff

253
sys/dev/usb/if_auereg.h Normal file
View File

@ -0,0 +1,253 @@
/*
* Copyright (c) 1997, 1998, 1999
* Bill Paul <wpaul@ee.columbia.edu>. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by Bill Paul.
* 4. Neither the name of the author nor the names of any co-contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY Bill Paul AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL Bill Paul OR THE VOICES IN HIS HEAD
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*
* $FreeBSD$
*/
/*
* Register definitions for ADMtek Pegasus AN986 USB to Ethernet
* chip. The Pegasus uses a total of four USB endpoints: the control
* endpoint (0), a bulk read endpoint for receiving packets (1),
* a bulk write endpoint for sending packets (2) and an interrupt
* endpoint for passing RX and TX status (3). Endpoint 0 is used
* to read and write the ethernet module's registers. All registers
* are 8 bits wide.
*
* Packet transfer is done in 64 byte chunks. The last chunk in a
* transfer is denoted by having a length less that 64 bytes. For
* the RX case, the data includes an optional RX status word.
*/
#define AUE_VENDORID_ADMTEK 0x07A6
#define AUE_DEVICEID_PEGASUS 0x0986
#define AUE_VENDORID_BILLIONTON 0x08DD
#define AUE_DEVICEID_USB100 0x0986
#define AUE_VENDORID_MELCO 0x0411
#define AUE_DEVICEID_LUATX 0x0001
#define AUE_UR_READREG 0xF0
#define AUE_UR_WRITEREG 0xF1
/*
* Note that while the ADMtek technically has four
* endpoints, the control endpoint (endpoint 0) is
* regarded as special by the USB code and drivers
* don't have direct access to it. (We access it
* using usbd_do_request() when reading/writing
* registers.) Consequently, our endpoint indexes
* don't match those in the ADMtek Pegasus manual:
* we consider the RX data endpoint to be index 0
* and work up from there.
*/
#define AUE_ENDPT_RX 0x0
#define AUE_ENDPT_TX 0x1
#define AUE_ENDPT_INTR 0x2
#define AUE_ENDPT_MAX 0x3
#define AUE_INTR_PKTLEN 0x8
#define AUE_CTL0 0x00
#define AUE_CTL1 0x01
#define AUE_CTL2 0x02
#define AUE_MAR0 0x08
#define AUE_MAR1 0x09
#define AUE_MAR2 0x0A
#define AUE_MAR3 0x0B
#define AUE_MAR4 0x0C
#define AUE_MAR5 0x0D
#define AUE_MAR6 0x0E
#define AUE_MAR7 0x0F
#define AUE_MAR AUE_MAR0
#define AUE_PAR0 0x10
#define AUE_PAR1 0x11
#define AUE_PAR2 0x12
#define AUE_PAR3 0x13
#define AUE_PAR4 0x14
#define AUE_PAR5 0x15
#define AUE_PAR AUE_PAR0
#define AUE_PAUSE0 0x18
#define AUE_PAUSE1 0x19
#define AUE_PAUSE AUE_PAUSE0
#define AUE_RX_FLOWCTL_CNT 0x1A
#define AUE_RX_FLOWCTL_FIFO 0x1B
#define AUE_EE_REG 0x20
#define AUE_EE_DATA0 0x21
#define AUE_EE_DATA1 0x22
#define AUE_EE_DATA AUE_EE_DATA0
#define AUE_EE_CTL 0x23
#define AUE_PHY_ADDR 0x25
#define AUE_PHY_DATA0 0x26
#define AUE_PHY_DATA1 0x27
#define AUE_PHY_DATA AUE_PHY_DATA0
#define AUE_PHY_CTL 0x28
#define AUE_USB_STS 0x2A
#define AUE_TXSTAT0 0x2B
#define AUE_TXSTAT1 0x2C
#define AUE_TXSTAT AUE_TXSTAT0
#define AUE_RXSTAT 0x2D
#define AUE_PKTLOST0 0x2E
#define AUE_PKTLOST1 0x2F
#define AUE_PKTLOST AUE_PKTLOST0
#define AUE_GPIO0 0x7E
#define AUE_GPIO1 0x7F
#define AUE_CTL0_INCLUDE_RXCRC 0x01
#define AUE_CTL0_ALLMULTI 0x02
#define AUE_CTL0_STOP_BACKOFF 0x04
#define AUE_CTL0_RXSTAT_APPEND 0x08
#define AUE_CTL0_WAKEON_ENB 0x10
#define AUE_CTL0_RXPAUSE_ENB 0x20
#define AUE_CTL0_RX_ENB 0x40
#define AUE_CTL0_TX_ENB 0x80
#define AUE_CTL1_HOMELAN 0x04
#define AUE_CTL1_RESETMAC 0x08
#define AUE_CTL1_SPEEDSEL 0x10 /* 0 = 10mbps, 1 = 100mbps */
#define AUE_CTL1_DUPLEX 0x20 /* 0 = half, 1 = full */
#define AUE_CTL1_DELAYHOME 0x40
#define AUE_CTL2_EP3_CLR 0x01 /* reading EP3 clrs status regs */
#define AUE_CTL2_RX_BADFRAMES 0x02
#define AUE_CTL2_RX_PROMISC 0x04
#define AUE_CTL2_LOOPBACK 0x08
#define AUE_CTL2_EEPROMWR_ENB 0x10
#define AUE_CTL2_EEPROM_LOAD 0x20
#define AUE_EECTL_WRITE 0x01
#define AUE_EECTL_READ 0x02
#define AUE_EECTL_DONE 0x04
#define AUE_PHYCTL_PHYREG 0x1F
#define AUE_PHYCTL_WRITE 0x20
#define AUE_PHYCTL_READ 0x40
#define AUE_PHYCTL_DONE 0x80
#define AUE_USBSTS_SUSPEND 0x01
#define AUE_USBSTS_RESUME 0x02
#define AUE_TXSTAT0_JABTIMO 0x04
#define AUE_TXSTAT0_CARLOSS 0x08
#define AUE_TXSTAT0_NOCARRIER 0x10
#define AUE_TXSTAT0_LATECOLL 0x20
#define AUE_TXSTAT0_EXCESSCOLL 0x40
#define AUE_TXSTAT0_UNDERRUN 0x80
#define AUE_TXSTAT1_PKTCNT 0x0F
#define AUE_TXSTAT1_FIFO_EMPTY 0x40
#define AUE_TXSTAT1_FIFO_FULL 0x80
#define AUE_RXSTAT_OVERRUN 0x01
#define AUE_RXSTAT_PAUSE 0x02
#define AUE_GPIO_IN0 0x01
#define AUE_GPIO_OUT0 0x02
#define AUE_GPIO_SEL0 0x04
#define AUE_GPIO_IN1 0x08
#define AUE_GPIO_OUT1 0x10
#define AUE_GPIO_SEL1 0x20
struct aue_intrpkt {
u_int8_t aue_txstat0;
u_int8_t aue_txstat1;
u_int8_t aue_rxstat;
u_int8_t aue_rxlostpkt0;
u_int8_t aue_rxlostpkt1;
u_int8_t aue_wakeupstat;
u_int8_t aue_rsvd;
};
struct aue_rxpkt {
u_int16_t aue_pktlen;
u_int8_t aue_rxstat;
};
#define AUE_RXSTAT_MCAST 0x01
#define AUE_RXSTAT_GIANT 0x02
#define AUE_RXSTAT_RUNT 0x04
#define AUE_RXSTAT_CRCERR 0x08
#define AUE_RXSTAT_DRIBBLE 0x10
#define AUE_RXSTAT_MASK 0x1E
struct aue_type {
u_int16_t aue_vid;
u_int16_t aue_did;
char *aue_name;
};
#define AUE_TX_LIST_CNT 1
#define AUE_RX_LIST_CNT 1
struct aue_softc;
struct aue_chain {
struct aue_softc *aue_sc;
usbd_xfer_handle aue_xfer;
char *aue_buf;
struct mbuf *aue_mbuf;
int aue_accum;
int aue_idx;
};
struct aue_cdata {
struct aue_chain aue_tx_chain[AUE_TX_LIST_CNT];
struct aue_chain aue_rx_chain[AUE_RX_LIST_CNT];
struct aue_intrpkt *aue_ibuf;
int aue_tx_prod;
int aue_tx_cons;
int aue_tx_cnt;
int aue_rx_prod;
};
#define AUE_INC(x, y) (x) = (x + 1) % y
struct aue_softc {
struct arpcom arpcom;
device_t aue_miibus;
usbd_device_handle aue_udev;
usbd_interface_handle aue_iface;
int aue_ed[AUE_ENDPT_MAX];
usbd_pipe_handle aue_ep[AUE_ENDPT_MAX];
int aue_unit;
u_int8_t aue_link;
int aue_if_flags;
struct aue_cdata aue_cdata;
struct callout_handle aue_stat_ch;
};
#define AUE_TIMEOUT 1000
#define ETHER_ALIGN 2
#define AUE_BUFSZ 1536
#define AUE_CUTOFF 1088
#define AUE_MIN_FRAMELEN 60

View File

@ -66,6 +66,10 @@ static struct usbd_quirk_entry {
{ USB_VENDOR_LOGITECH, USB_PRODUCT_LOGITECH_N48, 0x110, { UQ_MS_REVZ }},
{ USB_VENDOR_ALTEC, USB_PRODUCT_ALTEC_ASC495, 0x000, { UQ_BAD_AUDIO }},
{ USB_VENDOR_QTRONIX, USB_PRODUCT_QTRONIX_980N, 0x110, { UQ_SPUR_BUT_UP }},
{ USB_VENDOR_ADMTEK, USB_PRODUCT_ADMTEK_PEGASUS, 0x101, { UQ_NO_TSLEEP }},
{ USB_VENDOR_BILLIONTON, USB_PRODUCT_BILLIONTON_USB100,
0x101, { UQ_NO_TSLEEP }},
{ USB_VENDOR_MELCO, USB_PRODUCT_MELCO_LUATX, 0x101, { UQ_NO_TSLEEP }},
{ 0, 0, 0, { 0 } }
};

View File

@ -48,6 +48,8 @@ struct usbd_quirks {
#define UQ_BUS_POWERED 0x20 /* device is bus powered, despite claim */
#define UQ_BAD_AUDIO 0x40 /* device claims audio class, but isn't */
#define UQ_SPUR_BUT_UP 0x80 /* spurious mouse button up events */
#define UQ_NO_TSLEEP 0x100 /* device needs to work at interrupt
* context, must avoid tsleep! */
};
extern struct usbd_quirks usbd_no_quirk;

View File

@ -44,6 +44,7 @@ $FreeBSD$
vendor HP 0x03f0 Hewlett Packard
vendor NEC 0x0409 NEC
vendor KODAK 0x040a Eastman Kodak Corp.
vendor MELCO 0x0411 Melco Inc.
vendor CATC 0x0423 Computer Access Technology Corp.
vendor GRAVIS 0x0428 Advanced Gravis Computer Tech. Ltd.
vendor LEXMARK 0x043d Lexmark International Inc.
@ -101,9 +102,11 @@ vendor MULTITECH 0x06e0 MultiTech
vendor ADS 0x06e1 ADS Technologies
vendor MIDIMAN 0x0763 Midiman
vendor SANDISK 0x0781 SanDisk Corp
vendor ADMTEK 0x07a6 ADMtek Inc.
vendor SIIG 0x07cc SIIG
vendor HANDSPRING 0x082d Handspring Inc.
vendor ACTIVEWIRE 0x0854 ActiveWire Inc.
vendor BILLIONTON 0x08DD Billionton Systems
vendor MOTOROLA 0x1063 Motorola
vendor PLX 0x10b5 PLX
vendor INSIDEOUT 0x1608 Inside Out Networks
@ -127,6 +130,9 @@ product KODAK DC260 0x0110 Digital Science DC260
product KODAK DC240 0x0120 Digital Science DC240
product KODAK DC280 0x0130 Digital Science DC280
/* Melco products */
product MELCO LUATX 0x0001 LU-ATX Ethernet adapter
/* CATC products */
product CATC ANDROMEDA 0x1237 Andromeda hub
product CATC CHIEF 0x000d USB Chief Bus & Protocol Analyzer
@ -314,6 +320,9 @@ product MIDIMAN MIDISPORT2X2 0x1001 Midisport 2x2
/* SanDisk products */
product SANDISK IMAGEMATE 0x0001 USB ImageMate
/* ADMtek products */
product ADMTEK PEGASUS 0x0986 AN986 USB Ethernet adapter
/* SIIG products */
product SIIG DIGIFILMREADER 0x0004 DigiFilm-Combo Reader
@ -324,6 +333,9 @@ product HANDSPRING VISOR 0x0100 Handspring Visor
product ACTIVEWIRE IOBOARD 0x0100 I/O Board
product ACTIVEWIRE IOBOARD_FW1 0x0101 I/O Board, rev. 1 firmware
/* Billionton products */
product BILLIONTON USB100 0x0986 USB100 Ethernet adapter
/* Motorola products */
product MOTOROLA MC141555 0x1555 MC141555 hub controller

View File

@ -51,6 +51,7 @@
#define USB_VENDOR_HP 0x03f0 /* Hewlett Packard */
#define USB_VENDOR_NEC 0x0409 /* NEC */
#define USB_VENDOR_KODAK 0x040a /* Eastman Kodak Corp. */
#define USB_VENDOR_MELCO 0x0411 /* Melco Inc. */
#define USB_VENDOR_CATC 0x0423 /* Computer Access Technology Corp. */
#define USB_VENDOR_GRAVIS 0x0428 /* Advanced Gravis Computer Tech. Ltd. */
#define USB_VENDOR_LEXMARK 0x043d /* Lexmark International Inc. */
@ -81,7 +82,6 @@
#define USB_VENDOR_BELKIN 0x050d /* Belkin Components */
#define USB_VENDOR_KAWATSU 0x050f /* Kawatsu Semiconductor, Inc. */
#define USB_VENDOR_APC 0x051d /* American Power Conversion */
#define USB_VENDOR_NETCHIP 0x0525 /* NetChip Technology */
#define USB_VENDOR_AKS 0x0529 /* Fast Security AG */
#define USB_VENDOR_UNIACCESS 0x0540 /* Universal Access */
#define USB_VENDOR_ANCHOR 0x0547 /* Anchor Chips Inc. */
@ -109,9 +109,11 @@
#define USB_VENDOR_ADS 0x06e1 /* ADS Technologies */
#define USB_VENDOR_MIDIMAN 0x0763 /* Midiman */
#define USB_VENDOR_SANDISK 0x0781 /* SanDisk Corp */
#define USB_VENDOR_ADMTEK 0x07a6 /* ADMtek Inc. */
#define USB_VENDOR_SIIG 0x07cc /* SIIG */
#define USB_VENDOR_HANDSPRING 0x082d /* Handspring Inc. */
#define USB_VENDOR_ACTIVEWIRE 0x0854 /* ActiveWire Inc. */
#define USB_VENDOR_BILLIONTON 0x08DD /* Billionton Systems */
#define USB_VENDOR_MOTOROLA 0x1063 /* Motorola */
#define USB_VENDOR_PLX 0x10b5 /* PLX */
#define USB_VENDOR_INSIDEOUT 0x1608 /* Inside Out Networks */
@ -135,9 +137,12 @@
#define USB_PRODUCT_KODAK_DC240 0x0120 /* Digital Science DC240 */
#define USB_PRODUCT_KODAK_DC280 0x0130 /* Digital Science DC280 */
/* Melco products */
#define USB_PRODUCT_MELCO_LUATX 0x0001 /* LU-ATX Ethernet adapter */
/* CATC products */
#define USB_PRODUCT_CATC_CHIEF 0x000d /* USB Chief Bus & Protocol Analyzer */
#define USB_PRODUCT_CATC_ANDROMEDA 0x1237 /* Andromeda hub */
#define USB_PRODUCT_CATC_CHIEF 0x000d /* USB Chief Bus & Protocol Analyzer */
/* Gravis products */
#define USB_PRODUCT_GRAVIS_GAMEPADPRO 0x4001 /* GamePad Pro */
@ -226,9 +231,6 @@
/* American Power Conversion products */
#define USB_PRODUCT_APC_UPSPRO500 0x0002 /* Back-UPS Pro 500 */
/* NetChip Technology Products */
#define USB_PRODUCT_NETCHIP_TURBOCONNECT 0x1080 /* Turbo-Connect */
/* AKS products */
#define USB_PRODUCT_AKS_USBHASP 0x0001 /* USB-HASP 0.06 */
@ -325,6 +327,9 @@
/* SanDisk products */
#define USB_PRODUCT_SANDISK_IMAGEMATE 0x0001 /* USB ImageMate */
/* ADMtek products */
#define USB_PRODUCT_ADMTEK_PEGASUS 0x0986 /* AN986 USB Ethernet adapter */
/* SIIG products */
#define USB_PRODUCT_SIIG_DIGIFILMREADER 0x0004 /* DigiFilm-Combo Reader */
@ -335,6 +340,9 @@
#define USB_PRODUCT_ACTIVEWIRE_IOBOARD 0x0100 /* I/O Board */
#define USB_PRODUCT_ACTIVEWIRE_IOBOARD_FW1 0x0101 /* I/O Board, rev. 1 firmware */
/* Billionton products */
#define USB_PRODUCT_BILLIONTON_USB100 0x0986 /* USB100 Ethernet adapter */
/* Motorola products */
#define USB_PRODUCT_MOTOROLA_MC141555 0x1555 /* MC141555 hub controller */

View File

@ -88,10 +88,10 @@ struct usb_knowndev usb_knowndevs[] = {
"Digital Science DC280",
},
{
USB_VENDOR_CATC, USB_PRODUCT_CATC_CHIEF,
USB_VENDOR_MELCO, USB_PRODUCT_MELCO_LUATX,
0,
"Computer Access Technology Corp.",
"USB Chief Bus & Protocol Analyzer",
"Melco Inc.",
"LU-ATX Ethernet adapter",
},
{
USB_VENDOR_CATC, USB_PRODUCT_CATC_ANDROMEDA,
@ -99,6 +99,12 @@ struct usb_knowndev usb_knowndevs[] = {
"Computer Access Technology Corp.",
"Andromeda hub",
},
{
USB_VENDOR_CATC, USB_PRODUCT_CATC_CHIEF,
0,
"Computer Access Technology Corp.",
"USB Chief Bus & Protocol Analyzer",
},
{
USB_VENDOR_GRAVIS, USB_PRODUCT_GRAVIS_GAMEPADPRO,
0,
@ -309,12 +315,6 @@ struct usb_knowndev usb_knowndevs[] = {
"American Power Conversion",
"Back-UPS Pro 500",
},
{
USB_VENDOR_NETCHIP, USB_PRODUCT_NETCHIP_TURBOCONNECT,
0,
"NetChip Technology",
"Turbo-Connect",
},
{
USB_VENDOR_AKS, USB_PRODUCT_AKS_USBHASP,
0,
@ -567,6 +567,12 @@ struct usb_knowndev usb_knowndevs[] = {
"SanDisk Corp",
"USB ImageMate",
},
{
USB_VENDOR_ADMTEK, USB_PRODUCT_ADMTEK_PEGASUS,
0,
"ADMtek Inc.",
"AN986 USB Ethernet adapter",
},
{
USB_VENDOR_SIIG, USB_PRODUCT_SIIG_DIGIFILMREADER,
0,
@ -591,6 +597,12 @@ struct usb_knowndev usb_knowndevs[] = {
"ActiveWire Inc.",
"I/O Board, rev. 1 firmware",
},
{
USB_VENDOR_BILLIONTON, USB_PRODUCT_BILLIONTON_USB100,
0,
"Billionton Systems",
"USB100 Ethernet adapter",
},
{
USB_VENDOR_MOTOROLA, USB_PRODUCT_MOTOROLA_MC141555,
0,
@ -633,6 +645,12 @@ struct usb_knowndev usb_knowndevs[] = {
"Eastman Kodak Corp.",
NULL,
},
{
USB_VENDOR_MELCO, 0,
USB_KNOWNDEV_NOPROD,
"Melco Inc.",
NULL,
},
{
USB_VENDOR_CATC, 0,
USB_KNOWNDEV_NOPROD,
@ -813,12 +831,6 @@ struct usb_knowndev usb_knowndevs[] = {
"American Power Conversion",
NULL,
},
{
USB_VENDOR_NETCHIP, 0,
USB_KNOWNDEV_NOPROD,
"NetChip Technology",
NULL,
},
{
USB_VENDOR_AKS, 0,
USB_KNOWNDEV_NOPROD,
@ -981,6 +993,12 @@ struct usb_knowndev usb_knowndevs[] = {
"SanDisk Corp",
NULL,
},
{
USB_VENDOR_ADMTEK, 0,
USB_KNOWNDEV_NOPROD,
"ADMtek Inc.",
NULL,
},
{
USB_VENDOR_SIIG, 0,
USB_KNOWNDEV_NOPROD,
@ -999,6 +1017,12 @@ struct usb_knowndev usb_knowndevs[] = {
"ActiveWire Inc.",
NULL,
},
{
USB_VENDOR_BILLIONTON, 0,
USB_KNOWNDEV_NOPROD,
"Billionton Systems",
NULL,
},
{
USB_VENDOR_MOTOROLA, 0,
USB_KNOWNDEV_NOPROD,

View File

@ -56,12 +56,14 @@
#include <sys/proc.h>
#include <machine/bus.h>
#include <machine/clock.h>
#include <dev/usb/usb.h>
#include <dev/usb/usbdi.h>
#include <dev/usb/usbdi_util.h>
#include <dev/usb/usbdivar.h>
#include <dev/usb/usb_mem.h>
#include <dev/usb/usb_quirks.h>
#if defined(__FreeBSD__)
#include "usb_if.h"
@ -297,7 +299,18 @@ usbd_transfer(xfer)
if (!xfer->done) {
if (pipe->device->bus->use_polling)
panic("usbd_transfer: not done\n");
tsleep(xfer, PRIBIO, "usbsyn", 0);
if (pipe->device->quirks->uq_flags & UQ_NO_TSLEEP) {
int i;
for (i = 0; i < xfer->timeout + 1; i++) {
DELAY(1);
pipe->device->bus->methods->do_poll(pipe->device->bus);
if (xfer->done)
break;
}
if (!xfer->done)
pipe->methods->abort(xfer);
} else
tsleep(xfer, PRIBIO, "usbsyn", 0);
}
splx(s);
return (xfer->status);

View File

@ -214,3 +214,4 @@ pseudo-device bpf #Berkeley packet filter
#device ulpt0 # Printer
#controller umass0 # Disks/Mass storage - Requires scbus and da0
#device ums0 # Mouse
#device aue0 # ADMtek USB ethernet

View File

@ -2328,6 +2328,10 @@ controller umass0
# USB mouse
device ums0
#
# ADMtek USB ethernet. Supports the LinkSys USB100TX,
# the Billionton USB100 and the Melco LU-ATX NICs. Also
# works with the ADMtek AN986 Pegasus eval board.
device aue0
# debugging options for the USB subsystem
#

View File

@ -224,5 +224,6 @@ pseudo-device bpf #Berkeley packet filter
#device ulpt0 # Printer
#controller umass0 # Disks/Mass storage - Requires scbus and da0
#device ums0 # Mouse
#device aue0 # ADMtek USB ethernet
options DDB

View File

@ -2328,6 +2328,10 @@ controller umass0
# USB mouse
device ums0
#
# ADMtek USB ethernet. Supports the LinkSys USB100TX,
# the Billionton USB100 and the Melco LU-ATX NICs. Also
# works with the ADMtek AN986 Pegasus eval board.
device aue0
# debugging options for the USB subsystem
#

View File

@ -215,3 +215,4 @@ pseudo-device bpf #Berkeley packet filter
#device ulpt0 # Printer
#controller umass0 # Disks/Mass storage - Requires scbus and da0
#device ums0 # Mouse
#device aue0 # ADMtek USB ethernet

View File

@ -377,6 +377,7 @@ static DEV_INFO device_info[] = {
{"amd", "Tekram DC-390(T) / AMD 53c974 based PCI SCSI", FLG_FIXED, CLS_STORAGE},
{"plip", "Parallel Port IP link", FLG_FIXED, CLS_NETWORK},
{"aue", "ADMtek AN986 USB ethernet adapter", FLG_FIXED, CLS_NETWORK},
{"cs", "IBM EtherJet, CS89x0-based Ethernet adapters",0, CLS_NETWORK},
{"ed", "NE1000,NE2000,3C503,WD/SMC80xx Ethernet adapters",0, CLS_NETWORK},
{"el", "3C501 Ethernet adapter", 0, CLS_NETWORK},

View File

@ -2,8 +2,8 @@
# XXX present but broken: ip_mroute_mod pcic
SUBDIR= aha amr ccd cd9660 coda dc fdesc fxp if_disc if_ef if_ppp if_sl \
if_tun ipfilter ipfw joy kernfs md mfs mii mlx msdos \
SUBDIR= aha amr aue ccd cd9660 coda dc fdesc fxp if_disc if_ef if_ppp \
if_sl if_tun ipfilter ipfw joy kernfs md mfs mii mlx msdos \
ncp netgraph nfs ntfs nullfs \
nwfs portal procfs rl sf sis sk ste ti tl \
ugen uhid ukbd ulpt umapfs umass umodem ums union usb vn vr wb xl

11
sys/modules/aue/Makefile Normal file
View File

@ -0,0 +1,11 @@
# $FreeBSD$
S = ${.CURDIR}/../..
.PATH: $S/dev/usb
KMOD = if_aue
SRCS = if_aue.c opt_bdg.h opt_usb.h device_if.h bus_if.h
SRCS += miibus_if.h
CFLAGS += ${DEBUG_FLAGS}
KMODDEPS = miibus
.include <bsd.kmod.mk>

View File

@ -85,6 +85,7 @@ static struct _devname {
{ DEVICE_TYPE_DISK, "ramrd%d", "AMI MegaRAID drive", 133, 65538, 8, 4, 'c' },
{ DEVICE_TYPE_FLOPPY, "fd%d", "floppy drive unit A", 2, 0, 64, 4, 'b' },
{ DEVICE_TYPE_FLOPPY, "worm%d", "SCSI optical disk / CDR", 23, 0, 1, 4, 'b' },
{ DEVICE_TYPE_NETWORK, "aue", "ADMtek USB ethernet adapter" },
{ DEVICE_TYPE_NETWORK, "fpa", "DEC DEFPA PCI FDDI card" },
{ DEVICE_TYPE_NETWORK, "sr", "SDL T1/E1 sync serial PCI card" },
{ DEVICE_TYPE_NETWORK, "cc3i", "SDL HSSI sync serial PCI card" },

View File

@ -85,6 +85,7 @@ static struct _devname {
{ DEVICE_TYPE_DISK, "ramrd%d", "AMI MegaRAID drive", 133, 65538, 8, 4, 'c' },
{ DEVICE_TYPE_FLOPPY, "fd%d", "floppy drive unit A", 2, 0, 64, 4, 'b' },
{ DEVICE_TYPE_FLOPPY, "worm%d", "SCSI optical disk / CDR", 23, 0, 1, 4, 'b' },
{ DEVICE_TYPE_NETWORK, "aue", "ADMtek USB ethernet adapter" },
{ DEVICE_TYPE_NETWORK, "fpa", "DEC DEFPA PCI FDDI card" },
{ DEVICE_TYPE_NETWORK, "sr", "SDL T1/E1 sync serial PCI card" },
{ DEVICE_TYPE_NETWORK, "cc3i", "SDL HSSI sync serial PCI card" },