Greg Kroah-Hartman | d7c4308 | 2017-11-07 21:07:53 +0100 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0+ |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 2 | /* |
| 3 | * Copyright (c) 1996, 2003 VIA Networking Technologies, Inc. |
| 4 | * All rights reserved. |
| 5 | * |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 6 | * File: baseband.h |
| 7 | * |
| 8 | * Purpose: Implement functions to access baseband |
| 9 | * |
| 10 | * Author: Jerry Chen |
| 11 | * |
| 12 | * Date: Jun. 5, 2002 |
| 13 | * |
| 14 | */ |
| 15 | |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 16 | #ifndef __BASEBAND_H__ |
| 17 | #define __BASEBAND_H__ |
| 18 | |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 19 | #include "device.h" |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 20 | |
Aybuke Ozdemir | dbc6ee6 | 2014-09-19 19:49:33 +0300 | [diff] [blame] | 21 | /* |
| 22 | * Registers in the BASEBAND |
| 23 | */ |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 24 | #define BB_MAX_CONTEXT_SIZE 256 |
| 25 | |
Aybuke Ozdemir | dbc6ee6 | 2014-09-19 19:49:33 +0300 | [diff] [blame] | 26 | /* |
| 27 | * Baseband RF pair definition in eeprom (Bits 6..0) |
| 28 | */ |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 29 | |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 30 | #define PREAMBLE_LONG 0 |
| 31 | #define PREAMBLE_SHORT 1 |
| 32 | |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 33 | #define F5G 0 |
| 34 | #define F2_4G 1 |
| 35 | |
| 36 | #define TOP_RATE_54M 0x80000000 |
| 37 | #define TOP_RATE_48M 0x40000000 |
| 38 | #define TOP_RATE_36M 0x20000000 |
| 39 | #define TOP_RATE_24M 0x10000000 |
| 40 | #define TOP_RATE_18M 0x08000000 |
| 41 | #define TOP_RATE_12M 0x04000000 |
| 42 | #define TOP_RATE_11M 0x02000000 |
| 43 | #define TOP_RATE_9M 0x01000000 |
| 44 | #define TOP_RATE_6M 0x00800000 |
| 45 | #define TOP_RATE_55M 0x00400000 |
| 46 | #define TOP_RATE_2M 0x00200000 |
| 47 | #define TOP_RATE_1M 0x00100000 |
| 48 | |
Charles Clément | b6e95cd | 2010-06-02 09:52:01 -0700 | [diff] [blame] | 49 | unsigned int |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 50 | BBuGetFrameTime( |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 51 | unsigned char byPreambleType, |
| 52 | unsigned char byPktType, |
| 53 | unsigned int cbFrameLength, |
| 54 | unsigned short wRate |
| 55 | ); |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 56 | |
sayli karnik | 841e3bc | 2017-03-10 17:59:04 +0530 | [diff] [blame] | 57 | void vnt_get_phy_field(struct vnt_private *priv, u32 frame_length, |
| 58 | u16 tx_rate, u8 pkt_type, struct vnt_phy_field *phy); |
Malcolm Priestley | 10c1744 | 2014-08-20 22:30:28 +0100 | [diff] [blame] | 59 | |
sayli karnik | 841e3bc | 2017-03-10 17:59:04 +0530 | [diff] [blame] | 60 | bool BBbReadEmbedded(struct vnt_private *priv, unsigned char byBBAddr, |
Kathryn Hampton | 5150d01 | 2016-03-15 18:16:24 -0700 | [diff] [blame] | 61 | unsigned char *pbyData); |
sayli karnik | 841e3bc | 2017-03-10 17:59:04 +0530 | [diff] [blame] | 62 | bool BBbWriteEmbedded(struct vnt_private *priv, unsigned char byBBAddr, |
Kathryn Hampton | 5150d01 | 2016-03-15 18:16:24 -0700 | [diff] [blame] | 63 | unsigned char byData); |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 64 | |
sayli karnik | 841e3bc | 2017-03-10 17:59:04 +0530 | [diff] [blame] | 65 | void BBvSetShortSlotTime(struct vnt_private *priv); |
| 66 | void BBvSetVGAGainOffset(struct vnt_private *priv, unsigned char byData); |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 67 | |
Aybuke Ozdemir | dbc6ee6 | 2014-09-19 19:49:33 +0300 | [diff] [blame] | 68 | /* VT3253 Baseband */ |
Arushi Singhal | 29fcf85 | 2017-02-09 18:52:53 +0530 | [diff] [blame] | 69 | bool BBbVT3253Init(struct vnt_private *priv); |
| 70 | void BBvSoftwareReset(struct vnt_private *priv); |
| 71 | void BBvPowerSaveModeON(struct vnt_private *priv); |
| 72 | void BBvPowerSaveModeOFF(struct vnt_private *priv); |
| 73 | void BBvSetTxAntennaMode(struct vnt_private *priv, unsigned char byAntennaMode); |
| 74 | void BBvSetRxAntennaMode(struct vnt_private *priv, unsigned char byAntennaMode); |
| 75 | void BBvSetDeepSleep(struct vnt_private *priv, unsigned char byLocalID); |
| 76 | void BBvExitDeepSleep(struct vnt_private *priv, unsigned char byLocalID); |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 77 | |
Aybuke Ozdemir | dbc6ee6 | 2014-09-19 19:49:33 +0300 | [diff] [blame] | 78 | #endif /* __BASEBAND_H__ */ |