]>
Commit | Line | Data |
---|---|---|
5449c685 FB |
1 | /* |
2 | * Copyright (c) 1996, 2003 VIA Networking Technologies, Inc. | |
3 | * All rights reserved. | |
4 | * | |
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. | |
9 | * | |
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. | |
14 | * | |
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. | |
18 | * | |
19 | * File: card.h | |
20 | * | |
21 | * Purpose: Provide functions to setup NIC operation mode | |
22 | * | |
23 | * Author: Tevin Chen | |
24 | * | |
25 | * Date: May 21, 1996 | |
26 | * | |
27 | */ | |
28 | ||
5449c685 FB |
29 | #ifndef __CARD_H__ |
30 | #define __CARD_H__ | |
31 | ||
5449c685 | 32 | #include "ttype.h" |
7b6a0013 | 33 | #include <linux/types.h> |
5449c685 FB |
34 | |
35 | /*--------------------- Export Definitions -------------------------*/ | |
36 | // | |
37 | // Loopback mode | |
38 | // | |
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) | |
43 | ||
44 | ||
45 | #define DEFAULT_MSDU_LIFETIME 512 // ms | |
46 | #define DEFAULT_MSDU_LIFETIME_RES_64us 8000 // 64us | |
47 | ||
48 | #define DEFAULT_MGN_LIFETIME 8 // ms | |
49 | #define DEFAULT_MGN_LIFETIME_RES_64us 125 // 64us | |
50 | ||
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) | |
54 | ||
55 | typedef enum _CARD_PHY_TYPE { | |
56 | PHY_TYPE_AUTO, | |
57 | PHY_TYPE_11B, | |
58 | PHY_TYPE_11G, | |
59 | PHY_TYPE_11A | |
60 | } CARD_PHY_TYPE, *PCARD_PHY_TYPE; | |
61 | ||
62 | typedef enum _CARD_PKT_TYPE { | |
63 | PKT_TYPE_802_11_BCN, | |
64 | PKT_TYPE_802_11_MNG, | |
65 | PKT_TYPE_802_11_DATA, | |
66 | PKT_TYPE_802_11_ALL | |
67 | } CARD_PKT_TYPE, *PCARD_PKT_TYPE; | |
68 | ||
69 | typedef enum _CARD_STATUS_TYPE { | |
70 | CARD_STATUS_MEDIA_CONNECT, | |
71 | CARD_STATUS_MEDIA_DISCONNECT, | |
72 | CARD_STATUS_PMKID | |
73 | } CARD_STATUS_TYPE, *PCARD_STATUS_TYPE; | |
74 | ||
75 | typedef enum _CARD_OP_MODE { | |
76 | OP_MODE_INFRASTRUCTURE, | |
77 | OP_MODE_ADHOC, | |
78 | OP_MODE_AP, | |
79 | OP_MODE_UNKNOWN | |
80 | } CARD_OP_MODE, *PCARD_OP_MODE; | |
81 | ||
82 | ||
83 | ||
84 | /*--------------------- Export Classes ----------------------------*/ | |
85 | ||
86 | /*--------------------- Export Variables --------------------------*/ | |
87 | ||
88 | /*--------------------- Export Functions --------------------------*/ | |
5449c685 | 89 | |
830a619c CC |
90 | void CARDvSetRSPINF(void *pDeviceHandler, CARD_PHY_TYPE ePHYType); |
91 | void vUpdateIFS(void *pDeviceHandler); | |
92 | void CARDvUpdateBasicTopRate(void *pDeviceHandler); | |
7b6a0013 CC |
93 | bool CARDbAddBasicRate(void *pDeviceHandler, unsigned short wRateIdx); |
94 | bool CARDbIsOFDMinBasicRate(void *pDeviceHandler); | |
2986db5f | 95 | void CARDvSetLoopbackMode(unsigned long dwIoBase, unsigned short wLoopbackMode); |
7b6a0013 | 96 | bool CARDbSoftwareReset(void *pDeviceHandler); |
2986db5f CC |
97 | void CARDvSetFirstNextTBTT(unsigned long dwIoBase, unsigned short wBeaconInterval); |
98 | void CARDvUpdateNextTBTT(unsigned long dwIoBase, QWORD qwTSF, unsigned short wBeaconInterval); | |
7b6a0013 | 99 | bool CARDbGetCurrentTSF(unsigned long dwIoBase, PQWORD pqwCurrTSF); |
2986db5f | 100 | QWORD CARDqGetNextTBTT(QWORD qwTSF, unsigned short wBeaconInterval); |
3fc9b584 | 101 | QWORD CARDqGetTSFOffset(unsigned char byRxRate, QWORD qwTSF1, QWORD qwTSF2); |
7b6a0013 | 102 | bool CARDbSetTxPower(void *pDeviceHandler, unsigned long ulTxPower); |
3fc9b584 | 103 | unsigned char CARDbyGetPktType(void *pDeviceHandler); |
830a619c CC |
104 | void CARDvSafeResetTx(void *pDeviceHandler); |
105 | void CARDvSafeResetRx(void *pDeviceHandler); | |
5449c685 FB |
106 | |
107 | //xxx | |
7b6a0013 CC |
108 | bool CARDbRadioPowerOff(void *pDeviceHandler); |
109 | bool CARDbRadioPowerOn(void *pDeviceHandler); | |
110 | //bool CARDbSendPacket(void *pDeviceHandler, void *pPacket, CARD_PKT_TYPE ePktType, unsigned int uLength); | |
111 | bool CARDbIsShortPreamble(void *pDeviceHandler); | |
112 | bool CARDbIsShorSlotTime(void *pDeviceHandler); | |
113 | bool CARDbSetPhyParameter(void *pDeviceHandler, CARD_PHY_TYPE ePHYType, unsigned short wCapInfo, unsigned char byERPField, void *pvSupportRateIEs, void *pvExtSupportRateIEs); | |
114 | bool CARDbUpdateTSF(void *pDeviceHandler, unsigned char byRxRate, QWORD qwBSSTimestamp, QWORD qwLocalTSF); | |
115 | bool CARDbStopTxPacket(void *pDeviceHandler, CARD_PKT_TYPE ePktType); | |
116 | bool CARDbStartTxPacket(void *pDeviceHandler, CARD_PKT_TYPE ePktType); | |
117 | bool CARDbSetBeaconPeriod(void *pDeviceHandler, unsigned short wBeaconInterval); | |
118 | bool CARDbSetBSSID(void *pDeviceHandler, unsigned char *pbyBSSID, CARD_OP_MODE eOPMode); | |
119 | ||
120 | bool | |
5449c685 | 121 | CARDbPowerDown( |
830a619c | 122 | void *pDeviceHandler |
5449c685 FB |
123 | ); |
124 | ||
7b6a0013 | 125 | bool CARDbSetTxDataRate( |
830a619c | 126 | void *pDeviceHandler, |
2986db5f | 127 | unsigned short wDataRate |
5449c685 FB |
128 | ); |
129 | ||
130 | ||
7b6a0013 | 131 | bool CARDbRemoveKey (void *pDeviceHandler, unsigned char *pbyBSSID); |
5449c685 | 132 | |
7b6a0013 | 133 | bool |
5449c685 | 134 | CARDbAdd_PMKID_Candidate ( |
3a215e0f | 135 | void *pDeviceHandler, |
2989e96f | 136 | unsigned char *pbyBSSID, |
7b6a0013 | 137 | bool bRSNCapExist, |
2986db5f | 138 | unsigned short wRSNCap |
5449c685 FB |
139 | ); |
140 | ||
830a619c | 141 | void * |
5449c685 | 142 | CARDpGetCurrentAddress ( |
3a215e0f | 143 | void *pDeviceHandler |
5449c685 FB |
144 | ); |
145 | ||
7b6a0013 | 146 | bool |
5449c685 | 147 | CARDbStartMeasure ( |
3a215e0f CC |
148 | void *pDeviceHandler, |
149 | void *pvMeasureEIDs, | |
b6e95cd5 | 150 | unsigned int uNumOfMeasureEIDs |
5449c685 FB |
151 | ); |
152 | ||
7b6a0013 | 153 | bool |
5449c685 | 154 | CARDbChannelSwitch ( |
3a215e0f | 155 | void *pDeviceHandler, |
3fc9b584 CC |
156 | unsigned char byMode, |
157 | unsigned char byNewChannel, | |
158 | unsigned char byCount | |
5449c685 FB |
159 | ); |
160 | ||
7b6a0013 | 161 | bool |
5449c685 | 162 | CARDbSetQuiet ( |
3a215e0f | 163 | void *pDeviceHandler, |
7b6a0013 | 164 | bool bResetQuiet, |
3fc9b584 CC |
165 | unsigned char byQuietCount, |
166 | unsigned char byQuietPeriod, | |
2986db5f CC |
167 | unsigned short wQuietDuration, |
168 | unsigned short wQuietOffset | |
5449c685 FB |
169 | ); |
170 | ||
7b6a0013 | 171 | bool |
5449c685 | 172 | CARDbStartQuiet ( |
3a215e0f | 173 | void *pDeviceHandler |
5449c685 FB |
174 | ); |
175 | ||
6b35b7b3 | 176 | void |
5449c685 | 177 | CARDvSetPowerConstraint ( |
3a215e0f | 178 | void *pDeviceHandler, |
3fc9b584 | 179 | unsigned char byChannel, |
ec28c7fa | 180 | char byPower |
5449c685 FB |
181 | ); |
182 | ||
6b35b7b3 | 183 | void |
5449c685 | 184 | CARDvGetPowerCapability ( |
3a215e0f | 185 | void *pDeviceHandler, |
2989e96f CC |
186 | unsigned char *pbyMinPower, |
187 | unsigned char *pbyMaxPower | |
5449c685 FB |
188 | ); |
189 | ||
ec28c7fa | 190 | char |
5449c685 | 191 | CARDbyGetTransmitPower ( |
3a215e0f | 192 | void *pDeviceHandler |
5449c685 FB |
193 | ); |
194 | ||
5449c685 FB |
195 | #endif // __CARD_H__ |
196 | ||
197 | ||
198 |