From patchwork Tue Oct 10 06:50:02 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Manikanta Pubbisetty X-Patchwork-Id: 9995143 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 8FA9260216 for ; Tue, 10 Oct 2017 06:52:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7FC6027C05 for ; Tue, 10 Oct 2017 06:52:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 71AA127F3E; Tue, 10 Oct 2017 06:52:24 +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=-4.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_MED autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 28CBC27F2B for ; Tue, 10 Oct 2017 06:52:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=h6qY3PyK5viV2nquzVwvuDLJN05AQcSK17jezWRLO0I=; b=tWy7KKiT+FAtTX OeYWeneADvnz/lOUjxrBz3oZ2dol1lRWUB0vHwqNYnau06UzhA3MKrXO5RM7A5iVkj/MBO/iQ+w+N t03eGGB784lLrxVqoUTwqkGdxZRi5AkIbtHUXBIpsUZBi9GEUpWE1aik4WOQ/ofdcxJfOiZi0GNvj 0JZtLqkcGcfi4LpnMph8M0fBHqV/SAaG3obgz6QxwR3a7fpYK/1CDnR1v9UZE2QLwM3DlmJEzi9gy 3vC5KVTL4EyY8ZrSAsOjxEzqw8ABMgu4aMyYkWlBkyvAzM3sVwmu2kUZHEdgymFZnK+onA0+J532Y B4TjmfRKp6/mo8cCpFKA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1e1oOp-0007S9-5Q; Tue, 10 Oct 2017 06:52:19 +0000 Received: from alexa-out.qualcomm.com ([129.46.98.28]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1e1oO5-0006Vd-9u for ath10k@lists.infradead.org; Tue, 10 Oct 2017 06:51:44 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=qti.qualcomm.com; i=@qti.qualcomm.com; q=dns/txt; s=qcdkim; t=1507618293; x=1539154293; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=gcA216oYd2QJ6e9/cTRvqFwA4px9lchHqkdkiaznyGk=; b=qnaJhtlZxjMbHnL36f6zwGQLOK/XMwazp7P5e/VoTsGFDaLVHF3EFGvg eys0NXq6P9HmxJXnoQEUs8fi9b97T7I3MAdILhhiZJKQ/rJJL9q01+99N QFYEv5w9iowSPicIHtGwApXgxmWArwsNfoao5kntx45y7QLv3HiWxXw/j c=; X-IronPort-AV: E=Sophos;i="5.42,503,1500966000"; d="scan'208";a="6206450" Received: from ironmsg04-r-new.qualcomm.com (HELO Ironmsg04-R.qualcomm.com) ([10.53.140.108]) by alexa-out.qualcomm.com with ESMTP; 09 Oct 2017 23:51:13 -0700 X-IronPort-AV: E=McAfee;i="5900,7806,8679"; a="1509027223" X-MGA-submission: =?us-ascii?q?MDFF673NWwKEogJDN9HvOuHBRuZcx8dRa9vfRp?= =?us-ascii?q?8ww3mlAwKOqBognOz+keIb1hXfC21qr3xbJkrnYg8komZJMJf3rYhk5D?= =?us-ascii?q?9HK1fzkN5vr2ldvadAyAQvXAx6xR6qoT+x9uOOLEbQfjSIBLjFJRYwuu?= =?us-ascii?q?Q5?= Received: from nasanexm01c.na.qualcomm.com ([10.85.0.83]) by Ironmsg04-R.qualcomm.com with ESMTP/TLS/AES256-SHA; 09 Oct 2017 23:51:12 -0700 Received: from aphydexm01f.ap.qualcomm.com (10.252.127.15) by NASANEXM01C.na.qualcomm.com (10.85.0.83) with Microsoft SMTP Server (TLS) id 15.0.1293.2; Mon, 9 Oct 2017 23:51:11 -0700 Received: from localhost (10.80.80.8) by aphydexm01f.ap.qualcomm.com (10.252.127.15) with Microsoft SMTP Server (TLS) id 15.0.1293.2; Tue, 10 Oct 2017 12:21:06 +0530 From: To: Subject: [PATCH 2/2] ath10k: handle tdls peer events Date: Tue, 10 Oct 2017 12:20:02 +0530 Message-ID: <1507618202-25473-3-git-send-email-mpubbise@qti.qualcomm.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1507618202-25473-1-git-send-email-mpubbise@qti.qualcomm.com> References: <1507618202-25473-1-git-send-email-mpubbise@qti.qualcomm.com> MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: NASANEXM01E.na.qualcomm.com (10.85.0.31) To aphydexm01f.ap.qualcomm.com (10.252.127.15) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20171009_235134_150411_D66DB4BA X-CRM114-Status: UNSURE ( 8.32 ) X-CRM114-Notice: Please train this message. X-BeenThere: ath10k@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Manikanta Pubbisetty , linux-wireless@vger.kernel.org Sender: "ath10k" Errors-To: ath10k-bounces+patchwork-ath10k=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Manikanta Pubbisetty Handle tdls peer events from the target. TDLS events for the peer could be discover, teardown, etc. As of now, adding the logic to handle tdls teardown events alone. Teardown due to peer traffic indication(PTR) timeout is one such teardown event from the target. Tested this change on QCA9888 with 10.4-3.5.1-00018 fw version. Signed-off-by: Manikanta Pubbisetty --- drivers/net/wireless/ath/ath10k/wmi.c | 59 +++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) diff --git a/drivers/net/wireless/ath/ath10k/wmi.c b/drivers/net/wireless/ath/ath10k/wmi.c index 38a9708..344f19c 100644 --- a/drivers/net/wireless/ath/ath10k/wmi.c +++ b/drivers/net/wireless/ath/ath10k/wmi.c @@ -29,6 +29,7 @@ #include "p2p.h" #include "hw.h" #include "hif.h" +#include "txrx.h" #define ATH10K_WMI_BARRIER_ECHO_ID 0xBA991E9 #define ATH10K_WMI_BARRIER_TIMEOUT_HZ (3 * HZ) @@ -4456,6 +4457,61 @@ void ath10k_wmi_event_pdev_tpc_config(struct ath10k *ar, struct sk_buff *skb) __le32_to_cpu(ev->rate_max)); } +void ath10k_wmi_handle_tdls_peer_event(struct ath10k *ar, struct sk_buff *skb) +{ + struct wmi_tdls_peer_event *ev; + struct ath10k_peer *peer; + struct ath10k_vif *arvif; + u8 reason; + + ev = (struct wmi_tdls_peer_event *)skb->data; + + spin_lock_bh(&ar->data_lock); + peer = ath10k_peer_find(ar, ev->vdev_id, ev->peer_macaddr.addr); + spin_unlock_bh(&ar->data_lock); + + if (!peer) { + ath10k_warn(ar, "failed to find peer entry for %pM\n", + ev->peer_macaddr.addr); + return; + } + + switch (ev->peer_status) { + case WMI_TDLS_SHOULD_TEARDOWN: + switch (ev->peer_reason) { + case WMI_TDLS_TEARDOWN_REASON_PTR_TIMEOUT: + case WMI_TDLS_TEARDOWN_REASON_NO_RESPONSE: + case WMI_TDLS_TEARDOWN_REASON_RSSI: + reason = WLAN_REASON_TDLS_TEARDOWN_UNREACHABLE; + break; + default: + reason = WLAN_REASON_TDLS_TEARDOWN_UNSPECIFIED; + break; + } + + arvif = ath10k_get_arvif(ar, ev->vdev_id); + if (!arvif) { + ath10k_warn(ar, "received tdls peer event for invalid vdev id %u\n", + ev->vdev_id); + return; + } + + ieee80211_tdls_oper_request(arvif->vif, ev->peer_macaddr.addr, + NL80211_TDLS_TEARDOWN, reason, + GFP_ATOMIC); + + ath10k_dbg(ar, ATH10K_DBG_WMI, + "received tdls teardown event for peer %pM reason %u\n", + ev->peer_macaddr.addr, ev->peer_reason); + break; + default: + ath10k_dbg(ar, ATH10K_DBG_WMI, + "received unknown tdls peer event %u\n", + ev->peer_status); + break; + } +} + void ath10k_wmi_event_pdev_ftm_intg(struct ath10k *ar, struct sk_buff *skb) { ath10k_dbg(ar, ATH10K_DBG_WMI, "WMI_PDEV_FTM_INTG_EVENTID\n"); @@ -5477,6 +5533,9 @@ static void ath10k_wmi_10_4_op_rx(struct ath10k *ar, struct sk_buff *skb) case WMI_10_4_PDEV_TPC_CONFIG_EVENTID: ath10k_wmi_event_pdev_tpc_config(ar, skb); break; + case WMI_10_4_TDLS_PEER_EVENTID: + ath10k_wmi_handle_tdls_peer_event(ar, skb); + break; default: ath10k_warn(ar, "Unknown eventid: %d\n", id); break;