iPXE
calib.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2008-2011 Atheros Communications Inc.
3  *
4  * Modified for iPXE by Scott K Logan <logans@cottsay.net> July 2011
5  * Original from Linux kernel 3.0.1
6  *
7  * Permission to use, copy, modify, and/or distribute this software for any
8  * purpose with or without fee is hereby granted, provided that the above
9  * copyright notice and this permission notice appear in all copies.
10  *
11  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
12  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
13  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
14  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
15  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
16  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
17  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
18  */
19 
20 #ifndef CALIB_H
21 #define CALIB_H
22 
23 FILE_LICENCE ( BSD2 );
24 
25 #include "hw.h"
26 
27 #define AR_PHY_CCA_FILTERWINDOW_LENGTH_INIT 3
28 #define AR_PHY_CCA_FILTERWINDOW_LENGTH 5
29 
30 #define NUM_NF_READINGS 6
31 #define ATH9K_NF_CAL_HIST_MAX 5
32 
37 };
38 
39 #define INIT_INI_ARRAY(iniarray, array, rows, columns) do { \
40  (iniarray)->ia_array = (u32 *)(array); \
41  (iniarray)->ia_rows = (rows); \
42  (iniarray)->ia_columns = (columns); \
43  } while (0)
44 
45 #define INI_RA(iniarray, row, column) \
46  (((iniarray)->ia_array)[(row) * ((iniarray)->ia_columns) + (column)])
47 
48 #define INIT_CAL(_perCal) do { \
49  (_perCal)->calState = CAL_WAITING; \
50  (_perCal)->calNext = NULL; \
51  } while (0)
52 
53 #define INSERT_CAL(_ahp, _perCal) \
54  do { \
55  if ((_ahp)->cal_list_last == NULL) { \
56  (_ahp)->cal_list = \
57  (_ahp)->cal_list_last = (_perCal); \
58  ((_ahp)->cal_list_last)->calNext = (_perCal); \
59  } else { \
60  ((_ahp)->cal_list_last)->calNext = (_perCal); \
61  (_ahp)->cal_list_last = (_perCal); \
62  (_perCal)->calNext = (_ahp)->cal_list; \
63  } \
64  } while (0)
65 
71 };
72 
73 #define MIN_CAL_SAMPLES 1
74 #define MAX_CAL_SAMPLES 64
75 #define INIT_LOG_COUNT 5
76 #define PER_MIN_LOG_COUNT 2
77 #define PER_MAX_LOG_COUNT 10
78 
83  void (*calCollect) (struct ath_hw *);
84  void (*calPostProc) (struct ath_hw *, u8);
85 };
86 
88  const struct ath9k_percal_data *calData;
91 };
92 
98 };
99 
100 #define MAX_PACAL_SKIPCOUNT 8
102  int32_t prev_offset; /* Previous value of PA offset value */
103  int8_t max_skipcount; /* Max No. of times PACAL can be skipped */
104  int8_t skipcount; /* No. of times the PACAL to be skipped */
105 };
106 
107 int ath9k_hw_reset_calvalid(struct ath_hw *ah);
108 void ath9k_hw_start_nfcal(struct ath_hw *ah, int update);
109 void ath9k_hw_loadnf(struct ath_hw *ah, struct ath9k_channel *chan);
110 int ath9k_hw_getnf(struct ath_hw *ah, struct ath9k_channel *chan);
112  struct ath9k_channel *chan);
114  struct ath9k_cal_list *currCal);
115 
116 
117 #endif /* CALIB_H */
int ath9k_hw_reset_calvalid(struct ath_hw *ah)
Definition: ath9k_calib.c:173
ath9k_cal_state
Definition: calib.h:66
Definition: hw.h:656
int32_t prev_offset
Definition: calib.h:102
void(* calPostProc)(struct ath_hw *, u8)
Definition: calib.h:84
void ath9k_hw_loadnf(struct ath_hw *ah, struct ath9k_channel *chan)
Definition: ath9k_calib.c:224
struct ath9k_cal_list * calNext
Definition: calib.h:90
int8_t skipcount
Definition: calib.h:104
void ath9k_init_nfcal_hist_buffer(struct ath_hw *ah, struct ath9k_channel *chan)
Definition: ath9k_calib.c:384
void ath9k_hw_start_nfcal(struct ath_hw *ah, int update)
Definition: ath9k_calib.c:206
u32 calNumSamples
Definition: calib.h:81
Definition: calib.h:70
int16_t privNF
Definition: calib.h:96
int8_t max_skipcount
Definition: calib.h:103
#define u8
Definition: igbvf_osdep.h:38
int ath9k_hw_getnf(struct ath_hw *ah, struct ath9k_channel *chan)
Definition: ath9k_calib.c:346
signed char int8_t
Definition: stdint.h:15
u32 ia_rows
Definition: calib.h:35
u8 invalidNFcount
Definition: calib.h:97
void(* calCollect)(struct ath_hw *)
Definition: calib.h:83
int16_t nfCalBuffer[ATH9K_NF_CAL_HIST_MAX]
Definition: calib.h:94
u32 ia_columns
Definition: calib.h:36
void ath9k_hw_reset_calibration(struct ath_hw *ah, struct ath9k_cal_list *currCal)
Definition: ath9k_calib.c:153
FILE_LICENCE(BSD2)
const struct ath9k_percal_data * calData
Definition: calib.h:88
signed int int32_t
Definition: stdint.h:17
u32 calCountMax
Definition: calib.h:82
uint8_t ah
Definition: registers.h:85
signed short int16_t
Definition: stdint.h:16
u32 * ia_array
Definition: calib.h:34
enum ath9k_cal_state calState
Definition: calib.h:89
uint8_t u8
Definition: stdint.h:19
uint32_t u32
Definition: stdint.h:23
#define ATH9K_NF_CAL_HIST_MAX
Definition: calib.h:31