Search Linux Wireless

mac80211_hwsim : unsigned int for signal in netlink info frames

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

 



I'm working on my code base and I was surprised by the fact, that the
type of the received signal strength for frames received via Netlink is
u32, but the actual struct ieee80211_rx_status.signal uses an s8 for signal.

I actually refer to this line:
https://elixir.bootlin.com/linux/v4.20-rc4/source/drivers/net/wireless/mac80211_hwsim.c#L3250

As we use the signal measurement in dBm (see
https://elixir.bootlin.com/linux/v4.20-rc4/source/drivers/net/wireless/mac80211_hwsim.c#L2764),
negative dBm values are totally reasonable as received signal strength.
Moreover, I don't really know, whether mac80211 or respectively minstrel
can do reasonable work with positive values.

Was this done intentionally ?

On the other hand this line
https://elixir.bootlin.com/linux/v4.20-rc4/source/drivers/net/wireless/mac80211_hwsim.c#L1276
inconsistently uses a negative value in the case of not using
netlink/wmediumd, which is a decent value.

I think it is not possible to easily switch to another type (e.g. s32 or
even s8) for the netlink attribute without breaking things, but somebody
might correct me.

We could do the hack and always negate the value of signal, since
positive signal strength values in dBm are practically impossible over
the air. Or I could simply use the corresponding u32 value, which will
map silently to the "right" negative s8 value, but it doesn't feel right :-)

Any suggestions?

kind regards

Benjamin Beichler

-- 
M.Sc. Benjamin Beichler

Universität Rostock, Fakultät für Informatik und Elektrotechnik
Institut für Angewandte Mikroelektronik und Datentechnik

University of Rostock, Department of CS and EE
Institute of Applied Microelectronics and CE

Richard-Wagner-Straße 31
18119 Rostock
Deutschland/Germany

phone: +49 (0) 381 498 - 7278
email: Benjamin.Beichler@xxxxxxxxxxxxxx
www: http://www.imd.uni-rostock.de/







[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