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 FILE_SECBOOT ( FORBIDDEN );
25 
26 #include "hw.h"
27 
28 #define AR_PHY_CCA_FILTERWINDOW_LENGTH_INIT 3
29 #define AR_PHY_CCA_FILTERWINDOW_LENGTH 5
30 
31 #define NUM_NF_READINGS 6
32 #define ATH9K_NF_CAL_HIST_MAX 5
33 
38 };
39 
40 #define INIT_INI_ARRAY(iniarray, array, rows, columns) do { \
41  (iniarray)->ia_array = (u32 *)(array); \
42  (iniarray)->ia_rows = (rows); \
43  (iniarray)->ia_columns = (columns); \
44  } while (0)
45 
46 #define INI_RA(iniarray, row, column) \
47  (((iniarray)->ia_array)[(row) * ((iniarray)->ia_columns) + (column)])
48 
49 #define INIT_CAL(_perCal) do { \
50  (_perCal)->calState = CAL_WAITING; \
51  (_perCal)->calNext = NULL; \
52  } while (0)
53 
54 #define INSERT_CAL(_ahp, _perCal) \
55  do { \
56  if ((_ahp)->cal_list_last == NULL) { \
57  (_ahp)->cal_list = \
58  (_ahp)->cal_list_last = (_perCal); \
59  ((_ahp)->cal_list_last)->calNext = (_perCal); \
60  } else { \
61  ((_ahp)->cal_list_last)->calNext = (_perCal); \
62  (_ahp)->cal_list_last = (_perCal); \
63  (_perCal)->calNext = (_ahp)->cal_list; \
64  } \
65  } while (0)
66 
72 };
73 
74 #define MIN_CAL_SAMPLES 1
75 #define MAX_CAL_SAMPLES 64
76 #define INIT_LOG_COUNT 5
77 #define PER_MIN_LOG_COUNT 2
78 #define PER_MAX_LOG_COUNT 10
79 
84  void (*calCollect) (struct ath_hw *);
85  void (*calPostProc) (struct ath_hw *, u8);
86 };
87 
89  const struct ath9k_percal_data *calData;
92 };
93 
99 };
100 
101 #define MAX_PACAL_SKIPCOUNT 8
103  int32_t prev_offset; /* Previous value of PA offset value */
104  int8_t max_skipcount; /* Max No. of times PACAL can be skipped */
105  int8_t skipcount; /* No. of times the PACAL to be skipped */
106 };
107 
108 int ath9k_hw_reset_calvalid(struct ath_hw *ah);
109 void ath9k_hw_start_nfcal(struct ath_hw *ah, int update);
110 void ath9k_hw_loadnf(struct ath_hw *ah, struct ath9k_channel *chan);
111 int ath9k_hw_getnf(struct ath_hw *ah, struct ath9k_channel *chan);
113  struct ath9k_channel *chan);
115  struct ath9k_cal_list *currCal);
116 
117 
118 #endif /* CALIB_H */
int ath9k_hw_reset_calvalid(struct ath_hw *ah)
Definition: ath9k_calib.c:175
ath9k_cal_state
Definition: calib.h:67
Definition: hw.h:657
int32_t prev_offset
Definition: calib.h:103
void(* calPostProc)(struct ath_hw *, u8)
Definition: calib.h:85
void ath9k_hw_loadnf(struct ath_hw *ah, struct ath9k_channel *chan)
Definition: ath9k_calib.c:226
struct ath9k_cal_list * calNext
Definition: calib.h:91
int8_t skipcount
Definition: calib.h:105
void ath9k_init_nfcal_hist_buffer(struct ath_hw *ah, struct ath9k_channel *chan)
Definition: ath9k_calib.c:386
void ath9k_hw_start_nfcal(struct ath_hw *ah, int update)
Definition: ath9k_calib.c:208
u32 calNumSamples
Definition: calib.h:82
Definition: calib.h:71
int16_t privNF
Definition: calib.h:97
int8_t max_skipcount
Definition: calib.h:104
#define u8
Definition: igbvf_osdep.h:40
int ath9k_hw_getnf(struct ath_hw *ah, struct ath9k_channel *chan)
Definition: ath9k_calib.c:348
signed char int8_t
Definition: stdint.h:15
u32 ia_rows
Definition: calib.h:36
u8 invalidNFcount
Definition: calib.h:98
void(* calCollect)(struct ath_hw *)
Definition: calib.h:84
int16_t nfCalBuffer[ATH9K_NF_CAL_HIST_MAX]
Definition: calib.h:95
u32 ia_columns
Definition: calib.h:37
void ath9k_hw_reset_calibration(struct ath_hw *ah, struct ath9k_cal_list *currCal)
Definition: ath9k_calib.c:155
FILE_SECBOOT(FORBIDDEN)
FILE_LICENCE(BSD2)
const struct ath9k_percal_data * calData
Definition: calib.h:89
signed int int32_t
Definition: stdint.h:17
u32 calCountMax
Definition: calib.h:83
uint8_t ah
Definition: registers.h:85
signed short int16_t
Definition: stdint.h:16
u32 * ia_array
Definition: calib.h:35
enum ath9k_cal_state calState
Definition: calib.h:90
uint8_t u8
Definition: stdint.h:20
uint32_t u32
Definition: stdint.h:24
#define ATH9K_NF_CAL_HIST_MAX
Definition: calib.h:32