From patchwork Sat Jun 24 01:53:00 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Larry Finger X-Patchwork-Id: 9807513 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 6D52960329 for ; Sat, 24 Jun 2017 01:53:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4DFFF2879C for ; Sat, 24 Jun 2017 01:53:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 402B8287D0; Sat, 24 Jun 2017 01:53:35 +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 88EAB2879C for ; Sat, 24 Jun 2017 01:53:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754499AbdFXBxS (ORCPT ); Fri, 23 Jun 2017 21:53:18 -0400 Received: from mail-ot0-f193.google.com ([74.125.82.193]:35114 "EHLO mail-ot0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754162AbdFXBxQ (ORCPT ); Fri, 23 Jun 2017 21:53:16 -0400 Received: by mail-ot0-f193.google.com with SMTP id z48so6486723otz.2 for ; Fri, 23 Jun 2017 18:53:15 -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=2uzao/KzTSIlZenudTX5jyisBh44zlDDrpIsOm4qkfk=; b=imfA+Zeke7bjRQuBAMqqRmsgTY7ex9ANGqNpJeiOuqLLllvzHjs7tIj6JNB0+EZid7 yK1l50z6RvSrjHKnRsBsmwYc/bOjSdhLjUfeebRGNlJRerYktXvE83g9SJFGbQ1IUTw7 eoJG+bld6BO8U8uiAaZKAbfjmNe+WrC1+BDKimn8bwb3ccWOI5M19FsIJbcqXXOHvGaF StBlvqAB0QH9m71wk4ts8GYNSibCeO+kl/bNPyImDWx6693CLi8cgSlJWULmcDV/FD7m YjU7g24ys6P+GDx0CERP27uLQsuyPihw8W62LenRXuOkBAidYNxuUEFaPHt6G9bB+keA RcXQ== 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=2uzao/KzTSIlZenudTX5jyisBh44zlDDrpIsOm4qkfk=; b=BJzBJkML0vYdPBDn6TXialEsuDuilMCIPBU+dLBMCz7jTzgOBOHzQmpRwC15JYlOOo TJDl7dCVkdNqOe/x/OIhL5WToW3vKd7/mdhXSa3txX73GCfDLIVt0sI5F++HW8254wOA CVv/h/2Ajii8oyW1pNbzKaAOsZGirWodoRREFPBn6Ye8Zvmah+PVaQpa4Mb+Vgza4Q7q tOHwfZXnjZwavNjs3QqJstaur99vHJgds/2PvsRXgAfa8kXS5R2wMgR3VsAf5/vNk0Ak uglt+B+V2lE9x5RDiCFV1H1ziMtVpKg6yGMByLaKLMeX2kML8xgdJsoPCWo7847hRLG1 Ubxw== X-Gm-Message-State: AKS2vOwd860CeS4DaKVvpHXw5InEK0a7bkJInVNe3PkmrNNP+iDU859J 7b9zLjdBOnlACw== X-Received: by 10.157.58.102 with SMTP id j93mr6518625otc.147.1498269195270; Fri, 23 Jun 2017 18:53:15 -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 t190sm2833277oie.29.2017.06.23.18.53.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 23 Jun 2017 18:53:14 -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 01/10] rtlwifi: Fill in_4way field by driver Date: Fri, 23 Jun 2017 20:53:00 -0500 Message-Id: <20170624015309.28099-2-Larry.Finger@lwfinger.net> X-Mailer: git-send-email 2.12.3 In-Reply-To: <20170624015309.28099-1-Larry.Finger@lwfinger.net> References: <20170624015309.28099-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 --- 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 {