Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 203022
b: refs/heads/master
c: ac0bb76
h: refs/heads/master
v: v3
  • Loading branch information
Luis R. Rodriguez authored and John W. Linville committed Jun 14, 2010
1 parent b5d9c4b commit 75066a5
Show file tree
Hide file tree
Showing 8 changed files with 74 additions and 12 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 6e97f0fb4dc8e95cd7507f3ae89841a79bac0193
refs/heads/master: ac0bb76791ce2550e3c0a658408c344e1e231e3d
30 changes: 23 additions & 7 deletions trunk/drivers/net/wireless/ath/ath9k/ani.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@
#include "hw.h"
#include "hw-ops.h"

/* Private to ani.c */
static inline void ath9k_hw_ani_lower_immunity(struct ath_hw *ah)
{
ath9k_hw_private_ops(ah)->ani_lower_immunity(ah);
}

static int ath9k_hw_get_ani_channel_idx(struct ath_hw *ah,
struct ath9k_channel *chan)
{
Expand Down Expand Up @@ -206,7 +212,7 @@ static void ath9k_hw_ani_cck_err_trigger(struct ath_hw *ah)
}
}

static void ath9k_hw_ani_lower_immunity(struct ath_hw *ah)
static void ath9k_hw_ani_lower_immunity_old(struct ath_hw *ah)
{
struct ar5416AniState *aniState;
int32_t rssi;
Expand Down Expand Up @@ -316,7 +322,7 @@ static int32_t ath9k_hw_ani_get_listen_time(struct ath_hw *ah)
return listenTime;
}

void ath9k_ani_reset(struct ath_hw *ah)
static void ath9k_ani_reset_old(struct ath_hw *ah)
{
struct ar5416AniState *aniState;
struct ath9k_channel *chan = ah->curchan;
Expand Down Expand Up @@ -402,8 +408,8 @@ void ath9k_ani_reset(struct ath_hw *ah)
DISABLE_REGWRITE_BUFFER(ah);
}

void ath9k_hw_ani_monitor(struct ath_hw *ah,
struct ath9k_channel *chan)
static void ath9k_hw_ani_monitor_old(struct ath_hw *ah,
struct ath9k_channel *chan)
{
struct ar5416AniState *aniState;
struct ath_common *common = ath9k_hw_common(ah);
Expand Down Expand Up @@ -487,7 +493,6 @@ void ath9k_hw_ani_monitor(struct ath_hw *ah,
}
}
}
EXPORT_SYMBOL(ath9k_hw_ani_monitor);

void ath9k_enable_mib_counters(struct ath_hw *ah)
{
Expand Down Expand Up @@ -572,7 +577,7 @@ u32 ath9k_hw_GetMibCycleCountsPct(struct ath_hw *ah,
* any of the MIB counters overflow/trigger so don't assume we're
* here because a PHY error counter triggered.
*/
void ath9k_hw_procmibevent(struct ath_hw *ah)
static void ath9k_hw_proc_mib_event_old(struct ath_hw *ah)
{
u32 phyCnt1, phyCnt2;

Expand Down Expand Up @@ -628,7 +633,6 @@ void ath9k_hw_procmibevent(struct ath_hw *ah)
ath9k_ani_restart(ah);
}
}
EXPORT_SYMBOL(ath9k_hw_procmibevent);

void ath9k_hw_ani_setup(struct ath_hw *ah)
{
Expand Down Expand Up @@ -694,3 +698,15 @@ void ath9k_hw_ani_init(struct ath_hw *ah)
if (ah->config.enable_ani)
ah->proc_phyerr |= HAL_PROCESS_ANI;
}

void ath9k_hw_attach_ani_ops_old(struct ath_hw *ah)
{
struct ath_hw_private_ops *priv_ops = ath9k_hw_private_ops(ah);
struct ath_hw_ops *ops = ath9k_hw_ops(ah);

priv_ops->ani_reset = ath9k_ani_reset_old;
priv_ops->ani_lower_immunity = ath9k_hw_ani_lower_immunity_old;

ops->ani_proc_mib_event = ath9k_hw_proc_mib_event_old;
ops->ani_monitor = ath9k_hw_ani_monitor_old;
}
4 changes: 0 additions & 4 deletions trunk/drivers/net/wireless/ath/ath9k/ani.h
Original file line number Diff line number Diff line change
Expand Up @@ -108,14 +108,10 @@ struct ar5416Stats {
};
#define ah_mibStats stats.ast_mibstats

void ath9k_ani_reset(struct ath_hw *ah);
void ath9k_hw_ani_monitor(struct ath_hw *ah,
struct ath9k_channel *chan);
void ath9k_enable_mib_counters(struct ath_hw *ah);
void ath9k_hw_disable_mib_counters(struct ath_hw *ah);
u32 ath9k_hw_GetMibCycleCountsPct(struct ath_hw *ah, u32 *rxc_pcnt,
u32 *rxf_pcnt, u32 *txf_pcnt);
void ath9k_hw_procmibevent(struct ath_hw *ah);
void ath9k_hw_ani_setup(struct ath_hw *ah);
void ath9k_hw_ani_init(struct ath_hw *ah);

Expand Down
2 changes: 2 additions & 0 deletions trunk/drivers/net/wireless/ath/ath9k/ar9002_hw.c
Original file line number Diff line number Diff line change
Expand Up @@ -636,4 +636,6 @@ void ar9002_hw_attach_ops(struct ath_hw *ah)

ar9002_hw_attach_calib_ops(ah);
ar9002_hw_attach_mac_ops(ah);

ath9k_hw_attach_ani_ops_old(ah);
}
2 changes: 2 additions & 0 deletions trunk/drivers/net/wireless/ath/ath9k/ar9003_hw.c
Original file line number Diff line number Diff line change
Expand Up @@ -313,4 +313,6 @@ void ar9003_hw_attach_ops(struct ath_hw *ah)
ar9003_hw_attach_phy_ops(ah);
ar9003_hw_attach_calib_ops(ah);
ar9003_hw_attach_mac_ops(ah);

