Commit 0d736605 authored by Toke Høiland-Jørgensen's avatar Toke Høiland-Jørgensen Committed by Zheng Zengkai
Browse files

ath9k: Fix usage of driver-private space in tx_info

stable inclusion
from stable-v5.10.112
commit 9b7ec35253c9d23f3471e8ae6e7a956d86bb2a2c
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I5HL0X

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=9b7ec35253c9d23f3471e8ae6e7a956d86bb2a2c



--------------------------------

commit 5a6b06f5 upstream.

The ieee80211_tx_info_clear_status() helper also clears the rate counts and
the driver-private part of struct ieee80211_tx_info, so using it breaks
quite a few other things. So back out of using it, and instead define a
ath-internal helper that only clears the area between the
status_driver_data and the rates info. Combined with moving the
ath_frame_info struct to status_driver_data, this avoids clearing anything
we shouldn't be, and so we can keep the existing code for handling the rate
information.

While fixing this I also noticed that the setting of
tx_info->status.rates[tx_rateindex].count on hardware underrun errors was
always immediately overridden by the normal setting of the same fields, so
rearrange the code so that the underrun detection actually takes effect.

The new helper could be generalised to a 'memset_between()' helper, but
leave it as a driver-internal helper for now since this needs to go to
stable.

Cc: stable@vger.kernel.org
Reported-by: default avatarPeter Seiderer <ps.report@gmx.net>
Fixes: 037250f0 ("ath9k: Properly clear TX status area before reporting to mac80211")
Signed-off-by: default avatarToke Høiland-Jørgensen <toke@redhat.com>
Reviewed-by: default avatarPeter Seiderer <ps.report@gmx.net>
Tested-by: default avatarPeter Seiderer <ps.report@gmx.net>
Signed-off-by: default avatarKalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20220404204800.2681133-1-toke@toke.dk


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarZheng Zengkai <zhengzengkai@huawei.com>
Acked-by: default avatarXie XiuQi <xiexiuqi@huawei.com>
parent 7fe75e37
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment