aboutsummaryrefslogtreecommitdiffstats
path: root/net/wireless
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2010-09-10 01:27:33 -0400
committerDavid S. Miller <davem@davemloft.net>2010-09-10 01:27:33 -0400
commite548833df83c3554229eff0672900bfe958b45fd (patch)
tree85efc4a76dc356593d6d394776aeb845dc580fb6 /net/wireless
parentcbd9da7be869f676afc204e1a664163778c770bd (diff)
parent053d8f6622701f849fda2ca2c9ae596c13599ba9 (diff)
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
Conflicts: net/mac80211/main.c
Diffstat (limited to 'net/wireless')
-rw-r--r--net/wireless/core.c21
-rw-r--r--net/wireless/wext-compat.c3
-rw-r--r--net/wireless/wext-core.c16
3 files changed, 31 insertions, 9 deletions
diff --git a/net/wireless/core.c b/net/wireless/core.c
index d52630bbab04..d587ad284b3d 100644
--- a/net/wireless/core.c
+++ b/net/wireless/core.c
@@ -480,12 +480,10 @@ int wiphy_register(struct wiphy *wiphy)
480 mutex_lock(&cfg80211_mutex); 480 mutex_lock(&cfg80211_mutex);
481 481
482 res = device_add(&rdev->wiphy.dev); 482 res = device_add(&rdev->wiphy.dev);
483 if (res) 483 if (res) {
484 goto out_unlock; 484 mutex_unlock(&cfg80211_mutex);
485 485 return res;
486 res = rfkill_register(rdev->rfkill); 486 }
487 if (res)
488 goto out_rm_dev;
489 487
490 /* set up regulatory info */ 488 /* set up regulatory info */
491 wiphy_update_regulatory(wiphy, NL80211_REGDOM_SET_BY_CORE); 489 wiphy_update_regulatory(wiphy, NL80211_REGDOM_SET_BY_CORE);
@@ -514,13 +512,18 @@ int wiphy_register(struct wiphy *wiphy)
514 cfg80211_debugfs_rdev_add(rdev); 512 cfg80211_debugfs_rdev_add(rdev);
515 mutex_unlock(&cfg80211_mutex); 513 mutex_unlock(&cfg80211_mutex);
516 514
515 /*
516 * due to a locking dependency this has to be outside of the
517 * cfg80211_mutex lock
518 */
519 res = rfkill_register(rdev->rfkill);
520 if (res)
521 goto out_rm_dev;
522
517 return 0; 523 return 0;
518 524
519out_rm_dev: 525out_rm_dev:
520 device_del(&rdev->wiphy.dev); 526 device_del(&rdev->wiphy.dev);
521
522out_unlock:
523 mutex_unlock(&cfg80211_mutex);
524 return res; 527 return res;
525} 528}
526EXPORT_SYMBOL(wiphy_register); 529EXPORT_SYMBOL(wiphy_register);
diff --git a/net/wireless/wext-compat.c b/net/wireless/wext-compat.c
index bb5e0a5ecfa1..7e5c3a45f811 100644
--- a/net/wireless/wext-compat.c
+++ b/net/wireless/wext-compat.c
@@ -1420,6 +1420,9 @@ int cfg80211_wext_giwessid(struct net_device *dev,
1420{ 1420{
1421 struct wireless_dev *wdev = dev->ieee80211_ptr; 1421 struct wireless_dev *wdev = dev->ieee80211_ptr;
1422 1422
1423 data->flags = 0;
1424 data->length = 0;
1425
1423 switch (wdev->iftype) { 1426 switch (wdev->iftype) {
1424 case NL80211_IFTYPE_ADHOC: 1427 case NL80211_IFTYPE_ADHOC:
1425 return cfg80211_ibss_wext_giwessid(dev, info, data, ssid); 1428 return cfg80211_ibss_wext_giwessid(dev, info, data, ssid);
diff --git a/net/wireless/wext-core.c b/net/wireless/wext-core.c
index 40385936e286..dc675a3daa3d 100644
--- a/net/wireless/wext-core.c
+++ b/net/wireless/wext-core.c
@@ -782,6 +782,22 @@ static int ioctl_standard_iw_point(struct iw_point *iwp, unsigned int cmd,
782 } 782 }
783 } 783 }
784 784
785 if (IW_IS_GET(cmd) && !(descr->flags & IW_DESCR_FLAG_NOMAX)) {
786 /*
787 * If this is a GET, but not NOMAX, it means that the extra
788 * data is not bounded by userspace, but by max_tokens. Thus
789 * set the length to max_tokens. This matches the extra data
790 * allocation.
791 * The driver should fill it with the number of tokens it
792 * provided, and it may check iwp->length rather than having
793 * knowledge of max_tokens. If the driver doesn't change the
794 * iwp->length, this ioctl just copies back max_token tokens
795 * filled with zeroes. Hopefully the driver isn't claiming
796 * them to be valid data.
797 */
798 iwp->length = descr->max_tokens;
799 }
800
785 err = handler(dev, info, (union iwreq_data *) iwp, extra); 801 err = handler(dev, info, (union iwreq_data *) iwp, extra);
786 802
787 iwp->length += essid_compat; 803 iwp->length += essid_compat;