Full support for Ginger Console
[linux-ginger.git] / drivers / staging / rt3090 / ap_wds.h
blobefcb107db4ffe8e6365a06373f6382017c8b9231
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_cfg.h
30 Abstract:
31 Miniport generic portion header file
33 Revision History:
34 Who When What
35 -------- ---------- ----------------------------------------------
36 Fonchi 02-13-2007 created
39 #ifndef _AP_WDS_H_
40 #define _AP_WDS_H_
42 #define WDS_ENTRY_RETRY_INTERVAL (100 * OS_HZ / 1000)
45 static inline BOOLEAN WDS_IF_UP_CHECK(
46 IN PRTMP_ADAPTER pAd,
47 IN ULONG ifidx)
49 if ((pAd->flg_wds_init != TRUE) ||
50 (ifidx >= MAX_WDS_ENTRY))
51 return FALSE;
53 // if (pAd->WdsTab.WdsEntry[ifidx].dev->flags & IFF_UP)
54 // Patch for wds ,when dirver call apmlmeperiod => APMlmeDynamicTxRateSwitching check if wds device ready
55 if ((pAd->WdsTab.WdsEntry[ifidx].dev != NULL) && (pAd->WdsTab.WdsEntry[ifidx].dev->flags & IFF_UP))
56 return TRUE;
58 return FALSE;
61 LONG WdsEntryAlloc(
62 IN PRTMP_ADAPTER pAd,
63 IN PUCHAR pAddr);
65 VOID WdsEntryDel(
66 IN PRTMP_ADAPTER pAd,
67 IN PUCHAR pAddr);
69 MAC_TABLE_ENTRY *MacTableInsertWDSEntry(
70 IN PRTMP_ADAPTER pAd,
71 IN PUCHAR pAddr,
72 UINT WdsTabIdx);
74 BOOLEAN MacTableDeleteWDSEntry(
75 IN PRTMP_ADAPTER pAd,
76 IN USHORT wcid,
77 IN PUCHAR pAddr);
80 BOOLEAN ApWdsAllowToSendPacket(
81 IN RTMP_ADAPTER *pAd,
82 IN PNDIS_PACKET pPacket,
83 OUT UCHAR *pWcid);
85 MAC_TABLE_ENTRY *WdsTableLookupByWcid(
86 IN PRTMP_ADAPTER pAd,
87 IN UCHAR wcid,
88 IN PUCHAR pAddr,
89 IN BOOLEAN bResetIdelCount);
91 MAC_TABLE_ENTRY *WdsTableLookup(
92 IN PRTMP_ADAPTER pAd,
93 IN PUCHAR pAddr,
94 IN BOOLEAN bResetIdelCount);
96 MAC_TABLE_ENTRY *FindWdsEntry(
97 IN PRTMP_ADAPTER pAd,
98 IN UCHAR Wcid,
99 IN PUCHAR pAddr,
100 IN UINT32 PhyMode);
102 VOID WdsTableMaintenance(
103 IN PRTMP_ADAPTER pAd);
105 VOID RT28xx_WDS_Init(
106 IN PRTMP_ADAPTER pAd,
107 IN PNET_DEV net_dev);
109 VOID RT28xx_WDS_Close(
110 IN PRTMP_ADAPTER pAd);
112 VOID RT28xx_WDS_Remove(
113 IN PRTMP_ADAPTER pAd);
115 VOID WdsDown(
116 IN PRTMP_ADAPTER pAd);
118 VOID AsicUpdateWdsRxWCIDTable(
119 IN PRTMP_ADAPTER pAd);
121 VOID AsicUpdateWdsEncryption(
122 IN PRTMP_ADAPTER pAd,
123 IN UCHAR wcid);
125 VOID WdsPeerBeaconProc(
126 IN PRTMP_ADAPTER pAd,
127 IN PMAC_TABLE_ENTRY pEntry,
128 IN USHORT CapabilityInfo,
129 IN UCHAR MaxSupportedRateIn500Kbps,
130 IN UCHAR MaxSupportedRateLen,
131 IN BOOLEAN bWmmCapable,
132 IN ULONG ClientRalinkIe,
133 IN HT_CAPABILITY_IE *pHtCapability,
134 IN UCHAR HtCapabilityLen);
136 VOID APWdsInitialize(
137 IN PRTMP_ADAPTER pAd);
139 INT Show_WdsTable_Proc(
140 IN PRTMP_ADAPTER pAd,
141 IN PSTRING arg);
143 VOID rtmp_read_wds_from_file(
144 IN PRTMP_ADAPTER pAd,
145 PSTRING tmpbuf,
146 PSTRING buffer);
148 VOID WdsPrepareWepKeyFromMainBss(
149 IN PRTMP_ADAPTER pAd);
151 INT WdsVirtualIFSendPackets(
152 IN PNDIS_PACKET pSkb,
153 IN PNET_DEV dev);
155 INT WdsVirtualIF_open(
156 IN PNET_DEV dev);
158 INT WdsVirtualIF_close(
159 IN PNET_DEV dev);
161 INT WdsVirtualIF_ioctl(
162 IN PNET_DEV net_dev,
163 IN OUT struct ifreq *rq,
164 IN INT cmd);
167 ==========================================================================
168 Description:
169 Check the WDS Entry is valid or not.
170 ==========================================================================
172 static inline BOOLEAN ValidWdsEntry(
173 IN PRTMP_ADAPTER pAd,
174 IN UCHAR WdsIndex)
176 BOOLEAN result;
177 PMAC_TABLE_ENTRY pMacEntry;
181 if (WdsIndex >= MAX_WDS_ENTRY)
183 result = FALSE;
184 break;
187 if (pAd->WdsTab.WdsEntry[WdsIndex].Valid != TRUE)
189 result = FALSE;
190 break;
193 if ((pAd->WdsTab.WdsEntry[WdsIndex].MacTabMatchWCID==0)
194 || (pAd->WdsTab.WdsEntry[WdsIndex].MacTabMatchWCID >= MAX_LEN_OF_MAC_TABLE))
196 result = FALSE;
197 break;
200 pMacEntry = &pAd->MacTab.Content[pAd->WdsTab.WdsEntry[WdsIndex].MacTabMatchWCID];
201 if (pMacEntry->ValidAsWDS != TRUE)
203 result = FALSE;
204 break;
207 result = TRUE;
208 } while(FALSE);
210 return result;
212 #endif // _AP_WDS_H_ //