blob: 7f9cce0462b5f305509f6929c02e475cac1673c6 [file] [log] [blame]
Zvikomborero VIncent Zvikarambab7261682016-08-03 01:27:15 -04001/*
2 * Copyright (c) 2014 The Linux Foundation. All rights reserved.
3 *
4 * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
5 *
6 *
7 * Permission to use, copy, modify, and/or distribute this software for
8 * any purpose with or without fee is hereby granted, provided that the
9 * above copyright notice and this permission notice appear in all
10 * copies.
11 *
12 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
13 * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
14 * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
15 * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
16 * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
17 * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
18 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
19 * PERFORMANCE OF THIS SOFTWARE.
20 */
21
22/*
23 * This file was originally distributed by Qualcomm Atheros, Inc.
24 * under proprietary terms before Copyright ownership was assigned
25 * to the Linux Foundation.
26 */
27
28/**
29
30
31 pttModule.h: global variable structure for pttModule
32 Author: Mark Nelson
33 Date: 6/27/05
34
35 History -
36 Date Modified by Modification Information
37 --------------------------------------------------------------------------
38
39 */
40
41#ifndef PTTMODULE_H
42#define PTTMODULE_H
43#include <wlan_phy.h>
44#include <pttFrameGen.h>
45
46#ifdef BUILD_QWPTTSTATIC
47#include "wlan_hal_msg.h" // it is needed to build qwptt static lib
48#endif
49
50// Max NV fragment size
51#define MAX_NV_BIN_SIZE 2000
52
53enum
54{
55 PTT_STATUS_SUCCESS = 0,
56 PTT_STATUS_FAILURE = 1,
57 PTT_MAX_VAL = 0XFFFF,
58};
59typedef tANI_U32 eQWPttStatus;
60
61
62typedef PACKED_PRE struct PACKED_POST {
63 tANI_U16 drvMjr;
64 tANI_U16 drvMnr;
65 tANI_U16 drvPtch;
66 tANI_U16 drvBld;
67 tANI_U16 pttMax;
68 tANI_U16 pttMin;
69 //FwVersionInfo fwVer;
70} sBuildReleaseParams;
71
72typedef PACKED_PRE struct PACKED_POST {
73 tANI_BOOLEAN agPktsDisabled; //802.11ag
74 tANI_BOOLEAN bPktsDisabled; //802.11b
75 tANI_BOOLEAN slrPktsDisabled; //deprecated in Riva
76 tANI_BOOLEAN n40PktsDisabled; //11N 40
77 tANI_BOOLEAN ac80PktsDisabled; //11AC 80
78 tANI_BOOLEAN rsvd;
79} sRxTypesDisabled;
80
81typedef PACKED_PRE struct PACKED_POST {
82 tANI_U32 totalRxPackets;
83 tANI_U32 totalMacRxPackets;
84 tANI_U32 totalMacFcsErrPackets;
85} sRxFrameCounters;
86
87
88
89
90/* GRAB RAM types */
91//TODO: Change Grab RAM interface as appropriate to Taurus
92typedef enum {
93 GRAB_RAM_RXFIR,
94 GRAB_RAM_ADC,
95 GRAB_RAM_ADC_80,
96 GRAB_RAM_MAX_VAL = 0XFFFF,
97} eGrabRamType;
98
99#define GRAB_RAM_SIZE 6000
100#define GRAB_RAM_SIZE_80MHZ_1_CHAIN 12000
101
102
103
104/// Enum used to specify the trigger type for the aniGrabRam API
105typedef enum eGramDumpTrigType {
106 eGRAM_DUMP_UNTRIGGERED,
107 eGRAM_DUMP_TRIG_ON_11A,
108 eGRAM_DUMP_TRIG_ON_11B,
109 eGRAM_DUMP_TRIG_ON_11A_OR_11B
110} tGramDumpTrigType;
111
112typedef PACKED_PRE struct PACKED_POST {
113 //common to both transmit chains
114 eHalPhyRates rate; //current rate
115 ePhyChanBondState cbState; //current Channel bonded state
116
117 tANI_U8 channelId; //current channel Id
118 tANI_U8 pwrTemplateIndex; //5-bit template index used for the current rate
119 tANI_U8 reserved[2];
120
121 //specific transmit chain power
122 tTxChainPower txChains[PHY_MAX_TX_CHAINS]; //output power for Tx chains
123} tTxPowerReport;
124
125#define RXP_MAX_FILTER_IDX 64
126
127typedef PACKED_PRE struct PACKED_POST
128{
129 uint32 rxpFilterForFTMPER[RXP_MAX_FILTER_IDX];
130 uint32 max_pktlen;
131 uint32 flt_disable0;
132 uint32 flt_disable1;
133 uint32 config2;
134 uint32 push_wq_ctrl;
135 uint32 push_wq_ctrl2;
136 uint32 extra_frame_flt;
137} sMACConfig;
138
139
140typedef PACKED_PRE struct PACKED_POST {
141 /*
142 * The idea here is to store only those things which cannot be
143 * handled directly within the individual function calls.
144 * Most things will go straight to registers or come from registers.
145 */
146 sPttFrameGenParams frameGenParams;
147 tANI_U8 payload[MAX_PAYLOAD_SIZE];
148
149 //Tx Waveform Gen Service
150 tANI_U16 numWfmSamples;
151 tANI_BOOLEAN wfmEnabled;
152 tANI_BOOLEAN wfmStored;
153
154 //Tx Frame Power Service
155 tTxGain forcedTxGain[PHY_MAX_TX_CHAINS]; //use TXPWR_OVERRIDE for wfm, and fill gain table otherwise
156 tANI_U8 tpcPowerLut[PHY_MAX_TX_CHAINS][TPC_MEM_POWER_LUT_DEPTH];
157 tTxGain tpcGainLut[PHY_MAX_TX_CHAINS][TPC_MEM_GAIN_LUT_DEPTH];
158
159 //Tx Frame Gen Service
160 tANI_BOOLEAN frameGenEnabled;
161 tANI_BOOLEAN phyDbgFrameGen; //this says use phyDbg for frames - leave this in place until we know that PhyDbg will suffice
162
163 // for FTM PER feature
164 tANI_U8 tx_mode;
165
166 tANI_BOOLEAN ftm_per_settings_saved;
167
168 //Rx Gain Service
169 sRxChainsAgcEnable agcEnables;
170
171 tANI_U32 *pADCCaptureCache; //pointer to allocate ADC capture cache
172
173 //TX_TIMER adcRssiStatsTimer; //Create adc rssi stat collection timer
174
175 sRxChainsRssi rssi;
176} tPttModuleVariables;
177
178#ifdef WCN_PRONTO
179extern sMACConfig macConfig;
180#endif
181
182#endif /* PTTMODULE_H */