diff options
Diffstat (limited to 'net/mac80211/cfg.c')
-rw-r--r-- | net/mac80211/cfg.c | 25 |
1 files changed, 11 insertions, 14 deletions
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c index ed8c9f5be94f..9eb02a340889 100644 --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c | |||
@@ -413,9 +413,6 @@ static int ieee80211_dump_survey(struct wiphy *wiphy, struct net_device *dev, | |||
413 | { | 413 | { |
414 | struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr); | 414 | struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr); |
415 | 415 | ||
416 | if (!local->ops->get_survey) | ||
417 | return -EOPNOTSUPP; | ||
418 | |||
419 | return drv_get_survey(local, idx, survey); | 416 | return drv_get_survey(local, idx, survey); |
420 | } | 417 | } |
421 | 418 | ||
@@ -1329,28 +1326,28 @@ static int ieee80211_set_wiphy_params(struct wiphy *wiphy, u32 changed) | |||
1329 | } | 1326 | } |
1330 | 1327 | ||
1331 | static int ieee80211_set_tx_power(struct wiphy *wiphy, | 1328 | static int ieee80211_set_tx_power(struct wiphy *wiphy, |
1332 | enum tx_power_setting type, int dbm) | 1329 | enum nl80211_tx_power_setting type, int mbm) |
1333 | { | 1330 | { |
1334 | struct ieee80211_local *local = wiphy_priv(wiphy); | 1331 | struct ieee80211_local *local = wiphy_priv(wiphy); |
1335 | struct ieee80211_channel *chan = local->hw.conf.channel; | 1332 | struct ieee80211_channel *chan = local->hw.conf.channel; |
1336 | u32 changes = 0; | 1333 | u32 changes = 0; |
1337 | 1334 | ||
1338 | switch (type) { | 1335 | switch (type) { |
1339 | case TX_POWER_AUTOMATIC: | 1336 | case NL80211_TX_POWER_AUTOMATIC: |
1340 | local->user_power_level = -1; | 1337 | local->user_power_level = -1; |
1341 | break; | 1338 | break; |
1342 | case TX_POWER_LIMITED: | 1339 | case NL80211_TX_POWER_LIMITED: |
1343 | if (dbm < 0) | 1340 | if (mbm < 0 || (mbm % 100)) |
1344 | return -EINVAL; | 1341 | return -EOPNOTSUPP; |
1345 | local->user_power_level = dbm; | 1342 | local->user_power_level = MBM_TO_DBM(mbm); |
1346 | break; | 1343 | break; |
1347 | case TX_POWER_FIXED: | 1344 | case NL80211_TX_POWER_FIXED: |
1348 | if (dbm < 0) | 1345 | if (mbm < 0 || (mbm % 100)) |
1349 | return -EINVAL; | 1346 | return -EOPNOTSUPP; |
1350 | /* TODO: move to cfg80211 when it knows the channel */ | 1347 | /* TODO: move to cfg80211 when it knows the channel */ |
1351 | if (dbm > chan->max_power) | 1348 | if (MBM_TO_DBM(mbm) > chan->max_power) |
1352 | return -EINVAL; | 1349 | return -EINVAL; |
1353 | local->user_power_level = dbm; | 1350 | local->user_power_level = MBM_TO_DBM(mbm); |
1354 | break; | 1351 | break; |
1355 | } | 1352 | } |
1356 | 1353 | ||