aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/rtl8187se/ieee80211/dot11d.h
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@suse.de>2008-12-04 23:01:41 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2009-01-06 16:52:31 -0500
commitc8d86be38785705aca77e33933298c320a1bf2a5 (patch)
treeb188305415619e6901fb2f259861110d5762041a /drivers/staging/rtl8187se/ieee80211/dot11d.h
parentc8801d8c9f639153afb7c4926654f0769483348e (diff)
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: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging/rtl8187se/ieee80211/dot11d.h')
-rw-r--r--drivers/staging/rtl8187se/ieee80211/dot11d.h102
1 files changed, 102 insertions, 0 deletions
diff --git a/drivers/staging/rtl8187se/ieee80211/dot11d.h b/drivers/staging/rtl8187se/ieee80211/dot11d.h
new file mode 100644
index 00000000000..64bcf15bd21
--- /dev/null
+++ b/drivers/staging/rtl8187se/ieee80211/dot11d.h
@@ -0,0 +1,102 @@
1#ifndef __INC_DOT11D_H
2#define __INC_DOT11D_H
3
4#include "ieee80211.h"
5
6//#define ENABLE_DOT11D
7
8//#define DOT11D_MAX_CHNL_NUM 83
9
10typedef struct _CHNL_TXPOWER_TRIPLE {
11 u8 FirstChnl;
12 u8 NumChnls;
13 u8 MaxTxPowerInDbm;
14}CHNL_TXPOWER_TRIPLE, *PCHNL_TXPOWER_TRIPLE;
15
16typedef enum _DOT11D_STATE {
17 DOT11D_STATE_NONE = 0,
18 DOT11D_STATE_LEARNED,
19 DOT11D_STATE_DONE,
20}DOT11D_STATE;
21
22typedef struct _RT_DOT11D_INFO {
23 //DECLARE_RT_OBJECT(RT_DOT11D_INFO);
24
25 bool bEnabled; // dot11MultiDomainCapabilityEnabled
26
27 u16 CountryIeLen; // > 0 if CountryIeBuf[] contains valid country information element.
28 u8 CountryIeBuf[MAX_IE_LEN];
29 u8 CountryIeSrcAddr[6]; // Source AP of the country IE.
30 u8 CountryIeWatchdog;
31
32 u8 channel_map[MAX_CHANNEL_NUMBER+1]; //!!!Value 0: Invalid, 1: Valid (active scan), 2: Valid (passive scan)
33 //u8 ChnlListLen; // #Bytes valid in ChnlList[].
34 //u8 ChnlList[DOT11D_MAX_CHNL_NUM];
35 u8 MaxTxPwrDbmList[MAX_CHANNEL_NUMBER+1];
36
37 DOT11D_STATE State;
38}RT_DOT11D_INFO, *PRT_DOT11D_INFO;
39#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 )
40#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])
41#define GET_DOT11D_INFO(__pIeeeDev) ((PRT_DOT11D_INFO)((__pIeeeDev)->pDot11dInfo))
42
43#define IS_DOT11D_ENABLE(__pIeeeDev) GET_DOT11D_INFO(__pIeeeDev)->bEnabled
44#define IS_COUNTRY_IE_VALID(__pIeeeDev) (GET_DOT11D_INFO(__pIeeeDev)->CountryIeLen > 0)
45
46#define IS_EQUAL_CIE_SRC(__pIeeeDev, __pTa) eqMacAddr(GET_DOT11D_INFO(__pIeeeDev)->CountryIeSrcAddr, __pTa)
47#define UPDATE_CIE_SRC(__pIeeeDev, __pTa) cpMacAddr(GET_DOT11D_INFO(__pIeeeDev)->CountryIeSrcAddr, __pTa)
48
49#define IS_COUNTRY_IE_CHANGED(__pIeeeDev, __Ie) \
50 (((__Ie).Length == 0 || (__Ie).Length != GET_DOT11D_INFO(__pIeeeDev)->CountryIeLen) ? \
51 FALSE : \
52 (!memcmp(GET_DOT11D_INFO(__pIeeeDev)->CountryIeBuf, (__Ie).Octet, (__Ie).Length)))
53
54#define CIE_WATCHDOG_TH 1
55#define GET_CIE_WATCHDOG(__pIeeeDev) GET_DOT11D_INFO(__pIeeeDev)->CountryIeWatchdog
56#define RESET_CIE_WATCHDOG(__pIeeeDev) GET_CIE_WATCHDOG(__pIeeeDev) = 0
57#define UPDATE_CIE_WATCHDOG(__pIeeeDev) ++GET_CIE_WATCHDOG(__pIeeeDev)
58
59#define IS_DOT11D_STATE_DONE(__pIeeeDev) (GET_DOT11D_INFO(__pIeeeDev)->State == DOT11D_STATE_DONE)
60
61
62void
63Dot11d_Init(
64 struct ieee80211_device *dev
65 );
66
67void
68Dot11d_Reset(
69 struct ieee80211_device *dev
70 );
71
72void
73Dot11d_UpdateCountryIe(
74 struct ieee80211_device *dev,
75 u8 * pTaddr,
76 u16 CoutryIeLen,
77 u8 * pCoutryIe
78 );
79
80u8
81DOT11D_GetMaxTxPwrInDbm(
82 struct ieee80211_device *dev,
83 u8 Channel
84 );
85
86void
87DOT11D_ScanComplete(
88 struct ieee80211_device * dev
89 );
90
91int IsLegalChannel(
92 struct ieee80211_device * dev,
93 u8 channel
94);
95
96int ToLegalChannel(
97 struct ieee80211_device * dev,
98 u8 channel
99);
100
101void dump_chnl_map(u8 * channel_map);
102#endif // #ifndef __INC_DOT11D_H