Forest Bond | 92b9679 | 2009-06-13 07:38:31 -0400 | [diff] [blame] | 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 | * |
| 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 | |
Forest Bond | 92b9679 | 2009-06-13 07:38:31 -0400 | [diff] [blame] | 36 | #include "ttype.h" |
Forest Bond | 92b9679 | 2009-06-13 07:38:31 -0400 | [diff] [blame] | 37 | #include "tether.h" |
Forest Bond | 92b9679 | 2009-06-13 07:38:31 -0400 | [diff] [blame] | 38 | #include "device.h" |
Forest Bond | 92b9679 | 2009-06-13 07:38:31 -0400 | [diff] [blame] | 39 | |
| 40 | /*--------------------- Export Definitions -------------------------*/ |
| 41 | |
| 42 | #define PREAMBLE_LONG 0 |
| 43 | #define PREAMBLE_SHORT 1 |
| 44 | |
| 45 | // |
| 46 | // Registers in the BASEBAND |
| 47 | // |
| 48 | #define BB_MAX_CONTEXT_SIZE 256 |
| 49 | |
| 50 | #define C_SIFS_A 16 // micro sec. |
| 51 | #define C_SIFS_BG 10 |
| 52 | |
| 53 | #define C_EIFS 80 // micro sec. |
| 54 | |
| 55 | |
| 56 | #define C_SLOT_SHORT 9 // micro sec. |
| 57 | #define C_SLOT_LONG 20 |
| 58 | |
| 59 | #define C_CWMIN_A 15 // slot time |
| 60 | #define C_CWMIN_B 31 |
| 61 | |
| 62 | #define C_CWMAX 1023 // slot time |
| 63 | |
| 64 | //0:11A 1:11B 2:11G |
| 65 | #define BB_TYPE_11A 0 |
| 66 | #define BB_TYPE_11B 1 |
| 67 | #define BB_TYPE_11G 2 |
| 68 | |
| 69 | //0:11a,1:11b,2:11gb(only CCK in BasicRate),3:11ga(OFDM in Basic Rate) |
| 70 | #define PK_TYPE_11A 0 |
| 71 | #define PK_TYPE_11B 1 |
| 72 | #define PK_TYPE_11GB 2 |
| 73 | #define PK_TYPE_11GA 3 |
| 74 | |
| 75 | #define TOP_RATE_54M 0x80000000 |
| 76 | #define TOP_RATE_48M 0x40000000 |
| 77 | #define TOP_RATE_36M 0x20000000 |
| 78 | #define TOP_RATE_24M 0x10000000 |
| 79 | #define TOP_RATE_18M 0x08000000 |
| 80 | #define TOP_RATE_12M 0x04000000 |
| 81 | #define TOP_RATE_11M 0x02000000 |
| 82 | #define TOP_RATE_9M 0x01000000 |
| 83 | #define TOP_RATE_6M 0x00800000 |
| 84 | #define TOP_RATE_55M 0x00400000 |
| 85 | #define TOP_RATE_2M 0x00200000 |
| 86 | #define TOP_RATE_1M 0x00100000 |
| 87 | |
| 88 | |
| 89 | /*--------------------- Export Types ------------------------------*/ |
| 90 | |
| 91 | /*--------------------- Export Macros ------------------------------*/ |
| 92 | |
| 93 | /*--------------------- Export Classes ----------------------------*/ |
| 94 | |
| 95 | /*--------------------- Export Variables --------------------------*/ |
| 96 | |
| 97 | /*--------------------- Export Functions --------------------------*/ |
Forest Bond | 92b9679 | 2009-06-13 07:38:31 -0400 | [diff] [blame] | 98 | |
Andres More | cc856e6 | 2010-05-17 21:34:01 -0300 | [diff] [blame] | 99 | unsigned int |
Forest Bond | 92b9679 | 2009-06-13 07:38:31 -0400 | [diff] [blame] | 100 | BBuGetFrameTime( |
Andres More | 592ccfe | 2010-04-17 12:07:42 -0300 | [diff] [blame] | 101 | BYTE byPreambleType, |
| 102 | BYTE byFreqType, |
Andres More | cc856e6 | 2010-05-17 21:34:01 -0300 | [diff] [blame] | 103 | unsigned int cbFrameLength, |
Andres More | 592ccfe | 2010-04-17 12:07:42 -0300 | [diff] [blame] | 104 | WORD wRate |
Forest Bond | 92b9679 | 2009-06-13 07:38:31 -0400 | [diff] [blame] | 105 | ); |
| 106 | |
Andres More | d9d1ccb | 2010-05-26 20:00:36 -0300 | [diff] [blame] | 107 | void BBvCaculateParameter(PSDevice pDevice, |
| 108 | unsigned int cbFrameLength, |
| 109 | WORD wRate, |
| 110 | BYTE byPacketType, |
| 111 | PWORD pwPhyLen, |
| 112 | PBYTE pbyPhySrv, |
| 113 | PBYTE pbyPhySgn); |
Forest Bond | 92b9679 | 2009-06-13 07:38:31 -0400 | [diff] [blame] | 114 | |
| 115 | // timer for antenna diversity |
| 116 | |
Andres More | 0cbd8d9 | 2010-05-06 20:34:29 -0300 | [diff] [blame] | 117 | void TimerSQ3CallBack(void *hDeviceContext); |
| 118 | void TimerSQ3Tmax3CallBack(void *hDeviceContext); |
Forest Bond | 92b9679 | 2009-06-13 07:38:31 -0400 | [diff] [blame] | 119 | |
Andres More | 8611a29 | 2010-05-01 14:25:00 -0300 | [diff] [blame] | 120 | void BBvAntennaDiversity(PSDevice pDevice, BYTE byRxRate, BYTE bySQ3); |
| 121 | void BBvLoopbackOn(PSDevice pDevice); |
| 122 | void BBvLoopbackOff(PSDevice pDevice); |
| 123 | void BBvSoftwareReset(PSDevice pDevice); |
Forest Bond | 92b9679 | 2009-06-13 07:38:31 -0400 | [diff] [blame] | 124 | |
| 125 | void BBvSetShortSlotTime(PSDevice pDevice); |
Andres More | 8611a29 | 2010-05-01 14:25:00 -0300 | [diff] [blame] | 126 | void BBvSetVGAGainOffset(PSDevice pDevice, BYTE byData); |
Forest Bond | 92b9679 | 2009-06-13 07:38:31 -0400 | [diff] [blame] | 127 | void BBvSetAntennaMode(PSDevice pDevice, BYTE byAntennaMode); |
Andres More | d9d1ccb | 2010-05-26 20:00:36 -0300 | [diff] [blame] | 128 | BOOL BBbVT3184Init(PSDevice pDevice); |
Andres More | 8611a29 | 2010-05-01 14:25:00 -0300 | [diff] [blame] | 129 | void BBvSetDeepSleep(PSDevice pDevice); |
| 130 | void BBvExitDeepSleep(PSDevice pDevice); |
| 131 | void BBvUpdatePreEDThreshold( |
Andres More | 592ccfe | 2010-04-17 12:07:42 -0300 | [diff] [blame] | 132 | PSDevice pDevice, |
| 133 | BOOL bScanning |
Forest Bond | 92b9679 | 2009-06-13 07:38:31 -0400 | [diff] [blame] | 134 | ); |
| 135 | |
Andres More | e7b07d1 | 2010-05-01 19:12:26 -0300 | [diff] [blame] | 136 | #endif /* __BASEBAND_H__ */ |