diff options
author | Tomas Winkler <tomas.winkler@intel.com> | 2008-06-18 10:53:44 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-06-30 17:37:34 -0400 |
commit | 06ff47bc9595848b818ac79e7d8069337c6e58b1 (patch) | |
tree | a0a2d00f25f5c97f04dffd4c27059e1d217ea5a0 | |
parent | 7b1e78d5052a92e95d851fbb0236a712264fe7e8 (diff) |
mac80211: add spectrum capabilities
This patch add spectrum capability and required information
elements to association request providing AP has requested it and
it is supported by the driver
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Assaf Krauss <assaf.krauss@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r-- | include/net/mac80211.h | 5 | ||||
-rw-r--r-- | net/mac80211/mlme.c | 24 |
2 files changed, 29 insertions, 0 deletions
diff --git a/include/net/mac80211.h b/include/net/mac80211.h index 02c79e6b309e..a7044958c75f 100644 --- a/include/net/mac80211.h +++ b/include/net/mac80211.h | |||
@@ -710,6 +710,10 @@ enum ieee80211_tkip_key_type { | |||
710 | * @IEEE80211_HW_NOISE_DBM: | 710 | * @IEEE80211_HW_NOISE_DBM: |
711 | * Hardware can provide noise (radio interference) values in units dBm, | 711 | * Hardware can provide noise (radio interference) values in units dBm, |
712 | * decibel difference from one milliwatt. | 712 | * decibel difference from one milliwatt. |
713 | * | ||
714 | * @IEEE80211_HW_SPECTRUM_MGMT: | ||
715 | * Hardware supports spectrum management defined in 802.11h | ||
716 | * Measurement, Channel Switch, Quieting, TPC | ||
713 | */ | 717 | */ |
714 | enum ieee80211_hw_flags { | 718 | enum ieee80211_hw_flags { |
715 | IEEE80211_HW_HOST_GEN_BEACON_TEMPLATE = 1<<0, | 719 | IEEE80211_HW_HOST_GEN_BEACON_TEMPLATE = 1<<0, |
@@ -721,6 +725,7 @@ enum ieee80211_hw_flags { | |||
721 | IEEE80211_HW_SIGNAL_DB = 1<<6, | 725 | IEEE80211_HW_SIGNAL_DB = 1<<6, |
722 | IEEE80211_HW_SIGNAL_DBM = 1<<7, | 726 | IEEE80211_HW_SIGNAL_DBM = 1<<7, |
723 | IEEE80211_HW_NOISE_DBM = 1<<8, | 727 | IEEE80211_HW_NOISE_DBM = 1<<8, |
728 | IEEE80211_HW_SPECTRUM_MGMT = 1<<9, | ||
724 | }; | 729 | }; |
725 | 730 | ||
726 | /** | 731 | /** |
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c index 7b4d4d46843b..c9f7c13d2e7e 100644 --- a/net/mac80211/mlme.c +++ b/net/mac80211/mlme.c | |||
@@ -747,6 +747,10 @@ static void ieee80211_send_assoc(struct net_device *dev, | |||
747 | * b-only mode) */ | 747 | * b-only mode) */ |
748 | rates_len = ieee80211_compatible_rates(bss, sband, &rates); | 748 | rates_len = ieee80211_compatible_rates(bss, sband, &rates); |
749 | 749 | ||
750 | if ((bss->capability & WLAN_CAPABILITY_SPECTRUM_MGMT) && | ||
751 | (local->hw.flags & IEEE80211_HW_SPECTRUM_MGMT)) | ||
752 | capab |= WLAN_CAPABILITY_SPECTRUM_MGMT; | ||
753 | |||
750 | ieee80211_rx_bss_put(dev, bss); | 754 | ieee80211_rx_bss_put(dev, bss); |
751 | } else { | 755 | } else { |
752 | rates = ~0; | 756 | rates = ~0; |
@@ -814,6 +818,26 @@ static void ieee80211_send_assoc(struct net_device *dev, | |||
814 | } | 818 | } |
815 | } | 819 | } |
816 | 820 | ||
821 | if (capab & WLAN_CAPABILITY_SPECTRUM_MGMT) { | ||
822 | /* 1. power capabilities */ | ||
823 | pos = skb_put(skb, 4); | ||
824 | *pos++ = WLAN_EID_PWR_CAPABILITY; | ||
825 | *pos++ = 2; | ||
826 | *pos++ = 0; /* min tx power */ | ||
827 | *pos++ = local->hw.conf.channel->max_power; /* max tx power */ | ||
828 | |||
829 | /* 2. supported channels */ | ||
830 | /* TODO: get this in reg domain format */ | ||
831 | pos = skb_put(skb, 2 * sband->n_channels + 2); | ||
832 | *pos++ = WLAN_EID_SUPPORTED_CHANNELS; | ||
833 | *pos++ = 2 * sband->n_channels; | ||
834 | for (i = 0; i < sband->n_channels; i++) { | ||
835 | *pos++ = ieee80211_frequency_to_channel( | ||
836 | sband->channels[i].center_freq); | ||
837 | *pos++ = 1; /* one channel in the subband*/ | ||
838 | } | ||
839 | } | ||
840 | |||
817 | if (ifsta->extra_ie) { | 841 | if (ifsta->extra_ie) { |
818 | pos = skb_put(skb, ifsta->extra_ie_len); | 842 | pos = skb_put(skb, ifsta->extra_ie_len); |
819 | memcpy(pos, ifsta->extra_ie, ifsta->extra_ie_len); | 843 | memcpy(pos, ifsta->extra_ie, ifsta->extra_ie_len); |