From patchwork Mon Jan 12 11:42:20 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kalle Valo X-Patchwork-Id: 5609591 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.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 257669F2ED for ; Mon, 12 Jan 2015 11:42:35 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 44E7A2061A for ; Mon, 12 Jan 2015 11:42:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 57EA3205E4 for ; Mon, 12 Jan 2015 11:42:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751994AbbALLmb (ORCPT ); Mon, 12 Jan 2015 06:42:31 -0500 Received: from wolverine02.qualcomm.com ([199.106.114.251]:62466 "EHLO wolverine02.qualcomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750971AbbALLmb (ORCPT ); Mon, 12 Jan 2015 06:42:31 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=qca.qualcomm.com; i=@qca.qualcomm.com; q=dns/txt; s=qcdkim; t=1421062951; x=1452598951; h=from:to:cc:subject:references:date:in-reply-to: message-id:mime-version; bh=iHF5q8y+KviRbMIUBOXP5uLQ+ggUf0fbX1NvubapkFo=; b=c8JdeguXYhDYIXuc3IFEzna+20miS87pyNoOztI5VfCfuxNuktDU/Gw2 RI/ZnphAjALTWf0xaGZPVipesCsVSvShNMC0cXfsZsNds2+VDRrHuy16a 4fqh8fdaiNnMW7RqHtt9xnY65gYu8W/KtAemAoTgQJ+DhTmljEgqBPoyA E=; X-IronPort-AV: E=McAfee;i="5600,1067,7678"; a="189529839" Received: from ironmsg02-lv.qualcomm.com ([10.47.202.183]) by wolverine02.qualcomm.com with ESMTP; 12 Jan 2015 03:42:30 -0800 X-IronPort-AV: E=Sophos;i="5.07,743,1413270000"; d="scan'208";a="31461191" Received: from nalasexr01g.na.qualcomm.com ([10.49.56.53]) by ironmsg02-lv.qualcomm.com with ESMTP/TLS/RC4-SHA; 12 Jan 2015 03:42:30 -0800 Received: from potku.adurom.net.qca.qualcomm.com (10.80.80.8) by NALASEXR01G.na.qualcomm.com (10.49.56.53) with Microsoft SMTP Server (TLS) id 15.0.995.29; Mon, 12 Jan 2015 03:42:27 -0800 From: Kalle Valo To: Rajkumar Manoharan CC: , Subject: Re: [PATCH v2 6/8] ath10k: add support to send addba request References: <1419407949-32367-1-git-send-email-rmanohar@qti.qualcomm.com> <1419407949-32367-7-git-send-email-rmanohar@qti.qualcomm.com> Date: Mon, 12 Jan 2015 13:42:20 +0200 In-Reply-To: <1419407949-32367-7-git-send-email-rmanohar@qti.qualcomm.com> (Rajkumar Manoharan's message of "Wed, 24 Dec 2014 13:29:07 +0530") Message-ID: <87387gfco3.fsf@kamboji.qca.qualcomm.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux) MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanexm01a.na.qualcomm.com (10.85.0.81) To NALASEXR01G.na.qualcomm.com (10.49.56.53) 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 Rajkumar Manoharan writes: > 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 [...] > + 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; > + } It's preferred that the driver doesn't print anything based on wrong user input, so I removed these two warning messages: --- a/drivers/net/wireless/ath/ath10k/debugfs_sta.c +++ b/drivers/net/wireless/ath/ath10k/debugfs_sta.c @@ -97,16 +97,12 @@ static ssize_t ath10k_dbg_sta_write_addba(struct file *file, buf[sizeof(buf) - 1] = '\0'; ret = sscanf(buf, "%u %u", &tid, &buf_size); - if (ret != 2) { - ath10k_warn(ar, "ex: echo >addba\n"); + if (ret != 2) 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); + if (tid > HTT_DATA_TX_EXT_TID_MGMT - 2) return -EINVAL; - } mutex_lock(&ar->conf_mutex); if ((ar->state != ATH10K_STATE_ON) ||