2 * Copyright (c) 2000-2005 ZyDAS Technology Corporation
3 * Copyright (c) 2007-2008 Atheros Communications Inc.
5 * Permission to use, copy, modify, and/or distribute this software for any
6 * purpose with or without fee is hereby granted, provided that the above
7 * copyright notice and this permission notice appear in all copies.
9 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17 /* Module Name : ud_defs.h */
20 /* This module contains USB data structure definitions. */
25 /************************************************************************/
30 #define ZM_OTUS_ENABLE_RETRY_FREQ_CHANGE
31 #define ZM_BEACON_BUFFER_ADDRESS 0x117900
33 #define ZM_MAX_CMD_SIZE 64
34 #define ZM_HAL_MAX_EEPROM_REQ 510
35 #define ZM_HAL_MAX_EEPROM_PRQ 2
37 /* For USB STREAM mode */
38 #ifdef ZM_DISABLE_AMSDU8K_SUPPORT
39 #define ZM_MAX_USB_IN_TRANSFER_SIZE 4096
41 #define ZM_MAX_USB_IN_TRANSFER_SIZE 8192
43 #define ZM_USB_STREAM_MODE_TAG_LEN 4
44 #define ZM_USB_STREAM_MODE_TAG 0x4e00
45 #define ZM_USB_MAX_EPINT_BUFFER 64
52 u32_t cmd
[ZM_MAX_CMD_SIZE
/4];
58 u32_t delayWcmdAddr
[(ZM_CMD_QUEUE_SIZE
-4)/4];
59 u32_t delayWcmdVal
[(ZM_CMD_QUEUE_SIZE
-4)/4];
64 u32_t currentRSSI
[7]; /* RSSI combined */
65 u32_t currentRxEVM
[14];
66 u32_t currentRxDataMT
;
67 u32_t currentRxDataMCS
;
68 u32_t currentRxDataBW
;
69 u32_t currentRxDataSG
;
82 /* Fortunately the second loop can be disabled with a bit */
83 /* called en_pd_dc_offset_thr */
89 #ifdef ZM_XP_USB_MULTCMD
90 u16_t cmdSend
; // Used for Mult send USB cmd
92 struct zsCmdQ cmdQ
[ZM_CMD_QUEUE_SIZE
];
94 struct zsCommand cmd
; /* buffer for delayed commands */
100 * ANI & Radar support.
102 u32_t procPhyErr
; /* Process Phy errs */
103 u8_t hasHwPhyCounters
; /* Hardware has phy counters */
104 u32_t aniPeriod
; /* ani update list period */
105 struct zsAniStats stats
; /* various statistics */
106 struct zsAniState
*curani
; /* cached last reference */
107 struct zsAniState ani
[50]; /* per-channel state */
110 * Ani tables that change between the 5416 and 5312.
111 * These get set at attach time.
112 * XXX don't belong here
113 * XXX need better explanation
115 s32_t totalSizeDesired
[5];
121 * ANI related PHY register value.
123 u32_t regPHYDesiredSZ
;
127 u32_t regPHYSfcorrLow
;
129 u32_t regPHYCckDetect
;
131 u32_t eepromImage
[1024];
132 u32_t eepromImageIndex
;
133 u32_t eepromImageRdReq
;
141 u8_t tPow2x2g24HeavyClipOffset
;
142 u8_t tPow2x2gHt20
[8];
143 u8_t tPow2x2gHt40
[8];
145 u8_t tPow2x5gHt20
[8];
146 u8_t tPow2x5gHt40
[8];
148 /* hwBBHeavyClip : used compatibility */
149 /* 0 : dongle not support. */
150 /* !0: support heavy clip. */
152 u8_t enableBBHeavyClip
; /* 0=>force disable 1=>enable */
153 u8_t doBBHeavyClip
; /* set 1 if heavy clip need by each frequency switch */
154 u32_t setValueHeavyClip
; /* save setting value for heavy clip when completed routine */
157 * Rxdata RSSI, EVM, Rate etc...
159 struct zsHalRxInfo halRxInfo
;
162 u32_t usbAcSendBytes
[4];
164 u16_t aggMaxDurationBE
;
173 u8_t slotType
; //0->20us, 1=>9us
175 #ifdef ZM_OTUS_RX_STREAM_MODE
176 u16_t usbRxRemainLen
;
179 u16_t usbRxTransferLen
;
186 u32_t ibssBcnInterval
;
188 // For re-issue the frequency change command
189 u32_t latestFrequency
;
191 u8_t latestExtOffset
;
192 u8_t freqRetryCounter
;
194 u8_t recordFreqRetryCounter
;
196 u8_t coldResetNeedFreq
;
198 u64_t camRollCallTable
;
199 u8_t currentAckRtsTpc
;
201 /* #1 Save the initial value of the related RIFS register settings */
202 //u32_t isInitialPhy;
203 u32_t initDesiredSigSize
;
205 u32_t initAgcControl
;
206 u32_t initSearchStartDelay
;
207 u32_t initRIFSSearchParams
;
208 u32_t initFastChannelChangeControl
;
210 /* Dynamic SIFS for retransmission event */
211 u8_t retransmissionEvent
;
215 extern u32_t
zfHpLoadEEPROMFromFW(zdev_t
* dev
);
218 typedef u8_t A_UINT8
;
220 typedef u16_t A_UINT16
;
221 typedef u32_t A_UINT32
;
222 #define __ATTRIB_PACK
224 #pragma pack (push, 1)
226 #define AR5416_EEP_VER 0xE
227 #define AR5416_EEP_VER_MINOR_MASK 0xFFF
228 #define AR5416_EEP_NO_BACK_VER 0x1
229 #define AR5416_EEP_MINOR_VER_2 0x2 // Adds modal params txFrameToPaOn, txFrametoDataStart, ht40PowerInc
230 #define AR5416_EEP_MINOR_VER_3 0x3 // Adds modal params bswAtten, bswMargin, swSettle and base OpFlags for HT20/40 Disable
232 // 16-bit offset location start of calibration struct
233 #define AR5416_EEP_START_LOC 256
234 #define AR5416_NUM_5G_CAL_PIERS 8
235 #define AR5416_NUM_2G_CAL_PIERS 4
236 #define AR5416_NUM_5G_20_TARGET_POWERS 8
237 #define AR5416_NUM_5G_40_TARGET_POWERS 8
238 #define AR5416_NUM_2G_CCK_TARGET_POWERS 3
239 #define AR5416_NUM_2G_20_TARGET_POWERS 4
240 #define AR5416_NUM_2G_40_TARGET_POWERS 4
241 #define AR5416_NUM_CTLS 24
242 #define AR5416_NUM_BAND_EDGES 8
243 #define AR5416_NUM_PD_GAINS 4
244 #define AR5416_PD_GAINS_IN_MASK 4
245 #define AR5416_PD_GAIN_ICEPTS 5
246 #define AR5416_EEPROM_MODAL_SPURS 5
247 #define AR5416_MAX_RATE_POWER 63
248 #define AR5416_NUM_PDADC_VALUES 128
249 #define AR5416_NUM_RATES 16
250 #define AR5416_BCHAN_UNUSED 0xFF
251 #define AR5416_MAX_PWR_RANGE_IN_HALF_DB 64
252 #define AR5416_OPFLAGS_11A 0x01
253 #define AR5416_OPFLAGS_11G 0x02
254 #define AR5416_OPFLAGS_5G_HT40 0x04
255 #define AR5416_OPFLAGS_2G_HT40 0x08
256 #define AR5416_OPFLAGS_5G_HT20 0x10
257 #define AR5416_OPFLAGS_2G_HT20 0x20
258 #define AR5416_EEPMISC_BIG_ENDIAN 0x01
259 #define FREQ2FBIN(x,y) ((y) ? ((x) - 2300) : (((x) - 4800) / 5))
260 #define AR5416_MAX_CHAINS 2
261 #define AR5416_ANT_16S 25
263 #define AR5416_NUM_ANT_CHAIN_FIELDS 7
264 #define AR5416_NUM_ANT_COMMON_FIELDS 4
265 #define AR5416_SIZE_ANT_CHAIN_FIELD 3
266 #define AR5416_SIZE_ANT_COMMON_FIELD 4
267 #define AR5416_ANT_CHAIN_MASK 0x7
268 #define AR5416_ANT_COMMON_MASK 0xf
269 #define AR5416_CHAIN_0_IDX 0
270 #define AR5416_CHAIN_1_IDX 1
271 #define AR5416_CHAIN_2_IDX 2
274 /* Capabilities Enum */
276 EEPCAP_COMPRESS_DIS
= 0x0001,
277 EEPCAP_AES_DIS
= 0x0002,
278 EEPCAP_FASTFRAME_DIS
= 0x0004,
279 EEPCAP_BURST_DIS
= 0x0008,
280 EEPCAP_MAXQCU_M
= 0x01F0,
282 EEPCAP_HEAVY_CLIP_EN
= 0x0200,
283 EEPCAP_KC_ENTRIES_M
= 0xF000,
284 EEPCAP_KC_ENTRIES_S
= 12,
285 } EEPROM_CAPABILITIES
;
287 typedef enum Ar5416_Rates
{
288 rate6mb
, rate9mb
, rate12mb
, rate18mb
,
289 rate24mb
, rate36mb
, rate48mb
, rate54mb
,
290 rate1l
, rate2l
, rate2s
, rate5_5l
,
291 rate5_5s
, rate11l
, rate11s
, rateXr
,
292 rateHt20_0
, rateHt20_1
, rateHt20_2
, rateHt20_3
,
293 rateHt20_4
, rateHt20_5
, rateHt20_6
, rateHt20_7
,
294 rateHt40_0
, rateHt40_1
, rateHt40_2
, rateHt40_3
,
295 rateHt40_4
, rateHt40_5
, rateHt40_6
, rateHt40_7
,
296 rateDupCck
, rateDupOfdm
, rateExtCck
, rateExtOfdm
,
300 typedef struct eepFlags
{
303 } __ATTRIB_PACK EEP_FLAGS
;
305 #define AR5416_CHECKSUM_LOCATION (AR5416_EEP_START_LOC + 1)
306 typedef struct BaseEepHeader
{
310 EEP_FLAGS opCapFlags
;
316 A_UINT16 blueToothOptions
;
318 A_UINT32 binBuildNumber
;
320 A_UINT8 futureBase
[33];
321 } __ATTRIB_PACK BASE_EEP_HEADER
; // 64 B
323 typedef struct spurChanStruct
{
325 A_UINT8 spurRangeLow
;
326 A_UINT8 spurRangeHigh
;
327 } __ATTRIB_PACK SPUR_CHAN
;
329 typedef struct ModalEepHeader
{
330 A_UINT32 antCtrlChain
[AR5416_MAX_CHAINS
]; // 12
331 A_UINT32 antCtrlCommon
; // 4
332 A_INT8 antennaGainCh
[AR5416_MAX_CHAINS
]; // 3
333 A_UINT8 switchSettling
; // 1
334 A_UINT8 txRxAttenCh
[AR5416_MAX_CHAINS
]; // 3
335 A_UINT8 rxTxMarginCh
[AR5416_MAX_CHAINS
]; // 3
336 A_INT8 adcDesiredSize
; // 1
337 A_INT8 pgaDesiredSize
; // 1
338 A_UINT8 xlnaGainCh
[AR5416_MAX_CHAINS
]; // 3
339 A_UINT8 txEndToXpaOff
; // 1
340 A_UINT8 txEndToRxOn
; // 1
341 A_UINT8 txFrameToXpaOn
; // 1
342 A_UINT8 thresh62
; // 1
343 A_INT8 noiseFloorThreshCh
[AR5416_MAX_CHAINS
]; // 3
344 A_UINT8 xpdGain
; // 1
346 A_INT8 iqCalICh
[AR5416_MAX_CHAINS
]; // 1
347 A_INT8 iqCalQCh
[AR5416_MAX_CHAINS
]; // 1
348 A_UINT8 pdGainOverlap
; // 1
351 A_UINT8 xpaBiasLvl
; // 1
352 A_UINT8 pwrDecreaseFor2Chain
; // 1
353 A_UINT8 pwrDecreaseFor3Chain
; // 1 -> 48 B
354 A_UINT8 txFrameToDataStart
; // 1
355 A_UINT8 txFrameToPaOn
; // 1
356 A_UINT8 ht40PowerIncForPdadc
; // 1
357 A_UINT8 bswAtten
[AR5416_MAX_CHAINS
]; // 3
358 A_UINT8 bswMargin
[AR5416_MAX_CHAINS
]; // 3
359 A_UINT8 swSettleHt40
; // 1
360 A_UINT8 futureModal
[22]; //
361 SPUR_CHAN spurChans
[AR5416_EEPROM_MODAL_SPURS
]; // 20 B
362 } __ATTRIB_PACK MODAL_EEP_HEADER
; // == 100 B
364 typedef struct calDataPerFreq
{
365 A_UINT8 pwrPdg
[AR5416_NUM_PD_GAINS
][AR5416_PD_GAIN_ICEPTS
];
366 A_UINT8 vpdPdg
[AR5416_NUM_PD_GAINS
][AR5416_PD_GAIN_ICEPTS
];
367 } __ATTRIB_PACK CAL_DATA_PER_FREQ
;
369 typedef struct CalTargetPowerLegacy
{
372 } __ATTRIB_PACK CAL_TARGET_POWER_LEG
;
374 typedef struct CalTargetPowerHt
{
377 } __ATTRIB_PACK CAL_TARGET_POWER_HT
;
379 #if defined(ARCH_BIG_ENDIAN) || defined(BIG_ENDIAN)
380 typedef struct CalCtlEdges
{
384 } __ATTRIB_PACK CAL_CTL_EDGES
;
386 typedef struct CalCtlEdges
{
390 } __ATTRIB_PACK CAL_CTL_EDGES
;
393 typedef struct CalCtlData
{
394 CAL_CTL_EDGES ctlEdges
[AR5416_MAX_CHAINS
][AR5416_NUM_BAND_EDGES
];
395 } __ATTRIB_PACK CAL_CTL_DATA
;
397 typedef struct ar5416Eeprom
{
398 BASE_EEP_HEADER baseEepHeader
; // 64 B
399 A_UINT8 custData
[64]; // 64 B
400 MODAL_EEP_HEADER modalHeader
[2]; // 200 B
401 A_UINT8 calFreqPier5G
[AR5416_NUM_5G_CAL_PIERS
];
402 A_UINT8 calFreqPier2G
[AR5416_NUM_2G_CAL_PIERS
];
403 CAL_DATA_PER_FREQ calPierData5G
[AR5416_MAX_CHAINS
][AR5416_NUM_5G_CAL_PIERS
];
404 CAL_DATA_PER_FREQ calPierData2G
[AR5416_MAX_CHAINS
][AR5416_NUM_2G_CAL_PIERS
];
405 CAL_TARGET_POWER_LEG calTargetPower5G
[AR5416_NUM_5G_20_TARGET_POWERS
];
406 CAL_TARGET_POWER_HT calTargetPower5GHT20
[AR5416_NUM_5G_20_TARGET_POWERS
];
407 CAL_TARGET_POWER_HT calTargetPower5GHT40
[AR5416_NUM_5G_40_TARGET_POWERS
];
408 CAL_TARGET_POWER_LEG calTargetPowerCck
[AR5416_NUM_2G_CCK_TARGET_POWERS
];
409 CAL_TARGET_POWER_LEG calTargetPower2G
[AR5416_NUM_2G_20_TARGET_POWERS
];
410 CAL_TARGET_POWER_HT calTargetPower2GHT20
[AR5416_NUM_2G_20_TARGET_POWERS
];
411 CAL_TARGET_POWER_HT calTargetPower2GHT40
[AR5416_NUM_2G_40_TARGET_POWERS
];
412 A_UINT8 ctlIndex
[AR5416_NUM_CTLS
];
413 CAL_CTL_DATA ctlData
[AR5416_NUM_CTLS
];
415 } __ATTRIB_PACK AR5416_EEPROM
;
419 typedef enum ConformanceTestLimits
{
437 #endif /* #ifndef _HPUSB_H */