2 *************************************************************************
4 * 5F., No.36, Taiyuan St., Jhubei City,
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. *
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. *
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. *
25 *************************************************************************
31 Miniport generic portion header file
35 -------- ---------- ----------------------------------------------
36 Shiang, Fonchi 02-13-2007 created
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) \
57 if ((idx) >= MAX_APCLI_NUM) \
60 DBGPRINT(RT_DEBUG_ERROR, ("%s> Error! apcli-idx > MAX_APCLI_NUM!\n", __FUNCTION__)); \
64 typedef struct _APCLI_MLME_JOIN_REQ_STRUCT
{
65 UCHAR Bssid
[MAC_ADDR_LEN
];
67 UCHAR Ssid
[MAX_LEN_OF_SSID
];
68 } APCLI_MLME_JOIN_REQ_STRUCT
;
70 typedef struct _STA_CTRL_JOIN_REQ_STRUCT
{
72 } APCLI_CTRL_MSG_STRUCT
, *PSTA_CTRL_MSG_STRUCT
;
74 BOOLEAN
isValidApCliIf(
78 // Private routines in apcli_ctrl.c
80 VOID
ApCliCtrlStateMachineInit(
82 IN STATE_MACHINE_EX
*Sm
,
83 OUT STATE_MACHINE_FUNC_EX Trans
[]);
86 // Private routines in apcli_sync.c
88 VOID
ApCliSyncStateMachineInit(
90 IN STATE_MACHINE_EX
*Sm
,
91 OUT STATE_MACHINE_FUNC_EX Trans
[]);
94 // Private routines in apcli_auth.c
96 VOID
ApCliAuthStateMachineInit(
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
,
115 BOOLEAN
ApCliAllowToSendPacket(
116 IN RTMP_ADAPTER
*pAd
,
117 IN PNDIS_PACKET pPacket
,
120 BOOLEAN
ApCliValidateRSNIE(
121 IN PRTMP_ADAPTER pAd
,
122 IN PEID_STRUCT pEid_ptr
,
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
);
141 IN PRTMP_ADAPTER pAd
,
144 INT
ApCli_VirtualIF_Open(
147 INT
ApCli_VirtualIF_Close(
150 INT
ApCli_VirtualIF_PacketSend(
151 IN PNDIS_PACKET skb_p
,
154 INT
ApCli_VirtualIF_Ioctl(
156 IN OUT
struct ifreq
*rq_p
,
160 VOID
ApCliMgtMacHeaderInit(
161 IN PRTMP_ADAPTER pAd
,
162 IN OUT PHEADER_802_11 pHdr80211
,
169 #ifdef DOT11_N_SUPPORT
170 BOOLEAN
ApCliCheckHt(
171 IN PRTMP_ADAPTER pAd
,
173 IN OUT HT_CAPABILITY_IE
*pHtCapability
,
174 IN OUT ADD_HT_INFO_IE
*pAddHtInfo
);
175 #endif // DOT11_N_SUPPORT //
178 IN PRTMP_ADAPTER pAd
,
182 IN PRTMP_ADAPTER pAd
,
186 IN PRTMP_ADAPTER pAd
);
189 IN PRTMP_ADAPTER pAd
);
192 IN PRTMP_ADAPTER pAd
);
194 BOOLEAN
ApCliMsgTypeSubst(
195 IN PRTMP_ADAPTER pAd
,
196 IN PFRAME_802_11 pFrame
,
200 BOOLEAN
preCheckMsgTypeSubset(
201 IN PRTMP_ADAPTER pAd
,
202 IN PFRAME_802_11 pFrame
,
206 BOOLEAN
ApCliPeerAssocRspSanity(
207 IN PRTMP_ADAPTER pAd
,
211 OUT USHORT
*pCapabilityInfo
,
215 OUT UCHAR
*pSupRateLen
,
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
,
245 IN MAC_TABLE_ENTRY
*pEntry
,
248 BOOLEAN
ApCliParseKeyData(
249 IN PRTMP_ADAPTER pAd
,
252 IN MAC_TABLE_ENTRY
*pEntry
,
254 IN UCHAR bPairewise
);
256 BOOLEAN
ApCliHandleRxBroadcastFrame(
257 IN PRTMP_ADAPTER pAd
,
259 IN MAC_TABLE_ENTRY
*pEntry
,
260 IN UCHAR FromWhichBSSID
);
262 VOID
APCliUpdatePairwiseKeyTable(
263 IN PRTMP_ADAPTER pAd
,
265 IN MAC_TABLE_ENTRY
*pEntry
);
267 BOOLEAN
APCliUpdateSharedKeyTable(
268 IN PRTMP_ADAPTER pAd
,
271 IN UCHAR DefaultKeyIdx
,
272 IN MAC_TABLE_ENTRY
*pEntry
);
274 #endif // APCLI_SUPPORT //
276 #endif /* _AP_APCLI_H_ */