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
This commit is contained in:
@@ -894,7 +894,7 @@ out_fail_pernet:
|
||||
}
|
||||
subsys_initcall(cfg80211_init);
|
||||
|
||||
static void cfg80211_exit(void)
|
||||
static void __exit cfg80211_exit(void)
|
||||
{
|
||||
debugfs_remove(ieee80211_debugfs_dir);
|
||||
nl80211_exit();
|
||||
|
@@ -153,6 +153,9 @@ static const struct nla_policy nl80211_policy[NL80211_ATTR_MAX+1] = {
|
||||
[NL80211_ATTR_CQM] = { .type = NLA_NESTED, },
|
||||
[NL80211_ATTR_LOCAL_STATE_CHANGE] = { .type = NLA_FLAG },
|
||||
[NL80211_ATTR_AP_ISOLATE] = { .type = NLA_U8 },
|
||||
|
||||
[NL80211_ATTR_WIPHY_TX_POWER_SETTING] = { .type = NLA_U32 },
|
||||
[NL80211_ATTR_WIPHY_TX_POWER_LEVEL] = { .type = NLA_U32 },
|
||||
};
|
||||
|
||||
/* policy for the attributes */
|
||||
@@ -869,6 +872,34 @@ static int nl80211_set_wiphy(struct sk_buff *skb, struct genl_info *info)
|
||||
goto bad_res;
|
||||
}
|
||||
|
||||
if (info->attrs[NL80211_ATTR_WIPHY_TX_POWER_SETTING]) {
|
||||
enum nl80211_tx_power_setting type;
|
||||
int idx, mbm = 0;
|
||||
|
||||
if (!rdev->ops->set_tx_power) {
|
||||
return -EOPNOTSUPP;
|
||||
goto bad_res;
|
||||
}
|
||||
|
||||
idx = NL80211_ATTR_WIPHY_TX_POWER_SETTING;
|
||||
type = nla_get_u32(info->attrs[idx]);
|
||||
|
||||
if (!info->attrs[NL80211_ATTR_WIPHY_TX_POWER_LEVEL] &&
|
||||
(type != NL80211_TX_POWER_AUTOMATIC)) {
|
||||
result = -EINVAL;
|
||||
goto bad_res;
|
||||
}
|
||||
|
||||
if (type != NL80211_TX_POWER_AUTOMATIC) {
|
||||
idx = NL80211_ATTR_WIPHY_TX_POWER_LEVEL;
|
||||
mbm = nla_get_u32(info->attrs[idx]);
|
||||
}
|
||||
|
||||
result = rdev->ops->set_tx_power(&rdev->wiphy, type, mbm);
|
||||
if (result)
|
||||
goto bad_res;
|
||||
}
|
||||
|
||||
changed = 0;
|
||||
|
||||
if (info->attrs[NL80211_ATTR_WIPHY_RETRY_SHORT]) {
|
||||
|
@@ -80,7 +80,7 @@ static const struct ieee80211_regdomain *country_ie_regdomain;
|
||||
* - country_ie_regdomain
|
||||
* - last_request
|
||||
*/
|
||||
DEFINE_MUTEX(reg_mutex);
|
||||
static DEFINE_MUTEX(reg_mutex);
|
||||
#define assert_reg_lock() WARN_ON(!mutex_is_locked(®_mutex))
|
||||
|
||||
/* Used to queue up regulatory hints */
|
||||
@@ -2630,7 +2630,7 @@ out:
|
||||
mutex_unlock(®_mutex);
|
||||
}
|
||||
|
||||
int regulatory_init(void)
|
||||
int __init regulatory_init(void)
|
||||
{
|
||||
int err = 0;
|
||||
|
||||
@@ -2676,7 +2676,7 @@ int regulatory_init(void)
|
||||
return 0;
|
||||
}
|
||||
|
||||
void regulatory_exit(void)
|
||||
void /* __init_or_exit */ regulatory_exit(void)
|
||||
{
|
||||
struct regulatory_request *reg_request, *tmp;
|
||||
struct reg_beacon *reg_beacon, *btmp;
|
||||
|
@@ -10,7 +10,7 @@ int regulatory_hint_user(const char *alpha2);
|
||||
|
||||
void reg_device_remove(struct wiphy *wiphy);
|
||||
|
||||
int regulatory_init(void);
|
||||
int __init regulatory_init(void);
|
||||
void regulatory_exit(void);
|
||||
|
||||
int set_regdom(const struct ieee80211_regdomain *rd);
|
||||
|
@@ -829,7 +829,7 @@ int cfg80211_wext_siwtxpower(struct net_device *dev,
|
||||
{
|
||||
struct wireless_dev *wdev = dev->ieee80211_ptr;
|
||||
struct cfg80211_registered_device *rdev = wiphy_to_dev(wdev->wiphy);
|
||||
enum tx_power_setting type;
|
||||
enum nl80211_tx_power_setting type;
|
||||
int dbm = 0;
|
||||
|
||||
if ((data->txpower.flags & IW_TXPOW_TYPE) != IW_TXPOW_DBM)
|
||||
@@ -852,7 +852,7 @@ int cfg80211_wext_siwtxpower(struct net_device *dev,
|
||||
if (data->txpower.value < 0)
|
||||
return -EINVAL;
|
||||
dbm = data->txpower.value;
|
||||
type = TX_POWER_FIXED;
|
||||
type = NL80211_TX_POWER_FIXED;
|
||||
/* TODO: do regulatory check! */
|
||||
} else {
|
||||
/*
|
||||
@@ -860,10 +860,10 @@ int cfg80211_wext_siwtxpower(struct net_device *dev,
|
||||
* passed in from userland.
|
||||
*/
|
||||
if (data->txpower.value < 0) {
|
||||
type = TX_POWER_AUTOMATIC;
|
||||
type = NL80211_TX_POWER_AUTOMATIC;
|
||||
} else {
|
||||
dbm = data->txpower.value;
|
||||
type = TX_POWER_LIMITED;
|
||||
type = NL80211_TX_POWER_LIMITED;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@@ -872,7 +872,7 @@ int cfg80211_wext_siwtxpower(struct net_device *dev,
|
||||
return 0;
|
||||
}
|
||||
|
||||
return rdev->ops->set_tx_power(wdev->wiphy, type, dbm);
|
||||
return rdev->ops->set_tx_power(wdev->wiphy, type, DBM_TO_MBM(dbm));
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(cfg80211_wext_siwtxpower);
|
||||
|
||||
|
Reference in New Issue
Block a user