From patchwork Tue Jul 10 07:12:58 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Karthikeyan periyasamy X-Patchwork-Id: 10516259 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 96576600CA for ; Tue, 10 Jul 2018 07:13:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 817B328B4D for ; Tue, 10 Jul 2018 07:13:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 75B2D28BA0; Tue, 10 Jul 2018 07:13:23 +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=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI, 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 D61E628B4D for ; Tue, 10 Jul 2018 07:13:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751103AbeGJHNV (ORCPT ); Tue, 10 Jul 2018 03:13:21 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:55824 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750937AbeGJHNU (ORCPT ); Tue, 10 Jul 2018 03:13:20 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 1B1B3607EB; Tue, 10 Jul 2018 07:13:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1531206800; bh=jywrBFd0CkXPQkg83Zdm1bSDCfcQBl0+CbQgoNPrUgU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hlM5xfiThBxWMuIvUAJ32f1gwMyh2A992kD63peK82YlyzEK9dMoTtbN2eA2IaF7Q ubfLYzeqSr+rZxipeSyiO35XJXCzitGAu0li3XvIPDMcd0jl3/DA/TYbdnDM8UHPor QJ0R18dsyxyleDclL7wTNGEQJpAIvmvC0Q5oz8Eo= Received: from localhost (blr-c-bdr-fw-01_globalnat_allzones-outside.qualcomm.com [103.229.19.19]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: periyasa@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 135C660646; Tue, 10 Jul 2018 07:13:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1531206799; bh=jywrBFd0CkXPQkg83Zdm1bSDCfcQBl0+CbQgoNPrUgU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KRo4usCUvWEWYCy+8O3hr67j9MlR3UfNyAVnEgfQmruvyjl94WcgOEAGzXnfePLeX u6Lb4VJbaaX6zeci8Q8A+Fi3GnHhaCJc7Zyo0EFWXfJ4T3VwaDMif8FNJkUEs7o6a4 Xzh54zKJWtVcMgo/fl4bz3iDl/GGLObEaBGpI/o4= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 135C660646 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=periyasa@codeaurora.org From: Karthikeyan Periyasamy To: ath10k@lists.infradead.org Cc: linux-wireless@vger.kernel.org, Karthikeyan Periyasamy Subject: [RFCv2 1/2] ath10k: add wmi interface for vdev_set_neighbor_rx_param Date: Tue, 10 Jul 2018 12:42:58 +0530 Message-Id: <1531206779-26517-2-git-send-email-periyasa@codeaurora.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1531206779-26517-1-git-send-email-periyasa@codeaurora.org> References: <1531206779-26517-1-git-send-email-periyasa@codeaurora.org> 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 Add WMI command interface support for receiving neighbor BSS frames from the target. QCA9984, QCA4019 and QCA9888 support this WMI command with the capability advertisement through wmi service map. Hardware tested: QCA9984, QCA4019 and QCA9888 Firmware tested: 10.4-3.6-xxxxx NOTE: Tested with debug firmware Signed-off-by: Karthikeyan Periyasamy --- drivers/net/wireless/ath/ath10k/wmi-ops.h | 28 +++++++++++- drivers/net/wireless/ath/ath10k/wmi.c | 33 ++++++++++++++ drivers/net/wireless/ath/ath10k/wmi.h | 76 +++++++++++++++++++++++++++++++ 3 files changed, 136 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/ath/ath10k/wmi-ops.h b/drivers/net/wireless/ath/ath10k/wmi-ops.h index 5ecce04..8444b41 100644 --- a/drivers/net/wireless/ath/ath10k/wmi-ops.h +++ b/drivers/net/wireless/ath/ath10k/wmi-ops.h @@ -214,7 +214,12 @@ struct wmi_ops { struct sk_buff *(*gen_echo)(struct ath10k *ar, u32 value); struct sk_buff *(*gen_pdev_get_tpc_table_cmdid)(struct ath10k *ar, u32 param); - + struct sk_buff *(*gen_vdev_set_neighbor_rx_param)(struct ath10k *ar, + u32 vdev_id, + const u8 *addr, + u32 idx, + u32 action, + u32 type); }; int ath10k_wmi_cmd_send(struct ath10k *ar, struct sk_buff *skb, u32 cmd_id); @@ -1543,4 +1548,25 @@ struct wmi_ops { ar->wmi.cmd->radar_found_cmdid); } +static inline int +ath10k_wmi_set_neighbor_rx_param(struct ath10k *ar, u32 vdev_id, + const u8 *addr, u32 idx, + u32 action, u32 type) +{ + struct sk_buff *skb; + u32 cmdid; + + if (!ar->wmi.ops->gen_vdev_set_neighbor_rx_param) + return -EOPNOTSUPP; + + cmdid = ar->wmi.cmd->vdev_filter_neighbor_rx_packets_cmdid; + skb = ar->wmi.ops->gen_vdev_set_neighbor_rx_param(ar, + vdev_id, addr, + idx, action, type); + + if (IS_ERR(skb)) + return PTR_ERR(skb); + + return ath10k_wmi_cmd_send(ar, skb, cmdid); +} #endif diff --git a/drivers/net/wireless/ath/ath10k/wmi.c b/drivers/net/wireless/ath/ath10k/wmi.c index 877249a..fe62489 100644 --- a/drivers/net/wireless/ath/ath10k/wmi.c +++ b/drivers/net/wireless/ath/ath10k/wmi.c @@ -8662,6 +8662,37 @@ static u32 ath10k_wmi_prepare_peer_qos(u8 uapsd_queues, u8 sp) return 0; } +static struct sk_buff * +ath10k_wmi_10_4_op_gen_vdev_set_neighbor_rx_param(struct ath10k *ar, + u32 vdev_id, + const u8 *addr, + u32 idx, u32 action, + u32 type) +{ + struct wmi_set_vdev_filter_nrp_10_4_cmd *cmd; + struct sk_buff *skb; + + skb = ath10k_wmi_alloc_skb(ar, sizeof(*cmd)); + if (!skb) + return ERR_PTR(-ENOMEM); + + cmd = (struct wmi_set_vdev_filter_nrp_10_4_cmd *)skb->data; + + cmd->vdev_id = __cpu_to_le32(vdev_id); + cmd->action = __cpu_to_le32(action); + cmd->type = __cpu_to_le32(type); + cmd->idx = __cpu_to_le32(idx); + + ether_addr_copy(cmd->macaddr.addr, addr); + + ath10k_dbg(ar, ATH10K_DBG_WMI, + "vdev id:0x%x Macaddr[0x%x]:[0x%x] idx:0x%x action:0x%x type:0x%x flag:0x%x\n", + cmd->vdev_id, cmd->macaddr.addr[0], cmd->macaddr.addr[5], + cmd->idx, cmd->action, cmd->type, cmd->flag); + + return skb; +} + static const struct wmi_ops wmi_ops = { .rx = ath10k_wmi_op_rx, .map_svc = wmi_main_svc_map, @@ -9014,6 +9045,8 @@ static u32 ath10k_wmi_prepare_peer_qos(u8 uapsd_queues, u8 sp) .gen_pdev_bss_chan_info_req = ath10k_wmi_10_2_op_gen_pdev_bss_chan_info, .gen_echo = ath10k_wmi_op_gen_echo, .gen_pdev_get_tpc_config = ath10k_wmi_10_2_4_op_gen_pdev_get_tpc_config, + .gen_vdev_set_neighbor_rx_param = + ath10k_wmi_10_4_op_gen_vdev_set_neighbor_rx_param, }; int ath10k_wmi_attach(struct ath10k *ar) diff --git a/drivers/net/wireless/ath/ath10k/wmi.h b/drivers/net/wireless/ath/ath10k/wmi.h index d68afb6..bc53d4c 100644 --- a/drivers/net/wireless/ath/ath10k/wmi.h +++ b/drivers/net/wireless/ath/ath10k/wmi.h @@ -203,6 +203,13 @@ enum wmi_service { WMI_SERVICE_TPC_STATS_FINAL, WMI_SERVICE_RESET_CHIP, WMI_SERVICE_SPOOF_MAC_SUPPORT, + WMI_SERVICE_CFR_CAPTURE_SUPPORT, + WMI_SERVICE_TX_DATA_ACK_RSSI, + WMI_SERVICE_CFR_CAPTURE_IND_MSG_TYPE_LAGACY, + WMI_SERVICE_PER_PACKET_SW_ENCRYPT, + WMI_SERVICE_PEER_TID_CONFIGS_SUPPORT, + WMI_SERVICE_VDEV_BCN_RATE_CONTROL, + WMI_SERVICE_VDEV_FILTER_NEIGHBOR, /* keep last */ WMI_SERVICE_MAX, @@ -350,6 +357,13 @@ enum wmi_10_4_service { WMI_10_4_SERVICE_HTT_MGMT_TX_COMP_VALID_FLAGS, WMI_10_4_SERVICE_HOST_DFS_CHECK_SUPPORT, WMI_10_4_SERVICE_TPC_STATS_FINAL, + WMI_10_4_SERVICE_CFR_CAPTURE_SUPPORT, + WMI_10_4_SERVICE_TX_DATA_ACK_RSSI, + WMI_10_4_SERVICE_CFR_CAPTURE_IND_MSG_TYPE_LAGACY, + WMI_10_4_SERVICE_PER_PACKET_SW_ENCRYPT, + WMI_10_4_SERVICE_PEER_TID_CONFIGS_SUPPORT, + WMI_10_4_SERVICE_VDEV_BCN_RATE_CONTROL, + WMI_10_4_SERVICE_VDEV_FILTER_NEIGHBOR, }; static inline char *wmi_service_name(int service_id) @@ -462,6 +476,15 @@ static inline char *wmi_service_name(int service_id) SVCSTR(WMI_SERVICE_HTT_MGMT_TX_COMP_VALID_FLAGS); SVCSTR(WMI_SERVICE_HOST_DFS_CHECK_SUPPORT); SVCSTR(WMI_SERVICE_TPC_STATS_FINAL); + SVCSTR(WMI_SERVICE_RESET_CHIP); + SVCSTR(WMI_SERVICE_CFR_CAPTURE_SUPPORT); + SVCSTR(WMI_SERVICE_TX_DATA_ACK_RSSI); + SVCSTR(WMI_SERVICE_CFR_CAPTURE_IND_MSG_TYPE_LAGACY); + SVCSTR(WMI_SERVICE_PER_PACKET_SW_ENCRYPT); + SVCSTR(WMI_SERVICE_PEER_TID_CONFIGS_SUPPORT); + SVCSTR(WMI_SERVICE_VDEV_BCN_RATE_CONTROL); + SVCSTR(WMI_SERVICE_VDEV_FILTER_NEIGHBOR); + default: return NULL; } @@ -770,6 +793,20 @@ static inline void wmi_10_4_svc_map(const __le32 *in, unsigned long *out, WMI_SERVICE_HOST_DFS_CHECK_SUPPORT, len); SVCMAP(WMI_10_4_SERVICE_TPC_STATS_FINAL, WMI_SERVICE_TPC_STATS_FINAL, len); + SVCMAP(WMI_10_4_SERVICE_CFR_CAPTURE_SUPPORT, + WMI_SERVICE_CFR_CAPTURE_SUPPORT, len); + SVCMAP(WMI_10_4_SERVICE_TX_DATA_ACK_RSSI, + WMI_SERVICE_TX_DATA_ACK_RSSI, len); + SVCMAP(WMI_10_4_SERVICE_CFR_CAPTURE_IND_MSG_TYPE_LAGACY, + WMI_SERVICE_CFR_CAPTURE_IND_MSG_TYPE_LAGACY, len); + SVCMAP(WMI_10_4_SERVICE_PER_PACKET_SW_ENCRYPT, + WMI_SERVICE_PER_PACKET_SW_ENCRYPT, len); + SVCMAP(WMI_10_4_SERVICE_PEER_TID_CONFIGS_SUPPORT, + WMI_SERVICE_PEER_TID_CONFIGS_SUPPORT, len); + SVCMAP(WMI_10_4_SERVICE_VDEV_BCN_RATE_CONTROL, + WMI_SERVICE_VDEV_BCN_RATE_CONTROL, len); + SVCMAP(WMI_10_4_SERVICE_VDEV_FILTER_NEIGHBOR, + WMI_SERVICE_VDEV_FILTER_NEIGHBOR, len); } #undef SVCMAP @@ -7028,6 +7065,45 @@ struct wmi_pdev_chan_info_req_cmd { __le32 reserved; } __packed; +/* enum wmi_neighbor_rx_action - Neighbor Rx Packets add/remove filter */ +enum wmi_neighbor_rx_action { + WMI_NEIGHBOR_RX_ACTION_ADD = 1, + WMI_NEIGHBOR_RX_ACTION_DEL, +}; + +/* enum wmi_neighbor_rx_type - Neighbor Rx Packets ap/client addr */ +enum wmi_neighbor_rx_type { + WMI_NEIGHBOR_RX_TYPE_BSSID = 1, + WMI_NEIGHBOR_RX_TYPE_CLIENT, +}; + +/* enum wmi_neighbor_rx_capture_flag - Neighbor Rx Packets flags */ +enum wmi_neighbor_rx_capture_flag { + WMI_NEIGHBOR_RX_CAPTURE_ONLY_RX_PKT = 1, + WMI_NEIGHBOR_RX_CAPTURE_ONLY_TX_PKT, + WMI_NEIGHBOR_RX_CAPTURE_BOTH_TXRX_PKT +}; + +/* Filter for Neighbor Rx Packets */ +struct wmi_set_vdev_filter_nrp_10_4_cmd { + __le32 vdev_id; + + /* AP Bssid or Client Mac-addr */ + struct wmi_mac_addr macaddr; + + /* see enum wmi_neighbor_rx_action */ + __le32 action; + + /* see enum wmi_neighbor_rx_type */ + __le32 type; + + /* enum wmi_neighbor_rx_capture_flag */ + __le32 flag; + + /* BSSID index - index of the BSSID register */ + __le32 idx; +} __packed; + struct ath10k; struct ath10k_vif; struct ath10k_fw_stats_pdev;