From patchwork Mon Dec 22 09:11:14 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rajkumar Manoharan X-Patchwork-Id: 5526331 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 1BC8CBEEA8 for ; Mon, 22 Dec 2014 09:11:43 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2F73C2017A for ; Mon, 22 Dec 2014 09:11:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 05AEA20173 for ; Mon, 22 Dec 2014 09:11:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754135AbaLVJLi (ORCPT ); Mon, 22 Dec 2014 04:11:38 -0500 Received: from sabertooth01.qualcomm.com ([65.197.215.72]:13417 "EHLO sabertooth01.qualcomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753980AbaLVJLg (ORCPT ); Mon, 22 Dec 2014 04:11:36 -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=1419239496; x=1450775496; h=from:to:cc:subject:date:message-id:mime-version; bh=77wJTCQ+E8S+dv+dkz2x89Y/3WFTPDcVLE4Wpk2q81Y=; b=e8hNiLvJpVqCx75SUDzq9WJoLn+WfEAtFm4y08SIv+pEIg5xbdxplm08 N5v8dwKTA1cdZ9jwKQGPxZrU/Gu9pGR2pDi5pd1P4B1bWaiL1n3FGFNsj alaKft30nVrgYinY244Q2q+8JmeEJ3l7qYcGadZ5Ym6RffqAiEYD4dja9 4=; X-IronPort-AV: E=McAfee;i="5600,1067,7659"; a="80438674" Received: from ironmsg04-l.qualcomm.com ([172.30.48.19]) by sabertooth01.qualcomm.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 22 Dec 2014 01:11:36 -0800 X-IronPort-AV: E=Sophos;i="5.07,622,1413270000"; d="scan'208";a="777014900" Received: from nasanexhc08.na.qualcomm.com ([172.30.39.7]) by Ironmsg04-L.qualcomm.com with ESMTP/TLS/RC4-SHA; 22 Dec 2014 01:11:35 -0800 Received: from aphydexm01b.ap.qualcomm.com (10.222.112.203) by nasanexhc08.na.qualcomm.com (172.30.39.7) with Microsoft SMTP Server (TLS) id 14.3.181.6; Mon, 22 Dec 2014 01:11:35 -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; Mon, 22 Dec 2014 01:11:26 -0800 Received: by qcmail1.qualcomm.com (sSMTP sendmail emulation); Mon, 22 Dec 2014 14:41:14 +0530 From: Rajkumar Manoharan To: CC: , Rajkumar Manoharan Subject: [PATCH v2 8/8] ath10k: add support to send delba Date: Mon, 22 Dec 2014 14:41:14 +0530 Message-ID: <1419239474-958-1-git-send-email-rmanohar@qti.qualcomm.com> X-Mailer: git-send-email 2.2.1 MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanexm01a.na.qualcomm.com (10.85.0.81) 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 delba in manual mode for debugging purpose. It accepts tid, initiator and reason code as inputs. To send delba, echo 0 1 37 >/sys/kernel/debug/ieee80211/phyX/netdev:wlanX/ stations/XX:XX:XX:XX:XX:XX/delba 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 95eb5a1..5effd7bb 100644 --- a/drivers/net/wireless/ath/ath10k/debugfs_sta.c +++ b/drivers/net/wireless/ath/ath10k/debugfs_sta.c @@ -190,6 +190,61 @@ static const struct file_operations fops_addba_resp = { .llseek = default_llseek, }; +static ssize_t ath10k_dbg_sta_write_delba(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, initiator, reason; + 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 %u", &tid, &initiator, &reason); + if (ret != 3) { + ath10k_warn(ar, "ex: echo >delba\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_delba_send(ar, arsta->arvif->vdev_id, sta->addr, + tid, initiator, reason); + if (ret) { + ath10k_warn(ar, "failed to send delba: vdev_id %u peer %pM tid %u initiator %u reason %u\n", + arsta->arvif->vdev_id, sta->addr, tid, initiator, + reason); + } + ret = count; +out: + mutex_unlock(&ar->conf_mutex); + return ret; +} + +static const struct file_operations fops_delba = { + .write = ath10k_dbg_sta_write_delba, + .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) { @@ -197,4 +252,5 @@ void ath10k_sta_add_debugfs(struct ieee80211_hw *hw, struct ieee80211_vif *vif, &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); + debugfs_create_file("delba", S_IWUSR, dir, sta, &fops_delba); }