diff options
Diffstat (limited to 'drivers/net/wireless/rndis_wlan.c')
-rw-r--r-- | drivers/net/wireless/rndis_wlan.c | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/drivers/net/wireless/rndis_wlan.c b/drivers/net/wireless/rndis_wlan.c index 4102cca54882..5e26edb57d82 100644 --- a/drivers/net/wireless/rndis_wlan.c +++ b/drivers/net/wireless/rndis_wlan.c | |||
@@ -520,8 +520,9 @@ static int rndis_scan(struct wiphy *wiphy, struct net_device *dev, | |||
520 | 520 | ||
521 | static int rndis_set_wiphy_params(struct wiphy *wiphy, u32 changed); | 521 | static int rndis_set_wiphy_params(struct wiphy *wiphy, u32 changed); |
522 | 522 | ||
523 | static int rndis_set_tx_power(struct wiphy *wiphy, enum tx_power_setting type, | 523 | static int rndis_set_tx_power(struct wiphy *wiphy, |
524 | int dbm); | 524 | enum nl80211_tx_power_setting type, |
525 | int mbm); | ||
525 | static int rndis_get_tx_power(struct wiphy *wiphy, int *dbm); | 526 | static int rndis_get_tx_power(struct wiphy *wiphy, int *dbm); |
526 | 527 | ||
527 | static int rndis_connect(struct wiphy *wiphy, struct net_device *dev, | 528 | static int rndis_connect(struct wiphy *wiphy, struct net_device *dev, |
@@ -1856,20 +1857,25 @@ static int rndis_set_wiphy_params(struct wiphy *wiphy, u32 changed) | |||
1856 | return 0; | 1857 | return 0; |
1857 | } | 1858 | } |
1858 | 1859 | ||
1859 | static int rndis_set_tx_power(struct wiphy *wiphy, enum tx_power_setting type, | 1860 | static int rndis_set_tx_power(struct wiphy *wiphy, |
1860 | int dbm) | 1861 | enum nl80211_tx_power_setting type, |
1862 | int mbm) | ||
1861 | { | 1863 | { |
1862 | struct rndis_wlan_private *priv = wiphy_priv(wiphy); | 1864 | struct rndis_wlan_private *priv = wiphy_priv(wiphy); |
1863 | struct usbnet *usbdev = priv->usbdev; | 1865 | struct usbnet *usbdev = priv->usbdev; |
1864 | 1866 | ||
1865 | netdev_dbg(usbdev->net, "%s(): type:0x%x dbm:%i\n", | 1867 | netdev_dbg(usbdev->net, "%s(): type:0x%x mbm:%i\n", |
1866 | __func__, type, dbm); | 1868 | __func__, type, mbm); |
1869 | |||
1870 | if (mbm < 0 || (mbm % 100)) | ||
1871 | return -ENOTSUPP; | ||
1867 | 1872 | ||
1868 | /* Device doesn't support changing txpower after initialization, only | 1873 | /* Device doesn't support changing txpower after initialization, only |
1869 | * turn off/on radio. Support 'auto' mode and setting same dBm that is | 1874 | * turn off/on radio. Support 'auto' mode and setting same dBm that is |
1870 | * currently used. | 1875 | * currently used. |
1871 | */ | 1876 | */ |
1872 | if (type == TX_POWER_AUTOMATIC || dbm == get_bcm4320_power_dbm(priv)) { | 1877 | if (type == NL80211_TX_POWER_AUTOMATIC || |
1878 | MBM_TO_DBM(mbm) == get_bcm4320_power_dbm(priv)) { | ||
1873 | if (!priv->radio_on) | 1879 | if (!priv->radio_on) |
1874 | disassociate(usbdev, true); /* turn on radio */ | 1880 | disassociate(usbdev, true); /* turn on radio */ |
1875 | 1881 | ||