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
20FILE_LICENCE ( BSD2 );
21FILE_SECBOOT ( FORBIDDEN );
22
23#include "hw.h"
24
25/* Hardware core and driver accessible callbacks */
26
27static 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
34static inline void ath9k_hw_rxena(struct ath_hw *ah)
35{
37}
38
39static inline void ath9k_hw_set_desc_link(struct ath_hw *ah, void *ds,
40 u32 link)
41{
43}
44
45static inline void ath9k_hw_get_desc_link(struct ath_hw *ah, void *ds,
46 u32 **link)
47{
49}
50static 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
58static 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
63static 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
72static 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
78static 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
88static 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
100static inline void ath9k_hw_set11n_aggr_first(struct ath_hw *ah, void *ds,
101 u32 aggrLen)
102{
104}
105
106static 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
112static inline void ath9k_hw_set11n_aggr_last(struct ath_hw *ah, void *ds)
113{
115}
116
117static inline void ath9k_hw_clr11n_aggr(struct ath_hw *ah, void *ds)
118{
120}
121
122static inline void ath9k_hw_set_clrdmask(struct ath_hw *ah, void *ds, int val)
123{
125}
126
127static inline void ath9k_hw_antdiv_comb_conf_get(struct ath_hw *ah,
128 struct ath_hw_antcomb_conf *antconf)
129{
131}
132
133static 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
143static inline int ath9k_hw_rf_set_freq(struct ath_hw *ah,
144 struct ath9k_channel *chan)
145{
146 return ath9k_hw_private_ops(ah)->rf_set_freq(ah, chan);
147}
148
149static inline void ath9k_hw_spur_mitigate_freq(struct ath_hw *ah,
150 struct ath9k_channel *chan)
151{
153}
154
155static 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
163static 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
171static 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
181static inline void ath9k_hw_init_bb(struct ath_hw *ah,
182 struct ath9k_channel *chan)
183{
184 return ath9k_hw_private_ops(ah)->init_bb(ah, chan);
185}
186
187static inline void ath9k_hw_set_channel_regs(struct ath_hw *ah,
188 struct ath9k_channel *chan)
189{
191}
192
193static inline int ath9k_hw_process_ini(struct ath_hw *ah,
194 struct ath9k_channel *chan)
195{
196 return ath9k_hw_private_ops(ah)->process_ini(ah, chan);
197}
198
199static inline void ath9k_olc_init(struct ath_hw *ah)
200{
201 if (!ath9k_hw_private_ops(ah)->olc_init)
202 return;
203
205}
206
207static inline void ath9k_hw_set_rfmode(struct ath_hw *ah,
208 struct ath9k_channel *chan)
209{
210 return ath9k_hw_private_ops(ah)->set_rfmode(ah, chan);
211}
212
213static inline void ath9k_hw_mark_phy_inactive(struct ath_hw *ah)
214{
216}
217
218static inline void ath9k_hw_set_delta_slope(struct ath_hw *ah,
219 struct ath9k_channel *chan)
220{
222}
223
224static inline int ath9k_hw_rfbus_req(struct ath_hw *ah)
225{
227}
228
229static inline void ath9k_hw_rfbus_done(struct ath_hw *ah)
230{
232}
233
234static 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
242static inline void ath9k_hw_set_diversity(struct ath_hw *ah, int value)
243{
245}
246
247static inline int ath9k_hw_ani_control(struct ath_hw *ah,
248 enum ath9k_ani_cmd cmd, int param)
249{
251}
252
253static inline void ath9k_hw_do_getnf(struct ath_hw *ah,
254 int16_t nfarray[NUM_NF_READINGS])
255{
257}
258
259static inline int ath9k_hw_init_cal(struct ath_hw *ah,
260 struct ath9k_channel *chan)
261{
262 return ath9k_hw_private_ops(ah)->init_cal(ah, chan);
263}
264
265static 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 */
struct golan_eqe_cmd cmd
Definition CIB_PRM.h:1
ath9k_ani_cmd
Definition ani.h:81
u32 link
Link to next descriptor.
Definition ar9003_mac.h:1
pseudo_bit_t value[0x00020]
Definition arbel.h:2
signed short int16_t
Definition stdint.h:16
#define NUM_NF_READINGS
Definition calib.h:31
uint32_t type
Operating system type.
Definition ena.h:1
uint8_t flags
Flags.
Definition ena.h:7
#define FILE_LICENCE(_licence)
Declare a particular licence as applying to a file.
Definition compiler.h:896
#define FILE_SECBOOT(_status)
Declare a file's UEFI Secure Boot permission status.
Definition compiler.h:926
static void ath9k_hw_set_desc_link(struct ath_hw *ah, void *ds, u32 link)
Definition hw-ops.h:39
static void ath9k_hw_restore_chainmask(struct ath_hw *ah)
Definition hw-ops.h:234
static void ath9k_hw_get_desc_link(struct ath_hw *ah, void *ds, u32 **link)
Definition hw-ops.h:45
static void ath9k_hw_setup_calibration(struct ath_hw *ah, struct ath9k_cal_list *currCal)
Definition hw-ops.h:265
static int ath9k_hw_calibrate(struct ath_hw *ah, struct ath9k_channel *chan, u8 rxchainmask, int longcal)
Definition hw-ops.h:50
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
static int ath9k_hw_init_cal(struct ath_hw *ah, struct ath9k_channel *chan)
Definition hw-ops.h:259
static void ath9k_hw_spur_mitigate_freq(struct ath_hw *ah, struct ath9k_channel *chan)
Definition hw-ops.h:149
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_set11n_aggr_middle(struct ath_hw *ah, void *ds, u32 numDelims)
Definition hw-ops.h:106
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 int ath9k_hw_rf_alloc_ext_banks(struct ath_hw *ah)
Definition hw-ops.h:155
static void ath9k_hw_set11n_aggr_last(struct ath_hw *ah, void *ds)
Definition hw-ops.h:112
static void ath9k_hw_rf_free_ext_banks(struct ath_hw *ah)
Definition hw-ops.h:163
static void ath9k_hw_set_clrdmask(struct ath_hw *ah, void *ds, int val)
Definition hw-ops.h:122
static void ath9k_hw_set_diversity(struct ath_hw *ah, int value)
Definition hw-ops.h:242
static int ath9k_hw_rf_set_freq(struct ath_hw *ah, struct ath9k_channel *chan)
Definition hw-ops.h:143
static void ath9k_hw_set_channel_regs(struct ath_hw *ah, struct ath9k_channel *chan)
Definition hw-ops.h:187
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
static void ath9k_hw_clr11n_aggr(struct ath_hw *ah, void *ds)
Definition hw-ops.h:117
static void ath9k_hw_configpcipowersave(struct ath_hw *ah, int restore, int power_off)
Definition hw-ops.h:27
static int ath9k_hw_getisr(struct ath_hw *ah, enum ath9k_int *masked)
Definition hw-ops.h:58
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
static int ath9k_hw_process_ini(struct ath_hw *ah, struct ath9k_channel *chan)
Definition hw-ops.h:193
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_rfbus_done(struct ath_hw *ah)
Definition hw-ops.h:229
static void ath9k_hw_do_getnf(struct ath_hw *ah, int16_t nfarray[NUM_NF_READINGS])
Definition hw-ops.h:253
static int ath9k_hw_set_rf_regs(struct ath_hw *ah, struct ath9k_channel *chan, u16 modesIndex)
Definition hw-ops.h:171
static void ath9k_hw_set11n_aggr_first(struct ath_hw *ah, void *ds, u32 aggrLen)
Definition hw-ops.h:100
static void ath9k_hw_set_delta_slope(struct ath_hw *ah, struct ath9k_channel *chan)
Definition hw-ops.h:218
static void ath9k_hw_mark_phy_inactive(struct ath_hw *ah)
Definition hw-ops.h:213
static void ath9k_hw_rxena(struct ath_hw *ah)
Definition hw-ops.h:34
static void ath9k_hw_antdiv_comb_conf_get(struct ath_hw *ah, struct ath_hw_antcomb_conf *antconf)
Definition hw-ops.h:127
static void ath9k_hw_init_bb(struct ath_hw *ah, struct ath9k_channel *chan)
Definition hw-ops.h:181
static int ath9k_hw_txprocdesc(struct ath_hw *ah, void *ds, struct ath_tx_status *ts)
Definition hw-ops.h:72
static void ath9k_hw_set_rfmode(struct ath_hw *ah, struct ath9k_channel *chan)
Definition hw-ops.h:207
static struct ath_hw_private_ops * ath9k_hw_private_ops(struct ath_hw *ah)
Definition hw.h:880
static struct ath_hw_ops * ath9k_hw_ops(struct ath_hw *ah)
Definition hw.h:885
ath9k_int
Definition hw.h:252
#define u8
Definition igbvf_osdep.h:40
struct hv_monitor_parameter param[4][32]
Parameters.
Definition hyperv.h:13
void __asmcall int val
Definition setjmp.h:12
uint32_t ds
Definition librm.h:5
ath9k_key_type
Definition mac.h:665
ath9k_pkt_type
Definition mac.h:605
uint8_t ah
Definition registers.h:1
void(* config_pci_powersave)(struct ath_hw *ah, int restore, int power_off)
Definition hw.h:605
void(* set11n_aggr_first)(struct ath_hw *ah, void *ds, u32 aggrLen)
Definition hw.h:633
int(* proc_txdesc)(struct ath_hw *ah, void *ds, struct ath_tx_status *ts)
Definition hw.h:620
void(* rx_enable)(struct ath_hw *ah)
Definition hw.h:608
void(* set_desc_link)(void *ds, u32 link)
Definition hw.h:609
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
void(* antdiv_comb_conf_set)(struct ath_hw *ah, struct ath_hw_antcomb_conf *antconf)
Definition hw.h:642
void(* clr11n_aggr)(struct ath_hw *ah, void *ds)
Definition hw.h:638
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
void(* antdiv_comb_conf_get)(struct ath_hw *ah, struct ath_hw_antcomb_conf *antconf)
Definition hw.h:640
void(* set_clrdmask)(struct ath_hw *ah, void *ds, int val)
Definition hw.h:639
void(* set11n_aggr_last)(struct ath_hw *ah, void *ds)
Definition hw.h:637
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
int(* get_isr)(struct ath_hw *ah, enum ath9k_int *masked)
Definition hw.h:615
void(* get_desc_link)(void *ds, u32 **link)
Definition hw.h:610
int(* calibrate)(struct ath_hw *ah, struct ath9k_channel *chan, u8 rxchainmask, int longcal)
Definition hw.h:611
void(* set11n_aggr_middle)(struct ath_hw *ah, void *ds, u32 numDelims)
Definition hw.h:635
void(* set_channel_regs)(struct ath_hw *ah, struct ath9k_channel *chan)
Definition hw.h:571
void(* rfbus_done)(struct ath_hw *ah)
Definition hw.h:580
void(* rf_free_ext_banks)(struct ath_hw *ah)
Definition hw.h:567
void(* init_bb)(struct ath_hw *ah, struct ath9k_channel *chan)
Definition hw.h:572
void(* mark_phy_inactive)(struct ath_hw *ah)
Definition hw.h:577
void(* setup_calibration)(struct ath_hw *ah, struct ath9k_cal_list *currCal)
Definition hw.h:558
void(* olc_init)(struct ath_hw *ah)
Definition hw.h:575
void(* set_delta_slope)(struct ath_hw *ah, struct ath9k_channel *chan)
Definition hw.h:578
int(* ani_control)(struct ath_hw *ah, enum ath9k_ani_cmd cmd, int param)
Definition hw.h:585
int(* rf_set_freq)(struct ath_hw *ah, struct ath9k_channel *chan)
Definition hw.h:562
int(* init_cal)(struct ath_hw *ah, struct ath9k_channel *chan)
Definition hw.h:554
void(* spur_mitigate_freq)(struct ath_hw *ah, struct ath9k_channel *chan)
Definition hw.h:564
void(* set_diversity)(struct ath_hw *ah, int value)
Definition hw.h:582
int(* set_rf_regs)(struct ath_hw *ah, struct ath9k_channel *chan, u16 modesIndex)
Definition hw.h:568
int(* rf_alloc_ext_banks)(struct ath_hw *ah)
Definition hw.h:566
void(* restore_chainmask)(struct ath_hw *ah)
Definition hw.h:581
int(* process_ini)(struct ath_hw *ah, struct ath9k_channel *chan)
Definition hw.h:574
int(* rfbus_req)(struct ath_hw *ah)
Definition hw.h:579
void(* set_rfmode)(struct ath_hw *ah, struct ath9k_channel *chan)
Definition hw.h:576
void(* do_getnf)(struct ath_hw *ah, int16_t nfarray[NUM_NF_READINGS])
Definition hw.h:587
Definition hw.h:657
#define u16
Definition vga.h:20
#define u32
Definition vga.h:21