diff options
author | David S. Miller <davem@davemloft.net> | 2010-07-01 20:34:14 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-07-01 20:34:14 -0400 |
commit | 05318bc905467237d4aa68a701f6e92a2b332218 (patch) | |
tree | 3b7577383bca50aeb442568aa16cf8f2167b8694 /net/wireless | |
parent | ea812ca1b06113597adcd8e70c0f84a413d97544 (diff) | |
parent | 88c1f4f6dffe66e2fed8e7e3276e091ee850bed0 (diff) |
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next-2.6
Conflicts:
drivers/net/wireless/libertas/host.h
Diffstat (limited to 'net/wireless')
-rw-r--r-- | net/wireless/core.c | 2 | ||||
-rw-r--r-- | net/wireless/nl80211.c | 31 | ||||
-rw-r--r-- | net/wireless/reg.c | 6 | ||||
-rw-r--r-- | net/wireless/reg.h | 2 | ||||
-rw-r--r-- | net/wireless/wext-compat.c | 10 |
5 files changed, 41 insertions, 10 deletions
diff --git a/net/wireless/core.c b/net/wireless/core.c index 37d0e0ab4432..47fcfd0eebc2 100644 --- a/net/wireless/core.c +++ b/net/wireless/core.c | |||
@@ -894,7 +894,7 @@ out_fail_pernet: | |||
894 | } | 894 | } |
895 | subsys_initcall(cfg80211_init); | 895 | subsys_initcall(cfg80211_init); |
896 | 896 | ||
897 | static void cfg80211_exit(void) | 897 | static void __exit cfg80211_exit(void) |
898 | { | 898 | { |
899 | debugfs_remove(ieee80211_debugfs_dir); | 899 | debugfs_remove(ieee80211_debugfs_dir); |
900 | nl80211_exit(); | 900 | nl80211_exit(); |
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index 6b41d15c4a05..85285b43d374 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c | |||
@@ -153,6 +153,9 @@ static const struct nla_policy nl80211_policy[NL80211_ATTR_MAX+1] = { | |||
153 | [NL80211_ATTR_CQM] = { .type = NLA_NESTED, }, | 153 | [NL80211_ATTR_CQM] = { .type = NLA_NESTED, }, |
154 | [NL80211_ATTR_LOCAL_STATE_CHANGE] = { .type = NLA_FLAG }, | 154 | [NL80211_ATTR_LOCAL_STATE_CHANGE] = { .type = NLA_FLAG }, |
155 | [NL80211_ATTR_AP_ISOLATE] = { .type = NLA_U8 }, | 155 | [NL80211_ATTR_AP_ISOLATE] = { .type = NLA_U8 }, |
156 | |||
157 | [NL80211_ATTR_WIPHY_TX_POWER_SETTING] = { .type = NLA_U32 }, | ||
158 | [NL80211_ATTR_WIPHY_TX_POWER_LEVEL] = { .type = NLA_U32 }, | ||
156 | }; | 159 | }; |
157 | 160 | ||
158 | /* policy for the attributes */ | 161 | /* policy for the attributes */ |
@@ -869,6 +872,34 @@ static int nl80211_set_wiphy(struct sk_buff *skb, struct genl_info *info) | |||
869 | goto bad_res; | 872 | goto bad_res; |
870 | } | 873 | } |
871 | 874 | ||
875 | if (info->attrs[NL80211_ATTR_WIPHY_TX_POWER_SETTING]) { | ||
876 | enum nl80211_tx_power_setting type; | ||
877 | int idx, mbm = 0; | ||
878 | |||
879 | if (!rdev->ops->set_tx_power) { | ||
880 | return -EOPNOTSUPP; | ||
881 | goto bad_res; | ||
882 | } | ||
883 | |||
884 | idx = NL80211_ATTR_WIPHY_TX_POWER_SETTING; | ||
885 | type = nla_get_u32(info->attrs[idx]); | ||
886 | |||
887 | if (!info->attrs[NL80211_ATTR_WIPHY_TX_POWER_LEVEL] && | ||
888 | (type != NL80211_TX_POWER_AUTOMATIC)) { | ||
889 | result = -EINVAL; | ||
890 | goto bad_res; | ||
891 | } | ||
892 | |||
893 | if (type != NL80211_TX_POWER_AUTOMATIC) { | ||
894 | idx = NL80211_ATTR_WIPHY_TX_POWER_LEVEL; | ||
895 | mbm = nla_get_u32(info->attrs[idx]); | ||
896 | } | ||
897 | |||
898 | result = rdev->ops->set_tx_power(&rdev->wiphy, type, mbm); | ||
899 | if (result) | ||
900 | goto bad_res; | ||
901 | } | ||
902 | |||
872 | changed = 0; | 903 | changed = 0; |
873 | 904 | ||
874 | if (info->attrs[NL80211_ATTR_WIPHY_RETRY_SHORT]) { | 905 | if (info->attrs[NL80211_ATTR_WIPHY_RETRY_SHORT]) { |
diff --git a/net/wireless/reg.c b/net/wireless/reg.c index 8f0d97dd3109..1ac2bdd46ecf 100644 --- a/net/wireless/reg.c +++ b/net/wireless/reg.c | |||
@@ -80,7 +80,7 @@ static const struct ieee80211_regdomain *country_ie_regdomain; | |||
80 | * - country_ie_regdomain | 80 | * - country_ie_regdomain |
81 | * - last_request | 81 | * - last_request |
82 | */ | 82 | */ |
83 | DEFINE_MUTEX(reg_mutex); | 83 | static DEFINE_MUTEX(reg_mutex); |
84 | #define assert_reg_lock() WARN_ON(!mutex_is_locked(®_mutex)) | 84 | #define assert_reg_lock() WARN_ON(!mutex_is_locked(®_mutex)) |
85 | 85 | ||
86 | /* Used to queue up regulatory hints */ | 86 | /* Used to queue up regulatory hints */ |
@@ -2630,7 +2630,7 @@ out: | |||
2630 | mutex_unlock(®_mutex); | 2630 | mutex_unlock(®_mutex); |
2631 | } | 2631 | } |
2632 | 2632 | ||
2633 | int regulatory_init(void) | 2633 | int __init regulatory_init(void) |
2634 | { | 2634 | { |
2635 | int err = 0; | 2635 | int err = 0; |
2636 | 2636 | ||
@@ -2676,7 +2676,7 @@ int regulatory_init(void) | |||
2676 | return 0; | 2676 | return 0; |
2677 | } | 2677 | } |
2678 | 2678 | ||
2679 | void regulatory_exit(void) | 2679 | void /* __init_or_exit */ regulatory_exit(void) |
2680 | { | 2680 | { |
2681 | struct regulatory_request *reg_request, *tmp; | 2681 | struct regulatory_request *reg_request, *tmp; |
2682 | struct reg_beacon *reg_beacon, *btmp; | 2682 | struct reg_beacon *reg_beacon, *btmp; |
diff --git a/net/wireless/reg.h b/net/wireless/reg.h index b26224a9f3bc..c4695d07af23 100644 --- a/net/wireless/reg.h +++ b/net/wireless/reg.h | |||
@@ -10,7 +10,7 @@ int regulatory_hint_user(const char *alpha2); | |||
10 | 10 | ||
11 | void reg_device_remove(struct wiphy *wiphy); | 11 | void reg_device_remove(struct wiphy *wiphy); |
12 | 12 | ||
13 | int regulatory_init(void); | 13 | int __init regulatory_init(void); |
14 | void regulatory_exit(void); | 14 | void regulatory_exit(void); |
15 | 15 | ||
16 | int set_regdom(const struct ieee80211_regdomain *rd); | 16 | int set_regdom(const struct ieee80211_regdomain *rd); |
diff --git a/net/wireless/wext-compat.c b/net/wireless/wext-compat.c index 96342993cf93..1ff1e9f49136 100644 --- a/net/wireless/wext-compat.c +++ b/net/wireless/wext-compat.c | |||
@@ -829,7 +829,7 @@ int cfg80211_wext_siwtxpower(struct net_device *dev, | |||
829 | { | 829 | { |
830 | struct wireless_dev *wdev = dev->ieee80211_ptr; | 830 | struct wireless_dev *wdev = dev->ieee80211_ptr; |
831 | struct cfg80211_registered_device *rdev = wiphy_to_dev(wdev->wiphy); | 831 | struct cfg80211_registered_device *rdev = wiphy_to_dev(wdev->wiphy); |
832 | enum tx_power_setting type; | 832 | enum nl80211_tx_power_setting type; |
833 | int dbm = 0; | 833 | int dbm = 0; |
834 | 834 | ||
835 | if ((data->txpower.flags & IW_TXPOW_TYPE) != IW_TXPOW_DBM) | 835 | if ((data->txpower.flags & IW_TXPOW_TYPE) != IW_TXPOW_DBM) |
@@ -852,7 +852,7 @@ int cfg80211_wext_siwtxpower(struct net_device *dev, | |||
852 | if (data->txpower.value < 0) | 852 | if (data->txpower.value < 0) |
853 | return -EINVAL; | 853 | return -EINVAL; |
854 | dbm = data->txpower.value; | 854 | dbm = data->txpower.value; |
855 | type = TX_POWER_FIXED; | 855 | type = NL80211_TX_POWER_FIXED; |
856 | /* TODO: do regulatory check! */ | 856 | /* TODO: do regulatory check! */ |
857 | } else { | 857 | } else { |
858 | /* | 858 | /* |
@@ -860,10 +860,10 @@ int cfg80211_wext_siwtxpower(struct net_device *dev, | |||
860 | * passed in from userland. | 860 | * passed in from userland. |
861 | */ | 861 | */ |
862 | if (data->txpower.value < 0) { | 862 | if (data->txpower.value < 0) { |
863 | type = TX_POWER_AUTOMATIC; | 863 | type = NL80211_TX_POWER_AUTOMATIC; |
864 | } else { | 864 | } else { |
865 | dbm = data->txpower.value; | 865 | dbm = data->txpower.value; |
866 | type = TX_POWER_LIMITED; | 866 | type = NL80211_TX_POWER_LIMITED; |
867 | } | 867 | } |
868 | } | 868 | } |
869 | } else { | 869 | } else { |
@@ -872,7 +872,7 @@ int cfg80211_wext_siwtxpower(struct net_device *dev, | |||
872 | return 0; | 872 | return 0; |
873 | } | 873 | } |
874 | 874 | ||
875 | return rdev->ops->set_tx_power(wdev->wiphy, type, dbm); | 875 | return rdev->ops->set_tx_power(wdev->wiphy, type, DBM_TO_MBM(dbm)); |
876 | } | 876 | } |
877 | EXPORT_SYMBOL_GPL(cfg80211_wext_siwtxpower); | 877 | EXPORT_SYMBOL_GPL(cfg80211_wext_siwtxpower); |
878 | 878 | ||