aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/rndis_wlan.c
diff options
context:
space:
mode:
authorJuuso Oikarinen <juuso.oikarinen@nokia.com>2010-06-23 05:12:37 -0400
committerJohn W. Linville <linville@tuxdriver.com>2010-06-24 15:42:33 -0400
commitfa61cf70a6ae1089e459e4b59b2e8d8e90d8535e (patch)
tree1bd81709faaa15fb207de7db4df1ceed96374208 /drivers/net/wireless/rndis_wlan.c
parenta185045c8da1ec6627236b4ade0d949b15da43b3 (diff)
cfg80211/mac80211: Update set_tx_power to use mBm instead of dBm units
In preparation for a TX power setting interface in the nl80211, change the .set_tx_power function to use mBm units instead of dBm for greater accuracy and smaller power levels. Also, already in advance move the tx_power_setting enumeration to nl80211. This change affects the .tx_set_power function prototype. As a result, the corresponding changes are needed to modules using it. These are mac80211, iwmc3200wifi and rndis_wlan. Cc: Samuel Ortiz <samuel.ortiz@intel.com> Cc: Jussi Kivilinna <jussi.kivilinna@mbnet.fi> Signed-off-by: Juuso Oikarinen <juuso.oikarinen@nokia.com> Acked-by: Samuel Ortiz <samuel.ortiz@intel.com> Acked-by: Jussi Kivilinna <jussi.kivilinna@mbnet.fi> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/rndis_wlan.c')
-rw-r--r--drivers/net/wireless/rndis_wlan.c20
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
521static int rndis_set_wiphy_params(struct wiphy *wiphy, u32 changed); 521static int rndis_set_wiphy_params(struct wiphy *wiphy, u32 changed);
522 522
523static int rndis_set_tx_power(struct wiphy *wiphy, enum tx_power_setting type, 523static int rndis_set_tx_power(struct wiphy *wiphy,
524 int dbm); 524 enum nl80211_tx_power_setting type,
525 int mbm);
525static int rndis_get_tx_power(struct wiphy *wiphy, int *dbm); 526static int rndis_get_tx_power(struct wiphy *wiphy, int *dbm);
526 527
527static int rndis_connect(struct wiphy *wiphy, struct net_device *dev, 528static 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
1859static int rndis_set_tx_power(struct wiphy *wiphy, enum tx_power_setting type, 1860static 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