2 * Copyright (c) 1996, 2003 VIA Networking Technologies, Inc.
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License along
16 * with this program; if not, write to the Free Software Foundation, Inc.,
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
21 * Purpose: Provide functions to setup NIC operation mode
34 /*--------------------- Export Definitions -------------------------*/
38 // LOBYTE is MAC LB mode, HIBYTE is MII LB mode
39 #define CARD_LB_NONE MAKEWORD(MAC_LB_NONE, 0)
40 #define CARD_LB_MAC MAKEWORD(MAC_LB_INTERNAL, 0) // PHY must ISO, avoid MAC loopback packet go out
41 #define CARD_LB_PHY MAKEWORD(MAC_LB_EXT, 0)
44 #define DEFAULT_MSDU_LIFETIME 512 // ms
45 #define DEFAULT_MSDU_LIFETIME_RES_64us 8000 // 64us
47 #define DEFAULT_MGN_LIFETIME 8 // ms
48 #define DEFAULT_MGN_LIFETIME_RES_64us 125 // 64us
50 #define CB_MAX_CHANNEL_24G 14
51 #define CB_MAX_CHANNEL_5G 42 //[20050104] add channel9(5045MHz), 41==>42
52 #define CB_MAX_CHANNEL (CB_MAX_CHANNEL_24G+CB_MAX_CHANNEL_5G)
54 typedef enum _CARD_PHY_TYPE
{
59 } CARD_PHY_TYPE
, *PCARD_PHY_TYPE
;
61 typedef enum _CARD_PKT_TYPE
{
66 } CARD_PKT_TYPE
, *PCARD_PKT_TYPE
;
68 typedef enum _CARD_STATUS_TYPE
{
69 CARD_STATUS_MEDIA_CONNECT
,
70 CARD_STATUS_MEDIA_DISCONNECT
,
72 } CARD_STATUS_TYPE
, *PCARD_STATUS_TYPE
;
74 typedef enum _CARD_OP_MODE
{
75 OP_MODE_INFRASTRUCTURE
,
79 } CARD_OP_MODE
, *PCARD_OP_MODE
;
83 /*--------------------- Export Classes ----------------------------*/
85 /*--------------------- Export Variables --------------------------*/
87 /*--------------------- Export Functions --------------------------*/
89 BOOL
ChannelValid(UINT CountryCode
, UINT ChannelIndex
);
90 void CARDvSetRSPINF(PVOID pDeviceHandler
, CARD_PHY_TYPE ePHYType
);
91 void vUpdateIFS(PVOID pDeviceHandler
);
92 void CARDvUpdateBasicTopRate(PVOID pDeviceHandler
);
93 BOOL
CARDbAddBasicRate(PVOID pDeviceHandler
, WORD wRateIdx
);
94 BOOL
CARDbIsOFDMinBasicRate(PVOID pDeviceHandler
);
95 void CARDvSetLoopbackMode(DWORD_PTR dwIoBase
, WORD wLoopbackMode
);
96 BOOL
CARDbSoftwareReset(PVOID pDeviceHandler
);
97 void CARDvSetFirstNextTBTT(DWORD_PTR dwIoBase
, WORD wBeaconInterval
);
98 void CARDvUpdateNextTBTT(DWORD_PTR dwIoBase
, QWORD qwTSF
, WORD wBeaconInterval
);
99 BOOL
CARDbGetCurrentTSF(DWORD_PTR dwIoBase
, PQWORD pqwCurrTSF
);
100 QWORD
CARDqGetNextTBTT(QWORD qwTSF
, WORD wBeaconInterval
);
101 QWORD
CARDqGetTSFOffset(BYTE byRxRate
, QWORD qwTSF1
, QWORD qwTSF2
);
102 BOOL
CARDbSetTxPower(PVOID pDeviceHandler
, ULONG ulTxPower
);
103 BYTE
CARDbyGetPktType(PVOID pDeviceHandler
);
104 VOID
CARDvSafeResetTx(PVOID pDeviceHandler
);
105 VOID
CARDvSafeResetRx(PVOID pDeviceHandler
);
108 BOOL
CARDbRadioPowerOff(PVOID pDeviceHandler
);
109 BOOL
CARDbRadioPowerOn(PVOID pDeviceHandler
);
110 BOOL
CARDbSetChannel(PVOID pDeviceHandler
, UINT uConnectionChannel
);
111 //BOOL CARDbSendPacket(PVOID pDeviceHandler, PVOID pPacket, CARD_PKT_TYPE ePktType, UINT uLength);
112 BOOL
CARDbIsShortPreamble(PVOID pDeviceHandler
);
113 BOOL
CARDbIsShorSlotTime(PVOID pDeviceHandler
);
114 BOOL
CARDbSetPhyParameter(PVOID pDeviceHandler
, CARD_PHY_TYPE ePHYType
, WORD wCapInfo
, BYTE byERPField
, PVOID pvSupportRateIEs
, PVOID pvExtSupportRateIEs
);
115 BOOL
CARDbUpdateTSF(PVOID pDeviceHandler
, BYTE byRxRate
, QWORD qwBSSTimestamp
, QWORD qwLocalTSF
);
116 BOOL
CARDbStopTxPacket(PVOID pDeviceHandler
, CARD_PKT_TYPE ePktType
);
117 BOOL
CARDbStartTxPacket(PVOID pDeviceHandler
, CARD_PKT_TYPE ePktType
);
118 BOOL
CARDbSetBeaconPeriod(PVOID pDeviceHandler
, WORD wBeaconInterval
);
119 BOOL
CARDbSetBSSID(PVOID pDeviceHandler
, PBYTE pbyBSSID
, CARD_OP_MODE eOPMode
);
126 BOOL
CARDbSetTxDataRate(
127 PVOID pDeviceHandler
,
132 BOOL
CARDbRemoveKey (PVOID pDeviceHandler
, PBYTE pbyBSSID
);
135 CARDbAdd_PMKID_Candidate (
136 IN PVOID pDeviceHandler
,
138 IN BOOL bRSNCapExist
,
143 CARDpGetCurrentAddress (
144 IN PVOID pDeviceHandler
148 VOID
CARDvInitChannelTable(PVOID pDeviceHandler
);
149 BYTE
CARDbyGetChannelMapping(PVOID pDeviceHandler
, BYTE byChannelNumber
, CARD_PHY_TYPE ePhyType
);
153 IN PVOID pDeviceHandler
,
154 IN PVOID pvMeasureEIDs
,
155 IN UINT uNumOfMeasureEIDs
160 IN PVOID pDeviceHandler
,
162 IN BYTE byNewChannel
,
168 IN PVOID pDeviceHandler
,
170 IN BYTE byQuietCount
,
171 IN BYTE byQuietPeriod
,
172 IN WORD wQuietDuration
,
178 IN PVOID pDeviceHandler
182 CARDvSetCountryInfo (
183 IN PVOID pDeviceHandler
,
184 IN CARD_PHY_TYPE ePHYType
,
189 CARDvSetPowerConstraint (
190 IN PVOID pDeviceHandler
,
196 CARDvGetPowerCapability (
197 IN PVOID pDeviceHandler
,
198 OUT PBYTE pbyMinPower
,
199 OUT PBYTE pbyMaxPower
203 CARDbySetSupportChannels (
204 IN PVOID pDeviceHandler
,
209 CARDbyGetTransmitPower (
210 IN PVOID pDeviceHandler
214 CARDbChannelGetList (
215 IN UINT uCountryCodeIdx
,
216 OUT PBYTE pbyChannelTable
221 IN PVOID pDeviceHandler
,
226 CARDbGetChannelMapInfo(
227 IN PVOID pDeviceHandler
,
228 IN UINT uChannelIndex
,
229 OUT PBYTE pbyChannelNumber
,
234 CARDvSetChannelMapInfo(
235 IN PVOID pDeviceHandler
,
236 IN UINT uChannelIndex
,
241 CARDvClearChannelMapInfo(
242 IN PVOID pDeviceHandler
246 CARDbyAutoChannelSelect(
247 IN PVOID pDeviceHandler
,
248 CARD_PHY_TYPE ePHYType
251 BYTE
CARDbyGetChannelNumber(PVOID pDeviceHandler
, BYTE byChannelIndex
);