From patchwork Fri Dec 19 06:54:58 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rajkumar Manoharan X-Patchwork-Id: 5517721 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 DC9639F30B for ; Fri, 19 Dec 2014 06:57:35 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 11EF320131 for ; Fri, 19 Dec 2014 06:57:35 +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 F2FDE2012D for ; Fri, 19 Dec 2014 06:57:33 +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 1Y1rVC-0005gB-Uj; Fri, 19 Dec 2014 06:57:30 +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 1Y1rVA-0005cK-Ou for ath10k@lists.infradead.org; Fri, 19 Dec 2014 06:57:29 +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=1418972248; x=1450508248; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=B36BoqoAo1aE7mt8fTv1YH5NPdLWdtMe0QDPvxIMPiU=; b=SM++ip57dzMbnOs+NcEbIQDwc86T1WKGot88CM+UnQas5cRc5bzVNd+0 /2IcDe5ux5O0MedX+ISHvaYZIvH1VxthE590hE2CVhk6Fk46r56Y5VvKr EWXCLvtrTSERmXn6sbN1URgCwwGKiA3QZj1U5uaJJEhnJ4UtouGyfURoB A=; X-IronPort-AV: E=McAfee;i="5600,1067,7656"; a="80300115" Received: from ironmsg02-lv.qualcomm.com ([10.47.202.183]) by sabertooth01.qualcomm.com with ESMTP; 18 Dec 2014 22:57:07 -0800 X-IronPort-AV: E=Sophos;i="5.07,605,1413270000"; d="scan'208";a="31334028" Received: from nasanexhc07.na.qualcomm.com ([172.30.39.190]) by ironmsg02-lv.qualcomm.com with ESMTP/TLS/RC4-SHA; 18 Dec 2014 22:57:07 -0800 Received: from aphydexm01b.ap.qualcomm.com (10.222.112.203) by nasanexhc07.na.qualcomm.com (172.30.39.190) with Microsoft SMTP Server (TLS) id 14.3.181.6; Thu, 18 Dec 2014 22:57:06 -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.913.22; Thu, 18 Dec 2014 22:56:48 -0800 Received: by qcmail1.qualcomm.com (sSMTP sendmail emulation); Fri, 19 Dec 2014 12:26:39 +0530 From: Rajkumar Manoharan To: Subject: [PATCH 7/8] ath10k: add support to send addba response Date: Fri, 19 Dec 2014 12:24:58 +0530 Message-ID: <1418972099-5296-8-git-send-email-rmanohar@qti.qualcomm.com> X-Mailer: git-send-email 2.2.0 In-Reply-To: <1418972099-5296-1-git-send-email-rmanohar@qti.qualcomm.com> References: <1418972099-5296-1-git-send-email-rmanohar@qti.qualcomm.com> MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: NASANEXM01C.na.qualcomm.com (10.85.0.83) 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-20141218_225728_920068_BF784FBB X-CRM114-Status: GOOD ( 11.10 ) 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 This per-station debugfs entry helps to send addba response in manual mode for debugging purpose. It accepts tid and status code as input arguments. To send addba response, echo 0 25 >/sys/kernel/debug/ieee80211/phyX/netdev:wlanX/ stations/XX:XX:XX:XX:XX:XX/addba_resp Signed-off-by: Rajkumar Manoharan --- drivers/net/wireless/ath/ath10k/debugfs_sta.c | 55 +++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) diff --git a/drivers/net/wireless/ath/ath10k/debugfs_sta.c b/drivers/net/wireless/ath/ath10k/debugfs_sta.c index 89e5e5a..95eb5a1 100644 --- a/drivers/net/wireless/ath/ath10k/debugfs_sta.c +++ b/drivers/net/wireless/ath/ath10k/debugfs_sta.c @@ -136,10 +136,65 @@ static const struct file_operations fops_addba = { .llseek = default_llseek, }; +static ssize_t ath10k_dbg_sta_write_addba_resp(struct file *file, + const char __user *user_buf, + size_t count, loff_t *ppos) +{ + struct ieee80211_sta *sta = file->private_data; + struct ath10k_sta *arsta = (struct ath10k_sta *)sta->drv_priv; + struct ath10k *ar = arsta->arvif->ar; + u32 tid, status; + int ret; + char buf[64]; + + simple_write_to_buffer(buf, sizeof(buf) - 1, ppos, user_buf, count); + + /* make sure that buf is null terminated */ + buf[sizeof(buf) - 1] = '\0'; + + ret = sscanf(buf, "%u %u", &tid, &status); + if (ret != 2) { + ath10k_warn(ar, "ex: echo >addba_resp\n"); + return -EINVAL; + } + + /* Valid TID values are 0 through 15 */ + if (tid > HTT_DATA_TX_EXT_TID_MGMT - 2) { + ath10k_warn(ar, "Invalid TID %u\n", tid); + return -EINVAL; + } + + mutex_lock(&ar->conf_mutex); + if ((ar->state != ATH10K_STATE_ON) || + (arsta->aggr_mode != ATH10K_DBG_AGGR_MODE_MANUAL)) { + ret = count; + goto out; + } + + ret = ath10k_wmi_addba_set_resp(ar, arsta->arvif->vdev_id, sta->addr, + tid, status); + if (ret) { + ath10k_warn(ar, "failed to send addba response: vdev_id %u peer %pM tid %u status%u\n", + arsta->arvif->vdev_id, sta->addr, tid, status); + } + ret = count; +out: + mutex_unlock(&ar->conf_mutex); + return ret; +} + +static const struct file_operations fops_addba_resp = { + .write = ath10k_dbg_sta_write_addba_resp, + .open = simple_open, + .owner = THIS_MODULE, + .llseek = default_llseek, +}; + void ath10k_sta_add_debugfs(struct ieee80211_hw *hw, struct ieee80211_vif *vif, struct ieee80211_sta *sta, struct dentry *dir) { debugfs_create_file("aggr_mode", S_IRUGO | S_IWUSR, dir, sta, &fops_aggr_mode); debugfs_create_file("addba", S_IWUSR, dir, sta, &fops_addba); + debugfs_create_file("addba_resp", S_IWUSR, dir, sta, &fops_addba_resp); }