Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c8d86be3 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman
Browse files

Staging: add rtl8187se driver



This is a driver for the Realtek 8187 "SE" wireless PCI devices in some
netbook computers (MSI Wind, and others).  It includes its own copy of
the ieee80211 stack, but it is compiled into the driver to prevend
duplicate symbol issues.

This version comes from Ralink with no authorship, but it is based
on an old version of the rtl8180 driver from Andrea Merello.  It was
hacked up a bit to get it to build properly within the kernel tree and
to properly handle the merged wireless stack within the driver.

Cc: Andrea Merello <andreamrl@tiscali.it>
Cc: linux-wireless <linux-wireless@vger.kernel.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent c8801d8c
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -81,5 +81,7 @@ source "drivers/staging/panel/Kconfig"

source "drivers/staging/altpciechdma/Kconfig"

source "drivers/staging/rtl8187se/Kconfig"

endif # !STAGING_EXCLUDE_BUILD
endif # STAGING
+1 −0
Original line number Diff line number Diff line
@@ -23,3 +23,4 @@ obj-$(CONFIG_COMEDI) += comedi/
obj-$(CONFIG_ASUS_OLED)		+= asus_oled/
obj-$(CONFIG_PANEL)		+= panel/
obj-$(CONFIG_ALTERA_PCIE_CHDMA)	+= altpciechdma/
obj-$(CONFIG_RTL8187SE)		+= rtl8187se/
+5 −0
Original line number Diff line number Diff line
config RTL8187SE
	tristate "RealTek RTL8187SE Wireless LAN NIC driver"
	depends on PCI
	default N
	---help---
+54 −0
Original line number Diff line number Diff line

#EXTRA_CFLAGS += -DCONFIG_IEEE80211_NOWEP=y
#EXTRA_CFLAGS += -DCONFIG_RTL8180_IOMAP
#EXTRA_CFLAGS += -std=gnu89
#EXTRA_CFLAGS += -O2
#CC            = gcc
EXTRA_CFLAGS += -DTHOMAS_TURBO
#CFLAGS += -DCONFIG_RTL8185B
#CFLAGS += -DCONFIG_RTL818x_S

#added for EeePC testing
EXTRA_CFLAGS += -DENABLE_IPS
EXTRA_CFLAGS += -DSW_ANTE
EXTRA_CFLAGS += -DTX_TRACK
EXTRA_CFLAGS += -DHIGH_POWER
EXTRA_CFLAGS += -DSW_DIG
EXTRA_CFLAGS += -DRATE_ADAPT
EXTRA_CFLAGS += -DCONFIG_RTL8180_PM

#+YJ,080626
EXTRA_CFLAGS += -DENABLE_DOT11D

#enable it for legacy power save, disable it for leisure  power save
EXTRA_CFLAGS += -DENABLE_LPS


#EXTRA_CFLAGS += -mhard-float -DCONFIG_FORCE_HARD_FLOAT=y

r8187se-objs :=	r8180_core.o		\
		r8180_sa2400.o		\
		r8180_93cx6.o		\
		r8180_wx.o		\
		r8180_max2820.o		\
		r8180_gct.o		\
		r8180_rtl8225.o		\
		r8180_rtl8255.o		\
		r8180_rtl8225z2.o	\
		r8185b_init.o		\
		r8180_dm.o		\
		r8180_pm.o		\
		ieee80211/dot11d.o			\
		ieee80211/ieee80211_softmac.o		\
		ieee80211/ieee80211_rx.o		\
		ieee80211/ieee80211_tx.o		\
		ieee80211/ieee80211_wx.o		\
		ieee80211/ieee80211_module.o		\
		ieee80211/ieee80211_softmac_wx.o	\
		ieee80211/ieee80211_crypt.o		\
		ieee80211/ieee80211_crypt_tkip.o	\
		ieee80211/ieee80211_crypt_ccmp.o	\
		ieee80211/ieee80211_crypt_wep.o

obj-$(CONFIG_RTL8187SE)	+= r8187se.o
+101 −0
Original line number Diff line number Diff line
#ifndef __INC_DOT11D_H
#define __INC_DOT11D_H

#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 // #ifndef __INC_DOT11D_H
Loading