blob: 9cad837aa7e77290ac8e3bdefd6da0f2ef91778b [file] [log] [blame]
Forest Bond92b96792009-06-13 07:38:31 -04001/*
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 *
20 * File: baseband.h
21 *
22 * Purpose: Implement functions to access baseband
23 *
24 * Author: Jerry Chen
25 *
26 * Date: Jun. 5, 2002
27 *
28 * Revision History:
29 * 06-10-2003 Bryan YC Fan: Re-write codes to support VT3253 spec.
30 * 08-26-2003 Kyle Hsu : Add defines of packet type and TX rate.
31 */
32
33#ifndef __BASEBAND_H__
34#define __BASEBAND_H__
35
36#if !defined(__TTYPE_H__)
37#include "ttype.h"
38#endif
39
40#if !defined(__TETHER_H__)
41#include "tether.h"
42#endif
43
44#if !defined(__DEVICE_H__)
45#include "device.h"
46#endif
47
48
49/*--------------------- Export Definitions -------------------------*/
50
51#define PREAMBLE_LONG 0
52#define PREAMBLE_SHORT 1
53
54//
55// Registers in the BASEBAND
56//
57#define BB_MAX_CONTEXT_SIZE 256
58
59#define C_SIFS_A 16 // micro sec.
60#define C_SIFS_BG 10
61
62#define C_EIFS 80 // micro sec.
63
64
65#define C_SLOT_SHORT 9 // micro sec.
66#define C_SLOT_LONG 20
67
68#define C_CWMIN_A 15 // slot time
69#define C_CWMIN_B 31
70
71#define C_CWMAX 1023 // slot time
72
73//0:11A 1:11B 2:11G
74#define BB_TYPE_11A 0
75#define BB_TYPE_11B 1
76#define BB_TYPE_11G 2
77
78//0:11a,1:11b,2:11gb(only CCK in BasicRate),3:11ga(OFDM in Basic Rate)
79#define PK_TYPE_11A 0
80#define PK_TYPE_11B 1
81#define PK_TYPE_11GB 2
82#define PK_TYPE_11GA 3
83
84#define TOP_RATE_54M 0x80000000
85#define TOP_RATE_48M 0x40000000
86#define TOP_RATE_36M 0x20000000
87#define TOP_RATE_24M 0x10000000
88#define TOP_RATE_18M 0x08000000
89#define TOP_RATE_12M 0x04000000
90#define TOP_RATE_11M 0x02000000
91#define TOP_RATE_9M 0x01000000
92#define TOP_RATE_6M 0x00800000
93#define TOP_RATE_55M 0x00400000
94#define TOP_RATE_2M 0x00200000
95#define TOP_RATE_1M 0x00100000
96
97
98/*--------------------- Export Types ------------------------------*/
99
100/*--------------------- Export Macros ------------------------------*/
101
102/*--------------------- Export Classes ----------------------------*/
103
104/*--------------------- Export Variables --------------------------*/
105
106/*--------------------- Export Functions --------------------------*/
107#ifdef __cplusplus
108extern "C" { /* Assume C declarations for C++ */
109#endif /* __cplusplus */
110
111UINT
112BBuGetFrameTime(
113 IN BYTE byPreambleType,
114 IN BYTE byFreqType,
115 IN UINT cbFrameLength,
116 IN WORD wRate
117 );
118
119VOID
120BBvCaculateParameter (
121 IN PSDevice pDevice,
122 IN UINT cbFrameLength,
123 IN WORD wRate,
124 IN BYTE byPacketType,
125 OUT PWORD pwPhyLen,
126 OUT PBYTE pbyPhySrv,
127 OUT PBYTE pbyPhySgn
128 );
129
130// timer for antenna diversity
131
132VOID
133TimerSQ3CallBack (
134 IN HANDLE hDeviceContext
135 );
136
137VOID
138TimerSQ3Tmax3CallBack (
139 IN HANDLE hDeviceContext
140 );
141
142VOID BBvAntennaDiversity (PSDevice pDevice, BYTE byRxRate, BYTE bySQ3);
143void BBvLoopbackOn (PSDevice pDevice);
144void BBvLoopbackOff (PSDevice pDevice);
145void BBvSoftwareReset (PSDevice pDevice);
146
147void BBvSetShortSlotTime(PSDevice pDevice);
148VOID BBvSetVGAGainOffset(PSDevice pDevice, BYTE byData);
149void BBvSetAntennaMode(PSDevice pDevice, BYTE byAntennaMode);
150BOOL BBbVT3184Init (PSDevice pDevice);
151VOID BBvSetDeepSleep (PSDevice pDevice);
152VOID BBvExitDeepSleep (PSDevice pDevice);
153VOID BBvUpdatePreEDThreshold(
154 IN PSDevice pDevice,
155 IN BOOL bScanning
156 );
157
158#ifdef __cplusplus
159} /* End of extern "C" { */
160#endif /* __cplusplus */
161
162
163#endif // __BASEBAND_H__