From patchwork Fri Nov 11 16:37:56 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Beichler X-Patchwork-Id: 9423225 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 3C37460233 for ; Fri, 11 Nov 2016 16:43:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2CFB329B18 for ; Fri, 11 Nov 2016 16:43:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 21ED329B39; Fri, 11 Nov 2016 16:43:44 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 40E1729B18 for ; Fri, 11 Nov 2016 16:43:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933747AbcKKQnl (ORCPT ); Fri, 11 Nov 2016 11:43:41 -0500 Received: from edge01.uni-rostock.de ([139.30.8.12]:22903 "EHLO edge01.uni-rostock.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932864AbcKKQnl (ORCPT ); Fri, 11 Nov 2016 11:43:41 -0500 X-Greylist: delayed 316 seconds by postgrey-1.27 at vger.kernel.org; Fri, 11 Nov 2016 11:43:40 EST From: Benjamin Beichler To: , CC: Benjamin Beichler Subject: [PATCH] fixed hwsim beacon delta calculation Date: Fri, 11 Nov 2016 17:37:56 +0100 X-Mailer: git-send-email 1.9.1 MIME-Version: 1.0 X-Originating-IP: [139.30.201.125] X-PMWin-Version: 3.1.3.0, Antivirus-Engine: 3.64.3, Antivirus-Data: 5.33 Message-ID: <980aa1f8-42c3-4fe4-a930-d930474ad2eb@MAIL1.uni-rostock.de> X-PMWin-Version: 3.1.3.0, Antivirus-Engine: 3.64.3, Antivirus-Data: 5.33 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Due to the cast from uint32_t to int64_t, a wrong next beacon timing is calculated and effectively the beacon timer stops to work. This is especially bad for 802.11s mesh networks, because discovery breaks without beacons. Signed-off-by: Benjamin Beichler --- drivers/net/wireless/mac80211_hwsim.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/wireless/mac80211_hwsim.c b/drivers/net/wireless/mac80211_hwsim.c index 8f366cc..8d7b0c6 100644 --- a/drivers/net/wireless/mac80211_hwsim.c +++ b/drivers/net/wireless/mac80211_hwsim.c @@ -819,7 +819,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)); } }