ath9k_hw_attach_ani_ops_old(ah);
}
16 changes: 16 additions & 0 deletions trunk/drivers/net/wireless/ath/ath9k/hw-ops.h
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,17 @@ static inline void ath9k_hw_set11n_virtualmorefrag(struct ath_hw *ah, void *ds,
ath9k_hw_ops(ah)->set11n_virtualmorefrag(ah, ds, vmf);
}

static inline void ath9k_hw_procmibevent(struct ath_hw *ah)
{
ath9k_hw_ops(ah)->ani_proc_mib_event(ah);
}

static inline void ath9k_hw_ani_monitor(struct ath_hw *ah,
struct ath9k_channel *chan)
{
ath9k_hw_ops(ah)->ani_monitor(ah, chan);
}

/* Private hardware call ops */

/* PHY ops */
Expand Down Expand Up @@ -277,4 +288,9 @@ static inline bool ath9k_hw_iscal_supported(struct ath_hw *ah,
return ath9k_hw_private_ops(ah)->iscal_supported(ah, calType);
}

static inline void ath9k_ani_reset(struct ath_hw *ah)
{
ath9k_hw_private_ops(ah)->ani_reset(ah);
}

#endif /* ATH9K_HW_OPS_H */
29 changes: 29 additions & 0 deletions trunk/drivers/net/wireless/ath/ath9k/hw.h
Original file line number Diff line number Diff line change
Expand Up @@ -511,6 +511,15 @@ struct ath_gen_timer_table {
* @setup_calibration: set up calibration
* @iscal_supported: used to query if a type of calibration is supported
* @loadnf: load noise floor read from each chain on the CCA registers
*
* @ani_reset: reset ANI parameters to default values
* @ani_lower_immunity: lower the noise immunity level. The level controls
* the power-based packet detection on hardware. If a power jump is
* detected the adapter takes it as an indication that a packet has
* arrived. The level ranges from 0-5. Each level corresponds to a
* few dB more of noise immunity. If you have a strong time-varying
* interference that is causing false detections (OFDM timing errors or
* CCK timing errors) the level can be increased.
*/
struct ath_hw_private_ops {
/* Calibration ops */
Expand Down Expand Up @@ -554,6 +563,10 @@ struct ath_hw_private_ops {
int param);
void (*do_getnf)(struct ath_hw *ah, int16_t nfarray[NUM_NF_READINGS]);
void (*loadnf)(struct ath_hw *ah, struct ath9k_channel *chan);

/* ANI */
void (*ani_reset)(struct ath_hw *ah);
void (*ani_lower_immunity)(struct ath_hw *ah);
};

/**
Expand All @@ -564,6 +577,11 @@ struct ath_hw_private_ops {
*
* @config_pci_powersave:
* @calibrate: periodic calibration for NF, ANI, IQ, ADC gain, ADC-DC
*
* @ani_proc_mib_event: process MIB events, this would happen upon specific ANI
* thresholds being reached or having overflowed.
* @ani_monitor: called periodically by the core driver to collect
* MIB stats and adjust ANI if specific thresholds have been reached.
*/
struct ath_hw_ops {
void (*config_pci_powersave)(struct ath_hw *ah,
Expand Down Expand Up @@ -604,6 +622,9 @@ struct ath_hw_ops {
u32 burstDuration);
void (*set11n_virtualmorefrag)(struct ath_hw *ah, void *ds,
u32 vmf);

void (*ani_proc_mib_event)(struct ath_hw *ah);
void (*ani_monitor)(struct ath_hw *ah, struct ath9k_channel *chan);
};

struct ath_hw {
Expand Down Expand Up @@ -934,6 +955,14 @@ void ar9003_hw_attach_calib_ops(struct ath_hw *ah);
void ar9002_hw_attach_ops(struct ath_hw *ah);
void ar9003_hw_attach_ops(struct ath_hw *ah);

/*
* ANI work can be shared between all families but a next
* generation implementation of ANI will be used only for AR9003 only
* for now as the other families still need to be tested with the same
* next generation ANI.
*/
void ath9k_hw_attach_ani_ops_old(struct ath_hw *ah);

#define ATH_PCIE_CAP_LINK_CTRL 0x70
#define ATH_PCIE_CAP_LINK_L0S 1
#define ATH_PCIE_CAP_LINK_L1 2
Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/net/wireless/ath/ath9k/mac.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
*/

#include "hw.h"
#include "hw-ops.h"

static void ath9k_hw_set_txq_interrupts(struct ath_hw *ah,
struct ath9k_tx_queue_info *qi)
Expand Down

0 comments on commit 75066a5

Please sign in to comment.