Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 51cce8a5 authored by John W. Linville's avatar John W. Linville
Browse files

Merge branch 'master' of...

parents 2fe66ec2 4f855938
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -54,7 +54,7 @@ int ar9170_write_mem(struct ar9170 *ar, const __le32 *data, size_t len)

int ar9170_write_reg(struct ar9170 *ar, const u32 reg, const u32 val)
{
	__le32 buf[2] = {
	const __le32 buf[2] = {
		cpu_to_le32(reg),
		cpu_to_le32(val),
	};
+6 −0
Original line number Diff line number Diff line
@@ -104,6 +104,11 @@ enum ath_cipher {
	ATH_CIPHER_MIC = 127
};

enum ath_drv_info {
	AR7010_DEVICE		= BIT(0),
	AR9287_DEVICE		= BIT(1),
};

/**
 * struct ath_ops - Register read/write operations
 *
@@ -147,6 +152,7 @@ struct ath_common {
	u8 rx_chainmask;

	u32 rx_bufsize;
	u32 driver_info;

	u32 keymax;
	DECLARE_BITMAP(keymap, ATH_KEYMAX);
+1 −0
Original line number Diff line number Diff line
@@ -4,6 +4,7 @@ config ATH5K
	select MAC80211_LEDS
	select LEDS_CLASS
	select NEW_LEDS
	select AVERAGE
	---help---
	  This module adds support for wireless adapters based on
	  Atheros 5xxx chipset.
+19 −19
Original line number Diff line number Diff line
@@ -63,15 +63,15 @@ ath5k_ani_set_noise_immunity_level(struct ath5k_hw *ah, int level)
	 * so i stick with the HAL version for now...
	 */
#if 0
	const s8 hi[] = { -18, -18, -16, -14, -12 };
	const s8 lo[] = { -52, -56, -60, -64, -70 };
	const s8 sz[] = { -34, -41, -48, -55, -62 };
	const s8 fr[] = { -70, -72, -75, -78, -80 };
	static const s8 hi[] = { -18, -18, -16, -14, -12 };
	static const s8 lo[] = { -52, -56, -60, -64, -70 };
	static const s8 sz[] = { -34, -41, -48, -55, -62 };
	static const s8 fr[] = { -70, -72, -75, -78, -80 };
#else
	const s8 sz[] = { -55, -62 };
	const s8 lo[] = { -64, -70 };
	const s8 hi[] = { -14, -12 };
	const s8 fr[] = { -78, -80 };
	static const s8 sz[] = { -55, -62 };
	static const s8 lo[] = { -64, -70 };
	static const s8 hi[] = { -14, -12 };
	static const s8 fr[] = { -78, -80 };
#endif
	if (level < 0 || level >= ARRAY_SIZE(sz)) {
		ATH5K_ERR(ah->ah_sc, "noise immuniy level %d out of range",
@@ -102,7 +102,7 @@ ath5k_ani_set_noise_immunity_level(struct ath5k_hw *ah, int level)
void
ath5k_ani_set_spur_immunity_level(struct ath5k_hw *ah, int level)
{
	const int val[] = { 2, 4, 6, 8, 10, 12, 14, 16 };
	static const int val[] = { 2, 4, 6, 8, 10, 12, 14, 16 };

	if (level < 0 || level >= ARRAY_SIZE(val) ||
	    level > ah->ah_sc->ani_state.max_spur_level) {
@@ -127,7 +127,7 @@ ath5k_ani_set_spur_immunity_level(struct ath5k_hw *ah, int level)
void
ath5k_ani_set_firstep_level(struct ath5k_hw *ah, int level)
{
	const int val[] = { 0, 4, 8 };
	static const int val[] = { 0, 4, 8 };

	if (level < 0 || level >= ARRAY_SIZE(val)) {
		ATH5K_ERR(ah->ah_sc, "firstep level %d out of range", level);
@@ -151,12 +151,12 @@ ath5k_ani_set_firstep_level(struct ath5k_hw *ah, int level)
void
ath5k_ani_set_ofdm_weak_signal_detection(struct ath5k_hw *ah, bool on)
{
	const int m1l[] = { 127, 50 };
	const int m2l[] = { 127, 40 };
	const int m1[] = { 127, 0x4d };
	const int m2[] = { 127, 0x40 };
	const int m2cnt[] = { 31, 16 };
	const int m2lcnt[] = { 63, 48 };
	static const int m1l[] = { 127, 50 };
	static const int m2l[] = { 127, 40 };
	static const int m1[] = { 127, 0x4d };
	static const int m2[] = { 127, 0x40 };
	static const int m2cnt[] = { 31, 16 };
	static const int m2lcnt[] = { 63, 48 };

	AR5K_REG_WRITE_BITS(ah, AR5K_PHY_WEAK_OFDM_LOW_THR,
				AR5K_PHY_WEAK_OFDM_LOW_THR_M1, m1l[on]);
@@ -192,7 +192,7 @@ ath5k_ani_set_ofdm_weak_signal_detection(struct ath5k_hw *ah, bool on)
void
ath5k_ani_set_cck_weak_signal_detection(struct ath5k_hw *ah, bool on)
{
	const int val[] = { 8, 6 };
	static const int val[] = { 8, 6 };
	AR5K_REG_WRITE_BITS(ah, AR5K_PHY_CCK_CROSSCORR,
				AR5K_PHY_CCK_CROSSCORR_WEAK_SIG_THR, val[on]);
	ah->ah_sc->ani_state.cck_weak_sig = on;
@@ -216,7 +216,7 @@ static void
ath5k_ani_raise_immunity(struct ath5k_hw *ah, struct ath5k_ani_state *as,
			 bool ofdm_trigger)
{
	int rssi = ah->ah_beacon_rssi_avg.avg;
	int rssi = ewma_read(&ah->ah_beacon_rssi_avg);

	ATH5K_DBG_UNLIMIT(ah->ah_sc, ATH5K_DEBUG_ANI, "raise immunity (%s)",
		ofdm_trigger ? "ODFM" : "CCK");
@@ -301,7 +301,7 @@ ath5k_ani_raise_immunity(struct ath5k_hw *ah, struct ath5k_ani_state *as,
static void
ath5k_ani_lower_immunity(struct ath5k_hw *ah, struct ath5k_ani_state *as)
{
	int rssi = ah->ah_beacon_rssi_avg.avg;
	int rssi = ewma_read(&ah->ah_beacon_rssi_avg);

	ATH5K_DBG_UNLIMIT(ah->ah_sc, ATH5K_DEBUG_ANI, "lower immunity");

+2 −24
Original line number Diff line number Diff line
@@ -25,6 +25,7 @@

#include <linux/io.h>
#include <linux/types.h>
#include <linux/average.h>
#include <net/mac80211.h>

/* RX/TX descriptor hw structs
@@ -1102,7 +1103,7 @@ struct ath5k_hw {
	struct ath5k_nfcal_hist ah_nfcal_hist;

	/* average beacon RSSI in our BSS (used by ANI) */
	struct ath5k_avg_val	ah_beacon_rssi_avg;
	struct ewma		ah_beacon_rssi_avg;

	/* noise floor from last periodic calibration */
	s32			ah_noise_floor;
@@ -1315,27 +1316,4 @@ static inline u32 ath5k_hw_bitswap(u32 val, unsigned int bits)
	return retval;
}

#define AVG_SAMPLES	8
#define AVG_FACTOR	1000

/**
 * ath5k_moving_average -  Exponentially weighted moving average
 * @avg: average structure
 * @val: current value
 *
 * This implementation make use of a struct ath5k_avg_val to prevent rounding
 * errors.
 */
static inline struct ath5k_avg_val
ath5k_moving_average(const struct ath5k_avg_val avg, const int val)
{
	struct ath5k_avg_val new;
	new.avg_weight = avg.avg_weight  ?
		(((avg.avg_weight * ((AVG_SAMPLES) - 1)) +
			(val * (AVG_FACTOR))) / (AVG_SAMPLES)) :
		(val * (AVG_FACTOR));
	new.avg = new.avg_weight / (AVG_FACTOR);
	return new;
}

#endif
Loading