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>
This commit is contained in:
Johannes Berg
2012-10-24 10:17:18 +02:00
parent 71fe96bf9d
commit c8442118ad
11 changed files with 56 additions and 32 deletions

View File

@@ -476,21 +476,22 @@ rdev_set_wiphy_params(struct cfg80211_registered_device *rdev, u32 changed)
}
static inline int rdev_set_tx_power(struct cfg80211_registered_device *rdev,
struct wireless_dev *wdev,
enum nl80211_tx_power_setting type, int mbm)
{
int ret;
trace_rdev_set_tx_power(&rdev->wiphy, type, mbm);
ret = rdev->ops->set_tx_power(&rdev->wiphy, type, mbm);
trace_rdev_set_tx_power(&rdev->wiphy, wdev, type, mbm);
ret = rdev->ops->set_tx_power(&rdev->wiphy, wdev, type, mbm);
trace_rdev_return_int(&rdev->wiphy, ret);
return ret;
}
static inline int rdev_get_tx_power(struct cfg80211_registered_device *rdev,
int *dbm)
struct wireless_dev *wdev, int *dbm)
{
int ret;
trace_rdev_get_tx_power(&rdev->wiphy);
ret = rdev->ops->get_tx_power(&rdev->wiphy, dbm);
trace_rdev_get_tx_power(&rdev->wiphy, wdev);
ret = rdev->ops->get_tx_power(&rdev->wiphy, wdev, dbm);
trace_rdev_return_int_int(&rdev->wiphy, ret, *dbm);
return ret;
}