From: Benjamin Beichler Date: Fri, 11 Nov 2016 16:37:56 +0000 (+0100) Subject: mac80211_hwsim: fix beacon delta calculation X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=4fb7f8af1f4c14a2a6cee7c9ff0cf999d918c72d;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git mac80211_hwsim: fix beacon delta calculation Due to the cast from uint32_t to int64_t, a wrong next beacon timing is calculated and effectively the beacon timer stops working. This is especially bad for 802.11s mesh networks, because discovery breaks without beacons. Signed-off-by: Benjamin Beichler Signed-off-by: Johannes Berg --- diff --git a/drivers/net/wireless/mac80211_hwsim.c b/drivers/net/wireless/mac80211_hwsim.c index 431f13b4faf6..d3bad5779376 100644 --- a/drivers/net/wireless/mac80211_hwsim.c +++ b/drivers/net/wireless/mac80211_hwsim.c @@ -826,7 +826,7 @@ static void mac80211_hwsim_set_tsf(struct ieee80211_hw *hw, data->bcn_delta = do_div(delta, bcn_int); } else { data->tsf_offset -= delta; - data->bcn_delta = -do_div(delta, bcn_int); + data->bcn_delta = -(s64)do_div(delta, bcn_int); } }