Skip to content

Commit

Permalink
Staging: add rtl8192SU wireless usb driver
Browse files Browse the repository at this point in the history
Driver from Realtek for the Realtek RTL8192 USB wifi device

Based on the r8187 driver from Andrea Merello <andreamrl@tiscali.it> and
others.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Jerry Chuang authored and gregkh committed Jun 19, 2009
1 parent d01c3c8 commit 5f53d8c
Show file tree
Hide file tree
Showing 86 changed files with 78,441 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/staging/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ source "drivers/staging/altpciechdma/Kconfig"

source "drivers/staging/rtl8187se/Kconfig"

source "drivers/staging/rtl8192su/Kconfig"

source "drivers/staging/rspiusb/Kconfig"

source "drivers/staging/mimio/Kconfig"
Expand Down
1 change: 1 addition & 0 deletions drivers/staging/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ obj-$(CONFIG_ASUS_OLED) += asus_oled/
obj-$(CONFIG_PANEL) += panel/
obj-$(CONFIG_ALTERA_PCIE_CHDMA) += altpciechdma/
obj-$(CONFIG_RTL8187SE) += rtl8187se/
obj-$(CONFIG_RTL8192SU) += rtl8192su/
obj-$(CONFIG_USB_RSPI) += rspiusb/
obj-$(CONFIG_INPUT_MIMIO) += mimio/
obj-$(CONFIG_TRANZPORT) += frontier/
Expand Down
6 changes: 6 additions & 0 deletions drivers/staging/rtl8192su/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
config RTL8192SU
tristate "RealTek RTL8192SU Wireless LAN NIC driver"
depends on PCI
depends on WIRELESS_EXT && COMPAT_NET_DEV_OPS
default N
---help---
66 changes: 66 additions & 0 deletions drivers/staging/rtl8192su/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
NIC_SELECT = RTL8192SU

EXTRA_CFLAGS += -std=gnu89
EXTRA_CFLAGS += -O2
EXTRA_CFLAGS += -mhard-float -DCONFIG_FORCE_HARD_FLOAT=y

EXTRA_CFLAGS += -DJACKSON_NEW_RX
EXTRA_CFLAGS += -DTHOMAS_BEACON -DTHOMAS_TURBO
#EXTRA_CFLAGS += -DUSE_ONE_PIPE
EXTRA_CFLAGS += -DENABLE_DOT11D

EXTRA_CFLAGS += -DRTL8192SU
EXTRA_CFLAGS += -DRTL8190_Download_Firmware_From_Header=1
EXTRA_CFLAGS += -DRTL8192S_PREPARE_FOR_NORMAL_RELEASE
EXTRA_CFLAGS += -DRTL8192SU_DISABLE_IQK=1

#EXTRA_CFLAGS += -DEEPROM_OLD_FORMAT_SUPPORT

#EXTRA_CFLAGS += -DUSB_RX_AGGREGATION_SUPPORT=0
#EXTRA_CFLAGS += -DUSB_TX_DRIVER_AGGREGATION_ENABLE=0
#EXTRA_CFLAGS += -DRTL8192SU_DISABLE_CCK_RATE=0
EXTRA_CFLAGS += -DRTL8192S_DISABLE_FW_DM=0
EXTRA_CFLAGS += -DDISABLE_BB_RF=0
EXTRA_CFLAGS += -DRTL8192SU_USE_PARAM_TXPWR=0
EXTRA_CFLAGS += -DRTL8192SU_FPGA_UNSPECIFIED_NETWORK=0
#EXTRA_CFLAGS += -DRTL8192SU_FPGA_2MAC_VERIFICATION #=0
EXTRA_CFLAGS += -DRTL8192SU_ASIC_VERIFICATION
EXTRA_CFLAGS += -DRTL8192SU_USB_PHY_TEST=0

#EXTRA_CFLAGS += -DMUTIPLE_BULK_OUT
EXTRA_CFLAGS += -DCONFIG_RTL8192_PM

r8192s_usb-objs := \
r8180_93cx6.o \
r8192U_wx.o \
r8192S_phy.o \
r8192S_rtl6052.o \
r8192S_rtl8225.o \
r819xU_cmdpkt.o \
r8192U_dm.o \
r8192SU_HWImg.o \
r8192S_firmware.o \
r8192S_Efuse.o \
r8192U_core.o \
r8192U_pm.o

ieee80211-rsl-objs := \
ieee80211/ieee80211_rx.o \
ieee80211/ieee80211_softmac.o \
ieee80211/ieee80211_tx.o \
ieee80211/ieee80211_wx.o \
ieee80211/ieee80211_module.o \
ieee80211/ieee80211_softmac_wx.o\
ieee80211/rtl819x_HTProc.o \
ieee80211/rtl819x_TSProc.o \
ieee80211/rtl819x_BAProc.o \
ieee80211/dot11d.o

