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

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

ath5k: fix slot time handling



Set the slot time based on the mac80211 short slot vs long slot setting
instead of just forcing long slot for all CCK-enabled channels.
This slightly improves 802.11g mode performance in in my tests.

Signed-off-by: default avatarFelix Fietkau <nbd@openwrt.org>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 488a5017
Loading
Loading
Loading
Loading
+1 −0
Original line number Original line Diff line number Diff line
@@ -1057,6 +1057,7 @@ struct ath5k_hw {
	u8			ah_coverage_class;
	u8			ah_coverage_class;
	bool			ah_ack_bitrate_high;
	bool			ah_ack_bitrate_high;
	u8			ah_bwmode;
	u8			ah_bwmode;
	bool			ah_short_slot;


	/* Antenna Control */
	/* Antenna Control */
	u32			ah_ant_ctl[AR5K_EEPROM_N_MODES][AR5K_ANT_MAX];
	u32			ah_ant_ctl[AR5K_EEPROM_N_MODES][AR5K_ANT_MAX];
+9 −0
Original line number Original line Diff line number Diff line
@@ -282,6 +282,15 @@ ath5k_bss_info_changed(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
	if (changes & BSS_CHANGED_BEACON_INT)
	if (changes & BSS_CHANGED_BEACON_INT)
		sc->bintval = bss_conf->beacon_int;
		sc->bintval = bss_conf->beacon_int;


	if (changes & BSS_CHANGED_ERP_SLOT) {
		int slot_time;

		ah->ah_short_slot = bss_conf->use_short_slot;
		slot_time = ath5k_hw_get_default_slottime(ah) +
			    3 * ah->ah_coverage_class;
		ath5k_hw_set_ifs_intervals(ah, slot_time);
	}

	if (changes & BSS_CHANGED_ASSOC) {
	if (changes & BSS_CHANGED_ASSOC) {
		avf->assoc = bss_conf->assoc;
		avf->assoc = bss_conf->assoc;
		if (bss_conf->assoc)
		if (bss_conf->assoc)
+2 −2
Original line number Original line Diff line number Diff line
@@ -151,9 +151,9 @@ unsigned int ath5k_hw_get_default_slottime(struct ath5k_hw *ah)
		slot_time = AR5K_INIT_SLOT_TIME_QUARTER_RATE;
		slot_time = AR5K_INIT_SLOT_TIME_QUARTER_RATE;
		break;
		break;
	case AR5K_BWMODE_DEFAULT:
	case AR5K_BWMODE_DEFAULT:
		slot_time = AR5K_INIT_SLOT_TIME_DEFAULT;
	default:
	default:
		if (channel->hw_value & CHANNEL_CCK)
		slot_time = AR5K_INIT_SLOT_TIME_DEFAULT;
		if ((channel->hw_value & CHANNEL_CCK) && !ah->ah_short_slot)
			slot_time = AR5K_INIT_SLOT_TIME_B;
			slot_time = AR5K_INIT_SLOT_TIME_B;
		break;
		break;
	}
	}