]> Pileus Git - ~andy/linux/blob - drivers/staging/vt6655/card.h
4c5a085f430304c21a2a4f26406763903500c222
[~andy/linux] / drivers / staging / vt6655 / card.h
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
29 #ifndef __CARD_H__
30 #define __CARD_H__
31
32 #include "ttype.h"
33
34 /*---------------------  Export Definitions -------------------------*/
35 //
36 // Loopback mode
37 //
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)
42
43
44 #define DEFAULT_MSDU_LIFETIME           512  // ms
45 #define DEFAULT_MSDU_LIFETIME_RES_64us  8000 // 64us
46
47 #define DEFAULT_MGN_LIFETIME            8    // ms
48 #define DEFAULT_MGN_LIFETIME_RES_64us   125  // 64us
49
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)
53
54 typedef enum _CARD_PHY_TYPE {
55     PHY_TYPE_AUTO,
56     PHY_TYPE_11B,
57     PHY_TYPE_11G,
58     PHY_TYPE_11A
59 } CARD_PHY_TYPE, *PCARD_PHY_TYPE;
60
61 typedef enum _CARD_PKT_TYPE {
62     PKT_TYPE_802_11_BCN,
63     PKT_TYPE_802_11_MNG,
64     PKT_TYPE_802_11_DATA,
65     PKT_TYPE_802_11_ALL
66 } CARD_PKT_TYPE, *PCARD_PKT_TYPE;
67
68 typedef enum _CARD_STATUS_TYPE {
69     CARD_STATUS_MEDIA_CONNECT,
70     CARD_STATUS_MEDIA_DISCONNECT,
71     CARD_STATUS_PMKID
72 } CARD_STATUS_TYPE, *PCARD_STATUS_TYPE;
73
74 typedef enum _CARD_OP_MODE {
75     OP_MODE_INFRASTRUCTURE,
76     OP_MODE_ADHOC,
77     OP_MODE_AP,
78     OP_MODE_UNKNOWN
79 } CARD_OP_MODE, *PCARD_OP_MODE;
80
81
82
83 /*---------------------  Export Classes  ----------------------------*/
84
85 /*---------------------  Export Variables  --------------------------*/
86
87 /*---------------------  Export Functions  --------------------------*/
88
89 void CARDvSetRSPINF(void *pDeviceHandler, CARD_PHY_TYPE ePHYType);
90 void vUpdateIFS(void *pDeviceHandler);
91 void CARDvUpdateBasicTopRate(void *pDeviceHandler);
92 BOOL CARDbAddBasicRate(void *pDeviceHandler, unsigned short wRateIdx);
93 BOOL CARDbIsOFDMinBasicRate(void *pDeviceHandler);
94 void CARDvSetLoopbackMode(unsigned long dwIoBase, unsigned short wLoopbackMode);
95 BOOL CARDbSoftwareReset(void *pDeviceHandler);
96 void CARDvSetFirstNextTBTT(unsigned long dwIoBase, unsigned short wBeaconInterval);
97 void CARDvUpdateNextTBTT(unsigned long dwIoBase, QWORD qwTSF, unsigned short wBeaconInterval);
98 BOOL CARDbGetCurrentTSF(unsigned long dwIoBase, PQWORD pqwCurrTSF);
99 QWORD CARDqGetNextTBTT(QWORD qwTSF, unsigned short wBeaconInterval);
100 QWORD CARDqGetTSFOffset(unsigned char byRxRate, QWORD qwTSF1, QWORD qwTSF2);
101 BOOL CARDbSetTxPower(void *pDeviceHandler, unsigned long ulTxPower);
102 unsigned char CARDbyGetPktType(void *pDeviceHandler);
103 void CARDvSafeResetTx(void *pDeviceHandler);
104 void CARDvSafeResetRx(void *pDeviceHandler);
105
106 //xxx
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);
118
119 BOOL
120 CARDbPowerDown(
121     void *pDeviceHandler
122     );
123
124 BOOL CARDbSetTxDataRate(
125     void *pDeviceHandler,
126     unsigned short wDataRate
127     );
128
129
130 BOOL CARDbRemoveKey (void *pDeviceHandler, unsigned char *pbyBSSID);
131
132 BOOL
133 CARDbAdd_PMKID_Candidate (
134     void *pDeviceHandler,
135     unsigned char *pbyBSSID,
136     BOOL             bRSNCapExist,
137     unsigned short wRSNCap
138     );
139
140 void *
141 CARDpGetCurrentAddress (
142     void *pDeviceHandler
143     );
144
145 BOOL
146 CARDbStartMeasure (
147     void *pDeviceHandler,
148     void *pvMeasureEIDs,
149     unsigned int uNumOfMeasureEIDs
150     );
151
152 BOOL
153 CARDbChannelSwitch (
154     void *pDeviceHandler,
155     unsigned char byMode,
156     unsigned char byNewChannel,
157     unsigned char byCount
158     );
159
160 BOOL
161 CARDbSetQuiet (
162     void *pDeviceHandler,
163     BOOL             bResetQuiet,
164     unsigned char byQuietCount,
165     unsigned char byQuietPeriod,
166     unsigned short wQuietDuration,
167     unsigned short wQuietOffset
168     );
169
170 BOOL
171 CARDbStartQuiet (
172     void *pDeviceHandler
173     );
174
175 void
176 CARDvSetPowerConstraint (
177     void *pDeviceHandler,
178     unsigned char byChannel,
179     char byPower
180     );
181
182 void
183 CARDvGetPowerCapability (
184     void *pDeviceHandler,
185     unsigned char *pbyMinPower,
186     unsigned char *pbyMaxPower
187     );
188
189 char
190 CARDbyGetTransmitPower (
191     void *pDeviceHandler
192     );
193
194 #endif // __CARD_H__
195
196
197