From patchwork Thu Jan 8 11:12:26 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Kazior X-Patchwork-Id: 5592031 Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id EC6ED9FB36 for ; Thu, 8 Jan 2015 11:13:02 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0DB1D200E9 for ; Thu, 8 Jan 2015 11:13:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 10F672034C for ; Thu, 8 Jan 2015 11:13:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756410AbbAHLM5 (ORCPT ); Thu, 8 Jan 2015 06:12:57 -0500 Received: from mail-wi0-f170.google.com ([209.85.212.170]:38605 "EHLO mail-wi0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756406AbbAHLM4 (ORCPT ); Thu, 8 Jan 2015 06:12:56 -0500 Received: by mail-wi0-f170.google.com with SMTP id bs8so2346890wib.1 for ; Thu, 08 Jan 2015 03:12:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tieto.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=E8/dMMF5S0sVCQDDUbxfnUmh3giPoVPy4H//+1CgEhw=; b=Qf926h0455zEUAm3p1cYHdbUPWsXJtCGKsv/4V0Ei8BTH1nlNXNGRFFEAdnX2ppX7a qQWRZYd++nSUSlCP5qtqXH4UrJuK5XblDYQFuufqvppC4J+TTXKQ2Xf/kcwaQgQGZWfE Dgp0f7C8lUzC8iB+UNlwSieMZnLUDrLiYr3Nc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=E8/dMMF5S0sVCQDDUbxfnUmh3giPoVPy4H//+1CgEhw=; b=ansESSmO+LkBEIMf4uGYAy2pwj7MUIdTL1QsDl/5vnOw+2rNJ5PeUFpwhtFbQNM40W dKXUGK4gxhqsm1oWxb1GR/vncfdoy90yiaP7uej32NZKYZrtq/2pCPdQBrBqzMcPJH9O L+NZZTwayyeO3HnYCaVEpI/T6hFyjnGhsIjtRHNaSX5jLsN0uSzHACBDUp81hZAq3tXj KMhavEkuA9rU8uzq8kgY1HfNkRlPS0KGqs75x1YoZCa9cK9Q+TEGIRgjUcBE2uB4QrJ6 24gbZqWO3RLys/P6rs+ERi10AOlnc7PPlZnIEDYCH30cTcDBzI8E1Uu0+7IccQuhKJ8Z Yukg== X-Gm-Message-State: ALoCoQmyEC2EN6UDyf3YFERcjpwWerwHBIEDcGvpKtQQI4B3PeKxwUuoCJi1bCPKXhpNG04KzTwqkQBTuTd/O/BC44SF/Ue6ql46CYieWwU0Y7K+Pi4dGKqfPXVPGLvhH1+bRSK4skRh X-Received: by 10.180.96.97 with SMTP id dr1mr17992574wib.49.1420715572743; Thu, 08 Jan 2015 03:12:52 -0800 (PST) Received: from localhost.localdomain ([91.198.246.8]) by mx.google.com with ESMTPSA id td6sm6123479wic.15.2015.01.08.03.12.51 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 08 Jan 2015 03:12:52 -0800 (PST) From: Michal Kazior To: ath10k@lists.infradead.org Cc: linux-wireless@vger.kernel.org, Michal Kazior Subject: [PATCH v2 1/5] ath10k: implement new beacon tx status event Date: Thu, 8 Jan 2015 12:12:26 +0100 Message-Id: <1420715550-16017-2-git-send-email-michal.kazior@tieto.com> X-Mailer: git-send-email 1.8.5.3 In-Reply-To: <1420715550-16017-1-git-send-email-michal.kazior@tieto.com> References: <1420715550-16017-1-git-send-email-michal.kazior@tieto.com> X-DomainID: tieto.com Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID,T_RP_MATCHES_RCVD,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This event is delivered to host by firmware if it supports beacon templates only. Signed-off-by: Michal Kazior --- drivers/net/wireless/ath/ath10k/wmi-tlv.c | 50 +++++++++++++++++++++++++++++++ drivers/net/wireless/ath/ath10k/wmi-tlv.h | 12 ++++++++ 2 files changed, 62 insertions(+) diff --git a/drivers/net/wireless/ath/ath10k/wmi-tlv.c b/drivers/net/wireless/ath/ath10k/wmi-tlv.c index 4c050ce..ae7c898 100644 --- a/drivers/net/wireless/ath/ath10k/wmi-tlv.c +++ b/drivers/net/wireless/ath/ath10k/wmi-tlv.c @@ -58,6 +58,8 @@ static const struct wmi_tlv_policy wmi_tlv_policies[] = { = { .min_len = sizeof(struct wlan_host_mem_req) }, [WMI_TLV_TAG_STRUCT_READY_EVENT] = { .min_len = sizeof(struct wmi_tlv_rdy_ev) }, + [WMI_TLV_TAG_STRUCT_OFFLOAD_BCN_TX_STATUS_EVENT] + = { .min_len = sizeof(struct wmi_tlv_bcn_tx_status_ev) }, }; static int @@ -156,6 +158,51 @@ static u16 ath10k_wmi_tlv_len(const void *ptr) return __le16_to_cpu((((const struct wmi_tlv *)ptr) - 1)->len); } +/**************/ +/* TLV events */ +/**************/ +static int ath10k_wmi_tlv_event_bcn_tx_status(struct ath10k *ar, + struct sk_buff *skb) +{ + const void **tb; + const struct wmi_tlv_bcn_tx_status_ev *ev; + u32 vdev_id, tx_status; + int ret; + + tb = ath10k_wmi_tlv_parse_alloc(ar, skb->data, skb->len, GFP_ATOMIC); + if (IS_ERR(tb)) { + ret = PTR_ERR(tb); + ath10k_warn(ar, "failed to parse tlv: %d\n", ret); + return ret; + } + + ev = tb[WMI_TLV_TAG_STRUCT_OFFLOAD_BCN_TX_STATUS_EVENT]; + if (!ev) { + kfree(tb); + return -EPROTO; + } + + tx_status = __le32_to_cpu(ev->tx_status); + vdev_id = __le32_to_cpu(ev->vdev_id); + + switch (tx_status) { + case WMI_TLV_BCN_TX_STATUS_OK: + break; + case WMI_TLV_BCN_TX_STATUS_XRETRY: + case WMI_TLV_BCN_TX_STATUS_DROP: + case WMI_TLV_BCN_TX_STATUS_FILTERED: + /* FIXME: It's probably worth telling mac80211 to stop the + * interface as it is crippled. + */ + ath10k_warn(ar, "received bcn tmpl tx status on vdev %i: %d", + vdev_id, tx_status); + break; + } + + kfree(tb); + return 0; +} + /***********/ /* TLV ops */ /***********/ @@ -268,6 +315,9 @@ static void ath10k_wmi_tlv_op_rx(struct ath10k *ar, struct sk_buff *skb) case WMI_TLV_READY_EVENTID: ath10k_wmi_event_ready(ar, skb); break; + case WMI_TLV_OFFLOAD_BCN_TX_STATUS_EVENTID: + ath10k_wmi_tlv_event_bcn_tx_status(ar, skb); + break; default: ath10k_warn(ar, "Unknown eventid: %d\n", id); break; diff --git a/drivers/net/wireless/ath/ath10k/wmi-tlv.h b/drivers/net/wireless/ath/ath10k/wmi-tlv.h index 54ffa12..ee19353 100644 --- a/drivers/net/wireless/ath/ath10k/wmi-tlv.h +++ b/drivers/net/wireless/ath/ath10k/wmi-tlv.h @@ -1375,6 +1375,18 @@ struct wmi_tlv_pktlog_disable { __le32 reserved; } __packed; +enum wmi_tlv_bcn_tx_status { + WMI_TLV_BCN_TX_STATUS_OK, + WMI_TLV_BCN_TX_STATUS_XRETRY, + WMI_TLV_BCN_TX_STATUS_DROP, + WMI_TLV_BCN_TX_STATUS_FILTERED, +}; + +struct wmi_tlv_bcn_tx_status_ev { + __le32 vdev_id; + __le32 tx_status; +} __packed; + void ath10k_wmi_tlv_attach(struct ath10k *ar); #endif