aboutsummaryrefslogtreecommitdiffstats
path: root/net/wireless/mlme.c
diff options
context:
space:
mode:
authorBen Greear <greearb@candelatech.com>2011-11-18 14:31:59 -0500
committerJohn W. Linville <linville@tuxdriver.com>2011-11-21 16:22:06 -0500
commit7e7c8926b2f4e3453b8aeb39cd814d2af3fec24f (patch)
treee22df42bf84d6ea3cb67ae0e332d7d7d10cca4b4 /net/wireless/mlme.c
parentdd76986b0e398978ca32dd60c1b7dc50ab4e9ae1 (diff)
wireless: Support ht-capabilities over-rides.
This allows users to disable features such as HT, HT40, and to modify the MCS, AMPDU, and AMSDU settings for drivers that support it. The MCS, AMPDU, and AMSDU features that may be disabled are are reported in the phy-info netlink message as a mask. Attemping to disable features that are not supported will take no affect, but will not return errors. This is to aid backwards compatibility in user-space apps that may not be clever enough to deal with parsing the the capabilities mask. This patch only enables the infrastructure. An additional patch will enable the feature in mac80211. Signed-off-by: Ben Greear <greearb@candelatech.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/wireless/mlme.c')
-rw-r--r--net/wireless/mlme.c37
1 files changed, 34 insertions, 3 deletions
diff --git a/net/wireless/mlme.c b/net/wireless/mlme.c
index 6c1bafd508c8..438dfc105b4a 100644
--- a/net/wireless/mlme.c
+++ b/net/wireless/mlme.c
@@ -501,13 +501,32 @@ int cfg80211_mlme_auth(struct cfg80211_registered_device *rdev,
501 return err; 501 return err;
502} 502}
503 503
504/* Do a logical ht_capa &= ht_capa_mask. */
505void cfg80211_oper_and_ht_capa(struct ieee80211_ht_cap *ht_capa,
506 const struct ieee80211_ht_cap *ht_capa_mask)
507{
508 int i;
509 u8 *p1, *p2;
510 if (!ht_capa_mask) {
511 memset(ht_capa, 0, sizeof(*ht_capa));
512 return;
513 }
514
515 p1 = (u8*)(ht_capa);
516 p2 = (u8*)(ht_capa_mask);
517 for (i = 0; i<sizeof(*ht_capa); i++)
518 p1[i] &= p2[i];
519}
520
504int __cfg80211_mlme_assoc(struct cfg80211_registered_device *rdev, 521int __cfg80211_mlme_assoc(struct cfg80211_registered_device *rdev,
505 struct net_device *dev, 522 struct net_device *dev,
506 struct ieee80211_channel *chan, 523 struct ieee80211_channel *chan,
507 const u8 *bssid, const u8 *prev_bssid, 524 const u8 *bssid, const u8 *prev_bssid,
508 const u8 *ssid, int ssid_len, 525 const u8 *ssid, int ssid_len,
509 const u8 *ie, int ie_len, bool use_mfp, 526 const u8 *ie, int ie_len, bool use_mfp,
510 struct cfg80211_crypto_settings *crypt) 527 struct cfg80211_crypto_settings *crypt,
528 u32 assoc_flags, struct ieee80211_ht_cap *ht_capa,
529 struct ieee80211_ht_cap *ht_capa_mask)
511{ 530{
512 struct wireless_dev *wdev = dev->ieee80211_ptr; 531 struct wireless_dev *wdev = dev->ieee80211_ptr;
513 struct cfg80211_assoc_request req; 532 struct cfg80211_assoc_request req;
@@ -537,6 +556,15 @@ int __cfg80211_mlme_assoc(struct cfg80211_registered_device *rdev,
537 memcpy(&req.crypto, crypt, sizeof(req.crypto)); 556 memcpy(&req.crypto, crypt, sizeof(req.crypto));
538 req.use_mfp = use_mfp; 557 req.use_mfp = use_mfp;
539 req.prev_bssid = prev_bssid; 558 req.prev_bssid = prev_bssid;
559 req.flags = assoc_flags;
560 if (ht_capa)
561 memcpy(&req.ht_capa, ht_capa, sizeof(req.ht_capa));
562 if (ht_capa_mask)
563 memcpy(&req.ht_capa_mask, ht_capa_mask,
564 sizeof(req.ht_capa_mask));
565 cfg80211_oper_and_ht_capa(&req.ht_capa_mask,
566 rdev->wiphy.ht_capa_mod_mask);
567
540 req.bss = cfg80211_get_bss(&rdev->wiphy, chan, bssid, ssid, ssid_len, 568 req.bss = cfg80211_get_bss(&rdev->wiphy, chan, bssid, ssid, ssid_len,
541 WLAN_CAPABILITY_ESS, WLAN_CAPABILITY_ESS); 569 WLAN_CAPABILITY_ESS, WLAN_CAPABILITY_ESS);
542 if (!req.bss) { 570 if (!req.bss) {
@@ -574,14 +602,17 @@ int cfg80211_mlme_assoc(struct cfg80211_registered_device *rdev,
574 const u8 *bssid, const u8 *prev_bssid, 602 const u8 *bssid, const u8 *prev_bssid,
575 const u8 *ssid, int ssid_len, 603 const u8 *ssid, int ssid_len,
576 const u8 *ie, int ie_len, bool use_mfp, 604 const u8 *ie, int ie_len, bool use_mfp,
577 struct cfg80211_crypto_settings *crypt) 605 struct cfg80211_crypto_settings *crypt,
606 u32 assoc_flags, struct ieee80211_ht_cap *ht_capa,
607 struct ieee80211_ht_cap *ht_capa_mask)
578{ 608{
579 struct wireless_dev *wdev = dev->ieee80211_ptr; 609 struct wireless_dev *wdev = dev->ieee80211_ptr;
580 int err; 610 int err;
581 611
582 wdev_lock(wdev); 612 wdev_lock(wdev);
583 err = __cfg80211_mlme_assoc(rdev, dev, chan, bssid, prev_bssid, 613 err = __cfg80211_mlme_assoc(rdev, dev, chan, bssid, prev_bssid,
584 ssid, ssid_len, ie, ie_len, use_mfp, crypt); 614 ssid, ssid_len, ie, ie_len, use_mfp, crypt,
615 assoc_flags, ht_capa, ht_capa_mask);
585 wdev_unlock(wdev); 616 wdev_unlock(wdev);
586 617
587 return err; 618 return err;