obj-$(CONFIG_RTL8192SU) += r8192s_usb.o
obj-$(CONFIG_RTL8192SU) += ieee80211-rsl.o
obj-$(CONFIG_RTL8192SU) += ieee80211/ieee80211_crypt.o
obj-$(CONFIG_RTL8192SU) += ieee80211/ieee80211_crypt_tkip.o
obj-$(CONFIG_RTL8192SU) += ieee80211/ieee80211_crypt_ccmp.o
obj-$(CONFIG_RTL8192SU) += ieee80211/ieee80211_crypt_wep.o


1 change: 1 addition & 0 deletions drivers/staging/rtl8192su/authors
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Andrea Merello <andreamrl@tiscali.it>
102 changes: 102 additions & 0 deletions drivers/staging/rtl8192su/dot11d.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
#ifndef __INC_DOT11D_H
#define __INC_DOT11D_H

#ifdef ENABLE_DOT11D
#include "ieee80211.h"

//#define ENABLE_DOT11D

//#define DOT11D_MAX_CHNL_NUM 83

typedef struct _CHNL_TXPOWER_TRIPLE {
u8 FirstChnl;
u8 NumChnls;
u8 MaxTxPowerInDbm;
}CHNL_TXPOWER_TRIPLE, *PCHNL_TXPOWER_TRIPLE;

typedef enum _DOT11D_STATE {
DOT11D_STATE_NONE = 0,
DOT11D_STATE_LEARNED,
DOT11D_STATE_DONE,
}DOT11D_STATE;

typedef struct _RT_DOT11D_INFO {
//DECLARE_RT_OBJECT(RT_DOT11D_INFO);

bool bEnabled; // dot11MultiDomainCapabilityEnabled

u16 CountryIeLen; // > 0 if CountryIeBuf[] contains valid country information element.
u8 CountryIeBuf[MAX_IE_LEN];
u8 CountryIeSrcAddr[6]; // Source AP of the country IE.
u8 CountryIeWatchdog;

u8 channel_map[MAX_CHANNEL_NUMBER+1]; //!!!Value 0: Invalid, 1: Valid (active scan), 2: Valid (passive scan)
//u8 ChnlListLen; // #Bytes valid in ChnlList[].
//u8 ChnlList[DOT11D_MAX_CHNL_NUM];
u8 MaxTxPwrDbmList[MAX_CHANNEL_NUMBER+1];

DOT11D_STATE State;
}RT_DOT11D_INFO, *PRT_DOT11D_INFO;
#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 )
#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])
#define GET_DOT11D_INFO(__pIeeeDev) ((PRT_DOT11D_INFO)((__pIeeeDev)->pDot11dInfo))

#define IS_DOT11D_ENABLE(__pIeeeDev) GET_DOT11D_INFO(__pIeeeDev)->bEnabled
#define IS_COUNTRY_IE_VALID(__pIeeeDev) (GET_DOT11D_INFO(__pIeeeDev)->CountryIeLen > 0)

#define IS_EQUAL_CIE_SRC(__pIeeeDev, __pTa) eqMacAddr(GET_DOT11D_INFO(__pIeeeDev)->CountryIeSrcAddr, __pTa)
#define UPDATE_CIE_SRC(__pIeeeDev, __pTa) cpMacAddr(GET_DOT11D_INFO(__pIeeeDev)->CountryIeSrcAddr, __pTa)

#define IS_COUNTRY_IE_CHANGED(__pIeeeDev, __Ie) \
(((__Ie).Length == 0 || (__Ie).Length != GET_DOT11D_INFO(__pIeeeDev)->CountryIeLen) ? \
FALSE : \
(!memcmp(GET_DOT11D_INFO(__pIeeeDev)->CountryIeBuf, (__Ie).Octet, (__Ie).Length)))

#define CIE_WATCHDOG_TH 1
#define GET_CIE_WATCHDOG(__pIeeeDev) GET_DOT11D_INFO(__pIeeeDev)->CountryIeWatchdog
#define RESET_CIE_WATCHDOG(__pIeeeDev) GET_CIE_WATCHDOG(__pIeeeDev) = 0
#define UPDATE_CIE_WATCHDOG(__pIeeeDev) ++GET_CIE_WATCHDOG(__pIeeeDev)

#define IS_DOT11D_STATE_DONE(__pIeeeDev) (GET_DOT11D_INFO(__pIeeeDev)->State == DOT11D_STATE_DONE)


void
Dot11d_Init(
struct ieee80211_device *dev
);

void
Dot11d_Reset(
struct ieee80211_device *dev
);

void
Dot11d_UpdateCountryIe(
struct ieee80211_device *dev,
u8 * pTaddr,
u16 CoutryIeLen,
u8 * pCoutryIe
);

u8
DOT11D_GetMaxTxPwrInDbm(
struct ieee80211_device *dev,
u8 Channel
);

void
DOT11D_ScanComplete(
struct ieee80211_device * dev
);

int IsLegalChannel(
struct ieee80211_device * dev,
u8 channel
);

int ToLegalChannel(
struct ieee80211_device * dev,
u8 channel
);
#endif //ENABLE_DOT11D
#endif // #ifndef __INC_DOT11D_H

0 comments on commit 5f53d8c

Please sign in to comment.