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 #include <linux/types.h>
35 /*--------------------- Export Definitions -------------------------*/
39 // LOBYTE is MAC LB mode, HIBYTE is MII LB mode
40 #define CARD_LB_NONE MAKEWORD(MAC_LB_NONE, 0)
41 #define CARD_LB_MAC MAKEWORD(MAC_LB_INTERNAL, 0) // PHY must ISO, avoid MAC loopback packet go out
42 #define CARD_LB_PHY MAKEWORD(MAC_LB_EXT, 0)
45 #define DEFAULT_MSDU_LIFETIME 512 // ms
46 #define DEFAULT_MSDU_LIFETIME_RES_64us 8000 // 64us
48 #define DEFAULT_MGN_LIFETIME 8 // ms
49 #define DEFAULT_MGN_LIFETIME_RES_64us 125 // 64us
51 #define CB_MAX_CHANNEL_24G 14
52 #define CB_MAX_CHANNEL_5G 42 //[20050104] add channel9(5045MHz), 41==>42
53 #define CB_MAX_CHANNEL (CB_MAX_CHANNEL_24G+CB_MAX_CHANNEL_5G)
55 typedef enum _CARD_PHY_TYPE
{
60 } CARD_PHY_TYPE
, *PCARD_PHY_TYPE
;
62 typedef enum _CARD_PKT_TYPE
{
67 } CARD_PKT_TYPE
, *PCARD_PKT_TYPE
;
69 typedef enum _CARD_STATUS_TYPE
{
70 CARD_STATUS_MEDIA_CONNECT
,
71 CARD_STATUS_MEDIA_DISCONNECT
,
73 } CARD_STATUS_TYPE
, *PCARD_STATUS_TYPE
;
75 typedef enum _CARD_OP_MODE
{
76 OP_MODE_INFRASTRUCTURE
,
80 } CARD_OP_MODE
, *PCARD_OP_MODE
;
84 /*--------------------- Export Classes ----------------------------*/
86 /*--------------------- Export Variables --------------------------*/
88 /*--------------------- Export Functions --------------------------*/
90 void CARDvSetRSPINF(void *pDeviceHandler
, CARD_PHY_TYPE ePHYType
);
91 void vUpdateIFS(void *pDeviceHandler
);
92 void CARDvUpdateBasicTopRate(void *pDeviceHandler
);
93 bool CARDbAddBasicRate(void *pDeviceHandler
, unsigned short wRateIdx
);
94 bool CARDbIsOFDMinBasicRate(void *pDeviceHandler
);
95 void CARDvSetLoopbackMode(unsigned long dwIoBase
, unsigned short wLoopbackMode
);
96 bool CARDbSoftwareReset(void *pDeviceHandler
);
97 void CARDvSetFirstNextTBTT(unsigned long dwIoBase
, unsigned short wBeaconInterval
);
98 void CARDvUpdateNextTBTT(unsigned long dwIoBase
, QWORD qwTSF
, unsigned short wBeaconInterval
);
99 bool CARDbGetCurrentTSF(unsigned long dwIoBase
, PQWORD pqwCurrTSF
);
100 QWORD
CARDqGetNextTBTT(QWORD qwTSF
, unsigned short wBeaconInterval
);
101 QWORD
CARDqGetTSFOffset(unsigned char byRxRate
, QWORD qwTSF1
, QWORD qwTSF2
);
102 bool CARDbSetTxPower(void *pDeviceHandler
, unsigned long ulTxPower
);
103 unsigned char CARDbyGetPktType(void *pDeviceHandler
);
104 void CARDvSafeResetTx(void *pDeviceHandler
);
105 void CARDvSafeResetRx(void *pDeviceHandler
);
107 bool CARDbRadioPowerOff(void *pDeviceHandler
);
108 bool CARDbRadioPowerOn(void *pDeviceHandler
);
109 //bool CARDbSendPacket(void *pDeviceHandler, void *pPacket, CARD_PKT_TYPE ePktType, unsigned int uLength);
110 bool CARDbIsShortPreamble(void *pDeviceHandler
);
111 bool CARDbIsShorSlotTime(void *pDeviceHandler
);
112 bool CARDbSetPhyParameter(void *pDeviceHandler
, CARD_PHY_TYPE ePHYType
, unsigned short wCapInfo
, unsigned char byERPField
, void *pvSupportRateIEs
, void *pvExtSupportRateIEs
);
113 bool CARDbUpdateTSF(void *pDeviceHandler
, unsigned char byRxRate
, QWORD qwBSSTimestamp
, QWORD qwLocalTSF
);
114 bool CARDbStopTxPacket(void *pDeviceHandler
, CARD_PKT_TYPE ePktType
);
115 bool CARDbStartTxPacket(void *pDeviceHandler
, CARD_PKT_TYPE ePktType
);
116 bool CARDbSetBeaconPeriod(void *pDeviceHandler
, unsigned short wBeaconInterval
);
117 bool CARDbSetBSSID(void *pDeviceHandler
, unsigned char *pbyBSSID
, CARD_OP_MODE eOPMode
);
124 bool CARDbSetTxDataRate(
125 void *pDeviceHandler
,
126 unsigned short wDataRate
130 bool CARDbRemoveKey (void *pDeviceHandler
, unsigned char *pbyBSSID
);
133 CARDbAdd_PMKID_Candidate (
134 void *pDeviceHandler
,
135 unsigned char *pbyBSSID
,
137 unsigned short wRSNCap
141 CARDpGetCurrentAddress (
147 void *pDeviceHandler
,
149 unsigned int uNumOfMeasureEIDs
154 void *pDeviceHandler
,
155 unsigned char byMode
,
156 unsigned char byNewChannel
,
157 unsigned char byCount
162 void *pDeviceHandler
,
164 unsigned char byQuietCount
,
165 unsigned char byQuietPeriod
,
166 unsigned short wQuietDuration
,
167 unsigned short wQuietOffset
176 CARDvSetPowerConstraint (
177 void *pDeviceHandler
,
178 unsigned char byChannel
,
183 CARDvGetPowerCapability (
184 void *pDeviceHandler
,
185 unsigned char *pbyMinPower
,
186 unsigned char *pbyMaxPower
190 CARDbyGetTransmitPower (