MFC r205042

- Integrate latest driver code from OpenBSD
 - Drain our tasks from the ieee80211 taskqueue
 - Add more IDs

Submitted by:	Akinori Furukoshi
This commit is contained in:
Andrew Thompson 2010-04-06 23:28:46 +00:00
parent 963d675e13
commit 1e426764e8
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/stable/8/; revision=206320
4 changed files with 653 additions and 132 deletions

View File

@ -277,6 +277,7 @@ vendor LACIE 0x059f LaCie
vendor FUJIFILM 0x05a2 Fuji Film
vendor ARC 0x05a3 ARC
vendor ORTEK 0x05a4 Ortek
vendor CISCOLINKSYS3 0x05a6 Cisco-Linksys
vendor BOSE 0x05a7 Bose
vendor OMNIVISION 0x05a9 OmniVision
vendor INSYSTEM 0x05ab In-System Design
@ -546,6 +547,7 @@ vendor RIM 0x0fca Research In Motion
vendor DYNASTREAM 0x0fcf Dynastream Innovations
vendor QUALCOMM 0x1004 Qualcomm
vendor APACER 0x1005 Apacer
vendor MOTOROLA4 0x100d Motorola
vendor DESKNOTE 0x1019 Desknote
vendor GIGABYTE 0x1044 GIGABYTE
vendor WESTERN 0x1058 Western Digital
@ -642,6 +644,7 @@ vendor LINKSYS3 0x1915 Linksys
vendor QUALCOMMINC 0x19d2 Qualcomm, Incorporated
vendor WCH2 0x1a86 QinHeng Electronics
vendor STELERA 0x1a8d Stelera Wireless
vendor OVISLINK 0x1b75 OvisLink
vendor TCTMOBILE 0x1bbb TCT Mobile
vendor TELIT 0x1bc7 Telit
vendor MPMAN 0x1cae MpMan
@ -683,6 +686,7 @@ vendor 3COM2 0x6891 3Com
vendor EDIMAX 0x7392 Edimax
vendor INTEL 0x8086 Intel
vendor INTEL2 0x8087 Intel
vendor ALLWIN 0x8516 ALLWIN Tech
vendor SITECOM2 0x9016 Sitecom
vendor MOSCHIP 0x9710 MosChip Semiconductor
vendor MARVELL 0x9e88 Marvell Technology Group Ltd.
@ -762,6 +766,7 @@ product ACCTON RT3070_1 0xa701 RT3070
product ACCTON RT3070_2 0xa702 RT3070
product ACCTON RT2870_1 0xb522 RT2870
product ACCTON RT3070_3 0xc522 RT3070
product ACCTON RT3070_5 0xd522 RT3070
product ACCTON ZD1211B 0xe501 ZD1211B
/* Aceeca products */
@ -894,6 +899,15 @@ product ALTEC ASC495 0xff05 ASC495 Speakers
/* Allied Telesyn International products */
product ALLIEDTELESYN ATUSB100 0xb100 AT-USB100
/* ALLWIN Tech products */
product ALLWIN RT2070 0x2070 RT2070
product ALLWIN RT2770 0x2770 RT2770
product ALLWIN RT2870 0x2870 RT2870
product ALLWIN RT3070 0x3070 RT3070
product ALLWIN RT3071 0x3071 RT3071
product ALLWIN RT3072 0x3072 RT3072
product ALLWIN RT3572 0x3572 RT3572
/* AlphaSmart, Inc. products */
product ALPHASMART DANA_KB 0xdbac AlphaSmart Dana Keyboard
product ALPHASMART DANA_SYNC 0xdf00 AlphaSmart Dana HotSync
@ -996,7 +1010,8 @@ product ASUS RT2870_2 0x1732 RT2870
product ASUS RT2870_3 0x1742 RT2870
product ASUS RT2870_4 0x1760 RT2870
product ASUS RT2870_5 0x1761 RT2870
product ASUS RT3070 0x1784 RT3070
product ASUS USBN13 0x1784 USB-N13
product ASUS RT3070_1 0x1790 RT3070
product ASUS P535 0x420f ASUS P535 PDA
product ASUS GMSC 0x422f ASUS Generic Mass Storage
product ASUS RT2570 0x1706 RT2500USB Wireless Adapter
@ -1154,7 +1169,8 @@ product CISCOLINKSYS HU200TS 0x001a HU200TS Wireless Adapter
product CISCOLINKSYS WUSB54GC 0x0020 WUSB54GC
product CISCOLINKSYS WUSB54GR 0x0023 WUSB54GR
product CISCOLINKSYS WUSBF54G 0x0024 WUSBF54G
product CISCOLINKSYS2 RT3070 0x4001 RT3070
product CISCOLINKSYS2 RT3070 0x4001 RT3070
product CISCOLINKSYS3 RT3070 0x0101 RT3070
/* CMOTECH products */
product CMOTECH CNU510 0x5141 CDMA Technologies USB modem
@ -1181,6 +1197,8 @@ product CONCEPTRONIC AR5523_2 0x7811 AR5523
product CONCEPTRONIC AR5523_2_NF 0x7812 AR5523 (no firmware)
product CONCEPTRONIC2 C54RU 0x3c02 C54RU WLAN
product CONCEPTRONIC2 C54RU2 0x3c22 C54RU
product CONCEPTRONIC2 RT3070_1 0x3c08 RT3070
product CONCEPTRONIC2 RT3070_2 0x3c11 RT3070
product CONCEPTRONIC2 VIGORN61 0x3c25 VIGORN61
product CONCEPTRONIC2 RT2870_1 0x3c06 RT2870
product CONCEPTRONIC2 RT2870_2 0x3c07 RT2870
@ -1333,12 +1351,14 @@ product DLINK2 DWA111 0x3c06 DWA-111
product DLINK2 RT2870_1 0x3c09 RT2870
product DLINK2 DWA110 0x3c07 DWA-110
product DLINK2 RT3072 0x3c0a RT3072
product DLINK2 RT3072_1 0x3c0b RT3072
product DLINK2 RT3070_1 0x3c0d RT3070
product DLINK2 RT3070_2 0x3c0e RT3070
product DLINK2 RT3070_3 0x3c0f RT3070
product DLINK2 RT2870_2 0x3c11 RT2870
product DLINK2 DWA130 0x3c13 DWA-130
product DLINK2 RT3070_4 0x3c15 RT3070
product DLINK2 RT3070_5 0x3c16 RT3070
product DLINK3 DWM652 0x3e04 DWM-652
/* DMI products */
@ -1909,6 +1929,7 @@ product LINKSYS4 WUSB100 0x0070 WUSB100
product LINKSYS4 WUSB600N 0x0071 WUSB600N
product LINKSYS4 WUSB54GCV2 0x0073 WUSB54GC v2
product LINKSYS4 WUSB54GCV3 0x0077 WUSB54GC v3
product LINKSYS4 RT3070 0x0078 RT3070
product LINKSYS4 WUSB600NV2 0x0079 WUSB600N v2
/* Logitech products */
@ -1982,6 +2003,8 @@ product MELCO KG54L 0x00da WLI-U2-KG54L
product MELCO WLIUCG300N 0x00e8 WLI-UC-G300N
product MELCO SG54HG 0x00f4 WLI-U2-SG54HG
product MELCO WLIUCAG300N 0x012e WLI-UC-AG300N
product MELCO RT2870_1 0x0148 RT2870
product MELCO RT2870_2 0x0150 RT2870
product MELCO WLIUCGN 0x015d WLI-UC-GN
/* Merlin products */
@ -2002,7 +2025,9 @@ product MGE UPS2 0xffff MGE UPS SYSTEMS PROTECTIONCENTER 2
product MSI BT_DONGLE 0x1967 Bluetooth USB dongle
product MSI RT3070_1 0x3820 RT3070
product MSI RT3070_2 0x3821 RT3070
product MSI RT3070_8 0x3822 RT3070
product MSI RT3070_3 0x3870 RT3070
product MSI RT3070_9 0x3871 RT3070
product MSI UB11B 0x6823 UB11B
product MSI RT2570 0x6861 RT2570
product MSI RT2570_2 0x6865 RT2570
@ -2011,7 +2036,9 @@ product MSI RT2573_1 0x6874 RT2573
product MSI RT2573_2 0x6877 RT2573
product MSI RT3070_4 0x6899 RT3070
product MSI RT3070_5 0x821a RT3070
product MSI RT3070_10 0x822a RT3070
product MSI RT3070_6 0x870a RT3070
product MSI RT3070_11 0x871a RT3070
product MSI RT3070_7 0x899a RT3070
product MSI RT2573_3 0xa861 RT2573
product MSI RT2573_4 0xa874 RT2573
@ -2092,6 +2119,8 @@ product MOTOROLA2 A41XV32X 0x2a22 A41x/V32x Mobile Phones
product MOTOROLA2 E398 0x4810 E398 Mobile Phone
product MOTOROLA2 USBLAN 0x600c USBLAN
product MOTOROLA2 USBLAN2 0x6027 USBLAN
product MOTOROLA4 RT2770 0x9031 RT2770
product MOTOROLA4 RT3070 0x9032 RT3070
/* MultiTech products */
product MULTITECH ATLAS 0xf101 MT5634ZBA-USB modem
@ -2262,6 +2291,9 @@ product OPTION MODHSXPA 0xd013 Globetrotter HSUPA
product OPTION ICON321 0xd031 Globetrotter HSUPA
product OPTION ICON505 0xd055 Globetrotter iCON 505
/* OvisLink product */
product OVISLINK RT3072 0x3072 RT3072
/* OQO */
product OQO WIFI01 0x0002 model 01 WiFi interface
product OQO BT01 0x0003 model 01 Bluetooth interface
@ -2296,6 +2328,7 @@ product PARA RT3070 0x8888 RT3070
product PEGATRON RT2870 0x0002 RT2870
product PEGATRON RT3070 0x000c RT3070
product PEGATRON RT3070_2 0x000e RT3070
product PEGATRON RT3070_3 0x0010 RT3070
/* Peracom products */
product PERACOM SERIAL1 0x0001 Serial
@ -2515,7 +2548,9 @@ product RALINK RT2870 0x2870 RT2870
product RALINK RT3070 0x3070 RT3070
product RALINK RT3071 0x3071 RT3071
product RALINK RT3072 0x3072 RT3072
product RALINK RT3370 0x3370 RT3370
product RALINK RT3572 0x3572 RT3572
product RALINK RT8070 0x8070 RT8070
product RALINK RT2570_3 0x9020 RT2500USB Wireless Adapter
product RALINK RT2573_2 0x9021 RT2501USB Wireless Adapter
@ -2752,6 +2787,7 @@ product SITECOMEU RT3070_3 0x003c RT3070
product SITECOMEU RT3070_4 0x003d RT3070
product SITECOMEU RT3070 0x003e RT3070
product SITECOMEU WL608 0x003f WL-608
product SITECOMEU RT3071 0x0040 RT3071
product SITECOMEU RT3072_1 0x0041 RT3072
product SITECOMEU RT3072_2 0x0042 RT3072
product SITECOMEU RT3072_3 0x0047 RT3072
@ -2888,6 +2924,7 @@ product SURECOM RT2573 0x31f3 RT2573
/* Sweex products */
product SWEEX ZD1211 0x1809 ZD1211
product SWEEX2 LW153 0x0153 LW153
product SWEEX2 LW303 0x0302 LW303
product SWEEX2 LW313 0x0313 LW313
@ -2943,6 +2980,7 @@ product TOPRE HHKB 0x0100 HHKB Professional
/* Toshiba Corporation products */
product TOSHIBA POCKETPC_E740 0x0706 PocketPC e740
product TOSHIBA RT3070 0x0a07 RT3070
product TOSHIBA G450 0x0d45 G450 modem
product TOSHIBA HSDPA 0x1302 G450 modem
@ -3124,3 +3162,4 @@ product ZYXEL M202 0x340a M-202
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

