Search Linux Wireless

Re: [PATCH v2 6/8] ath10k: add support to send addba request

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Rajkumar Manoharan <rmanohar@xxxxxxxxxxxxxxxx> 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 <rmanohar@xxxxxxxxxxxxxxxx>

[...]

> +	ret = sscanf(buf, "%u %u", &tid, &buf_size);
> +	if (ret != 2) {
> +		ath10k_warn(ar, "ex: echo <tid> <buffer size> >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 <tid> <buffer size> >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) ||

-- 
Kalle Valo
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux