Closed jychen0611 closed 3 months ago
In the future, we may be able to introduce device coordinate parameters to calculate the RSSI value in free space in conjunction with transmit power.
Also, you should avoid using "iwconfig," which is deprecated. Use "iw" command for consistency.
I'm currently facing an problem when using sudo iw dev vw0 set txpower fixed 1000
The wdev
is NULL.
[ 1623.934439] wdev: 0000000000000000, vif: 0000000000000000
[ 1623.934447] wdev is NULL
Thus, I tried using wiphy
to obtain vif
, and it worked. :+1: :+1:
I found that the current set_tx_power function in Linux does not use the wdev
parameter either.
Could this be related to the changes between iwconfig
and iw
?
I found that the function definition didn't use wdev
before v3.7.10.
In v3.8-rc1, wdev
was added to the function definition.
int (*set_tx_power)(struct wiphy* wiphy, enum nl80211_tx_power_setting type, int mbm);
cfg80211: allow per interface TX power setting
The TX power setting is currently per wiphy (hardware device) but with multi-channel capabilities that doesn't make much sense any more.
Allow drivers (and mac80211) to advertise support for per-interface TX power configuration. When the TX power is configured for the wiphy, the wdev will be NULL and the driver can still handle that, but when a wdev is given the TX power can be set only for that wdev now.
Signed-off-by: Johannes Berg johannes.berg@intel.com
int (*set_tx_power)(struct wiphy* wiphy, struct wireless_dev* wdev, enum nl80211_tx_power_setting type, int mbm);
mwifiex: add a cfg80211 .get_tx_power operation callback
The mwifiex driver implements a cfg80211 .set_tx_power operation handler but doesn't have the inverse .get_tx_power callback.
This not only has the effect that the Tx power can't be reported to user space tools such as iwconfig and iwlist but also that the wireless core prints a warning when a new wiphy is created due an cfg80211 operation being implemented without its counterpart.
After this patch, the Tx power is properly reported to user-space tools: $ iwlist mlan0 txpower mlan0 unknown transmit-power information. Current Tx-Power=13 dBm (19 mW)
If this pull request is ready for reviewing, use git rebase -i
to squash and refine the git commit message. Then, request the reviewers via GitHub web page.
Thank @jychen0611 for contributing!
Add
tx_power
to the virtual interface to describe the device's transmit power.Implement
vwifi_set_tx_power
andvwifi_get_tx_power
to correspond toset_tx_power
andget_tx_power
in cfg80211_ops, respectively.vwifi_set_tx_power
can set the device's transmit power, whilevwifi_get_tx_power
can retrieve the transmit power information.The transmit power can be set using the iwconfig vwn txpower command.