Skip to content

Commit 5f53d8c

Browse files
Jerry Chuanggregkh
Jerry Chuang
authored andcommitted
Staging: add rtl8192SU wireless usb driver
Driver from Realtek for the Realtek RTL8192 USB wifi device Based on the r8187 driver from Andrea Merello <[email protected]> and others. Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent d01c3c8 commit 5f53d8c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

86 files changed

+78441
-0
lines changed

drivers/staging/Kconfig

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,8 @@ source "drivers/staging/altpciechdma/Kconfig"
8585

8686
source "drivers/staging/rtl8187se/Kconfig"
8787

88+
source "drivers/staging/rtl8192su/Kconfig"
89+
8890
source "drivers/staging/rspiusb/Kconfig"
8991

9092
source "drivers/staging/mimio/Kconfig"

drivers/staging/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ obj-$(CONFIG_ASUS_OLED) += asus_oled/
2525
obj-$(CONFIG_PANEL) += panel/
2626
obj-$(CONFIG_ALTERA_PCIE_CHDMA) += altpciechdma/
2727
obj-$(CONFIG_RTL8187SE) += rtl8187se/
28+
obj-$(CONFIG_RTL8192SU) += rtl8192su/
2829
obj-$(CONFIG_USB_RSPI) += rspiusb/
2930
obj-$(CONFIG_INPUT_MIMIO) += mimio/
3031
obj-$(CONFIG_TRANZPORT) += frontier/

drivers/staging/rtl8192su/Kconfig

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
config RTL8192SU
2+
tristate "RealTek RTL8192SU Wireless LAN NIC driver"
3+
depends on PCI
4+
depends on WIRELESS_EXT && COMPAT_NET_DEV_OPS
5+
default N
6+
---help---

drivers/staging/rtl8192su/Makefile

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
NIC_SELECT = RTL8192SU
2+
3+
EXTRA_CFLAGS += -std=gnu89
4+
EXTRA_CFLAGS += -O2
5+
EXTRA_CFLAGS += -mhard-float -DCONFIG_FORCE_HARD_FLOAT=y
6+
7+
EXTRA_CFLAGS += -DJACKSON_NEW_RX
8+
EXTRA_CFLAGS += -DTHOMAS_BEACON -DTHOMAS_TURBO
9+
#EXTRA_CFLAGS += -DUSE_ONE_PIPE
10+
EXTRA_CFLAGS += -DENABLE_DOT11D
11+
12+
EXTRA_CFLAGS += -DRTL8192SU
13+
EXTRA_CFLAGS += -DRTL8190_Download_Firmware_From_Header=1
14+
EXTRA_CFLAGS += -DRTL8192S_PREPARE_FOR_NORMAL_RELEASE
15+
EXTRA_CFLAGS += -DRTL8192SU_DISABLE_IQK=1
16+
17+
#EXTRA_CFLAGS += -DEEPROM_OLD_FORMAT_SUPPORT
18+
19+
#EXTRA_CFLAGS += -DUSB_RX_AGGREGATION_SUPPORT=0
20+
#EXTRA_CFLAGS += -DUSB_TX_DRIVER_AGGREGATION_ENABLE=0
21+
#EXTRA_CFLAGS += -DRTL8192SU_DISABLE_CCK_RATE=0
22+
EXTRA_CFLAGS += -DRTL8192S_DISABLE_FW_DM=0
23+
EXTRA_CFLAGS += -DDISABLE_BB_RF=0
24+
EXTRA_CFLAGS += -DRTL8192SU_USE_PARAM_TXPWR=0
25+
EXTRA_CFLAGS += -DRTL8192SU_FPGA_UNSPECIFIED_NETWORK=0
26+
#EXTRA_CFLAGS += -DRTL8192SU_FPGA_2MAC_VERIFICATION #=0
27+
EXTRA_CFLAGS += -DRTL8192SU_ASIC_VERIFICATION
28+
EXTRA_CFLAGS += -DRTL8192SU_USB_PHY_TEST=0
29+
30+
#EXTRA_CFLAGS += -DMUTIPLE_BULK_OUT
31+
EXTRA_CFLAGS += -DCONFIG_RTL8192_PM
32+
33+
r8192s_usb-objs := \
34+
r8180_93cx6.o \
35+
r8192U_wx.o \
36+
r8192S_phy.o \
37+
r8192S_rtl6052.o \
38+
r8192S_rtl8225.o \
39+
r819xU_cmdpkt.o \
40+
r8192U_dm.o \
41+
r8192SU_HWImg.o \
42+
r8192S_firmware.o \
43+
r8192S_Efuse.o \
44+
r8192U_core.o \
45+
r8192U_pm.o
46+
47+
ieee80211-rsl-objs := \
48+
ieee80211/ieee80211_rx.o \
49+
ieee80211/ieee80211_softmac.o \
50+
ieee80211/ieee80211_tx.o \
51+
ieee80211/ieee80211_wx.o \
52+
ieee80211/ieee80211_module.o \
53+
ieee80211/ieee80211_softmac_wx.o\
54+
ieee80211/rtl819x_HTProc.o \
55+
ieee80211/rtl819x_TSProc.o \
56+
ieee80211/rtl819x_BAProc.o \
57+
ieee80211/dot11d.o
58+
59+
obj-$(CONFIG_RTL8192SU) += r8192s_usb.o
60+
obj-$(CONFIG_RTL8192SU) += ieee80211-rsl.o
61+
obj-$(CONFIG_RTL8192SU) += ieee80211/ieee80211_crypt.o
62+
obj-$(CONFIG_RTL8192SU) += ieee80211/ieee80211_crypt_tkip.o
63+
obj-$(CONFIG_RTL8192SU) += ieee80211/ieee80211_crypt_ccmp.o
64+
obj-$(CONFIG_RTL8192SU) += ieee80211/ieee80211_crypt_wep.o
65+
66+

