Full support for Ginger Console
[linux-ginger.git] / drivers / staging / rt3090 / ap_apcli.h
blobd363c36b82872e74338fd4628f6a5f287f1e91b5
1 /*
2 *************************************************************************
3 * Ralink Tech Inc.
4 * 5F., No.36, Taiyuan St., Jhubei City,
5 * Hsinchu County 302,
6 * Taiwan, R.O.C.
8 * (c) Copyright 2002-2007, Ralink Technology, Inc.
10 * This program is free software; you can redistribute it and/or modify *
11 * it under the terms of the GNU General Public License as published by *
12 * the Free Software Foundation; either version 2 of the License, or *
13 * (at your option) any later version. *
14 * *
15 * This program is distributed in the hope that it will be useful, *
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
18 * GNU General Public License for more details. *
19 * *
20 * You should have received a copy of the GNU General Public License *
21 * along with this program; if not, write to the *
22 * Free Software Foundation, Inc., *
23 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
24 * *
25 *************************************************************************
27 Module Name:
28 ap_apcli.h
30 Abstract:
31 Miniport generic portion header file
33 Revision History:
34 Who When What
35 -------- ---------- ----------------------------------------------
36 Shiang, Fonchi 02-13-2007 created
39 #ifndef _AP_APCLI_H_
40 #define _AP_APCLI_H_
42 #ifdef APCLI_SUPPORT
44 #include "rtmp.h"
46 #define AUTH_TIMEOUT 300 // unit: msec
47 #define ASSOC_TIMEOUT 300 // unit: msec
48 //#define JOIN_TIMEOUT 2000 // unit: msec // not used in Ap-client mode, remove it
49 #define PROBE_TIMEOUT 1000 // unit: msec
51 #define APCLI_ROOT_BSSID_GET(pAd, wcid) ((pAd)->MacTab.Content[(wcid)].Addr)
52 #define APCLI_IF_UP_CHECK(pAd, ifidx) ((pAd)->ApCfg.ApCliTab[(ifidx)].dev->flags & IFF_UP)
54 /* sanity check for apidx */
55 #define APCLI_MR_APIDX_SANITY_CHECK(idx) \
56 { \
57 if ((idx) >= MAX_APCLI_NUM) \
58 { \
59 (idx) = 0; \
60 DBGPRINT(RT_DEBUG_ERROR, ("%s> Error! apcli-idx > MAX_APCLI_NUM!\n", __FUNCTION__)); \
61 } \
64 typedef struct _APCLI_MLME_JOIN_REQ_STRUCT {
65 UCHAR Bssid[MAC_ADDR_LEN];
66 UCHAR SsidLen;
67 UCHAR Ssid[MAX_LEN_OF_SSID];
68 } APCLI_MLME_JOIN_REQ_STRUCT;
70 typedef struct _STA_CTRL_JOIN_REQ_STRUCT {
71 USHORT Status;
72 } APCLI_CTRL_MSG_STRUCT, *PSTA_CTRL_MSG_STRUCT;
74 BOOLEAN isValidApCliIf(
75 SHORT ifIndex);
78 // Private routines in apcli_ctrl.c
80 VOID ApCliCtrlStateMachineInit(
81 IN PRTMP_ADAPTER pAd,
82 IN STATE_MACHINE_EX *Sm,
83 OUT STATE_MACHINE_FUNC_EX Trans[]);
86 // Private routines in apcli_sync.c
88 VOID ApCliSyncStateMachineInit(
89 IN PRTMP_ADAPTER pAd,
90 IN STATE_MACHINE_EX *Sm,
91 OUT STATE_MACHINE_FUNC_EX Trans[]);
94 // Private routines in apcli_auth.c
96 VOID ApCliAuthStateMachineInit(
97 IN PRTMP_ADAPTER pAd,
98 IN STATE_MACHINE_EX *Sm,
99 OUT STATE_MACHINE_FUNC_EX Trans[]);
102 // Private routines in apcli_assoc.c
104 VOID ApCliAssocStateMachineInit(
105 IN PRTMP_ADAPTER pAd,
106 IN STATE_MACHINE_EX *Sm,
107 OUT STATE_MACHINE_FUNC_EX Trans[]);
109 MAC_TABLE_ENTRY *ApCliTableLookUpByWcid(
110 IN PRTMP_ADAPTER pAd,
111 IN UCHAR wcid,
112 IN PUCHAR pAddrs);
115 BOOLEAN ApCliAllowToSendPacket(
116 IN RTMP_ADAPTER *pAd,
117 IN PNDIS_PACKET pPacket,
118 OUT UCHAR *pWcid);
120 BOOLEAN ApCliValidateRSNIE(
121 IN PRTMP_ADAPTER pAd,
122 IN PEID_STRUCT pEid_ptr,
123 IN USHORT eid_len,
124 IN USHORT idx);
126 VOID RT28xx_ApCli_Init(
127 IN PRTMP_ADAPTER pAd,
128 IN PNET_DEV pPhyNetDev);
130 VOID RT28xx_ApCli_Close(
131 IN PRTMP_ADAPTER pAd);
133 VOID RT28xx_ApCli_Remove(
134 IN PRTMP_ADAPTER pAd);
137 VOID RT28xx_ApCli_Remove(
138 IN PRTMP_ADAPTER ad_p);
140 INT ApCliIfLookUp(
141 IN PRTMP_ADAPTER pAd,
142 IN PUCHAR pAddr);
144 INT ApCli_VirtualIF_Open(
145 IN PNET_DEV dev_p);
147 INT ApCli_VirtualIF_Close(
148 IN PNET_DEV dev_p);
150 INT ApCli_VirtualIF_PacketSend(
151 IN PNDIS_PACKET skb_p,
152 IN PNET_DEV dev_p);
154 INT ApCli_VirtualIF_Ioctl(
155 IN PNET_DEV dev_p,
156 IN OUT struct ifreq *rq_p,
157 IN INT cmd);
160 VOID ApCliMgtMacHeaderInit(
161 IN PRTMP_ADAPTER pAd,
162 IN OUT PHEADER_802_11 pHdr80211,
163 IN UCHAR SubType,
164 IN UCHAR ToDs,
165 IN PUCHAR pDA,
166 IN PUCHAR pBssid,
167 IN USHORT ifIndex);
169 #ifdef DOT11_N_SUPPORT
170 BOOLEAN ApCliCheckHt(
171 IN PRTMP_ADAPTER pAd,
172 IN USHORT IfIndex,
173 IN OUT HT_CAPABILITY_IE *pHtCapability,
174 IN OUT ADD_HT_INFO_IE *pAddHtInfo);
175 #endif // DOT11_N_SUPPORT //
177 BOOLEAN ApCliLinkUp(
178 IN PRTMP_ADAPTER pAd,
179 IN UCHAR ifIndex);
181 VOID ApCliLinkDown(
182 IN PRTMP_ADAPTER pAd,
183 IN UCHAR ifIndex);
185 VOID ApCliIfUp(
186 IN PRTMP_ADAPTER pAd);
188 VOID ApCliIfDown(
189 IN PRTMP_ADAPTER pAd);
191 VOID ApCliIfMonitor(
192 IN PRTMP_ADAPTER pAd);
194 BOOLEAN ApCliMsgTypeSubst(
195 IN PRTMP_ADAPTER pAd,
196 IN PFRAME_802_11 pFrame,
197 OUT INT *Machine,
198 OUT INT *MsgType);
200 BOOLEAN preCheckMsgTypeSubset(
201 IN PRTMP_ADAPTER pAd,
202 IN PFRAME_802_11 pFrame,
203 OUT INT *Machine,
204 OUT INT *MsgType);
206 BOOLEAN ApCliPeerAssocRspSanity(
207 IN PRTMP_ADAPTER pAd,
208 IN VOID *pMsg,
209 IN ULONG MsgLen,
210 OUT PUCHAR pAddr2,
211 OUT USHORT *pCapabilityInfo,
212 OUT USHORT *pStatus,
213 OUT USHORT *pAid,
214 OUT UCHAR SupRate[],
215 OUT UCHAR *pSupRateLen,
216 OUT UCHAR ExtRate[],
217 OUT UCHAR *pExtRateLen,
218 OUT HT_CAPABILITY_IE *pHtCapability,
219 OUT ADD_HT_INFO_IE *pAddHtInfo, // AP might use this additional ht info IE
220 OUT UCHAR *pHtCapabilityLen,
221 OUT UCHAR *pAddHtInfoLen,
222 OUT UCHAR *pNewExtChannelOffset,
223 OUT PEDCA_PARM pEdcaParm,
224 OUT UCHAR *pCkipFlag);
226 VOID ApCliPeerPairMsg1Action(
227 IN PRTMP_ADAPTER pAd,
228 IN MAC_TABLE_ENTRY *pEntry,
229 IN MLME_QUEUE_ELEM *Elem);
231 VOID ApCliPeerPairMsg3Action(
232 IN PRTMP_ADAPTER pAd,
233 IN MAC_TABLE_ENTRY *pEntry,
234 IN MLME_QUEUE_ELEM *Elem);
236 VOID ApCliPeerGroupMsg1Action(
237 IN PRTMP_ADAPTER pAd,
238 IN MAC_TABLE_ENTRY *pEntry,
239 IN MLME_QUEUE_ELEM *Elem);
241 BOOLEAN ApCliCheckRSNIE(
242 IN PRTMP_ADAPTER pAd,
243 IN PUCHAR pData,
244 IN UCHAR DataLen,
245 IN MAC_TABLE_ENTRY *pEntry,
246 OUT UCHAR *Offset);
248 BOOLEAN ApCliParseKeyData(
249 IN PRTMP_ADAPTER pAd,
250 IN PUCHAR pKeyData,
251 IN UCHAR KeyDataLen,
252 IN MAC_TABLE_ENTRY *pEntry,
253 IN UCHAR IfIdx,
254 IN UCHAR bPairewise);
256 BOOLEAN ApCliHandleRxBroadcastFrame(
257 IN PRTMP_ADAPTER pAd,
258 IN RX_BLK *pRxBlk,
259 IN MAC_TABLE_ENTRY *pEntry,
260 IN UCHAR FromWhichBSSID);
262 VOID APCliUpdatePairwiseKeyTable(
263 IN PRTMP_ADAPTER pAd,
264 IN UCHAR *KeyRsc,
265 IN MAC_TABLE_ENTRY *pEntry);
267 BOOLEAN APCliUpdateSharedKeyTable(
268 IN PRTMP_ADAPTER pAd,
269 IN PUCHAR pKey,
270 IN UCHAR KeyLen,
271 IN UCHAR DefaultKeyIdx,
272 IN MAC_TABLE_ENTRY *pEntry);
274 #endif // APCLI_SUPPORT //
276 #endif /* _AP_APCLI_H_ */