iPXE
hw-ops.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2010-2011 Atheros Communications Inc.
3  *
4  * Permission to use, copy, modify, and/or distribute this software for any
5  * purpose with or without fee is hereby granted, provided that the above
6  * copyright notice and this permission notice appear in all copies.
7  *
8  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15  */
16 
17 #ifndef ATH9K_HW_OPS_H
18 #define ATH9K_HW_OPS_H
19 
20 FILE_LICENCE ( BSD2 );
21 FILE_SECBOOT ( FORBIDDEN );
22 
23 #include "hw.h"
24 
25 /* Hardware core and driver accessible callbacks */
26 
27 static inline void ath9k_hw_configpcipowersave(struct ath_hw *ah,
28  int restore,
29  int power_off)
30 {
31  ath9k_hw_ops(ah)->config_pci_powersave(ah, restore, power_off);
32 }
33 
34 static inline void ath9k_hw_rxena(struct ath_hw *ah)
35 {
37 }
38 
39 static inline void ath9k_hw_set_desc_link(struct ath_hw *ah, void *ds,
40  u32 link)
41 {
43 }
44 
45 static inline void ath9k_hw_get_desc_link(struct ath_hw *ah, void *ds,
46  u32 **link)
47 {
49 }
50 static inline int ath9k_hw_calibrate(struct ath_hw *ah,
51  struct ath9k_channel *chan,
52  u8 rxchainmask,
53  int longcal)
54 {
55  return ath9k_hw_ops(ah)->calibrate(ah, chan, rxchainmask, longcal);
56 }
57 
58 static inline int ath9k_hw_getisr(struct ath_hw *ah, enum ath9k_int *masked)
59 {
60  return ath9k_hw_ops(ah)->get_isr(ah, masked);
61 }
62 
63 static inline void ath9k_hw_filltxdesc(struct ath_hw *ah, void *ds, u32 seglen,
64  int is_firstseg, int is_lastseg,
65  const void *ds0, u32 buf_addr,
66  unsigned int qcu)
67 {
68  ath9k_hw_ops(ah)->fill_txdesc(ah, ds, seglen, is_firstseg, is_lastseg,
69  ds0, buf_addr, qcu);
70 }
71 
72 static inline int ath9k_hw_txprocdesc(struct ath_hw *ah, void *ds,
73  struct ath_tx_status *ts)
74 {
75  return ath9k_hw_ops(ah)->proc_txdesc(ah, ds, ts);
76 }
77 
78 static inline void ath9k_hw_set11n_txdesc(struct ath_hw *ah, void *ds,
79  u32 pktLen, enum ath9k_pkt_type type,
80  u32 txPower, u32 keyIx,
81  enum ath9k_key_type keyType,
82  u32 flags)
83 {
84  ath9k_hw_ops(ah)->set11n_txdesc(ah, ds, pktLen, type, txPower, keyIx,
85  keyType, flags);
86 }
87 
88 static inline void ath9k_hw_set11n_ratescenario(struct ath_hw *ah, void *ds,
89  void *lastds,
90  u32 durUpdateEn, u32 rtsctsRate,
91  u32 rtsctsDuration,
92  struct ath9k_11n_rate_series series[],
93  u32 nseries, u32 flags)
94 {
95  ath9k_hw_ops(ah)->set11n_ratescenario(ah, ds, lastds, durUpdateEn,
96  rtsctsRate, rtsctsDuration, series,
97  nseries, flags);
98 }
99 
100 static inline void ath9k_hw_set11n_aggr_first(struct ath_hw *ah, void *ds,
101  u32 aggrLen)
102 {
103  ath9k_hw_ops(ah)->set11n_aggr_first(ah, ds, aggrLen);
104 }
105 
106 static inline void ath9k_hw_set11n_aggr_middle(struct ath_hw *ah, void *ds,
107  u32 numDelims)
108 {
109  ath9k_hw_ops(ah)->set11n_aggr_middle(ah, ds, numDelims);
110 }
111 
112 static inline void ath9k_hw_set11n_aggr_last(struct ath_hw *ah, void *ds)
113 {
115 }
116 
117 static inline void ath9k_hw_clr11n_aggr(struct ath_hw *ah, void *ds)
118 {
120 }
121 
122 static inline void ath9k_hw_set_clrdmask(struct ath_hw *ah, void *ds, int val)
123 {
125 }
126 
127 static inline void ath9k_hw_antdiv_comb_conf_get(struct ath_hw *ah,
128  struct ath_hw_antcomb_conf *antconf)
129 {
131 }
132 
133 static inline void ath9k_hw_antdiv_comb_conf_set(struct ath_hw *ah,
134  struct ath_hw_antcomb_conf *antconf)
135 {
137 }
138 
139 /* Private hardware call ops */
140 
141 /* PHY ops */
142 
143 static inline int ath9k_hw_rf_set_freq(struct ath_hw *ah,
144  struct ath9k_channel *chan)
145 {
147 }
148 
149 static inline void ath9k_hw_spur_mitigate_freq(struct ath_hw *ah,
150  struct ath9k_channel *chan)
151 {
153 }
154 
155 static inline int ath9k_hw_rf_alloc_ext_banks(struct ath_hw *ah)
156 {
157  if (!ath9k_hw_private_ops(ah)->rf_alloc_ext_banks)
158  return 0;
159 
161 }
162 
163 static inline void ath9k_hw_rf_free_ext_banks(struct ath_hw *ah)
164 {
165  if (!ath9k_hw_private_ops(ah)->rf_free_ext_banks)
166  return;
167 
169 }
170 
171 static inline int ath9k_hw_set_rf_regs(struct ath_hw *ah,
172  struct ath9k_channel *chan,
173  u16 modesIndex)
174 {
175  if (!ath9k_hw_private_ops(ah)->set_rf_regs)
176  return 1;
177 
178  return ath9k_hw_private_ops(ah)->set_rf_regs(ah, chan, modesIndex);
179 }
180 
181 static inline void ath9k_hw_init_bb(struct ath_hw *ah,
182  struct ath9k_channel *chan)
183 {
185 }
186 
187 static inline void ath9k_hw_set_channel_regs(struct ath_hw *ah,
188  struct ath9k_channel *chan)
189 {
191 }
192 
193 static inline int ath9k_hw_process_ini(struct ath_hw *ah,
194  struct ath9k_channel *chan)
195 {
197 }
198 
199 static inline void ath9k_olc_init(struct ath_hw *ah)
200 {
201  if (!ath9k_hw_private_ops(ah)->olc_init)
202  return;
203 
205 }
206 
207 static inline void ath9k_hw_set_rfmode(struct ath_hw *ah,
208  struct ath9k_channel *chan)
209 {
211 }
212 
213 static inline void ath9k_hw_mark_phy_inactive(struct ath_hw *ah)
214 {
216 }
217 
218 static inline void ath9k_hw_set_delta_slope(struct ath_hw *ah,
219  struct ath9k_channel *chan)
220 {
222 }
223 
224 static inline int ath9k_hw_rfbus_req(struct ath_hw *ah)
225 {
227 }
228 
229 static inline void ath9k_hw_rfbus_done(struct ath_hw *ah)
230 {
232 }
233 
234 static inline void ath9k_hw_restore_chainmask(struct ath_hw *ah)
235 {
236  if (!ath9k_hw_private_ops(ah)->restore_chainmask)
237  return;
238 
240 }
241 
242 static inline void ath9k_hw_set_diversity(struct ath_hw *ah, int value)
243 {
245 }
246 
247 static inline int ath9k_hw_ani_control(struct ath_hw *ah,
248  enum ath9k_ani_cmd cmd, int param)
249 {
251 }
252 
253 static inline void ath9k_hw_do_getnf(struct ath_hw *ah,
254  int16_t nfarray[NUM_NF_READINGS])
255 {
256  ath9k_hw_private_ops(ah)->do_getnf(ah, nfarray);
257 }
258 
259 static inline int ath9k_hw_init_cal(struct ath_hw *ah,
260  struct ath9k_channel *chan)
261 {
263 }
264 
265 static inline void ath9k_hw_setup_calibration(struct ath_hw *ah,
266  struct ath9k_cal_list *currCal)
267 {
269 }
270 
271 #endif /* ATH9K_HW_OPS_H */
uint16_t u16
Definition: stdint.h:22
void(* set_delta_slope)(struct ath_hw *ah, struct ath9k_channel *chan)
Definition: hw.h:578
static int ath9k_hw_getisr(struct ath_hw *ah, enum ath9k_int *masked)
Definition: hw-ops.h:58
Definition: hw.h:657
static void ath9k_hw_set_clrdmask(struct ath_hw *ah, void *ds, int val)
Definition: hw-ops.h:122
void(* init_bb)(struct ath_hw *ah, struct ath9k_channel *chan)
Definition: hw.h:572
void __asmcall int val
Definition: setjmp.h:12
void(* rx_enable)(struct ath_hw *ah)
Definition: hw.h:608
void(* rf_free_ext_banks)(struct ath_hw *ah)
Definition: hw.h:567
uint32_t type
Operating system type.
Definition: ena.h:12
void(* spur_mitigate_freq)(struct ath_hw *ah, struct ath9k_channel *chan)
Definition: hw.h:564
static void ath9k_hw_rxena(struct ath_hw *ah)
Definition: hw-ops.h:34
static void ath9k_hw_mark_phy_inactive(struct ath_hw *ah)
Definition: hw-ops.h:213
ath9k_int
Definition: hw.h:252
int(* rf_alloc_ext_banks)(struct ath_hw *ah)
Definition: hw.h:566
void(* olc_init)(struct ath_hw *ah)
Definition: hw.h:575
void(* rfbus_done)(struct ath_hw *ah)
Definition: hw.h:580
FILE_LICENCE(BSD2)
FILE_SECBOOT(FORBIDDEN)
void(* clr11n_aggr)(struct ath_hw *ah, void *ds)
Definition: hw.h:638
void(* setup_calibration)(struct ath_hw *ah, struct ath9k_cal_list *currCal)
Definition: hw.h:558
static void ath9k_hw_configpcipowersave(struct ath_hw *ah, int restore, int power_off)
Definition: hw-ops.h:27
static void ath9k_hw_set11n_ratescenario(struct ath_hw *ah, void *ds, void *lastds, u32 durUpdateEn, u32 rtsctsRate, u32 rtsctsDuration, struct ath9k_11n_rate_series series[], u32 nseries, u32 flags)
Definition: hw-ops.h:88
struct net80211_channel * chan
Definition: hw.h:348
static void ath9k_hw_antdiv_comb_conf_get(struct ath_hw *ah, struct ath_hw_antcomb_conf *antconf)
Definition: hw-ops.h:127
static int ath9k_hw_rf_alloc_ext_banks(struct ath_hw *ah)
Definition: hw-ops.h:155
static void ath9k_hw_set11n_aggr_first(struct ath_hw *ah, void *ds, u32 aggrLen)
Definition: hw-ops.h:100
void(* mark_phy_inactive)(struct ath_hw *ah)
Definition: hw.h:577
void(* antdiv_comb_conf_set)(struct ath_hw *ah, struct ath_hw_antcomb_conf *antconf)
Definition: hw.h:642
void(* set11n_aggr_last)(struct ath_hw *ah, void *ds)
Definition: hw.h:637
int(* get_isr)(struct ath_hw *ah, enum ath9k_int *masked)
Definition: hw.h:615
static int ath9k_hw_rfbus_req(struct ath_hw *ah)
Definition: hw-ops.h:224
static void ath9k_olc_init(struct ath_hw *ah)
Definition: hw-ops.h:199
static void ath9k_hw_antdiv_comb_conf_set(struct ath_hw *ah, struct ath_hw_antcomb_conf *antconf)
Definition: hw-ops.h:133
static void ath9k_hw_set11n_txdesc(struct ath_hw *ah, void *ds, u32 pktLen, enum ath9k_pkt_type type, u32 txPower, u32 keyIx, enum ath9k_key_type keyType, u32 flags)
Definition: hw-ops.h:78
int(* process_ini)(struct ath_hw *ah, struct ath9k_channel *chan)
Definition: hw.h:574
static int ath9k_hw_init_cal(struct ath_hw *ah, struct ath9k_channel *chan)
Definition: hw-ops.h:259
ath9k_key_type
Definition: mac.h:665
static void ath9k_hw_set_channel_regs(struct ath_hw *ah, struct ath9k_channel *chan)
Definition: hw-ops.h:187
pseudo_bit_t value[0x00020]
Definition: arbel.h:13
static void ath9k_hw_setup_calibration(struct ath_hw *ah, struct ath9k_cal_list *currCal)
Definition: hw-ops.h:265
int(* set_rf_regs)(struct ath_hw *ah, struct ath9k_channel *chan, u16 modesIndex)
Definition: hw.h:568
static void ath9k_hw_set11n_aggr_last(struct ath_hw *ah, void *ds)
Definition: hw-ops.h:112
u32 link
Link to next descriptor.
Definition: ar9003_mac.h:25
static void ath9k_hw_init_bb(struct ath_hw *ah, struct ath9k_channel *chan)
Definition: hw-ops.h:181
void(* set11n_ratescenario)(struct ath_hw *ah, void *ds, void *lastds, u32 durUpdateEn, u32 rtsctsRate, u32 rtsctsDuration, struct ath9k_11n_rate_series series[], u32 nseries, u32 flags)
Definition: hw.h:627
uint8_t flags
Flags.
Definition: ena.h:18
static void ath9k_hw_filltxdesc(struct ath_hw *ah, void *ds, u32 seglen, int is_firstseg, int is_lastseg, const void *ds0, u32 buf_addr, unsigned int qcu)
Definition: hw-ops.h:63
struct hv_monitor_parameter param[4][32]
Parameters.
Definition: hyperv.h:24
static void ath9k_hw_spur_mitigate_freq(struct ath_hw *ah, struct ath9k_channel *chan)
Definition: hw-ops.h:149
void(* set11n_txdesc)(struct ath_hw *ah, void *ds, u32 pktLen, enum ath9k_pkt_type type, u32 txPower, u32 keyIx, enum ath9k_key_type keyType, u32 flags)
Definition: hw.h:622
int(* calibrate)(struct ath_hw *ah, struct ath9k_channel *chan, u8 rxchainmask, int longcal)
Definition: hw.h:611
static void ath9k_hw_set_diversity(struct ath_hw *ah, int value)
Definition: hw-ops.h:242
static void ath9k_hw_set11n_aggr_middle(struct ath_hw *ah, void *ds, u32 numDelims)
Definition: hw-ops.h:106
static int ath9k_hw_calibrate(struct ath_hw *ah, struct ath9k_channel *chan, u8 rxchainmask, int longcal)
Definition: hw-ops.h:50
void(* config_pci_powersave)(struct ath_hw *ah, int restore, int power_off)
Definition: hw.h:605
void(* set_clrdmask)(struct ath_hw *ah, void *ds, int val)
Definition: hw.h:639
uint32_t ds
Definition: librm.h:140
static int ath9k_hw_process_ini(struct ath_hw *ah, struct ath9k_channel *chan)
Definition: hw-ops.h:193
void(* set_rfmode)(struct ath_hw *ah, struct ath9k_channel *chan)
Definition: hw.h:576
static void ath9k_hw_set_rfmode(struct ath_hw *ah, struct ath9k_channel *chan)
Definition: hw-ops.h:207
static void ath9k_hw_set_delta_slope(struct ath_hw *ah, struct ath9k_channel *chan)
Definition: hw-ops.h:218
void(* set_diversity)(struct ath_hw *ah, int value)
Definition: hw.h:582
static void ath9k_hw_rf_free_ext_banks(struct ath_hw *ah)
Definition: hw-ops.h:163
static struct ath_hw_ops * ath9k_hw_ops(struct ath_hw *ah)
Definition: hw.h:885
int(* proc_txdesc)(struct ath_hw *ah, void *ds, struct ath_tx_status *ts)
Definition: hw.h:620
ath9k_ani_cmd
Definition: ani.h:81
int(* rfbus_req)(struct ath_hw *ah)
Definition: hw.h:579
static int ath9k_hw_rf_set_freq(struct ath_hw *ah, struct ath9k_channel *chan)
Definition: hw-ops.h:143
static void ath9k_hw_get_desc_link(struct ath_hw *ah, void *ds, u32 **link)
Definition: hw-ops.h:45
static void ath9k_hw_restore_chainmask(struct ath_hw *ah)
Definition: hw-ops.h:234
void(* set11n_aggr_middle)(struct ath_hw *ah, void *ds, u32 numDelims)
Definition: hw.h:635
static int ath9k_hw_ani_control(struct ath_hw *ah, enum ath9k_ani_cmd cmd, int param)
Definition: hw-ops.h:247
static void ath9k_hw_rfbus_done(struct ath_hw *ah)
Definition: hw-ops.h:229
static void ath9k_hw_set_desc_link(struct ath_hw *ah, void *ds, u32 link)
Definition: hw-ops.h:39
static void ath9k_hw_clr11n_aggr(struct ath_hw *ah, void *ds)
Definition: hw-ops.h:117
#define NUM_NF_READINGS
Definition: calib.h:31
int(* ani_control)(struct ath_hw *ah, enum ath9k_ani_cmd cmd, int param)
Definition: hw.h:585
void(* antdiv_comb_conf_get)(struct ath_hw *ah, struct ath_hw_antcomb_conf *antconf)
Definition: hw.h:640
int(* rf_set_freq)(struct ath_hw *ah, struct ath9k_channel *chan)
Definition: hw.h:562
static int ath9k_hw_txprocdesc(struct ath_hw *ah, void *ds, struct ath_tx_status *ts)
Definition: hw-ops.h:72
void(* set11n_aggr_first)(struct ath_hw *ah, void *ds, u32 aggrLen)
Definition: hw.h:633
void(* set_channel_regs)(struct ath_hw *ah, struct ath9k_channel *chan)
Definition: hw.h:571
uint8_t ah
Definition: registers.h:85
static void ath9k_hw_do_getnf(struct ath_hw *ah, int16_t nfarray[NUM_NF_READINGS])
Definition: hw-ops.h:253
signed short int16_t
Definition: stdint.h:16
static struct ath_hw_private_ops * ath9k_hw_private_ops(struct ath_hw *ah)
Definition: hw.h:880
void(* do_getnf)(struct ath_hw *ah, int16_t nfarray[NUM_NF_READINGS])
Definition: hw.h:587
void(* restore_chainmask)(struct ath_hw *ah)
Definition: hw.h:581
ath9k_pkt_type
Definition: mac.h:605
void(* fill_txdesc)(struct ath_hw *ah, void *ds, u32 seglen, int is_firstseg, int is_is_lastseg, const void *ds0, u32 buf_addr, unsigned int qcu)
Definition: hw.h:616
struct golan_eqe_cmd cmd
Definition: CIB_PRM.h:29
void(* get_desc_link)(void *ds, u32 **link)
Definition: hw.h:610
uint8_t u8
Definition: stdint.h:20
uint32_t u32
Definition: stdint.h:24
int(* init_cal)(struct ath_hw *ah, struct ath9k_channel *chan)
Definition: hw.h:554
static int ath9k_hw_set_rf_regs(struct ath_hw *ah, struct ath9k_channel *chan, u16 modesIndex)
Definition: hw-ops.h:171
void(* set_desc_link)(void *ds, u32 link)
Definition: hw.h:609