From patchwork Sun Jul 2 18:12:30 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Larry Finger X-Patchwork-Id: 9821735 X-Patchwork-Delegate: kvalo@adurom.com 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 F001F6035F for ; Sun, 2 Jul 2017 18:12:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DD10226E49 for ; Sun, 2 Jul 2017 18:12:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BF92427CF9; Sun, 2 Jul 2017 18:12:53 +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.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID 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 ED67B27C2D for ; Sun, 2 Jul 2017 18:12:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751950AbdGBSMu (ORCPT ); Sun, 2 Jul 2017 14:12:50 -0400 Received: from mail-oi0-f67.google.com ([209.85.218.67]:36423 "EHLO mail-oi0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751857AbdGBSMs (ORCPT ); Sun, 2 Jul 2017 14:12:48 -0400 Received: by mail-oi0-f67.google.com with SMTP id n2so10037703oig.3 for ; Sun, 02 Jul 2017 11:12:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=Z9CI8YnFhKhJOFDsmX+FoKTHILq7SZmYiq8LC6B30JY=; b=U0EJSd1ZUkN2Wm7BZFdcPxuDk8p326jPP8eu1JOght1jvF8y93MdqM40g11LspV7nr gKXLH/cLhzhjR+G7tWeB35hxNbqngJYVykUwrSqU9zTXNFHBHDzUNO+96lTzx70wVfhj 9IMfC8OVMhpQIqL2ya6t2v9bGsqhBbr9sYPk5DH6UN8w2NzaPg2T2AZfpy/55irEK5CG Pw1lVCRVzKfRpdhqZjSkuelRNhli7cwNS96XAxiSqGh7Nqht83BwyQf7ICbCXhO2KtyR l0MFPv6ajGxbfXTnNlGaSoBw8Rk2I5Z3R5g//yFZyo2ZfK717eHFVamfUqinFdmw6XIH FNjw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=Z9CI8YnFhKhJOFDsmX+FoKTHILq7SZmYiq8LC6B30JY=; b=DZHdtvt4TgfNtMhf5lKwnnK9Gy2fz+nck/E/CYoK+/vRVE5q5EFx2J7bUnUK333BGb 8RIXwVtJbgEX/WOxRdG1R1B07AaI97gFS+D+xVaWQltAn71B8DhO/JtETLBD1I2WYOnu uu5KWOJw+33+09xM3NKn+8zjNYwpAnB4PICYTDK29MkWk9J5Uq9B3vv4QZTH/ALjcN7t cDUPWhc4HsgMDPyY9felfvBc9pr/xWMFm9miAzRygYZrlY4DOmUxs2eEHdpUUrqAY/9A 7SrxcbASAY5KF0ynaQsLUEOEb6vbAUHduItLKyGv4OWp7D/BlT4XzGDcDw2IinmXsmXu MFfg== X-Gm-Message-State: AIVw111ONZW6+T/jtmIqTnwD3QEhG5hKt30sUi6+7yZQ2ZAxtDCGKmUQ vTcA/1IrEeH7gg== X-Received: by 10.202.95.5 with SMTP id t5mr14228760oib.9.1499019167776; Sun, 02 Jul 2017 11:12:47 -0700 (PDT) Received: from linux-4v1g.suse (cpe-24-31-249-175.kc.res.rr.com. [24.31.249.175]) by smtp.gmail.com with ESMTPSA id t130sm23296520oig.3.2017.07.02.11.12.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 02 Jul 2017 11:12:47 -0700 (PDT) From: Larry Finger To: kvalo@codeaurora.org Cc: linux-wireless@vger.kernel.org, Ping-Ke Shih , Larry Finger , Yan-Hsuan Chuang , Birming Chiu , Shaofu , Steven Ting Subject: [PATCH v4 01/10] rtlwifi: Fill in_4way field by driver Date: Sun, 2 Jul 2017 13:12:30 -0500 Message-Id: <20170702181239.17911-2-Larry.Finger@lwfinger.net> X-Mailer: git-send-email 2.12.3 In-Reply-To: <20170702181239.17911-1-Larry.Finger@lwfinger.net> References: <20170702181239.17911-1-Larry.Finger@lwfinger.net> 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 From: Ping-Ke Shih Because it isn't always correct to use EAPOL to check 4-way, we add a timer to handle exception. Signed-off-by: Ping-Ke Shih Signed-off-by: Larry Finger Cc: Yan-Hsuan Chuang Cc: Birming Chiu Cc: Shaofu Cc: Steven Ting --- v2 - no changes v3 - no changes v4 - no changes --- drivers/net/wireless/realtek/rtlwifi/base.c | 11 +++++++++++ drivers/net/wireless/realtek/rtlwifi/core.c | 2 ++ drivers/net/wireless/realtek/rtlwifi/wifi.h | 3 +++ 3 files changed, 16 insertions(+) diff --git a/drivers/net/wireless/realtek/rtlwifi/base.c b/drivers/net/wireless/realtek/rtlwifi/base.c index e36ee592c660..0c9cfb670cec 100644 --- a/drivers/net/wireless/realtek/rtlwifi/base.c +++ b/drivers/net/wireless/realtek/rtlwifi/base.c @@ -1408,6 +1408,11 @@ u8 rtl_is_special_data(struct ieee80211_hw *hw, struct sk_buff *skb, u8 is_tx, return true; } else if (ETH_P_PAE == ether_type) { + /* EAPOL is seens as in-4way */ + rtlpriv->btcoexist.btc_info.in_4way = true; + rtlpriv->btcoexist.btc_info.in_4way_ts = jiffies; + rtlpriv->btcoexist.btc_info.in_4way_ts = jiffies; + RT_TRACE(rtlpriv, (COMP_SEND | COMP_RECV), DBG_DMESG, "802.1X %s EAPOL pkt!!\n", (is_tx) ? "Tx" : "Rx"); @@ -1959,6 +1964,12 @@ void rtl_watchdog_wq_callback(void *data) if (rtlpriv->cfg->ops->get_btc_status()) rtlpriv->btcoexist.btc_ops->btc_periodical(rtlpriv); + if (rtlpriv->btcoexist.btc_info.in_4way) { + if (time_after(jiffies, rtlpriv->btcoexist.btc_info.in_4way_ts + + msecs_to_jiffies(IN_4WAY_TIMEOUT_TIME))) + rtlpriv->btcoexist.btc_info.in_4way = false; + } + rtlpriv->link_info.bcn_rx_inperiod = 0; /* <6> scan list */ diff --git a/drivers/net/wireless/realtek/rtlwifi/core.c b/drivers/net/wireless/realtek/rtlwifi/core.c index b0ad061048c5..c53cbf3d52bd 100644 --- a/drivers/net/wireless/realtek/rtlwifi/core.c +++ b/drivers/net/wireless/realtek/rtlwifi/core.c @@ -1505,6 +1505,8 @@ static int rtl_op_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd, u8 mac_addr[ETH_ALEN]; u8 bcast_addr[ETH_ALEN] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }; + rtlpriv->btcoexist.btc_info.in_4way = false; + if (rtlpriv->cfg->mod_params->sw_crypto || rtlpriv->sec.use_sw_sec) { RT_TRACE(rtlpriv, COMP_ERR, DBG_WARNING, "not open hw encryption\n"); diff --git a/drivers/net/wireless/realtek/rtlwifi/wifi.h b/drivers/net/wireless/realtek/rtlwifi/wifi.h index fb1ebb01133f..7ec0d502a0d9 100644 --- a/drivers/net/wireless/realtek/rtlwifi/wifi.h +++ b/drivers/net/wireless/realtek/rtlwifi/wifi.h @@ -2477,6 +2477,8 @@ struct rtl_global_var { spinlock_t glb_list_lock; }; +#define IN_4WAY_TIMEOUT_TIME (30 * MSEC_PER_SEC) /* 30 seconds */ + struct rtl_btc_info { u8 bt_type; u8 btcoexist; @@ -2485,6 +2487,7 @@ struct rtl_btc_info { u8 ap_num; bool in_4way; + unsigned long in_4way_ts; }; struct bt_coexist_info {