@@ -1405,6 +1405,7 @@ static int ath6kl_cfg80211_set_wiphy_params(struct wiphy *wiphy, u8 radio_id, u3
static int ath6kl_cfg80211_set_txpower(struct wiphy *wiphy,
struct wireless_dev *wdev,
+ u8 radio_id,
enum nl80211_tx_power_setting type,
int mbm)
{
@@ -2624,7 +2624,7 @@ brcmf_cfg80211_disconnect(struct wiphy *wiphy, struct net_device *ndev,
}
static s32
-brcmf_cfg80211_set_tx_power(struct wiphy *wiphy, struct wireless_dev *wdev,
+brcmf_cfg80211_set_tx_power(struct wiphy *wiphy, struct wireless_dev *wdev, u8 radio_id,
enum nl80211_tx_power_setting type, s32 mbm)
{
struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
@@ -374,7 +374,7 @@ mwifiex_cfg80211_cancel_remain_on_channel(struct wiphy *wiphy,
*/
static int
mwifiex_cfg80211_set_tx_power(struct wiphy *wiphy,
- struct wireless_dev *wdev,
+ struct wireless_dev *wdev, u8 radio_id,
enum nl80211_tx_power_setting type,
int mbm)
{
@@ -1636,7 +1636,7 @@ static void wilc_set_wakeup(struct wiphy *wiphy, bool enabled)
srcu_read_unlock(&wl->srcu, srcu_idx);
}
-static int set_tx_power(struct wiphy *wiphy, struct wireless_dev *wdev,
+static int set_tx_power(struct wiphy *wiphy, struct wireless_dev *wdev, u8 radio_id,
enum nl80211_tx_power_setting type, int mbm)
{
int ret;
@@ -894,7 +894,7 @@ static int qtnf_get_tx_power(struct wiphy *wiphy, struct wireless_dev *wdev,
}
static int qtnf_set_tx_power(struct wiphy *wiphy, struct wireless_dev *wdev,
- enum nl80211_tx_power_setting type, int mbm)
+ u8 radio_id, enum nl80211_tx_power_setting type, int mbm)
{
struct qtnf_vif *vif;
int ret;
@@ -1795,7 +1795,7 @@ static int cfg80211_rtw_disconnect(struct wiphy *wiphy, struct net_device *ndev,
}
static int cfg80211_rtw_set_txpower(struct wiphy *wiphy,
- struct wireless_dev *wdev,
+ struct wireless_dev *wdev, u8 radio_id,
enum nl80211_tx_power_setting type, int mbm)
{
return 0;
@@ -4731,7 +4731,7 @@ struct cfg80211_ops {
int (*set_wiphy_params)(struct wiphy *wiphy, u8 radio_id, u32 changed);
int (*set_tx_power)(struct wiphy *wiphy, struct wireless_dev *wdev,
- enum nl80211_tx_power_setting type, int mbm);
+ u8 radio_id, enum nl80211_tx_power_setting type, int mbm);
int (*get_tx_power)(struct wiphy *wiphy, struct wireless_dev *wdev,
unsigned int link_id, int *dbm);
@@ -3068,7 +3068,7 @@ static int ieee80211_set_wiphy_params(struct wiphy *wiphy, u8 radio_id, u32 chan
}
static int ieee80211_set_tx_power(struct wiphy *wiphy,
- struct wireless_dev *wdev,
+ struct wireless_dev *wdev, u8 radio_id,
enum nl80211_tx_power_setting type, int mbm)
{
struct ieee80211_local *local = wiphy_priv(wiphy);
@@ -3758,7 +3758,7 @@ static int nl80211_set_wiphy(struct sk_buff *skb, struct genl_info *info)
mbm = nla_get_u32(info->attrs[idx]);
}
- result = rdev_set_tx_power(rdev, txp_wdev, type, mbm);
+ result = rdev_set_tx_power(rdev, txp_wdev, radio_id, type, mbm);
if (result)
return result;
}
@@ -589,12 +589,12 @@ rdev_set_wiphy_params(struct cfg80211_registered_device *rdev, u8 radio_id, u32
}
static inline int rdev_set_tx_power(struct cfg80211_registered_device *rdev,
- struct wireless_dev *wdev,
+ struct wireless_dev *wdev, u8 radio_id,
enum nl80211_tx_power_setting type, int mbm)
{
int ret;
- trace_rdev_set_tx_power(&rdev->wiphy, wdev, type, mbm);
- ret = rdev->ops->set_tx_power(&rdev->wiphy, wdev, type, mbm);
+ trace_rdev_set_tx_power(&rdev->wiphy, wdev, radio_id, type, mbm);
+ ret = rdev->ops->set_tx_power(&rdev->wiphy, wdev, radio_id, type, mbm);
trace_rdev_return_int(&rdev->wiphy, ret);
return ret;
}
@@ -1716,23 +1716,26 @@ DEFINE_EVENT(wiphy_wdev_link_evt, rdev_get_tx_power,
);
TRACE_EVENT(rdev_set_tx_power,
- TP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev,
+ TP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev, u8 radio_id,
enum nl80211_tx_power_setting type, int mbm),
- TP_ARGS(wiphy, wdev, type, mbm),
+ TP_ARGS(wiphy, wdev, radio_id, type, mbm),
TP_STRUCT__entry(
WIPHY_ENTRY
WDEV_ENTRY
+ __field(u8, radio_id)
__field(enum nl80211_tx_power_setting, type)
__field(int, mbm)
),
TP_fast_assign(
WIPHY_ASSIGN;
WDEV_ASSIGN;
+ __entry->radio_id = radio_id;
__entry->type = type;
__entry->mbm = mbm;
),
- TP_printk(WIPHY_PR_FMT ", " WDEV_PR_FMT ", type: %u, mbm: %d",
- WIPHY_PR_ARG, WDEV_PR_ARG,__entry->type, __entry->mbm)
+ TP_printk(WIPHY_PR_FMT ", " WDEV_PR_FMT ", radio_id: %u, type: %u, mbm: %d",
+ WIPHY_PR_ARG, WDEV_PR_ARG, __entry->radio_id, __entry->type,
+ __entry->mbm)
);
TRACE_EVENT(rdev_return_int_int,
@@ -892,7 +892,8 @@ static int cfg80211_wext_siwtxpower(struct net_device *dev,
guard(wiphy)(&rdev->wiphy);
- return rdev_set_tx_power(rdev, wdev, type, DBM_TO_MBM(dbm));
+ return rdev_set_tx_power(rdev, wdev, NL80211_WIPHY_RADIO_ID_MAX, type,
+ DBM_TO_MBM(dbm));
}
static int cfg80211_wext_giwtxpower(struct net_device *dev,
A wiphy can have multiple radios(wiphy.n_radio) combined in it and each radio is identified by radio index (radio_id). When set tx power is done without a valid wdev then it is a radio level configuration but currently it is being considered at wiphy level since radio identifier is not present in nl80211_set_wiphy(). Pass the radio id that is obtained via NL80211_ATTR_WIPHY_RADIO_INDEX as an argument to set_tx_power op to indicate the underlying drivers about the radio of the wiphy to which the configuration should be applied. When NL80211_ATTR_WIPHY_RADIO_INDEX is not passed or the wiphy is a non-multi radio wiphy, radio id value of NL80211_WIPHY_RADIO_ID_MAX(255) is passed in which case drivers should apply the configuration to all radios. Signed-off-by: Rameshkumar Sundaram <quic_ramess@quicinc.com> --- drivers/net/wireless/ath/ath6kl/cfg80211.c | 1 + .../wireless/broadcom/brcm80211/brcmfmac/cfg80211.c | 2 +- drivers/net/wireless/marvell/mwifiex/cfg80211.c | 2 +- drivers/net/wireless/microchip/wilc1000/cfg80211.c | 2 +- drivers/net/wireless/quantenna/qtnfmac/cfg80211.c | 2 +- drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c | 2 +- include/net/cfg80211.h | 2 +- net/mac80211/cfg.c | 2 +- net/wireless/nl80211.c | 2 +- net/wireless/rdev-ops.h | 6 +++--- net/wireless/trace.h | 11 +++++++---- net/wireless/wext-compat.c | 3 ++- 12 files changed, 21 insertions(+), 16 deletions(-)