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
33 //#if !defined(__DEVICE_H__)
36 #if !defined(__TTYPE_H__)
43 /*--------------------- Export Definitions -------------------------*/
47 // LOBYTE is MAC LB mode, HIBYTE is MII LB mode
48 #define CARD_LB_NONE MAKEWORD(MAC_LB_NONE, 0)
49 #define CARD_LB_MAC MAKEWORD(MAC_LB_INTERNAL, 0) // PHY must ISO, avoid MAC loopback packet go out
50 #define CARD_LB_PHY MAKEWORD(MAC_LB_EXT, 0)
53 #define DEFAULT_MSDU_LIFETIME 512 // ms
54 #define DEFAULT_MSDU_LIFETIME_RES_64us 8000 // 64us
56 #define DEFAULT_MGN_LIFETIME 8 // ms
57 #define DEFAULT_MGN_LIFETIME_RES_64us 125 // 64us
59 #define CB_MAX_CHANNEL_24G 14
60 #define CB_MAX_CHANNEL_5G 42 //[20050104] add channel9(5045MHz), 41==>42
61 #define CB_MAX_CHANNEL (CB_MAX_CHANNEL_24G+CB_MAX_CHANNEL_5G)
63 typedef enum _CARD_PHY_TYPE
{
68 } CARD_PHY_TYPE
, *PCARD_PHY_TYPE
;
70 typedef enum _CARD_PKT_TYPE
{
75 } CARD_PKT_TYPE
, *PCARD_PKT_TYPE
;
77 typedef enum _CARD_STATUS_TYPE
{
78 CARD_STATUS_MEDIA_CONNECT
,
79 CARD_STATUS_MEDIA_DISCONNECT
,
81 } CARD_STATUS_TYPE
, *PCARD_STATUS_TYPE
;
83 typedef enum _CARD_OP_MODE
{
84 OP_MODE_INFRASTRUCTURE
,
88 } CARD_OP_MODE
, *PCARD_OP_MODE
;
92 /*--------------------- Export Classes ----------------------------*/
94 /*--------------------- Export Variables --------------------------*/
96 /*--------------------- Export Functions --------------------------*/
98 extern "C" { /* Assume C declarations for C++ */
99 #endif /* __cplusplus */
101 BOOL
ChannelValid(UINT CountryCode
, UINT ChannelIndex
);
102 void CARDvSetRSPINF(PVOID pDeviceHandler
, CARD_PHY_TYPE ePHYType
);
103 void vUpdateIFS(PVOID pDeviceHandler
);
104 void CARDvUpdateBasicTopRate(PVOID pDeviceHandler
);
105 BOOL
CARDbAddBasicRate(PVOID pDeviceHandler
, WORD wRateIdx
);
106 BOOL
CARDbIsOFDMinBasicRate(PVOID pDeviceHandler
);
107 void CARDvSetLoopbackMode(DWORD_PTR dwIoBase
, WORD wLoopbackMode
);
108 BOOL
CARDbSoftwareReset(PVOID pDeviceHandler
);
109 void CARDvSetFirstNextTBTT(DWORD_PTR dwIoBase
, WORD wBeaconInterval
);
110 void CARDvUpdateNextTBTT(DWORD_PTR dwIoBase
, QWORD qwTSF
, WORD wBeaconInterval
);
111 BOOL
CARDbGetCurrentTSF(DWORD_PTR dwIoBase
, PQWORD pqwCurrTSF
);
112 QWORD
CARDqGetNextTBTT(QWORD qwTSF
, WORD wBeaconInterval
);
113 QWORD
CARDqGetTSFOffset(BYTE byRxRate
, QWORD qwTSF1
, QWORD qwTSF2
);
114 BOOL
CARDbSetTxPower(PVOID pDeviceHandler
, ULONG ulTxPower
);
115 BYTE
CARDbyGetPktType(PVOID pDeviceHandler
);
116 VOID
CARDvSafeResetTx(PVOID pDeviceHandler
);
117 VOID
CARDvSafeResetRx(PVOID pDeviceHandler
);
120 BOOL
CARDbRadioPowerOff(PVOID pDeviceHandler
);
121 BOOL
CARDbRadioPowerOn(PVOID pDeviceHandler
);
122 BOOL
CARDbSetChannel(PVOID pDeviceHandler
, UINT uConnectionChannel
);
123 //BOOL CARDbSendPacket(PVOID pDeviceHandler, PVOID pPacket, CARD_PKT_TYPE ePktType, UINT uLength);
124 BOOL
CARDbIsShortPreamble(PVOID pDeviceHandler
);
125 BOOL
CARDbIsShorSlotTime(PVOID pDeviceHandler
);
126 BOOL
CARDbSetPhyParameter(PVOID pDeviceHandler
, CARD_PHY_TYPE ePHYType
, WORD wCapInfo
, BYTE byERPField
, PVOID pvSupportRateIEs
, PVOID pvExtSupportRateIEs
);
127 BOOL
CARDbUpdateTSF(PVOID pDeviceHandler
, BYTE byRxRate
, QWORD qwBSSTimestamp
, QWORD qwLocalTSF
);
128 BOOL
CARDbStopTxPacket(PVOID pDeviceHandler
, CARD_PKT_TYPE ePktType
);
129 BOOL
CARDbStartTxPacket(PVOID pDeviceHandler
, CARD_PKT_TYPE ePktType
);
130 BOOL
CARDbSetBeaconPeriod(PVOID pDeviceHandler
, WORD wBeaconInterval
);
131 BOOL
CARDbSetBSSID(PVOID pDeviceHandler
, PBYTE pbyBSSID
, CARD_OP_MODE eOPMode
);
138 BOOL
CARDbSetTxDataRate(
139 PVOID pDeviceHandler
,
144 BOOL
CARDbRemoveKey (PVOID pDeviceHandler
, PBYTE pbyBSSID
);
147 CARDbAdd_PMKID_Candidate (
148 IN PVOID pDeviceHandler
,
150 IN BOOL bRSNCapExist
,
155 CARDpGetCurrentAddress (
156 IN PVOID pDeviceHandler
160 VOID
CARDvInitChannelTable(PVOID pDeviceHandler
);
161 BYTE
CARDbyGetChannelMapping(PVOID pDeviceHandler
, BYTE byChannelNumber
, CARD_PHY_TYPE ePhyType
);
165 IN PVOID pDeviceHandler
,
166 IN PVOID pvMeasureEIDs
,
167 IN UINT uNumOfMeasureEIDs
172 IN PVOID pDeviceHandler
,
174 IN BYTE byNewChannel
,
180 IN PVOID pDeviceHandler
,
182 IN BYTE byQuietCount
,
183 IN BYTE byQuietPeriod
,
184 IN WORD wQuietDuration
,
190 IN PVOID pDeviceHandler
194 CARDvSetCountryInfo (
195 IN PVOID pDeviceHandler
,
196 IN CARD_PHY_TYPE ePHYType
,
201 CARDvSetPowerConstraint (
202 IN PVOID pDeviceHandler
,
208 CARDvGetPowerCapability (
209 IN PVOID pDeviceHandler
,
210 OUT PBYTE pbyMinPower
,
211 OUT PBYTE pbyMaxPower
215 CARDbySetSupportChannels (
216 IN PVOID pDeviceHandler
,
221 CARDbyGetTransmitPower (
222 IN PVOID pDeviceHandler
226 CARDbChannelGetList (
227 IN UINT uCountryCodeIdx
,
228 OUT PBYTE pbyChannelTable
233 IN PVOID pDeviceHandler
,
238 CARDbGetChannelMapInfo(
239 IN PVOID pDeviceHandler
,
240 IN UINT uChannelIndex
,
241 OUT PBYTE pbyChannelNumber
,
246 CARDvSetChannelMapInfo(
247 IN PVOID pDeviceHandler
,
248 IN UINT uChannelIndex
,
253 CARDvClearChannelMapInfo(
254 IN PVOID pDeviceHandler
258 CARDbyAutoChannelSelect(
259 IN PVOID pDeviceHandler
,
260 CARD_PHY_TYPE ePHYType
263 BYTE
CARDbyGetChannelNumber(PVOID pDeviceHandler
, BYTE byChannelIndex
);
266 } /* End of extern "C" { */
267 #endif /* __cplusplus */