Import Kevin Lo's port of urtwn(4) from OpenBSD. urtwn(4) is a driver for the

Realtek RTL8188CU/RTL8192CU USB IEEE 802.11b/g/n wireless cards.
This driver requires microcode which is available in FreeBSD ports:
net/urtwn-firmware-kmod.

Hiren ported the urtwn(4) man page from OpenBSD and Glen just commited a port
for the firmware.

TODO:
- 802.11n support
- Stability fixes - the driver can sustain lots of traffic but has trouble
coping with simultaneous iperf sessions.
- fix debugging

MFC after:	2 months
Tested by:	kevlo, hiren, gjb
This commit is contained in:
rpaulo 2013-06-08 16:02:31 +00:00
parent a1d0d12367
commit 8f36fe887a
9 changed files with 5132 additions and 1 deletions

View File

@ -516,6 +516,7 @@ MAN= aac.4 \
ural.4 \
urio.4 \
${_urtw.4} \
urtwn.4 \
usb.4 \
usb_quirk.4 \
uslcom.4 \

140
share/man/man4/urtwn.4 Normal file
View File

@ -0,0 +1,140 @@
.\" $OpenBSD: urtwn.4,v 1.20 2013/05/16 10:02:59 sthen Exp $
.\" $FreeBSD$
.\"
.\" Copyright (c) 2010 Damien Bergamini <damien.bergamini@free.fr>
.\"
.\" Permission to use, copy, modify, and distribute this software for any
.\" purpose with or without fee is hereby granted, provided that the above
.\" copyright notice and this permission notice appear in all copies.
.\"
.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
.Dd July 7, 2013
.Dt URTWN 4
.Os
.Sh NAME
.Nm urtwn
.Nd Realtek RTL8188CU/RTL8192CU USB IEEE 802.11b/g/n wireless network device
.Sh SYNOPSIS
To compile this driver into the kernel,
place the following lines in your
kernel configuration file:
.Bd -ragged -offset indent
.Cd "device ehci"
.Cd "device uhci"
.Cd "device ohci"
.Cd "device usb"
.Cd "device urtwn"
.Cd "device wlan"
.Ed
.Pp
Alternatively, to load the driver as a
module at boot time, place the following line in
.Xr loader.conf 5 :
.Bd -literal -offset indent
if_urtwn_load="YES"
.Ed
.Sh DESCRIPTION
The
.Nm
driver supports USB 2.0 wireless network devices based on Realtek
RTL8188CUS, RTL8188CE-VAU, RTL8188RU and RTL8192CU chipsets.
.Pp
The RTL8188CUS is a highly integrated 802.11n adapter that combines
a MAC, a 1T1R capable baseband and an RF in a single chip.
It operates in the 2GHz spectrum only.
The RTL8188RU is a high-power variant of the RTL8188CUS.
The RTL8188CE-VAU is a PCI Express Mini Card adapter that attaches
to the USB interface.
.Pp
The RTL8192CU is a highly integrated multiple-in, multiple-out (MIMO)
802.11n adapter that combines a MAC, a 2T2R capable baseband and an
RF in a single chip.
It operates in the 2GHz spectrum only.
.Pp
The driver needs at least version 1.1p0 of the following firmware files,
which are loaded when an interface is attached:
.Pp
.Bl -tag -width Ds -offset indent -compact
.It urtwn-rtl8192cfwT
.It urtwn-rtl8192cfwU
.It urtwn-rtl8723fw
.El
.Pp
The firmware is available as part of the FreeBSD Ports collection in
net/urtwn-firmware-kmod.
.Sh HARDWARE
The following adapters should work:
.Pp
.Bl -tag -width Ds -offset indent -compact
.It Belkin F7D1102 Surf Wireless Micro
.It Edimax EW-7811Un
.It Netgear WNA1000M
.It Realtek RTL8192CU
.It Realtek RTL8188CUS
.El
.Sh EXAMPLES
Join an existing BSS network (i.e., connect to an access point):
.Bd -literal -offset indent
ifconfig wlan create wlandev urtwn0 inet 192.168.0.20 \e
netmask 0xffffff00
.Ed
.Pp
Join a specific BSS network with network name
.Dq Li my_net :
.Pp
.Dl "ifconfig wlan create wlandev urtwn0 ssid my_net up"
.Pp
Join a specific BSS network with 64-bit WEP encryption:
.Bd -literal -offset indent
ifconfig wlan create wlandev urtwn0 ssid my_net \e
wepmode on wepkey 0x1234567890 weptxkey 1 up
.Ed
.Sh DIAGNOSTICS
.Bl -diag
.It "urtwn%d: error %d, could not read firmware %s"
For some reason, the driver was unable to read the microcode file from the
filesystem.
The file might be missing or corrupted.
.It "urtwn%d: device timeout"
A frame dispatched to the hardware for transmission did not complete in time.
The driver will reset the hardware.
This should not happen.
.El
.Sh SEE ALSO
.Xr intro 4 ,
.Xr netintro 4 ,
.Xr usb 4 ,
.Xr wlan 4 ,
.Xr wlan_ccmp 4 ,
.Xr wlan_tkip 4 ,
.Xr wlan_wep 4 ,
.Xr ifconfig 8,
.Xr wpa_supplicant 8
.Rs
.%T Realtek
.%U http://www.realtek.com.tw
.Re
.Sh HISTORY
The
.Nm
driver first appeared in
.Ox 4.9
and
.Fx 10.0 .
.Sh AUTHORS
The
.Nm
driver was written by
.An Damien Bergamini Aq damien@openbsd.org .
.Sh CAVEATS
The
.Nm
driver does not support any of the 802.11n capabilities offered by the
adapters.