drivers/staging/rtl8192su/authors

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Andrea Merello <[email protected]>

drivers/staging/rtl8192su/dot11d.h

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
#ifndef __INC_DOT11D_H
2+
#define __INC_DOT11D_H
3+
4+
#ifdef ENABLE_DOT11D
5+
#include "ieee80211.h"
6+
7+
//#define ENABLE_DOT11D
8+
9+
//#define DOT11D_MAX_CHNL_NUM 83
10+
11+
typedef struct _CHNL_TXPOWER_TRIPLE {
12+
u8 FirstChnl;
13+
u8 NumChnls;
14+
u8 MaxTxPowerInDbm;
15+
}CHNL_TXPOWER_TRIPLE, *PCHNL_TXPOWER_TRIPLE;
16+
17+
typedef enum _DOT11D_STATE {
18+
DOT11D_STATE_NONE = 0,
19+
DOT11D_STATE_LEARNED,
20+
DOT11D_STATE_DONE,
21+
}DOT11D_STATE;
22+
23+
typedef struct _RT_DOT11D_INFO {
24+
//DECLARE_RT_OBJECT(RT_DOT11D_INFO);
25+
26+
bool bEnabled; // dot11MultiDomainCapabilityEnabled
27+
28+
u16 CountryIeLen; // > 0 if CountryIeBuf[] contains valid country information element.
29+
u8 CountryIeBuf[MAX_IE_LEN];
30+
u8 CountryIeSrcAddr[6]; // Source AP of the country IE.
31+
u8 CountryIeWatchdog;
32+
33+
u8 channel_map[MAX_CHANNEL_NUMBER+1]; //!!!Value 0: Invalid, 1: Valid (active scan), 2: Valid (passive scan)
34+
//u8 ChnlListLen; // #Bytes valid in ChnlList[].
35+
//u8 ChnlList[DOT11D_MAX_CHNL_NUM];
36+
u8 MaxTxPwrDbmList[MAX_CHANNEL_NUMBER+1];
37+
38+
DOT11D_STATE State;
39+
}RT_DOT11D_INFO, *PRT_DOT11D_INFO;
40+
#define eqMacAddr(a,b) ( ((a)[0]==(b)[0] && (a)[1]==(b)[1] && (a)[2]==(b)[2] && (a)[3]==(b)[3] && (a)[4]==(b)[4] && (a)[5]==(b)[5]) ? 1:0 )
41+
#define cpMacAddr(des,src) ((des)[0]=(src)[0],(des)[1]=(src)[1],(des)[2]=(src)[2],(des)[3]=(src)[3],(des)[4]=(src)[4],(des)[5]=(src)[5])
42+
#define GET_DOT11D_INFO(__pIeeeDev) ((PRT_DOT11D_INFO)((__pIeeeDev)->pDot11dInfo))
43+
44+
#define IS_DOT11D_ENABLE(__pIeeeDev) GET_DOT11D_INFO(__pIeeeDev)->bEnabled
45+
#define IS_COUNTRY_IE_VALID(__pIeeeDev) (GET_DOT11D_INFO(__pIeeeDev)->CountryIeLen > 0)
46+
47+
#define IS_EQUAL_CIE_SRC(__pIeeeDev, __pTa) eqMacAddr(GET_DOT11D_INFO(__pIeeeDev)->CountryIeSrcAddr, __pTa)
48+
#define UPDATE_CIE_SRC(__pIeeeDev, __pTa) cpMacAddr(GET_DOT11D_INFO(__pIeeeDev)->CountryIeSrcAddr, __pTa)
49+
50+
#define IS_COUNTRY_IE_CHANGED(__pIeeeDev, __Ie) \
51+
(((__Ie).Length == 0 || (__Ie).Length != GET_DOT11D_INFO(__pIeeeDev)->CountryIeLen) ? \
52+
FALSE : \
53+
(!memcmp(GET_DOT11D_INFO(__pIeeeDev)->CountryIeBuf, (__Ie).Octet, (__Ie).Length)))
54+
55+
#define CIE_WATCHDOG_TH 1
56+
#define GET_CIE_WATCHDOG(__pIeeeDev) GET_DOT11D_INFO(__pIeeeDev)->CountryIeWatchdog
57+
#define RESET_CIE_WATCHDOG(__pIeeeDev) GET_CIE_WATCHDOG(__pIeeeDev) = 0
58+
#define UPDATE_CIE_WATCHDOG(__pIeeeDev) ++GET_CIE_WATCHDOG(__pIeeeDev)
59+
60+
#define IS_DOT11D_STATE_DONE(__pIeeeDev) (GET_DOT11D_INFO(__pIeeeDev)->State == DOT11D_STATE_DONE)
61+
62+
63+
void
64+
Dot11d_Init(
65+
struct ieee80211_device *dev
66+
);
67+
68+
void
69+
Dot11d_Reset(
70+
struct ieee80211_device *dev
71+
);
72+
73+
void
74+
Dot11d_UpdateCountryIe(
75+
struct ieee80211_device *dev,
76+
u8 * pTaddr,
77+
u16 CoutryIeLen,
78+
u8 * pCoutryIe
79+
);
80+
81+
u8
82+
DOT11D_GetMaxTxPwrInDbm(
83+
struct ieee80211_device *dev,
84+
u8 Channel
85+
);
86+
87+
void
88+
DOT11D_ScanComplete(
89+
struct ieee80211_device * dev
90+
);
91+
92+
int IsLegalChannel(
93+
struct ieee80211_device * dev,
94+
u8 channel
95+
);
96+
97+
int ToLegalChannel(
98+
struct ieee80211_device * dev,
99+
u8 channel
100+
);
101+
#endif //ENABLE_DOT11D
102+
#endif // #ifndef __INC_DOT11D_H

0 commit comments

Comments
 (0)