From patchwork Wed Dec 24 07:59:08 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rajkumar Manoharan X-Patchwork-Id: 5537761 Return-Path: X-Original-To: patchwork-linux-wireless@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 C84B9BEEA8 for ; Wed, 24 Dec 2014 08:01:15 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0510D2010C for ; Wed, 24 Dec 2014 08:01:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1E77F20108 for ; Wed, 24 Dec 2014 08:01:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751779AbaLXIBL (ORCPT ); Wed, 24 Dec 2014 03:01:11 -0500 Received: from wolverine02.qualcomm.com ([199.106.114.251]:58660 "EHLO wolverine02.qualcomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751753AbaLXIBK (ORCPT ); Wed, 24 Dec 2014 03:01:10 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=qti.qualcomm.com; i=@qti.qualcomm.com; q=dns/txt; s=qcdkim; t=1419408070; x=1450944070; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=EdEr1PiTPZ08KPFmxbeO92TqaEZEdVToww6mqVLDvl4=; b=RyNWIjXRnjJrU05R348SPY9Hr4gjIgJbYwMWlgbWnT9x0vK2FXPlPdmi ZtJNu0JhDGp3qIEwODWGa+yELWgWy62dY/fZrAqnYrKHZV0cOcjFtN65r pqbl5D6XCW165ljbKYjESyycSlJHvoBzjm/1/Bgk1viYp0OzOOg4rxql5 M=; X-IronPort-AV: E=McAfee;i="5600,1067,7661"; a="186933221" Received: from ironmsg04-r.qualcomm.com ([172.30.46.18]) by wolverine02.qualcomm.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 24 Dec 2014 00:01:10 -0800 X-IronPort-AV: E=Sophos;i="5.07,637,1413270000"; d="scan'208";a="871991394" Received: from nasanexm01g.na.qualcomm.com ([10.85.0.33]) by Ironmsg04-R.qualcomm.com with ESMTP/TLS/RC4-SHA; 24 Dec 2014 00:01:04 -0800 Received: from aphydexm01b.ap.qualcomm.com (10.222.112.203) by NASANEXM01G.na.qualcomm.com (10.85.0.33) with Microsoft SMTP Server (TLS) id 15.0.995.29; Wed, 24 Dec 2014 00:01:02 -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; Wed, 24 Dec 2014 00:00:55 -0800 Received: by qcmail1.qualcomm.com (sSMTP sendmail emulation); Wed, 24 Dec 2014 13:30:48 +0530 From: Rajkumar Manoharan To: CC: , Rajkumar Manoharan Subject: [PATCH v2 7/8] ath10k: add support to send addba response Date: Wed, 24 Dec 2014 13:29:08 +0530 Message-ID: <1419407949-32367-8-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) 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=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); }