diff options
author | Ron Rindjunsky <ron.rindjunsky@intel.com> | 2007-11-26 09:14:34 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-01-28 17:55:33 -0500 |
commit | d3c990fb26b78f60614885d9ecaf7b7686b7b098 (patch) | |
tree | 4948049e6b1bd1ee0392173380e8444e69baa8c5 /net/mac80211/ieee80211.c | |
parent | fd4c7f2fce1737105208c564e1458c885918982d (diff) |
mac80211: adding 802.11n configuration flows
This patch configures the 802.11n mode of operation
internally in ieee80211_conf structure and in the low-level
driver as well (through op conf_ht).
It does not include AP configuration flows.
Signed-off-by: Ron Rindjunsky <ron.rindjunsky@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/mac80211/ieee80211.c')
-rw-r--r-- | net/mac80211/ieee80211.c | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/net/mac80211/ieee80211.c b/net/mac80211/ieee80211.c index 4f8b6653e364..d6a97a68a62e 100644 --- a/net/mac80211/ieee80211.c +++ b/net/mac80211/ieee80211.c | |||
@@ -34,6 +34,8 @@ | |||
34 | #include "debugfs.h" | 34 | #include "debugfs.h" |
35 | #include "debugfs_netdev.h" | 35 | #include "debugfs_netdev.h" |
36 | 36 | ||
37 | #define SUPP_MCS_SET_LEN 16 | ||
38 | |||
37 | /* | 39 | /* |
38 | * For seeing transmitted packets on monitor interfaces | 40 | * For seeing transmitted packets on monitor interfaces |
39 | * we have a radiotap header too. | 41 | * we have a radiotap header too. |
@@ -563,6 +565,55 @@ int ieee80211_hw_config(struct ieee80211_local *local) | |||
563 | return ret; | 565 | return ret; |
564 | } | 566 | } |
565 | 567 | ||
568 | /** | ||
569 | * ieee80211_hw_config_ht should be used only after legacy configuration | ||
570 | * has been determined, as ht configuration depends upon the hardware's | ||
571 | * HT abilities for a _specific_ band. | ||
572 | */ | ||
573 | int ieee80211_hw_config_ht(struct ieee80211_local *local, int enable_ht, | ||
574 | struct ieee80211_ht_info *req_ht_cap, | ||
575 | struct ieee80211_ht_bss_info *req_bss_cap) | ||
576 | { | ||
577 | struct ieee80211_conf *conf = &local->hw.conf; | ||
578 | struct ieee80211_hw_mode *mode = conf->mode; | ||
579 | int i; | ||
580 | |||
581 | /* HT is not supported */ | ||
582 | if (!mode->ht_info.ht_supported) { | ||
583 | conf->flags &= ~IEEE80211_CONF_SUPPORT_HT_MODE; | ||
584 | return -EOPNOTSUPP; | ||
585 | } | ||
586 | |||
587 | /* disable HT */ | ||
588 | if (!enable_ht) { | ||
589 | conf->flags &= ~IEEE80211_CONF_SUPPORT_HT_MODE; | ||
590 | } else { | ||
591 | conf->flags |= IEEE80211_CONF_SUPPORT_HT_MODE; | ||
592 | conf->ht_conf.cap = req_ht_cap->cap & mode->ht_info.cap; | ||
593 | conf->ht_conf.cap &= ~(IEEE80211_HT_CAP_MIMO_PS); | ||
594 | conf->ht_conf.cap |= | ||
595 | mode->ht_info.cap & IEEE80211_HT_CAP_MIMO_PS; | ||
596 | conf->ht_bss_conf.primary_channel = | ||
597 | req_bss_cap->primary_channel; | ||
598 | conf->ht_bss_conf.bss_cap = req_bss_cap->bss_cap; | ||
599 | conf->ht_bss_conf.bss_op_mode = req_bss_cap->bss_op_mode; | ||
600 | for (i = 0; i < SUPP_MCS_SET_LEN; i++) | ||
601 | conf->ht_conf.supp_mcs_set[i] = | ||
602 | mode->ht_info.supp_mcs_set[i] & | ||
603 | req_ht_cap->supp_mcs_set[i]; | ||
604 | |||
605 | /* In STA mode, this gives us indication | ||
606 | * to the AP's mode of operation */ | ||
607 | conf->ht_conf.ht_supported = 1; | ||
608 | conf->ht_conf.ampdu_factor = req_ht_cap->ampdu_factor; | ||
609 | conf->ht_conf.ampdu_density = req_ht_cap->ampdu_density; | ||
610 | } | ||
611 | |||
612 | local->ops->conf_ht(local_to_hw(local), &local->hw.conf); | ||
613 | |||
614 | return 0; | ||
615 | } | ||
616 | |||
566 | void ieee80211_erp_info_change_notify(struct net_device *dev, u8 changes) | 617 | void ieee80211_erp_info_change_notify(struct net_device *dev, u8 changes) |
567 | { | 618 | { |
568 | struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr); | 619 | struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr); |