From patchwork Wed Dec 24 07:59:04 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rajkumar Manoharan X-Patchwork-Id: 5537821 Return-Path: X-Original-To: patchwork-ath10k@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id E6117BEEA8 for ; Wed, 24 Dec 2014 08:11:46 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 019532012D for ; Wed, 24 Dec 2014 08:11:46 +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 F3B0D2010C for ; Wed, 24 Dec 2014 08:11:44 +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 1Y3h2T-0007TC-DG; Wed, 24 Dec 2014 08:11:25 +0000 Received: from sabertooth01.qualcomm.com ([65.197.215.72]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Y3gra-0001KU-3P for ath10k@lists.infradead.org; Wed, 24 Dec 2014 08:00:10 +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=1419408010; x=1450944010; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=ZKUuJ0BOC7BtpgHlVmvX6L7yuZQ2QyxwZ4ZBUvD+A3U=; b=NZeFTsD7FrepcghGZZO9QWgUIPYdZK2kwYD1Ep02gUnqpUayBOdEQQsk gCJWdPyKR/8uur/40yGvRxN4WJLdF+wvtJiIO6EYkH/epS1lPwYNKDRQ/ wmcDGsuZ+jk6ZLz4NHwaitkzQOFPVZeu3i20dtLst3aEfhxR9qQ7GmN6Z o=; X-IronPort-AV: E=McAfee;i="5600,1067,7661"; a="80547317" Received: from ironmsg02-lv.qualcomm.com ([10.47.202.183]) by sabertooth01.qualcomm.com with ESMTP; 24 Dec 2014 00:00:09 -0800 X-IronPort-AV: E=Sophos;i="5.07,637,1413270000"; d="scan'208";a="31364010" Received: from nasanexm02c.na.qualcomm.com ([10.46.200.74]) by ironmsg02-lv.qualcomm.com with ESMTP/TLS/RC4-SHA; 24 Dec 2014 00:00:09 -0800 Received: from aphydexm01b.ap.qualcomm.com (10.222.112.203) by NASANEXM02C.na.qualcomm.com (10.46.200.74) with Microsoft SMTP Server (TLS) id 15.0.995.29; Wed, 24 Dec 2014 00:00:07 -0800 Received: from qcmail1.qualcomm.com (10.80.80.8) by aphydexm01b.ap.qualcomm.com (10.222.112.203) with Microsoft SMTP Server (TLS) id 15.0.995.29; Tue, 23 Dec 2014 23:59:59 -0800 Received: by qcmail1.qualcomm.com (sSMTP sendmail emulation); Wed, 24 Dec 2014 13:29:53 +0530 From: Rajkumar Manoharan To: Subject: [PATCH v2 3/8] ath10k: add wmi support for addba_set_resp Date: Wed, 24 Dec 2014 13:29:04 +0530 Message-ID: <1419407949-32367-4-git-send-email-rmanohar@qti.qualcomm.com> X-Mailer: git-send-email 2.2.1 In-Reply-To: <1419407949-32367-1-git-send-email-rmanohar@qti.qualcomm.com> References: <1419407949-32367-1-git-send-email-rmanohar@qti.qualcomm.com> MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: NASANEXM01B.na.qualcomm.com (10.85.0.82) To aphydexm01b.ap.qualcomm.com (10.222.112.203) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20141224_000010_202407_CFFC9BE6 X-CRM114-Status: GOOD ( 11.43 ) X-Spam-Score: -5.1 (-----) Cc: linux-wireless@vger.kernel.org, Rajkumar Manoharan 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: , 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 Add WMI support for sending addba response manually. This command is used for debugging purpose. Signed-off-by: Rajkumar Manoharan --- drivers/net/wireless/ath/ath10k/wmi-ops.h | 20 ++++++++++++++++++++ drivers/net/wireless/ath/ath10k/wmi-tlv.c | 1 + drivers/net/wireless/ath/ath10k/wmi.c | 30 ++++++++++++++++++++++++++++++ 3 files changed, 51 insertions(+) diff --git a/drivers/net/wireless/ath/ath10k/wmi-ops.h b/drivers/net/wireless/ath/ath10k/wmi-ops.h index badf422..e8f49de 100644 --- a/drivers/net/wireless/ath/ath10k/wmi-ops.h +++ b/drivers/net/wireless/ath/ath10k/wmi-ops.h @@ -123,6 +123,9 @@ struct wmi_ops { const u8 *mac); struct sk_buff *(*gen_addba_send)(struct ath10k *ar, u32 vdev_id, const u8 *mac, u32 tid, u32 buf_size); + struct sk_buff *(*gen_addba_set_resp)(struct ath10k *ar, u32 vdev_id, + const u8 *mac, u32 tid, + u32 status); }; int ath10k_wmi_cmd_send(struct ath10k *ar, struct sk_buff *skb, u32 cmd_id); @@ -894,4 +897,21 @@ ath10k_wmi_addba_send(struct ath10k *ar, u32 vdev_id, const u8 *mac, ar->wmi.cmd->addba_send_cmdid); } +static inline int +ath10k_wmi_addba_set_resp(struct ath10k *ar, u32 vdev_id, const u8 *mac, + u32 tid, u32 status) +{ + struct sk_buff *skb; + + if (!ar->wmi.ops->gen_addba_set_resp) + return -EOPNOTSUPP; + + skb = ar->wmi.ops->gen_addba_set_resp(ar, vdev_id, mac, tid, status); + if (IS_ERR(skb)) + return PTR_ERR(skb); + + return ath10k_wmi_cmd_send(ar, skb, + ar->wmi.cmd->addba_set_resp_cmdid); +} + #endif diff --git a/drivers/net/wireless/ath/ath10k/wmi-tlv.c b/drivers/net/wireless/ath/ath10k/wmi-tlv.c index 74a0598..63f9860 100644 --- a/drivers/net/wireless/ath/ath10k/wmi-tlv.c +++ b/drivers/net/wireless/ath/ath10k/wmi-tlv.c @@ -2209,6 +2209,7 @@ static const struct wmi_ops wmi_tlv_ops = { /* .gen_pdev_get_temperature not implemented */ /* .gen_addba_clear_resp not implemented */ /* .gen_addba_send not implemented */ + /* .gen_addba_set_resp not implemented */ }; /************/ diff --git a/drivers/net/wireless/ath/ath10k/wmi.c b/drivers/net/wireless/ath/ath10k/wmi.c index 8103cbc..dd17c00 100644 --- a/drivers/net/wireless/ath/ath10k/wmi.c +++ b/drivers/net/wireless/ath/ath10k/wmi.c @@ -4927,6 +4927,32 @@ ath10k_wmi_op_gen_addba_send(struct ath10k *ar, u32 vdev_id, const u8 *mac, return skb; } +static struct sk_buff * +ath10k_wmi_op_gen_addba_set_resp(struct ath10k *ar, u32 vdev_id, const u8 *mac, + u32 tid, u32 status) +{ + struct wmi_addba_setresponse_cmd *cmd; + struct sk_buff *skb; + + if (!mac) + return ERR_PTR(-EINVAL); + + skb = ath10k_wmi_alloc_skb(ar, sizeof(*cmd)); + if (!skb) + return ERR_PTR(-ENOMEM); + + cmd = (struct wmi_addba_setresponse_cmd *)skb->data; + cmd->vdev_id = __cpu_to_le32(vdev_id); + ether_addr_copy(cmd->peer_macaddr.addr, mac); + cmd->tid = __cpu_to_le32(tid); + cmd->statuscode = __cpu_to_le32(status); + + ath10k_dbg(ar, ATH10K_DBG_WMI, + "wmi addba set resp vdev_id 0x%X mac_addr %pM tid %u status %u\n", + vdev_id, mac, tid, status); + return skb; +} + static const struct wmi_ops wmi_ops = { .rx = ath10k_wmi_op_rx, .map_svc = wmi_main_svc_map, @@ -4980,6 +5006,7 @@ static const struct wmi_ops wmi_ops = { /* .gen_pdev_get_temperature not implemented */ .gen_addba_clear_resp = ath10k_wmi_op_gen_addba_clear_resp, .gen_addba_send = ath10k_wmi_op_gen_addba_send, + .gen_addba_set_resp = ath10k_wmi_op_gen_addba_set_resp, }; static const struct wmi_ops wmi_10_1_ops = { @@ -5036,6 +5063,7 @@ static const struct wmi_ops wmi_10_1_ops = { .gen_pdev_set_quiet_mode = ath10k_wmi_op_gen_pdev_set_quiet_mode, .gen_addba_clear_resp = ath10k_wmi_op_gen_addba_clear_resp, .gen_addba_send = ath10k_wmi_op_gen_addba_send, + .gen_addba_set_resp = ath10k_wmi_op_gen_addba_set_resp, }; static const struct wmi_ops wmi_10_2_ops = { @@ -5093,6 +5121,7 @@ static const struct wmi_ops wmi_10_2_ops = { .gen_pdev_set_quiet_mode = ath10k_wmi_op_gen_pdev_set_quiet_mode, .gen_addba_clear_resp = ath10k_wmi_op_gen_addba_clear_resp, .gen_addba_send = ath10k_wmi_op_gen_addba_send, + .gen_addba_set_resp = ath10k_wmi_op_gen_addba_set_resp, }; static const struct wmi_ops wmi_10_2_4_ops = { @@ -5150,6 +5179,7 @@ static const struct wmi_ops wmi_10_2_4_ops = { .gen_pdev_set_quiet_mode = ath10k_wmi_op_gen_pdev_set_quiet_mode, .gen_addba_clear_resp = ath10k_wmi_op_gen_addba_clear_resp, .gen_addba_send = ath10k_wmi_op_gen_addba_send, + .gen_addba_set_resp = ath10k_wmi_op_gen_addba_set_resp, }; int ath10k_wmi_attach(struct ath10k *ar)