From patchwork Fri Dec 19 06:54:57 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rajkumar Manoharan X-Patchwork-Id: 5517671 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.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 6622F9F443 for ; Fri, 19 Dec 2014 06:56:52 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9A6662012D for ; Fri, 19 Dec 2014 06:56:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B6B1E2012B for ; Fri, 19 Dec 2014 06:56:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752078AbaLSG4t (ORCPT ); Fri, 19 Dec 2014 01:56:49 -0500 Received: from sabertooth02.qualcomm.com ([65.197.215.38]:28554 "EHLO sabertooth02.qualcomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752013AbaLSG4s (ORCPT ); Fri, 19 Dec 2014 01:56:48 -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=1418972208; x=1450508208; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=uHmCIRWIdd9khAN8rA7C4Y9BCTwXds4wlCystbHFxUY=; b=cMqJt5p9U8sbUvb99U2wqERNpIJlfhGo8BVdUx2Bydgb4gbo4I3UXdxP EulQuZ+0+HuMDDmMgLPDx8TTIGRdPbsL4tg/0hCn4lZQUK7X7xGn7BKiy qV0EoJsSQ78R3S4G8cab/x68mAW5QQt4+PeQMMNAkGbpYhPJJbNqqkLWS 8=; X-IronPort-AV: E=McAfee;i="5600,1067,7656"; a="81043061" Received: from ironmsg04-l.qualcomm.com ([172.30.48.19]) by sabertooth02.qualcomm.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 18 Dec 2014 22:56:48 -0800 X-IronPort-AV: E=Sophos;i="5.07,605,1413270000"; d="scan'208";a="775130000" Received: from nasanexhc06.na.qualcomm.com ([172.30.48.21]) by Ironmsg04-L.qualcomm.com with ESMTP/TLS/RC4-SHA; 18 Dec 2014 22:56:48 -0800 Received: from aphydexm01b.ap.qualcomm.com (172.30.48.1) by nasanexhc06.na.qualcomm.com (172.30.48.21) with Microsoft SMTP Server (TLS) id 14.3.181.6; Thu, 18 Dec 2014 22:56:47 -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:35 -0800 Received: by qcmail1.qualcomm.com (sSMTP sendmail emulation); Fri, 19 Dec 2014 12:26:24 +0530 From: Rajkumar Manoharan To: CC: , Rajkumar Manoharan Subject: [PATCH 6/8] ath10k: add support to send addba request Date: Fri, 19 Dec 2014 12:24:57 +0530 Message-ID: <1418972099-5296-7-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: NASANEXM01G.na.qualcomm.com (10.85.0.33) 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 request in manual mode. Need to pass two configuration parameters (tid, buffer size) as input. To send addba, echo 1 32 >/sys/kernel/debug/ieee80211/phyX/netdev:wlanX/ stations/XX:XX:XX:XX:XX:XX/addba Signed-off-by: Rajkumar Manoharan --- drivers/net/wireless/ath/ath10k/debugfs_sta.c | 56 +++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) diff --git a/drivers/net/wireless/ath/ath10k/debugfs_sta.c b/drivers/net/wireless/ath/ath10k/debugfs_sta.c index d5fca70..89e5e5a 100644 --- a/drivers/net/wireless/ath/ath10k/debugfs_sta.c +++ b/drivers/net/wireless/ath/ath10k/debugfs_sta.c @@ -81,9 +81,65 @@ static const struct file_operations fops_aggr_mode = { .llseek = default_llseek, }; +static ssize_t ath10k_dbg_sta_write_addba(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, buf_size; + 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, &buf_size); + if (ret != 2) { + ath10k_warn(ar, "ex: echo >addba\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_send(ar, arsta->arvif->vdev_id, sta->addr, + tid, buf_size); + if (ret) { + ath10k_warn(ar, "failed to send addba request: vdev_id %u peer %pM tid %u buf_size %u\n", + arsta->arvif->vdev_id, sta->addr, tid, buf_size); + } + + ret = count; +out: + mutex_unlock(&ar->conf_mutex); + return ret; +} + +static const struct file_operations fops_addba = { + .write = ath10k_dbg_sta_write_addba, + .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); }