View File

@ -2747,6 +2747,9 @@ device ural
# Realtek RTL8187B/L wireless driver
device urtw
#
# Realtek RTL8188CU/RTL8192CU wireless driver
device urtwn
#
# ZyDas ZD1211/ZD1211B wireless driver
device zyd
#

View File

@ -2292,6 +2292,7 @@ dev/usb/wlan/if_uath.c optional uath
dev/usb/wlan/if_upgt.c optional upgt
dev/usb/wlan/if_ural.c optional ural
dev/usb/wlan/if_urtw.c optional urtw
dev/usb/wlan/if_urtwn.c optional urtwn
dev/usb/wlan/if_zyd.c optional zyd
#
# USB serial and parallel port drivers

View File

@ -571,6 +571,7 @@ vendor KONTRON 0x0fe6 Kontron AG
vendor QUALCOMM 0x1004 Qualcomm
vendor APACER 0x1005 Apacer
vendor MOTOROLA4 0x100d Motorola
vendor HP3 0x103c Hewlett Packard
vendor AIRPLUS 0x1011 Airplus
vendor DESKNOTE 0x1019 Desknote
vendor NEC3 0x1033 NEC
@ -720,6 +721,7 @@ vendor ENCORE 0x203d Encore
vendor QIHARDWARE 0x20b7 QI-hardware
vendor PARA 0x20b8 PARA Industrial
vendor SIMTEC 0x20df Simtec Electronics
vendor TRENDNET 0x20f4 TRENDnet
vendor RTSYSTEMS 0x2100 RTSYSTEMS
vendor VIALABS 0x2109 VIA Labs
vendor ERICSSON 0x2282 Ericsson
@ -742,6 +744,7 @@ vendor IRIVER 0x4102 iRiver
vendor DELL 0x413c Dell
vendor WCH 0x4348 QinHeng Electronics
vendor ACEECA 0x4766 Aceeca
vendor FEIXUN 0x4855 FeiXun Communication
vendor PAPOUCH 0x5050 Papouch products
vendor AVERATEC 0x50c2 Averatec
vendor SWEEX 0x5173 Sweex
@ -757,6 +760,7 @@ vendor INTEL2 0x8087 Intel
vendor ALLWIN 0x8516 ALLWIN Tech
vendor SITECOM2 0x9016 Sitecom
vendor MOSCHIP 0x9710 MosChip Semiconductor
vendor NETGEAR4 0x9846 Netgear
vendor MARVELL 0x9e88 Marvell Technology Group Ltd.
vendor 3COM3 0xa727 3Com
vendor EVOLUTION 0xdeee Evolution Robotics products
@ -814,6 +818,9 @@ product ABOCOM HWU54DM 0xb21b HWU54DM
product ABOCOM RT2573_2 0xb21c RT2573
product ABOCOM RT2573_3 0xb21d RT2573
product ABOCOM RT2573_4 0xb21e RT2573
product ABOCOM RTL8188CU_1 0x8188 RTL8188CU
product ABOCOM RTL8188CU_2 0x8189 RTL8188CU
product ABOCOM RTL8192CU 0x8178 RTL8192CU
product ABOCOM WUG2700 0xb21f WUG2700
/* Acton Research Corp. */
@ -1126,6 +1133,7 @@ product ASUS RT2870_4 0x1760 RT2870
product ASUS RT2870_5 0x1761 RT2870
product ASUS USBN13 0x1784 USB-N13
product ASUS RT3070_1 0x1790 RT3070
product ASUS RTL8192CU 0x17ab RTL8192CU
product ASUS A730W 0x4202 ASUS MyPal A730W
product ASUS P535 0x420f ASUS P535 PDA
product ASUS GMSC 0x422f ASUS Generic Mass Storage
@ -1173,6 +1181,10 @@ product AZUREWAVE RT2870_2 0x3262 RT2870
product AZUREWAVE RT3070_1 0x3273 RT3070
product AZUREWAVE RT3070_2 0x3284 RT3070
product AZUREWAVE RT3070_3 0x3305 RT3070
product AZUREWAVE RTL8188CU 0x3357 RTL8188CU
product AZUREWAVE RTL8188CE_1 0x3358 RTL8188CE
product AZUREWAVE RTL8188CE_2 0x3359 RTL8188CE
/* Baltech products */
product BALTECH CARDREADER 0x9999 Card reader
@ -1215,6 +1227,9 @@ product BELKIN F5U257 0x0257 F5U257 Serial
product BELKIN F5U409 0x0409 F5U409 Serial
product BELKIN F6C550AVR 0x0551 F6C550-AVR UPS
product BELKIN F5U120 0x1203 F5U120-PC Hub
product BELKIN RTL8188CU 0x1102 RTL8188CU Wireless Adapter
product BELKIN RTL8192CU 0x2102 RTL8192CU Wireless Adapter
product BELKIN F7D2102 0x2103 F7D2102 Wireless Adapter
product BELKIN ZD1211B 0x4050 ZD1211B
product BELKIN F5D5055 0x5055 F5D5055
product BELKIN F5D7050 0x7050 F5D7050 Wireless Adapter
@ -1294,6 +1309,11 @@ product CHIC CYPRESS 0x0003 Cypress USB Mouse
product CHICONY KB8933 0x0001 KB-8933 keyboard
product CHICONY KU0325 0x0116 KU-0325 keyboard
product CHICONY CNF7129 0xb071 Notebook Web Camera
product CHICONY RTL8188CUS_1 0xaff7 RTL8188CUS
product CHICONY RTL8188CUS_2 0xaff8 RTL8188CUS
product CHICONY RTL8188CUS_3 0xaff9 RTL8188CUS
product CHICONY RTL8188CUS_4 0xaffa RTL8188CUS
product CHICONY RTL8188CUS_5 0xaffa RTL8188CUS
product CHICONY2 TWINKLECAM 0x600d TwinkleCam USB camera
/* CH Products */
@ -1383,6 +1403,7 @@ product COREGA RT2870_2 0x003c RT2870
product COREGA RT2870_3 0x003f RT2870
product COREGA RT3070 0x0041 RT3070
product COREGA CGWLUSB300GNM 0x0042 CG-WLUSB300GNM
product COREGA RTL8192CU 0x0056 RTL8192CU
product COREGA WLUSB_11_STICK 0x7613 WLAN USB Stick 11
product COREGA FETHER_USB_TXC 0x9601 FEther USB-TXC
@ -1519,6 +1540,10 @@ product DLINK DSB650 0xabc1 10/100 Ethernet
product DLINK DUBH7 0xf103 DUB-H7 USB 2.0 7-Port Hub
product DLINK DWR510_CD 0xa805 DWR-510 CD-ROM Mode
product DLINK DWR510 0x7e12 DWR-510
product DLINK RTL8188CU 0x3308 RTL8188CU
product DLINK RTL8192CU_1 0x3307 RTL8192CU
product DLINK RTL8192CU_2 0x3309 RTL8192CU
product DLINK RTL8192CU_3 0x330a RTL8192CU
product DLINK2 DWA120 0x3a0c DWA-120
product DLINK2 DWA120_NF 0x3a0d DWA-120 (no firmware)
product DLINK2 DWLG122C1 0x3c03 DWL-G122 c1
@ -1559,6 +1584,7 @@ product EDIMAX RT2870_1 0x7711 RT2870
product EDIMAX EW7717 0x7717 EW-7717
product EDIMAX EW7718 0x7718 EW-7718
product EDIMAX EW7811UN 0x7811 EW-7811Un
product EDIMAX RTL8192CU 0x7822 RTL8192CU
/* eGalax Products */
product EGALAX TPANEL 0x0001 Touch Panel
@ -1691,6 +1717,10 @@ product FEIYA 5IN1 0x1132 5-in-1 Card Reader
product FEIYA ELANGO 0x6200 MicroSDHC Card Reader
product FEIYA AC110 0x6300 AC-110 Card Reader
/* FeiXun Communication products */
product FEIXUN RTL8188CU 0x0090 RTL8188CU
product FEIXUN RTL8192CU 0x0091 RTL8192CU
/* Festo */
product FESTO CPX_USB 0x0102 CPX-USB
product FESTO CMSP 0x0501 CMSP
@ -2043,6 +2073,7 @@ product GUILLEMOT HWGUSB254 0xe000 HWGUSB2-54 WLAN
product GUILLEMOT HWGUSB254LB 0xe010 HWGUSB2-54-LB
product GUILLEMOT HWGUSB254V2AP 0xe020 HWGUSB2-54V2-AP
product GUILLEMOT HWNU300 0xe030 HWNU-300
product GUILLEMOT HWNUP150 0xe033 HWNUP-150
/* Hagiwara products */
product HAGIWARA FGSM 0x0002 FlashGate SmartMedia Card Reader
@ -2066,6 +2097,7 @@ product HAWKING RT2870_1 0x0001 RT2870
product HAWKING RT2870_2 0x0003 RT2870
product HAWKING HWUN2 0x0009 HWUN2
product HAWKING RT3070 0x000b RT3070
product HAWKING RTL8192CU 0x0019 RTL8192CU
product HAWKING UF100 0x400c 10/100 USB Ethernet
/* HID Global GmbH products */
@ -2115,6 +2147,7 @@ product HP 5400C 0x1005 Scanjet 5400C
product HP 2215 0x1016 iPAQ 22xx/Jornada 548
product HP 568J 0x1116 Jornada 568
product HP 930C 0x1204 DeskJet 930c
product HP3 RTL8188CU 0x1629 RTL8188CU
product HP P2000U 0x1801 Inkjet P-2000U
product HP HS2300 0x1e1d HS2300 HSDPA (aka MC8775)
product HP 640C 0x2004 DeskJet 640c
@ -3024,6 +3057,8 @@ product NETGEAR WG111V3 0x4260 WG111v3
product NETGEAR WG111U 0x4300 WG111U
product NETGEAR WG111U_NF 0x4301 WG111U (no firmware)
product NETGEAR WG111V2 0x6a00 WG111V2
product NETGEAR RTL8192CU 0x9021 RTL8192CU
product NETGEAR WNA1000M 0x9041 WNA1000M
product NETGEAR2 MA101 0x4100 MA101
product NETGEAR2 MA101B 0x4102 MA101 Rev B
product NETGEAR3 WG111T 0x4250 WG111T
@ -3031,6 +3066,7 @@ product NETGEAR3 WG111T_NF 0x4251 WG111T (no firmware)
product NETGEAR3 WPN111 0x5f00 WPN111
product NETGEAR3 WPN111_NF 0x5f01 WPN111 (no firmware)
product NETGEAR3 WPN111_2 0x5f02 WPN111
product NETGEAR4 RTL8188CU 0x9041 RTL8188CU
/* NetIndex products */
product NETINDEX WS002IN 0x2001 Willcom WS002IN
@ -3046,6 +3082,7 @@ product NIKON D300 0x041a Digital Camera D300
/* NovaTech Products */
product NOVATECH NV902 0x9020 NovaTech NV-902W
product NOVATECH RT2573 0x9021 RT2573
product NOVATECH RTL8188CU 0x9071 RTL8188CU
/* Nokia products */
product NOKIA N958GB 0x0070 Nokia N95 8GBc
@ -3274,8 +3311,14 @@ product PIENGINEERING PS2USB 0x020b PS2 to Mac USB Adapter
/* Planex Communications products */
product PLANEX GW_US11H 0x14ea GW-US11H WLAN
product PLANEX2 RTL8188CUS 0x1201 RTL8188CUS
product PLANEX2 GW_US11S 0x3220 GW-US11S WLAN
product PLANEX2 GW_US54GXS 0x5303 GW-US54GXS WLAN
product PLANEX2 RTL8188CU_1 0xab2a RTL8188CU
product PLANEX2 RTL8188CU_2 0xed17 RTL8188CU
product PLANEX2 RTL8188CU_3 0x4902 RTL8188CU
product PLANEX2 RTL8188CU_4 0xab2e RTL8188CU
product PLANEX2 RTL8192CU 0xab2b RTL8192CU
product PLANEX2 GWUS54HP 0xab01 GW-US54HP
product PLANEX2 GWUS300MINIS 0xab24 GW-US300MiniS
product PLANEX2 RT3070 0xab25 RT3070
@ -3502,11 +3545,24 @@ product RATOC REXUSB60F 0xb020 USB serial adapter REX-USB60F
/* Green House and CompUSA OEM this part */
product REALTEK DUMMY 0x0000 Dummy product
product REALTEK USB20CRW 0x0158 USB20CRW Card Reader
product REALTEK RTL8188CTV 0x018a RTL8188CTV
product REALTEK USBKR100 0x8150 USBKR100 USB Ethernet
product REALTEK RTL8188CE_0 0x8170 RTL8188CE
product REALTEK RTL8188CE_1 0x817e RTL8188CE
product REALTEK RTL8188CU_0 0x8176 RTL8188CU
product REALTEK RTL8188CU_1 0x817a RTL8188CU
product REALTEK RTL8188CU_2 0x817b RTL8188CU
product REALTEK RTL8187 0x8187 RTL8187 Wireless Adapter
product REALTEK RTL8187B_0 0x8189 RTL8187B Wireless Adapter
product REALTEK RTL8187B_1 0x8197 RTL8187B Wireless Adapter
product REALTEK RTL8187B_2 0x8198 RTL8187B Wireless Adapter
product REALTEK RTL8188CUS 0x818a RTL8188CUS
product REALTEK RTL8188CU_COMBO 0x8754 RTL8188CU
product REALTEK RTL8191CU 0x8177 RTL8191CU
product REALTEK RTL8192CU 0x8178 RTL8192CU
product REALTEK RTL8192CE 0x817c RTL8192CE
product REALTEK RTL8188RU_1 0x817d RTL8188RU
product REALTEK RTL8188RU_2 0x317f RTL8188RU
/* RedOctane products */
product REDOCTANE DUMMY 0x0000 Dummy product
@ -3881,6 +3937,9 @@ product SITECOMEU RT3072_3 0x0047 RT3072
product SITECOMEU RT3072_4 0x0048 RT3072
product SITECOMEU RT3072_5 0x004a RT3072
product SITECOMEU RT3072_6 0x004d RT3072
product SITECOMEU RTL8188CU_1 0x0052 RTL8188CU
product SITECOMEU RTL8188CU_2 0x005c RTL8188CU
product SITECOMEU RTL8192CU 0x0061 RTL8192CU
product SITECOMEU LN028 0x061c LN-028
product SITECOMEU WL113 0x9071 WL-113
product SITECOMEU ZD1211B 0x9075 ZD1211B
@ -4110,6 +4169,10 @@ product TREK THUMBDRIVE 0x1111 ThumbDrive
product TREK MEMKEY 0x8888 IBM USB Memory Key
product TREK THUMBDRIVE_8MB 0x9988 ThumbDrive_8MB
/* TRENDnet products */
product TRENDNET RTL8192CU 0x624d RTL8192CU
product TRENDNET RTL8188CU 0x648b RTL8188CU
/* Tripp-Lite products */
product TRIPPLITE U209 0x2008 Serial
@ -4319,3 +4382,4 @@ product ZYXEL G220V2 0x340f G-220 v2
product ZYXEL G202 0x3410 G-202
product ZYXEL RT2870_1 0x3416 RT2870
product ZYXEL RT2870_2 0x341a RT2870
product ZYXEL RTL8192CU 0x341f RTL8192CU

3016
sys/dev/usb/wlan/if_urtwn.c Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -32,7 +32,7 @@
SUBDIR = usb
SUBDIR += ${_dwc_otg} ehci ${_musb} ohci uhci xhci ${_uss820dci} ${_at91dci} ${_atmegadci} ${_avr32dci}
SUBDIR += ${_rum} run ${_uath} upgt usie ural ${_zyd} ${_urtw}
SUBDIR += ${_rum} run ${_uath} upgt usie ural ${_zyd} ${_urtw} urtwn
SUBDIR += atp uhid ukbd ums udbp ufm uep
SUBDIR += ucom u3g uark ubsa ubser uchcom ucycom ufoma uftdi ugensa uipaq ulpt \
umct umcs umodem umoscom uplcom uslcom uvisor uvscom

View File

@ -0,0 +1,10 @@
# $FreeBSD$
.PATH: ${.CURDIR}/../../../dev/usb/wlan
KMOD = if_urtwn
SRCS = if_urtwn.c if_urtwnreg.h \
bus_if.h device_if.h \
opt_bus.h opt_usb.h usb_if.h usbdevs.h
.include <bsd.kmod.mk>