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: 5609601 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.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 932139F2ED for ; Mon, 12 Jan 2015 11:43:02 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C992B2061A for ; Mon, 12 Jan 2015 11:43:01 +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 F24CC205E4 for ; Mon, 12 Jan 2015 11:43:00 +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 1YAdOb-0004xA-7w; Mon, 12 Jan 2015 11:42:57 +0000 Received: from wolverine01.qualcomm.com ([199.106.114.254]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1YAdOY-0004kt-6j for ath10k@lists.infradead.org; Mon, 12 Jan 2015 11:42:54 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=qca.qualcomm.com; i=@qca.qualcomm.com; q=dns/txt; s=qcdkim; t=1421062974; x=1452598974; h=from:to:cc:subject:references:date:in-reply-to: message-id:mime-version; bh=iHF5q8y+KviRbMIUBOXP5uLQ+ggUf0fbX1NvubapkFo=; b=CUcM0BlAsTZC1EU76TxhTGGMPeuvZ7dgUcYfYBGRXQYdbz0jD0tALmQY t3eNnVRx4cW+y9wPe2fbwTcQyoYybkgDL47ETmDzx9dDlV0qysyhz3Jmj t+1dd11W7581JYvtaEf6WGFmj2YiB5SBgqufkP/Sv1YFqohxl+pe7YLRL k=; X-IronPort-AV: E=McAfee;i="5600,1067,7678"; a="97734123" Received: from ironmsg02-lv.qualcomm.com ([10.47.202.183]) by wolverine01.qualcomm.com with ESMTP; 12 Jan 2015 03:42:31 -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 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) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150112_034254_424193_B1BD6F76 X-CRM114-Status: GOOD ( 11.06 ) X-Spam-Score: -5.1 (-----) Cc: linux-wireless@vger.kernel.org, ath10k@lists.infradead.org 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 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) ||