File diff suppressed because it is too large Load Diff

View File

@ -310,7 +310,8 @@
#define RT2860_MCU_CMD_LED1 0x52
#define RT2860_MCU_CMD_LED2 0x53
#define RT2860_MCU_CMD_LED3 0x54
#define RT2860_MCU_CMD_BOOT 0x72
#define RT2860_MCU_CMD_RFRESET 0x72
#define RT2860_MCU_CMD_ANTSEL 0x73
#define RT2860_MCU_CMD_BBP 0x80
#define RT2860_MCU_CMD_PSLEVEL 0x83
@ -890,6 +891,7 @@ struct rt2860_rxwi {
#define RT2860_EEPROM_TSSI5_5GHZ 0x6e
#define RT2860_EEPROM_RPWR 0x6f
#define RT2860_EEPROM_BBP_BASE 0x78
#define RT3071_EEPROM_RF_BASE 0x82
#define RT2860_RIDX_CCK1 0
#define RT2860_RIDX_CCK11 3
@ -903,18 +905,18 @@ static const struct rt2860_rate {
uint16_t sp_ack_dur;
uint16_t lp_ack_dur;
} rt2860_rates[] = {
{ 2, 0, IEEE80211_T_DS, 0, 304, 304 },
{ 4, 1, IEEE80211_T_DS, 1, 248, 152 },
{ 11, 2, IEEE80211_T_DS, 2, 213, 117 },
{ 22, 3, IEEE80211_T_DS, 3, 203, 107 },
{ 12, 0, IEEE80211_T_OFDM, 4, 50, 50 },
{ 18, 1, IEEE80211_T_OFDM, 4, 42, 42 },
{ 24, 2, IEEE80211_T_OFDM, 6, 38, 38 },
{ 36, 3, IEEE80211_T_OFDM, 6, 34, 34 },
{ 48, 4, IEEE80211_T_OFDM, 8, 34, 34 },
{ 72, 5, IEEE80211_T_OFDM, 8, 30, 30 },
{ 96, 6, IEEE80211_T_OFDM, 8, 30, 30 },
{ 108, 7, IEEE80211_T_OFDM, 8, 30, 30 }
{ 2, 0, IEEE80211_T_DS, 0, 314, 314 },
{ 4, 1, IEEE80211_T_DS, 1, 258, 162 },
{ 11, 2, IEEE80211_T_DS, 2, 223, 127 },
{ 22, 3, IEEE80211_T_DS, 3, 213, 117 },
{ 12, 0, IEEE80211_T_OFDM, 4, 60, 60 },
{ 18, 1, IEEE80211_T_OFDM, 4, 52, 52 },
{ 24, 2, IEEE80211_T_OFDM, 6, 48, 48 },
{ 36, 3, IEEE80211_T_OFDM, 6, 44, 44 },
{ 48, 4, IEEE80211_T_OFDM, 8, 44, 44 },
{ 72, 5, IEEE80211_T_OFDM, 8, 40, 40 },
{ 96, 6, IEEE80211_T_OFDM, 8, 40, 40 },
{ 108, 7, IEEE80211_T_OFDM, 8, 40, 40 }
};
/*
@ -1034,7 +1036,8 @@ static const struct rt2860_rate {
{ 91, 0x04 }, \
{ 92, 0x00 }, \
{ 103, 0x00 }, \
{ 105, 0x05 }
{ 105, 0x05 }, \
{ 106, 0x35 }
/*
* Default settings for RF registers; values derived from the reference driver.
@ -1088,8 +1091,13 @@ static const struct rt2860_rate {
{ 157, 0x100bb1, 0x1300e3, 0x05e014, 0x001407 }, \
{ 159, 0x100bb1, 0x1300e3, 0x05e014, 0x001409 }, \
{ 161, 0x100bb1, 0x1300e4, 0x05e014, 0x001401 }, \
{ 165, 0x100bb1, 0x1300e4, 0x05e014, 0x001405 }
{ 165, 0x100bb1, 0x1300e4, 0x05e014, 0x001405 }, \
{ 167, 0x100bb1, 0x1300f4, 0x05e014, 0x001407 }, \
{ 169, 0x100bb1, 0x1300f4, 0x05e014, 0x001409 }, \
{ 171, 0x100bb1, 0x1300f5, 0x05e014, 0x001401 }, \
{ 173, 0x100bb1, 0x1300f5, 0x05e014, 0x001403 }
#if 0
#define RT3070_RF3020 \
{ 241, 2, 2 }, \
{ 241, 2, 7 }, \
@ -1105,6 +1113,62 @@ static const struct rt2860_rate {
{ 246, 2, 7 }, \
{ 247, 2, 2 }, \
{ 248, 2, 4 }
#endif
#define RT3070_RF3052 \
{ 0xf1, 2, 2 }, \
{ 0xf1, 2, 7 }, \
{ 0xf2, 2, 2 }, \
{ 0xf2, 2, 7 }, \
{ 0xf3, 2, 2 }, \
{ 0xf3, 2, 7 }, \
{ 0xf4, 2, 2 }, \
{ 0xf4, 2, 7 }, \
{ 0xf5, 2, 2 }, \
{ 0xf5, 2, 7 }, \
{ 0xf6, 2, 2 }, \
{ 0xf6, 2, 7 }, \
{ 0xf7, 2, 2 }, \
{ 0xf8, 2, 4 }, \
{ 0x56, 0, 4 }, \
{ 0x56, 0, 6 }, \
{ 0x56, 0, 8 }, \
{ 0x57, 0, 0 }, \
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\
{ 23, 0x3c }, \
{ 24, 0x16 }, \
{ 25, 0x15 }, \
{ 26, 0x85 }, \
{ 27, 0x00 }, \
{ 28, 0x00 }, \
{ 29, 0x9b }, \
{ 30, 0x09 }, \
{ 31, 0x10 }
#endif /* _IF_RUNREG_H_ */

View File

@ -2,7 +2,8 @@
/*-
* Copyright (c) 2008,2009 Damien Bergamini <damien.bergamini@free.fr>
* ported to FreeBSD by Akinori Furukoshi <moonlightakkiy@yahoo.ca>
* ported to FreeBSD by Akinori Furukoshi <moonlightakkiy@yahoo.ca>
* USB Consulting, Hans Petter Selasky <hselasky@freebsd.org>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
@ -154,21 +155,28 @@ struct run_softc {
int (*sc_srom_read)(struct run_softc *,
uint16_t, uint16_t *);
uint32_t mac_rev;
uint16_t mac_ver;
uint16_t mac_rev;
uint8_t rf_rev;
uint8_t freq;
uint8_t ntxchains;
uint8_t nrxchains;
int fixed_ridx;
uint8_t bbp25;
uint8_t bbp26;
uint8_t rf24_20mhz;
uint8_t rf24_40mhz;
uint8_t patch_dac;
uint8_t rfswitch;
uint8_t ext_2ghz_lna;
uint8_t ext_5ghz_lna;
uint8_t calib_2ghz;
uint8_t calib_5ghz;
int8_t txpow1[50];
int8_t txpow2[50];
uint8_t txmixgain_2ghz;
uint8_t txmixgain_5ghz;
int8_t txpow1[54];
int8_t txpow2[54];
int8_t rssi_2ghz[3];
int8_t rssi_5ghz[3];
uint8_t lna[4];
@ -176,7 +184,7 @@ struct run_softc {
struct {
uint8_t reg;
uint8_t val;
} bbp[8];
} bbp[8], rf[10];
uint8_t leds;
uint16_t led[3];
uint32_t txpow20mhz[5];
@ -196,8 +204,6 @@ struct run_softc {
struct mbuf *rx_m;
int sifs;
union {
struct run_rx_radiotap_header th;
uint8_t pad[64];