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 
22 #include "hw.h"
23 
24 /* Hardware core and driver accessible callbacks */
25 
26 static inline void ath9k_hw_configpcipowersave(struct ath_hw *ah,
27  int restore,
28  int power_off)
29 {
30  ath9k_hw_ops(ah)->config_pci_powersave(ah, restore, power_off);
31 }
32 
33 static inline void ath9k_hw_rxena(struct ath_hw *ah)
34 {
36 }
37 
38 static inline void ath9k_hw_set_desc_link(struct ath_hw *ah, void *ds,
39  u32 link)
40 {
42 }
43 
44 static inline void ath9k_hw_get_desc_link(struct ath_hw *ah, void *ds,
45  u32 **link)
46 {
48 }
49 static inline int ath9k_hw_calibrate(struct ath_hw *ah,
50  struct ath9k_channel *chan,
51  u8 rxchainmask,
52  int longcal)
53 {
54  return ath9k_hw_ops(ah)->calibrate(ah, chan, rxchainmask, longcal);
55 }
56 
57 static inline int ath9k_hw_getisr(struct ath_hw *ah, enum ath9k_int *masked)
58 {
59  return ath9k_hw_ops(ah)->get_isr(ah, masked);
60 }
61 
62 static inline void ath9k_hw_filltxdesc(struct ath_hw *ah, void *ds, u32 seglen,
63  int is_firstseg, int is_lastseg,
64  const void *ds0, u32 buf_addr,
65  unsigned int qcu)
66 {
67  ath9k_hw_ops(ah)->fill_txdesc(ah, ds, seglen, is_firstseg, is_lastseg,
68  ds0, buf_addr, qcu);
69 }
70 
71 static inline int ath9k_hw_txprocdesc(struct ath_hw *ah, void *ds,
72  struct ath_tx_status *ts)
73 {
74  return ath9k_hw_ops(ah)->proc_txdesc(ah, ds, ts);
75 }
76 
77 static inline void ath9k_hw_set11n_txdesc(struct ath_hw *ah, void *ds,
78  u32 pktLen, enum ath9k_pkt_type type,
79  u32 txPower, u32 keyIx,
80  enum ath9k_key_type keyType,
81  u32 flags)
82 {
83  ath9k_hw_ops(ah)->set11n_txdesc(ah, ds, pktLen, type, txPower, keyIx,
84  keyType, flags);
85 }
86 
87 static inline void ath9k_hw_set11n_ratescenario(struct ath_hw *ah, void *ds,
88  void *lastds,
89  u32 durUpdateEn, u32 rtsctsRate,
90  u32 rtsctsDuration,
91  struct ath9k_11n_rate_series series[],
92  u32 nseries, u32 flags)
93 {
94  ath9k_hw_ops(ah)->set11n_ratescenario(ah, ds, lastds, durUpdateEn,
95  rtsctsRate, rtsctsDuration, series,
96  nseries, flags);
97 }
98 
99 static inline void ath9k_hw_set11n_aggr_first(struct ath_hw *ah, void *ds,
100  u32 aggrLen)
101 {
102  ath9k_hw_ops(ah)->set11n_aggr_first(ah, ds, aggrLen);
103 }
104 
105 static inline void ath9k_hw_set11n_aggr_middle(struct ath_hw *ah, void *ds,
106  u32 numDelims)
107 {
108  ath9k_hw_ops(ah)->set11n_aggr_middle(ah, ds, numDelims);
109 }
110 
111 static inline void ath9k_hw_set11n_aggr_last(struct ath_hw *ah, void *ds)
112 {
114 }
115 
116 static inline void ath9k_hw_clr11n_aggr(struct ath_hw *ah, void *ds)
117 {
119 }
120 
121 static inline void ath9k_hw_set_clrdmask(struct ath_hw *ah, void *ds, int val)
122 {
124 }
125 
126 static inline void ath9k_hw_antdiv_comb_conf_get(struct ath_hw *ah,
127  struct ath_hw_antcomb_conf *antconf)
128 {
130 }
131 
132 static inline void ath9k_hw_antdiv_comb_conf_set(struct ath_hw *ah,
133  struct ath_hw_antcomb_conf *antconf)
134 {
136 }
137 
138 /* Private hardware call ops */
139 
140 /* PHY ops */
141 
142 static inline int ath9k_hw_rf_set_freq(struct ath_hw *ah,
143  struct ath9k_channel *chan)
144 {
146 }
147 
148 static inline void ath9k_hw_spur_mitigate_freq(struct ath_hw *ah,
149  struct ath9k_channel *chan)
150 {
152 }
153 
154 static inline int ath9k_hw_rf_alloc_ext_banks(struct ath_hw *ah)
155 {
156  if (!ath9k_hw_private_ops(ah)->rf_alloc_ext_banks)
157  return 0;
158 
160 }
161 
162 static inline void ath9k_hw_rf_free_ext_banks(struct ath_hw *ah)
163 {
164  if (!ath9k_hw_private_ops(ah)->rf_free_ext_banks)
165  return;
166 
168 }
169 
170 static inline int ath9k_hw_set_rf_regs(struct ath_hw *ah,
171  struct ath9k_channel *chan,
172  u16 modesIndex)
173 {
174  if (!ath9k_hw_private_ops(ah)->set_rf_regs)
175  return 1;
176 
177  return ath9k_hw_private_ops(ah)->set_rf_regs(ah, chan, modesIndex);
178 }
179 
180 static inline void ath9k_hw_init_bb(struct ath_hw *ah,
181  struct ath9k_channel *chan)
182 {
184 }
185 
186 static inline void ath9k_hw_set_channel_regs(struct ath_hw *ah,
187  struct ath9k_channel *chan)
188 {
190 }
191 
192 static inline int ath9k_hw_process_ini(struct ath_hw *ah,
193  struct ath9k_channel *chan)
194 {
196 }
197 
198 static inline void ath9k_olc_init(struct ath_hw *ah)
199 {
200  if (!ath9k_hw_private_ops(ah)->olc_init)
201  return;
202 
204 }
205 
206 static inline void ath9k_hw_set_rfmode(struct ath_hw *ah,
207  struct ath9k_channel *chan)
208 {
210 }
211 
212 static inline void ath9k_hw_mark_phy_inactive(struct ath_hw *ah)
213 {
215 }
216 
217 static inline void ath9k_hw_set_delta_slope(struct ath_hw *ah,
218  struct ath9k_channel *chan)
219 {
221 }
222 
223 static inline int ath9k_hw_rfbus_req(struct ath_hw *ah)
224 {
226 }
227 
228 static inline void ath9k_hw_rfbus_done(struct ath_hw *ah)
229 {
231 }
232 
233 static inline void ath9k_hw_restore_chainmask(struct ath_hw *ah)
234 {
235  if (!ath9k_hw_private_ops(ah)->restore_chainmask)
236  return;
237 
239 }
240 
241 static inline void ath9k_hw_set_diversity(struct ath_hw *ah, int value)
242 {
244 }
245 
246 static inline int ath9k_hw_ani_control(struct ath_hw *ah,
247  enum ath9k_ani_cmd cmd, int param)
248 {
250 }
251 
252 static inline void ath9k_hw_do_getnf(struct ath_hw *ah,
253  int16_t nfarray[NUM_NF_READINGS])
254 {
255  ath9k_hw_private_ops(ah)->do_getnf(ah, nfarray);
256 }
257 
258 static inline int ath9k_hw_init_cal(struct ath_hw *ah,
259  struct ath9k_channel *chan)
260 {
262 }
263 
264 static inline void ath9k_hw_setup_calibration(struct ath_hw *ah,
265  struct ath9k_cal_list *currCal)
266 {
268 }
269 
270 #endif /* ATH9K_HW_OPS_H */
uint16_t u16
Definition: stdint.h:21
void(* set_delta_slope)(struct ath_hw *ah, struct ath9k_channel *chan)
Definition: hw.h:577
static int ath9k_hw_getisr(struct ath_hw *ah, enum ath9k_int *masked)
Definition: hw-ops.h:57
Definition: hw.h:656
static void ath9k_hw_set_clrdmask(struct ath_hw *ah, void *ds, int val)
Definition: hw-ops.h:121
void(* init_bb)(struct ath_hw *ah, struct ath9k_channel *chan)
Definition: hw.h:571
void(* rx_enable)(struct ath_hw *ah)
Definition: hw.h:607
void(* rf_free_ext_banks)(struct ath_hw *ah)
Definition: hw.h:566
void(* spur_mitigate_freq)(struct ath_hw *ah, struct ath9k_channel *chan)
Definition: hw.h:563
static void ath9k_hw_rxena(struct ath_hw *ah)
Definition: hw-ops.h:33
static void ath9k_hw_mark_phy_inactive(struct ath_hw *ah)
Definition: hw-ops.h:212
ath9k_int
Definition: hw.h:251
int(* rf_alloc_ext_banks)(struct ath_hw *ah)
Definition: hw.h:565
void(* olc_init)(struct ath_hw *ah)
Definition: hw.h:574
void(* rfbus_done)(struct ath_hw *ah)
Definition: hw.h:579
FILE_LICENCE(BSD2)
void(* clr11n_aggr)(struct ath_hw *ah, void *ds)
Definition: hw.h:637
void(* setup_calibration)(struct ath_hw *ah, struct ath9k_cal_list *currCal)
Definition: hw.h:557
static void ath9k_hw_configpcipowersave(struct ath_hw *ah, int restore, int power_off)
Definition: hw-ops.h:26
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:87
struct net80211_channel * chan
Definition: hw.h:347
static void ath9k_hw_antdiv_comb_conf_get(struct ath_hw *ah, struct ath_hw_antcomb_conf *antconf)
Definition: hw-ops.h:126
static int ath9k_hw_rf_alloc_ext_banks(struct ath_hw *ah)
Definition: hw-ops.h:154
static void ath9k_hw_set11n_aggr_first(struct ath_hw *ah, void *ds, u32 aggrLen)
Definition: hw-ops.h:99
void(* mark_phy_inactive)(struct ath_hw *ah)
Definition: hw.h:576
void(* antdiv_comb_conf_set)(struct ath_hw *ah, struct ath_hw_antcomb_conf *antconf)
Definition: hw.h:641
void(* set11n_aggr_last)(struct ath_hw *ah, void *ds)
Definition: hw.h:636
int(* get_isr)(struct ath_hw *ah, enum ath9k_int *masked)
Definition: hw.h:614
static int ath9k_hw_rfbus_req(struct ath_hw *ah)
Definition: hw-ops.h:223
static void ath9k_olc_init(struct ath_hw *ah)
Definition: hw-ops.h:198
static void ath9k_hw_antdiv_comb_conf_set(struct ath_hw *ah, struct ath_hw_antcomb_conf *antconf)
Definition: hw-ops.h:132
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:77
int(* process_ini)(struct ath_hw *ah, struct ath9k_channel *chan)
Definition: hw.h:573
static int ath9k_hw_init_cal(struct ath_hw *ah, struct ath9k_channel *chan)
Definition: hw-ops.h:258
ath9k_key_type
Definition: mac.h:664
static void ath9k_hw_set_channel_regs(struct ath_hw *ah, struct ath9k_channel *chan)
Definition: hw-ops.h:186
static void ath9k_hw_setup_calibration(struct ath_hw *ah, struct ath9k_cal_list *currCal)
Definition: hw-ops.h:264
int(* set_rf_regs)(struct ath_hw *ah, struct ath9k_channel *chan, u16 modesIndex)
Definition: hw.h:567
static void ath9k_hw_set11n_aggr_last(struct ath_hw *ah, void *ds)
Definition: hw-ops.h:111
u32 link
Link to next descriptor.
Definition: ar9003_mac.h:68
pseudo_bit_t value[0x00020]
Definition: arbel.h:13
static void ath9k_hw_init_bb(struct ath_hw *ah, struct ath9k_channel *chan)
Definition: hw-ops.h:180
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:626
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:62
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:148
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:621
int(* calibrate)(struct ath_hw *ah, struct ath9k_channel *chan, u8 rxchainmask, int longcal)
Definition: hw.h:610
static void ath9k_hw_set_diversity(struct ath_hw *ah, int value)
Definition: hw-ops.h:241
static void ath9k_hw_set11n_aggr_middle(struct ath_hw *ah, void *ds, u32 numDelims)
Definition: hw-ops.h:105
static int ath9k_hw_calibrate(struct ath_hw *ah, struct ath9k_channel *chan, u8 rxchainmask, int longcal)
Definition: hw-ops.h:49
void(* config_pci_powersave)(struct ath_hw *ah, int restore, int power_off)
Definition: hw.h:604
void(* set_clrdmask)(struct ath_hw *ah, void *ds, int val)
Definition: hw.h:638
uint32_t ds
Definition: librm.h:254
static int ath9k_hw_process_ini(struct ath_hw *ah, struct ath9k_channel *chan)
Definition: hw-ops.h:192
void(* set_rfmode)(struct ath_hw *ah, struct ath9k_channel *chan)
Definition: hw.h:575
static void ath9k_hw_set_rfmode(struct ath_hw *ah, struct ath9k_channel *chan)
Definition: hw-ops.h:206
static void ath9k_hw_set_delta_slope(struct ath_hw *ah, struct ath9k_channel *chan)
Definition: hw-ops.h:217
void __asmcall int val
Definition: setjmp.h:28
void(* set_diversity)(struct ath_hw *ah, int value)
Definition: hw.h:581
static void ath9k_hw_rf_free_ext_banks(struct ath_hw *ah)
Definition: hw-ops.h:162
static struct ath_hw_ops * ath9k_hw_ops(struct ath_hw *ah)
Definition: hw.h:884
int(* proc_txdesc)(struct ath_hw *ah, void *ds, struct ath_tx_status *ts)
Definition: hw.h:619
ath9k_ani_cmd
Definition: ani.h:80
int(* rfbus_req)(struct ath_hw *ah)
Definition: hw.h:578
static int ath9k_hw_rf_set_freq(struct ath_hw *ah, struct ath9k_channel *chan)
Definition: hw-ops.h:142
static void ath9k_hw_get_desc_link(struct ath_hw *ah, void *ds, u32 **link)
Definition: hw-ops.h:44
static void ath9k_hw_restore_chainmask(struct ath_hw *ah)
Definition: hw-ops.h:233
void(* set11n_aggr_middle)(struct ath_hw *ah, void *ds, u32 numDelims)
Definition: hw.h:634
static int ath9k_hw_ani_control(struct ath_hw *ah, enum ath9k_ani_cmd cmd, int param)
Definition: hw-ops.h:246
uint32_t type
Operating system type.
Definition: ena.h:12
static void ath9k_hw_rfbus_done(struct ath_hw *ah)
Definition: hw-ops.h:228
static void ath9k_hw_set_desc_link(struct ath_hw *ah, void *ds, u32 link)
Definition: hw-ops.h:38
static void ath9k_hw_clr11n_aggr(struct ath_hw *ah, void *ds)
Definition: hw-ops.h:116
#define NUM_NF_READINGS
Definition: calib.h:30
int(* ani_control)(struct ath_hw *ah, enum ath9k_ani_cmd cmd, int param)
Definition: hw.h:584
void(* antdiv_comb_conf_get)(struct ath_hw *ah, struct ath_hw_antcomb_conf *antconf)
Definition: hw.h:639
int(* rf_set_freq)(struct ath_hw *ah, struct ath9k_channel *chan)
Definition: hw.h:561
static int ath9k_hw_txprocdesc(struct ath_hw *ah, void *ds, struct ath_tx_status *ts)
Definition: hw-ops.h:71
void(* set11n_aggr_first)(struct ath_hw *ah, void *ds, u32 aggrLen)
Definition: hw.h:632
void(* set_channel_regs)(struct ath_hw *ah, struct ath9k_channel *chan)
Definition: hw.h:570
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:252
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:879
void(* do_getnf)(struct ath_hw *ah, int16_t nfarray[NUM_NF_READINGS])
Definition: hw.h:586
void(* restore_chainmask)(struct ath_hw *ah)
Definition: hw.h:580
ath9k_pkt_type
Definition: mac.h:604
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:615
struct golan_eqe_cmd cmd
Definition: CIB_PRM.h:29
void(* get_desc_link)(void *ds, u32 **link)
Definition: hw.h:609
uint8_t u8
Definition: stdint.h:19
uint32_t u32
Definition: stdint.h:23
int(* init_cal)(struct ath_hw *ah, struct ath9k_channel *chan)
Definition: hw.h:553
static int ath9k_hw_set_rf_regs(struct ath_hw *ah, struct ath9k_channel *chan, u16 modesIndex)
Definition: hw-ops.h:170
uint8_t flags
Flags.
Definition: ena.h:18
void(* set_desc_link)(void *ds, u32 link)
Definition: hw.h:608