On 10/24/2012 03:13 AM, Johannes Berg wrote:
From: Johannes Berg <johannes.berg@xxxxxxxxx> The TX power setting is currently per wiphy (hardware device) but with multi-channel capabilities that doesn't make much sense any more. Unfortunately, by making it per interface, we loose some backward compatibility with userspace, but that isn't a big issue since userspace must already accept that not all drivers support TX power setting, and mostly uses a netdev to identify the hardware anyway.
@@ -1971,6 +1971,7 @@ static int ieee80211_set_wiphy_params(struct wiphy *wiphy, u32 changed) } static int ieee80211_set_tx_power(struct wiphy *wiphy, + struct wireless_dev *wdev, enum nl80211_tx_power_setting type, int mbm) { struct ieee80211_local *local = wiphy_priv(wiphy); @@ -2005,7 +2006,9 @@ static int ieee80211_set_tx_power(struct wiphy *wiphy, return 0; } -static int ieee80211_get_tx_power(struct wiphy *wiphy, int *dbm) +static int ieee80211_get_tx_power(struct wiphy *wiphy, + struct wireless_dev *wdev, + int *dbm) { struct ieee80211_local *local = wiphy_priv(wiphy);
Do we really set mbm and read back dbm?
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index 879ca62..24175e2 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c @@ -1588,6 +1588,11 @@ static int nl80211_set_wiphy(struct sk_buff *skb, struct genl_info *info) enum nl80211_tx_power_setting type; int idx, mbm = 0; + if (!wdev) { + result = -EOPNOTSUPP; + goto bad_res; + }
I guess this is the part that breaks backwards compat when trying to set wiphy? If it does stay like this, maybe add a WARN_ON_ONCE that tells users to fix their user-space? Too bad there is not an -EUSEVIFINSTEAD :P Thanks, Ben -- Ben Greear <greearb@xxxxxxxxxxxxxxx> Candela Technologies Inc http://www.candelatech.com -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html