Search Linux Wireless

Re: [PATCH 1/3] cfg80211: Add support to set tx power for a station associated

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

 



On Thu, 2019-01-17 at 16:52 +0530, Balaji Pothunoori wrote:
> 
> +	s16 txpwr;
> +	enum nl80211_tx_power_setting type;

you should probably call this txpwr_type, or do something like

struct {
	s16 power;
	enum ... type;
} txpwr;


> +	[NL80211_ATTR_STA_TX_POWER_SETTING] = { .type = NLA_U8 },

That should use NLA_POLICY_RANGE()

> +	[NL80211_ATTR_STA_TX_POWER] = { .type = NLA_S16 },
 

> +		params->type = nla_get_u32(info->attrs[idx]);
> +
> +		if (params->type == NL80211_TX_POWER_LIMITED) {
> +			idx = NL80211_ATTR_STA_TX_POWER;
> +			params->txpwr = nla_get_u32(info->attrs[idx]);

You cannot use nla_get_u32 with U8/S16 attributes, use the correct
corresponding helper.

johannes




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

  Powered by Linux