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>
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)
43 #define DEFAULT_MSDU_LIFETIME 512 // ms
44 #define DEFAULT_MSDU_LIFETIME_RES_64us 8000 // 64us
46 #define DEFAULT_MGN_LIFETIME 8 // ms
47 #define DEFAULT_MGN_LIFETIME_RES_64us 125 // 64us
49 #define CB_MAX_CHANNEL_24G 14
50 #define CB_MAX_CHANNEL_5G 42
51 #define CB_MAX_CHANNEL (CB_MAX_CHANNEL_24G+CB_MAX_CHANNEL_5G)
53 typedef enum _CARD_PHY_TYPE {
58 } CARD_PHY_TYPE, *PCARD_PHY_TYPE;
60 typedef enum _CARD_PKT_TYPE {
65 } CARD_PKT_TYPE, *PCARD_PKT_TYPE;
67 typedef enum _CARD_STATUS_TYPE {
68 CARD_STATUS_MEDIA_CONNECT,
69 CARD_STATUS_MEDIA_DISCONNECT,
71 } CARD_STATUS_TYPE, *PCARD_STATUS_TYPE;
73 typedef enum _CARD_OP_MODE {
74 OP_MODE_INFRASTRUCTURE,
78 } CARD_OP_MODE, *PCARD_OP_MODE;
80 void CARDvSetRSPINF(void *pDeviceHandler, CARD_PHY_TYPE ePHYType);
81 void vUpdateIFS(void *pDeviceHandler);
82 void CARDvUpdateBasicTopRate(void *pDeviceHandler);
83 bool CARDbAddBasicRate(void *pDeviceHandler, unsigned short wRateIdx);
84 bool CARDbIsOFDMinBasicRate(void *pDeviceHandler);
85 void CARDvSetLoopbackMode(void __iomem *dwIoBase, unsigned short wLoopbackMode);
86 bool CARDbSoftwareReset(void *pDeviceHandler);
87 void CARDvSetFirstNextTBTT(void __iomem *dwIoBase, unsigned short wBeaconInterval);
88 void CARDvUpdateNextTBTT(void __iomem *dwIoBase, QWORD qwTSF, unsigned short wBeaconInterval);
89 bool CARDbGetCurrentTSF(void __iomem *dwIoBase, PQWORD pqwCurrTSF);
90 QWORD CARDqGetNextTBTT(QWORD qwTSF, unsigned short wBeaconInterval);
91 QWORD CARDqGetTSFOffset(unsigned char byRxRate, QWORD qwTSF1, QWORD qwTSF2);
92 bool CARDbSetTxPower(void *pDeviceHandler, unsigned long ulTxPower);
93 unsigned char CARDbyGetPktType(void *pDeviceHandler);
94 void CARDvSafeResetTx(void *pDeviceHandler);
95 void CARDvSafeResetRx(void *pDeviceHandler);
97 bool CARDbRadioPowerOff(void *pDeviceHandler);
98 bool CARDbRadioPowerOn(void *pDeviceHandler);
99 bool CARDbIsShortPreamble(void *pDeviceHandler);
100 bool CARDbIsShorSlotTime(void *pDeviceHandler);
101 bool CARDbSetPhyParameter(void *pDeviceHandler, CARD_PHY_TYPE ePHYType, unsigned short wCapInfo, unsigned char byERPField, void *pvSupportRateIEs, void *pvExtSupportRateIEs);
102 bool CARDbUpdateTSF(void *pDeviceHandler, unsigned char byRxRate, QWORD qwBSSTimestamp, QWORD qwLocalTSF);
103 bool CARDbStopTxPacket(void *pDeviceHandler, CARD_PKT_TYPE ePktType);
104 bool CARDbStartTxPacket(void *pDeviceHandler, CARD_PKT_TYPE ePktType);
105 bool CARDbSetBeaconPeriod(void *pDeviceHandler, unsigned short wBeaconInterval);
106 bool CARDbSetBSSID(void *pDeviceHandler, unsigned char *pbyBSSID, CARD_OP_MODE eOPMode);
113 bool CARDbSetTxDataRate(
114 void *pDeviceHandler,
115 unsigned short wDataRate
118 bool CARDbRemoveKey(void *pDeviceHandler, unsigned char *pbyBSSID);
121 CARDbAdd_PMKID_Candidate(
122 void *pDeviceHandler,
123 unsigned char *pbyBSSID,
125 unsigned short wRSNCap
129 CARDpGetCurrentAddress(
135 void *pDeviceHandler,
137 unsigned int uNumOfMeasureEIDs
142 void *pDeviceHandler,
143 unsigned char byMode,
144 unsigned char byNewChannel,
145 unsigned char byCount
150 void *pDeviceHandler,
152 unsigned char byQuietCount,
153 unsigned char byQuietPeriod,
154 unsigned short wQuietDuration,
155 unsigned short wQuietOffset
164 CARDvSetPowerConstraint(
165 void *pDeviceHandler,
166 unsigned char byChannel,
171 CARDvGetPowerCapability(
172 void *pDeviceHandler,
173 unsigned char *pbyMinPower,
174 unsigned char *pbyMaxPower
178 CARDbyGetTransmitPower(