]> Pileus Git - ~andy/linux/blob - drivers/staging/vt6656/card.h
Merge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
[~andy/linux] / drivers / staging / vt6656 / 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 #include "device.h"
32 #include "ttype.h"
33
34 /*---------------------  Export Definitions -------------------------*/
35
36 /*---------------------  Export Classes  ----------------------------*/
37
38 /* init card type */
39
40 typedef enum _CARD_PHY_TYPE {
41     PHY_TYPE_AUTO = 0,
42     PHY_TYPE_11B,
43     PHY_TYPE_11G,
44     PHY_TYPE_11A
45 } CARD_PHY_TYPE, *PCARD_PHY_TYPE;
46
47 typedef enum _CARD_OP_MODE {
48     OP_MODE_INFRASTRUCTURE = 0,
49     OP_MODE_ADHOC,
50     OP_MODE_AP,
51     OP_MODE_UNKNOWN
52 } CARD_OP_MODE, *PCARD_OP_MODE;
53
54 #define CB_MAX_CHANNEL_24G  14
55 #define CB_MAX_CHANNEL_5G       42 /* add channel9(5045MHz), 41==>42 */
56 #define CB_MAX_CHANNEL      (CB_MAX_CHANNEL_24G+CB_MAX_CHANNEL_5G)
57
58 /*---------------------  Export Variables  --------------------------*/
59
60 /*---------------------  Export Functions  --------------------------*/
61 struct vnt_private;
62
63 void CARDbSetMediaChannel(struct vnt_private *pDevice, u32 uConnectionChannel);
64 void CARDvSetRSPINF(struct vnt_private *pDevice, u8 byBBType);
65 void vUpdateIFS(struct vnt_private *pDevice);
66 void CARDvUpdateBasicTopRate(struct vnt_private *pDevice);
67 void CARDbAddBasicRate(struct vnt_private *pDevice, u16 wRateIdx);
68 int CARDbIsOFDMinBasicRate(struct vnt_private *pDevice);
69 void CARDvAdjustTSF(struct vnt_private *pDevice, u8 byRxRate,
70                 u64 qwBSSTimestamp, u64 qwLocalTSF);
71 bool CARDbGetCurrentTSF(struct vnt_private *pDevice, u64 *pqwCurrTSF);
72 bool CARDbClearCurrentTSF(struct vnt_private *pDevice);
73 void CARDvSetFirstNextTBTT(struct vnt_private *pDevice, WORD wBeaconInterval);
74 void CARDvUpdateNextTBTT(struct vnt_private *pDevice, u64 qwTSF,
75                          WORD wBeaconInterval);
76 u64 CARDqGetNextTBTT(u64 qwTSF, WORD wBeaconInterval);
77 u64 CARDqGetTSFOffset(BYTE byRxRate, u64 qwTSF1, u64 qwTSF2);
78 int CARDbRadioPowerOff(struct vnt_private *pDevice);
79 int CARDbRadioPowerOn(struct vnt_private *pDevice);
80 u8 CARDbyGetPktType(struct vnt_private *pDevice);
81 void CARDvSetBSSMode(struct vnt_private *pDevice);
82 int CARDbChannelSwitch(struct vnt_private *pDevice, u8 byMode,
83         u8 byNewChannel, u8 byCount);
84
85 #endif /* __CARD_H__ */