From patchwork Sun Jun 25 15:43:35 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Larry Finger X-Patchwork-Id: 9808203 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 735DB60329 for ; Sun, 25 Jun 2017 15:43:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 640EA2852D for ; Sun, 25 Jun 2017 15:43:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 58A7728662; Sun, 25 Jun 2017 15:43:55 +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=-5.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, URIBL_BLACK 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 30E72285D5 for ; Sun, 25 Jun 2017 15:43:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751238AbdFYPnx (ORCPT ); Sun, 25 Jun 2017 11:43:53 -0400 Received: from mail-ot0-f194.google.com ([74.125.82.194]:33121 "EHLO mail-ot0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751202AbdFYPnv (ORCPT ); Sun, 25 Jun 2017 11:43:51 -0400 Received: by mail-ot0-f194.google.com with SMTP id q16so9327878otb.0 for ; Sun, 25 Jun 2017 08:43:50 -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=Duo7CHcuq2Vc9FCDSeLbrHYD7wZw83IU7NukkgJhMC4=; b=OBH+j/ZyQBgT0x4tJnhYG3h3yz+QuksxVirNpoHkpa4piHJFzRmSouAqVNQ0kP36/l zABhxTLLDlB5iHIWQYzsWYc5QO4P+Et+eCkanr5lGm/EmYppk/M6ApVfI2VBNA53Yt/J RiwYJR1HBvkn7MZMieoMHVzsp0eQmUnOgEBSr0vruSYfWpamS3v+7D67D56PO0nxq9O8 1eGvA2OCXT0vmrZANz+sxxGOjwrD4yL7oQTFgA9LbAetXauzMkbgjFWB0ZHCvBN5Ipz4 40vvPfWtjLiaeck5AahaIRKclfaKaVKarDbnfPLl9Kty8+Els8ou1yyBUUf26O//vlbA D/ug== 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=Duo7CHcuq2Vc9FCDSeLbrHYD7wZw83IU7NukkgJhMC4=; b=qgHy6narn+nkcpz1x5SCCFNUvWaP2hq4NolMC5Y4/xGgDUgQFFb2MGSlDkrGSDswTx xNCBEnQnMLJGfgHJvFJu9vDBWNfDwo3PJYfeDZQ2GL5XdfdQ3XeShdKCphGhjvHSTO1v 5nRxLYSRPRqgro6tu/RUiAknl1gSNPLGHk9wwDaWjI7DqR91gBhezxxW6JeMOxzGbohM uYDe1f19cOnC/W4xzKT7cz702yYoeV/MUMk+1UPMFtVt963e6Zyu0ruXBJXZn4TvpTGc FRISHmxVrTXpwjaMRHd6MJkead0PCyPbjZV79xY/JJ6BvnvQPN0KBUISUi53mQtZWiKh HJig== X-Gm-Message-State: AKS2vOwqZEsM5K7BAZVsv/M3FqHA7tLpifSuQmtA+el9GfyFLYsQzfph 1NSH1gf6sZ+Jvzw5 X-Received: by 10.157.63.8 with SMTP id m8mr9504297otc.4.1498405430386; Sun, 25 Jun 2017 08:43:50 -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 p33sm5351379otc.49.2017.06.25.08.43.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 25 Jun 2017 08:43:49 -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 v2 01/10] rtlwifi: Fill in_4way field by driver Date: Sun, 25 Jun 2017 10:43:35 -0500 Message-Id: <20170625154344.19213-2-Larry.Finger@lwfinger.net> X-Mailer: git-send-email 2.12.3 In-Reply-To: <20170625154344.19213-1-Larry.Finger@lwfinger.net> References: <20170625154344.19213-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 --- 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 bd9ae07647e1..7aa3c39c9c5c 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 {