Search Linux Wireless

Re: [PATCH v2 1/2] nl80211/cfg80211: add scan channel times to scan command

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

 



On Wed, 2012-05-30 at 18:59 +0300, Victor Goldenshtein wrote:

> +	if (info->attrs[NL80211_ATTR_SCAN_MIN_CH_TIME]) {
> +		request->min_ch_time =
> +			nla_get_u32(info->attrs[NL80211_ATTR_SCAN_MIN_CH_TIME]);
> +	}
> +	if (info->attrs[NL80211_ATTR_SCAN_MAX_CH_TIME]) {
> +		request->max_ch_time =
> +			nla_get_u32(info->attrs[NL80211_ATTR_SCAN_MAX_CH_TIME]);
> +		if (request->min_ch_time > request->max_ch_time)
> +			return -EINVAL;
> +	}
> +	if (info->attrs[NL80211_ATTR_SCAN_PSV_MIN_CH_TIME]) {
> +		request->min_passive_ch_time =
> +		    nla_get_u32(info->attrs[NL80211_ATTR_SCAN_PSV_MIN_CH_TIME]);
> +	}
> +	if (info->attrs[NL80211_ATTR_SCAN_PSV_MAX_CH_TIME]) {
> +		request->max_passive_ch_time =
> +		    nla_get_u32(info->attrs[NL80211_ATTR_SCAN_PSV_MAX_CH_TIME]);
> +		if (request->min_passive_ch_time > request->max_passive_ch_time)
> +			return -EINVAL;
> +	}

All of this should probably reject 0 values since they're not valid and
will be overridden -- but to get defaults you can just as well leave it
out completely.

Also, I think you should be forced to specify both min and max if you're
going to specify any at all, because otherwise you can specify a max
that is smaller than the default min and get things completely confused.

johannes

--
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