aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJussi Kivilinna <jussi.kivilinna@mbnet.fi>2009-05-22 10:40:12 -0400
committerJohn W. Linville <linville@tuxdriver.com>2009-05-22 14:06:03 -0400
commit9656e85ba24a9814f1705e0e3639281d15d6a419 (patch)
tree2f84f565f91bb37c8924680545bdbddb7fba168a
parent59620e9fd631703ecdc7a6d304231b45560b8d26 (diff)
rndis_wlan: remove CAP_SUPPORT_TXPOWER/OID_802_11_TX_POWER_LEVEL code
BCM4320 doesn't support OID_802_11_TX_POWER_LEVEL (chip implements the command but setting value has no effect and getting txpower value always returns 0xff, full power). So remove the code for cleanup. Signed-off-by: Jussi Kivilinna <jussi.kivilinna@mbnet.fi> Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--drivers/net/wireless/rndis_wlan.c46
1 files changed, 8 insertions, 38 deletions
diff --git a/drivers/net/wireless/rndis_wlan.c b/drivers/net/wireless/rndis_wlan.c
index addd7a553acc..4b3e04699a67 100644
--- a/drivers/net/wireless/rndis_wlan.c
+++ b/drivers/net/wireless/rndis_wlan.c
@@ -2,7 +2,7 @@
2 * Driver for RNDIS based wireless USB devices. 2 * Driver for RNDIS based wireless USB devices.
3 * 3 *
4 * Copyright (C) 2007 by Bjorge Dijkstra <bjd@jooz.net> 4 * Copyright (C) 2007 by Bjorge Dijkstra <bjd@jooz.net>
5 * Copyright (C) 2008 by Jussi Kivilinna <jussi.kivilinna@mbnet.fi> 5 * Copyright (C) 2008-2009 by Jussi Kivilinna <jussi.kivilinna@mbnet.fi>
6 * 6 *
7 * This program is free software; you can redistribute it and/or modify 7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by 8 * it under the terms of the GNU General Public License as published by
@@ -309,7 +309,6 @@ enum wpa_key_mgmt { KEY_MGMT_802_1X, KEY_MGMT_PSK, KEY_MGMT_NONE,
309#define CAP_MODE_80211B 2 309#define CAP_MODE_80211B 2
310#define CAP_MODE_80211G 4 310#define CAP_MODE_80211G 4
311#define CAP_MODE_MASK 7 311#define CAP_MODE_MASK 7
312#define CAP_SUPPORT_TXPOWER 8
313 312
314#define WORK_LINK_UP (1<<0) 313#define WORK_LINK_UP (1<<0)
315#define WORK_LINK_DOWN (1<<1) 314#define WORK_LINK_DOWN (1<<1)
@@ -1849,18 +1848,10 @@ static int rndis_iw_get_txpower(struct net_device *dev,
1849 struct usbnet *usbdev = netdev_priv(dev); 1848 struct usbnet *usbdev = netdev_priv(dev);
1850 struct rndis_wext_private *priv = get_rndis_wext_priv(usbdev); 1849 struct rndis_wext_private *priv = get_rndis_wext_priv(usbdev);
1851 __le32 tx_power; 1850 __le32 tx_power;
1852 int ret = 0, len;
1853 1851
1854 if (priv->radio_on) { 1852 if (priv->radio_on) {
1855 if (priv->caps & CAP_SUPPORT_TXPOWER) { 1853 /* fake since changing tx_power (by userlevel) not supported */
1856 len = sizeof(tx_power); 1854 tx_power = cpu_to_le32(get_bcm4320_power(priv));
1857 ret = rndis_query_oid(usbdev, OID_802_11_TX_POWER_LEVEL,
1858 &tx_power, &len);
1859 if (ret != 0)
1860 return ret;
1861 } else
1862 /* fake incase not supported */
1863 tx_power = cpu_to_le32(get_bcm4320_power(priv));
1864 1855
1865 wrqu->txpower.flags = IW_TXPOW_MWATT; 1856 wrqu->txpower.flags = IW_TXPOW_MWATT;
1866 wrqu->txpower.value = le32_to_cpu(tx_power); 1857 wrqu->txpower.value = le32_to_cpu(tx_power);
@@ -1873,7 +1864,7 @@ static int rndis_iw_get_txpower(struct net_device *dev,
1873 1864
1874 devdbg(usbdev, "SIOCGIWTXPOW: %d", wrqu->txpower.value); 1865 devdbg(usbdev, "SIOCGIWTXPOW: %d", wrqu->txpower.value);
1875 1866
1876 return ret; 1867 return 0;
1877} 1868}
1878 1869
1879 1870
@@ -1883,7 +1874,6 @@ static int rndis_iw_set_txpower(struct net_device *dev,
1883 struct usbnet *usbdev = netdev_priv(dev); 1874 struct usbnet *usbdev = netdev_priv(dev);
1884 struct rndis_wext_private *priv = get_rndis_wext_priv(usbdev); 1875 struct rndis_wext_private *priv = get_rndis_wext_priv(usbdev);
1885 __le32 tx_power = 0; 1876 __le32 tx_power = 0;
1886 int ret = 0;
1887 1877
1888 if (!wrqu->txpower.disabled) { 1878 if (!wrqu->txpower.disabled) {
1889 if (wrqu->txpower.flags == IW_TXPOW_MWATT) 1879 if (wrqu->txpower.flags == IW_TXPOW_MWATT)
@@ -1906,22 +1896,10 @@ static int rndis_iw_set_txpower(struct net_device *dev,
1906 devdbg(usbdev, "SIOCSIWTXPOW: %d", le32_to_cpu(tx_power)); 1896 devdbg(usbdev, "SIOCSIWTXPOW: %d", le32_to_cpu(tx_power));
1907 1897
1908 if (le32_to_cpu(tx_power) != 0) { 1898 if (le32_to_cpu(tx_power) != 0) {
1909 if (priv->caps & CAP_SUPPORT_TXPOWER) { 1899 /* txpower unsupported, just turn radio on */
1910 /* turn radio on first */ 1900 if (!priv->radio_on)
1911 if (!priv->radio_on) 1901 return disassociate(usbdev, 1);
1912 disassociate(usbdev, 1); 1902 return 0; /* all ready on */
1913
1914 ret = rndis_set_oid(usbdev, OID_802_11_TX_POWER_LEVEL,
1915 &tx_power, sizeof(tx_power));
1916 if (ret != 0)
1917 ret = -EOPNOTSUPP;
1918 return ret;
1919 } else {
1920 /* txpower unsupported, just turn radio on */
1921 if (!priv->radio_on)
1922 return disassociate(usbdev, 1);
1923 return 0; /* all ready on */
1924 }
1925 } 1903 }
1926 1904
1927 /* tx_power == 0, turn off radio */ 1905 /* tx_power == 0, turn off radio */
@@ -2130,16 +2108,8 @@ static int rndis_wext_get_caps(struct usbnet *usbdev)
2130 __le32 items[8]; 2108 __le32 items[8];
2131 } networks_supported; 2109 } networks_supported;
2132 int len, retval, i, n; 2110 int len, retval, i, n;
2133 __le32 tx_power;
2134 struct rndis_wext_private *priv = get_rndis_wext_priv(usbdev); 2111 struct rndis_wext_private *priv = get_rndis_wext_priv(usbdev);
2135 2112
2136 /* determine if supports setting txpower */
2137 len = sizeof(tx_power);
2138 retval = rndis_query_oid(usbdev, OID_802_11_TX_POWER_LEVEL, &tx_power,
2139 &len);
2140 if (retval == 0 && le32_to_cpu(tx_power) != 0xFF)
2141 priv->caps |= CAP_SUPPORT_TXPOWER;
2142
2143 /* determine supported modes */ 2113 /* determine supported modes */
2144 len = sizeof(networks_supported); 2114 len = sizeof(networks_supported);
2145 retval = rndis_query_oid(usbdev, OID_802_11_NETWORK_TYPES_SUPPORTED, 2115 retval = rndis_query_oid(usbdev, OID_802_11_NETWORK_TYPES_SUPPORTED,