From patchwork Wed Dec 17 15:21:47 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Markowski X-Patchwork-Id: 5507381 Return-Path: X-Original-To: patchwork-ath10k@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 7E0779F1CD for ; Wed, 17 Dec 2014 15:23:01 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 40B4220A29 for ; Wed, 17 Dec 2014 15:23:00 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 72F2020A22 for ; Wed, 17 Dec 2014 15:22:58 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Y1GR6-0005ws-Tm; Wed, 17 Dec 2014 15:22:48 +0000 Received: from mail-wi0-x22c.google.com ([2a00:1450:400c:c05::22c]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Y1GR2-0005iF-6b for ath10k@lists.infradead.org; Wed, 17 Dec 2014 15:22:45 +0000 Received: by mail-wi0-f172.google.com with SMTP id n3so16082880wiv.11 for ; Wed, 17 Dec 2014 07:22:15 -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=Zx5LwaAbdqkq/9niW0wBnVrkkBcyExZnskk42+0cRKI=; b=bLVfEBzZp7sjv9w8oN/2jvI52dPf9nIxRgRN75ZRsnIGy6vnABKvWl+Km9DkrHRey2 cm+aoZP84Qo1RNMa4rlLCZ+B94O7aH5Mpu2LnASuMyrZQTpktjx79oDpZYM6eYo8IE+7 5PBaD4SMWb+daMFXDEa0mOz7UIU9+in4RyYZg= 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=Zx5LwaAbdqkq/9niW0wBnVrkkBcyExZnskk42+0cRKI=; b=FSG5TEfkj1WWH+/qPdU0GlA93gZ/WSue00T2sXYdx5CTj6F7iagQaEVOIQ34EOPC0Q K+59KEULGdc/3WhyIR1pryiFN5F940P1Uz/twgMBOP9V0ceYRfnMGon8BDU6uBB9XFl3 G53EsqawkWEPOppctVYW2Pwb9bhhOJi9xg9szqk0DEHpC/E00lqJ1uElwVrtvO0C8thR aHF9LgH/VEcXgPPXZX282QUA4jTxMzQxiuOxtX2CWrayHrARhxcZs1ycIir3/93Uxptc +d5V0LJ+uCBZxuaV1pig2rae9bZYgf/4+hYTGWdKEoztyhrsKlQUwVqGaYyuqmVBgQOu YuEg== X-Gm-Message-State: ALoCoQlYQR+Ygn0VhFkWcPGdgc5oTX54PL6GxAbojoDeES0wMVlwuhN05QbYKOgea2lFg25jDoTOMJbtzyE/tUZRNUBIyKMa6yjvrFtlVv2F+/8FtaIunXXExW7NDocJtz73AXKEHTYiuM3xXkIoSjMeDfy4iivlM0+ozJXLnLVDsCaVXo/VCU+qMaQPCWlsej2c56UJroMa X-Received: by 10.180.73.101 with SMTP id k5mr15307707wiv.43.1418829734674; Wed, 17 Dec 2014 07:22:14 -0800 (PST) Received: from uw000975.eu.tieto.com ([91.198.246.10]) by mx.google.com with ESMTPSA id hn2sm5498968wjc.5.2014.12.17.07.22.13 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 17 Dec 2014 07:22:14 -0800 (PST) From: Bartosz Markowski To: ath10k@lists.infradead.org Subject: [PATCH 1/5] ath10k: implement new beacon tx status event Date: Wed, 17 Dec 2014 16:21:47 +0100 Message-Id: <1418829711-19713-2-git-send-email-bartosz.markowski@tieto.com> X-Mailer: git-send-email 1.8.2 In-Reply-To: <1418829711-19713-1-git-send-email-bartosz.markowski@tieto.com> References: <1418829711-19713-1-git-send-email-bartosz.markowski@tieto.com> X-DomainID: tieto.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20141217_072244_440366_AC5FAF10 X-CRM114-Status: GOOD ( 11.34 ) X-Spam-Score: -0.8 (/) Cc: linux-wireless@vger.kernel.org, Michal Kazior X-BeenThere: ath10k@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "ath10k" Errors-To: ath10k-bounces+patchwork-ath10k=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable 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 From: Michal Kazior 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 1627ec5..0f7a3ae 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