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

Commit 488a5017 authored by Felix Fietkau's avatar Felix Fietkau Committed by John W. Linville
Browse files

ath5k: fix SIFS time handling



ath5k uses 8 usec as a sifs time, extracted from the initvals, whereas the
standard requires a sifs time of 10. The difference originates from the fact
that the SIFS register has an offset of 2 usec.
Fix the SIFS time definition to use the standard value of 10 usec and subtract
2 usecs when writing the SIFS register.

Signed-off-by: default avatarFelix Fietkau <nbd@openwrt.org>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent a27049e2
Loading
Loading
Loading
Loading
+1 −2
Original line number Original line Diff line number Diff line
@@ -224,8 +224,7 @@


/* SIFS */
/* SIFS */
#define	AR5K_INIT_SIFS_TURBO			6
#define	AR5K_INIT_SIFS_TURBO			6
/* XXX: 8 from initvals 10 from standard */
#define	AR5K_INIT_SIFS_DEFAULT_BG		10
#define	AR5K_INIT_SIFS_DEFAULT_BG		8
#define	AR5K_INIT_SIFS_DEFAULT_A		16
#define	AR5K_INIT_SIFS_DEFAULT_A		16
#define	AR5K_INIT_SIFS_HALF_RATE		32
#define	AR5K_INIT_SIFS_HALF_RATE		32
#define AR5K_INIT_SIFS_QUARTER_RATE		64
#define AR5K_INIT_SIFS_QUARTER_RATE		64
+1 −1
Original line number Original line Diff line number Diff line
@@ -519,7 +519,7 @@ int ath5k_hw_set_ifs_intervals(struct ath5k_hw *ah, unsigned int slot_time)
		return -EINVAL;
		return -EINVAL;


	sifs = ath5k_hw_get_default_sifs(ah);
	sifs = ath5k_hw_get_default_sifs(ah);
	sifs_clock = ath5k_hw_htoclock(ah, sifs);
	sifs_clock = ath5k_hw_htoclock(ah, sifs - 2);


	/* EIFS
	/* EIFS
	 * Txtime of ack at lowest rate + SIFS + DIFS
	 * Txtime of ack at lowest rate + SIFS + DIFS