diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/ieee80211.h | 80 | ||||
-rw-r--r-- | include/net/mac80211.h | 12 |
2 files changed, 10 insertions, 82 deletions
diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h index e02fc682bb68..2385119f8bb0 100644 --- a/include/linux/ieee80211.h +++ b/include/linux/ieee80211.h | |||
@@ -1935,36 +1935,6 @@ static inline bool ieee80211_is_public_action(struct ieee80211_hdr *hdr, | |||
1935 | } | 1935 | } |
1936 | 1936 | ||
1937 | /** | 1937 | /** |
1938 | * ieee80211_fhss_chan_to_freq - get channel frequency | ||
1939 | * @channel: the FHSS channel | ||
1940 | * | ||
1941 | * Convert IEEE802.11 FHSS channel to frequency (MHz) | ||
1942 | * Ref IEEE 802.11-2007 section 14.6 | ||
1943 | */ | ||
1944 | static inline int ieee80211_fhss_chan_to_freq(int channel) | ||
1945 | { | ||
1946 | if ((channel > 1) && (channel < 96)) | ||
1947 | return channel + 2400; | ||
1948 | else | ||
1949 | return -1; | ||
1950 | } | ||
1951 | |||
1952 | /** | ||
1953 | * ieee80211_freq_to_fhss_chan - get channel | ||
1954 | * @freq: the channels frequency | ||
1955 | * | ||
1956 | * Convert frequency (MHz) to IEEE802.11 FHSS channel | ||
1957 | * Ref IEEE 802.11-2007 section 14.6 | ||
1958 | */ | ||
1959 | static inline int ieee80211_freq_to_fhss_chan(int freq) | ||
1960 | { | ||
1961 | if ((freq > 2401) && (freq < 2496)) | ||
1962 | return freq - 2400; | ||
1963 | else | ||
1964 | return -1; | ||
1965 | } | ||
1966 | |||
1967 | /** | ||
1968 | * ieee80211_dsss_chan_to_freq - get channel center frequency | 1938 | * ieee80211_dsss_chan_to_freq - get channel center frequency |
1969 | * @channel: the DSSS channel | 1939 | * @channel: the DSSS channel |
1970 | * | 1940 | * |
@@ -2000,56 +1970,6 @@ static inline int ieee80211_freq_to_dsss_chan(int freq) | |||
2000 | return -1; | 1970 | return -1; |
2001 | } | 1971 | } |
2002 | 1972 | ||
2003 | /* Convert IEEE802.11 HR DSSS channel to frequency (MHz) and back | ||
2004 | * Ref IEEE 802.11-2007 section 18.4.6.2 | ||
2005 | * | ||
2006 | * The channels and frequencies are the same as those defined for DSSS | ||
2007 | */ | ||
2008 | #define ieee80211_hr_chan_to_freq(chan) ieee80211_dsss_chan_to_freq(chan) | ||
2009 | #define ieee80211_freq_to_hr_chan(freq) ieee80211_freq_to_dsss_chan(freq) | ||
2010 | |||
2011 | /* Convert IEEE802.11 ERP channel to frequency (MHz) and back | ||
2012 | * Ref IEEE 802.11-2007 section 19.4.2 | ||
2013 | */ | ||
2014 | #define ieee80211_erp_chan_to_freq(chan) ieee80211_hr_chan_to_freq(chan) | ||
2015 | #define ieee80211_freq_to_erp_chan(freq) ieee80211_freq_to_hr_chan(freq) | ||
2016 | |||
2017 | /** | ||
2018 | * ieee80211_ofdm_chan_to_freq - get channel center frequency | ||
2019 | * @s_freq: starting frequency == (dotChannelStartingFactor/2) MHz | ||
2020 | * @channel: the OFDM channel | ||
2021 | * | ||
2022 | * Convert IEEE802.11 OFDM channel to center frequency (MHz) | ||
2023 | * Ref IEEE 802.11-2007 section 17.3.8.3.2 | ||
2024 | */ | ||
2025 | static inline int ieee80211_ofdm_chan_to_freq(int s_freq, int channel) | ||
2026 | { | ||
2027 | if ((channel > 0) && (channel <= 200) && | ||
2028 | (s_freq >= 4000)) | ||
2029 | return s_freq + (channel * 5); | ||
2030 | else | ||
2031 | return -1; | ||
2032 | } | ||
2033 | |||
2034 | /** | ||
2035 | * ieee80211_freq_to_ofdm_channel - get channel | ||
2036 | * @s_freq: starting frequency == (dotChannelStartingFactor/2) MHz | ||
2037 | * @freq: the frequency | ||
2038 | * | ||
2039 | * Convert frequency (MHz) to IEEE802.11 OFDM channel | ||
2040 | * Ref IEEE 802.11-2007 section 17.3.8.3.2 | ||
2041 | * | ||
2042 | * This routine selects the channel with the closest center frequency. | ||
2043 | */ | ||
2044 | static inline int ieee80211_freq_to_ofdm_chan(int s_freq, int freq) | ||
2045 | { | ||
2046 | if ((freq > (s_freq + 2)) && (freq <= (s_freq + 1202)) && | ||
2047 | (s_freq >= 4000)) | ||
2048 | return (freq + 2 - s_freq) / 5; | ||
2049 | else | ||
2050 | return -1; | ||
2051 | } | ||
2052 | |||
2053 | /** | 1973 | /** |
2054 | * ieee80211_tu_to_usec - convert time units (TU) to microseconds | 1974 | * ieee80211_tu_to_usec - convert time units (TU) to microseconds |
2055 | * @tu: the TUs | 1975 | * @tu: the TUs |
diff --git a/include/net/mac80211.h b/include/net/mac80211.h index 71f8262fc1df..82558c8decf8 100644 --- a/include/net/mac80211.h +++ b/include/net/mac80211.h | |||
@@ -973,21 +973,29 @@ static inline bool ieee80211_vif_is_mesh(struct ieee80211_vif *vif) | |||
973 | * generation in software. | 973 | * generation in software. |
974 | * @IEEE80211_KEY_FLAG_PAIRWISE: Set by mac80211, this flag indicates | 974 | * @IEEE80211_KEY_FLAG_PAIRWISE: Set by mac80211, this flag indicates |
975 | * that the key is pairwise rather then a shared key. | 975 | * that the key is pairwise rather then a shared key. |
976 | * @IEEE80211_KEY_FLAG_SW_MGMT: This flag should be set by the driver for a | 976 | * @IEEE80211_KEY_FLAG_SW_MGMT_TX: This flag should be set by the driver for a |
977 | * CCMP key if it requires CCMP encryption of management frames (MFP) to | 977 | * CCMP key if it requires CCMP encryption of management frames (MFP) to |
978 | * be done in software. | 978 | * be done in software. |
979 | * @IEEE80211_KEY_FLAG_PUT_IV_SPACE: This flag should be set by the driver | 979 | * @IEEE80211_KEY_FLAG_PUT_IV_SPACE: This flag should be set by the driver |
980 | * if space should be prepared for the IV, but the IV | 980 | * if space should be prepared for the IV, but the IV |
981 | * itself should not be generated. Do not set together with | 981 | * itself should not be generated. Do not set together with |
982 | * @IEEE80211_KEY_FLAG_GENERATE_IV on the same key. | 982 | * @IEEE80211_KEY_FLAG_GENERATE_IV on the same key. |
983 | * @IEEE80211_KEY_FLAG_RX_MGMT: This key will be used to decrypt received | ||
984 | * management frames. The flag can help drivers that have a hardware | ||
985 | * crypto implementation that doesn't deal with management frames | ||
986 | * properly by allowing them to not upload the keys to hardware and | ||
987 | * fall back to software crypto. Note that this flag deals only with | ||
988 | * RX, if your crypto engine can't deal with TX you can also set the | ||
989 | * %IEEE80211_KEY_FLAG_SW_MGMT_TX flag to encrypt such frames in SW. | ||
983 | */ | 990 | */ |
984 | enum ieee80211_key_flags { | 991 | enum ieee80211_key_flags { |
985 | IEEE80211_KEY_FLAG_WMM_STA = 1<<0, | 992 | IEEE80211_KEY_FLAG_WMM_STA = 1<<0, |
986 | IEEE80211_KEY_FLAG_GENERATE_IV = 1<<1, | 993 | IEEE80211_KEY_FLAG_GENERATE_IV = 1<<1, |
987 | IEEE80211_KEY_FLAG_GENERATE_MMIC= 1<<2, | 994 | IEEE80211_KEY_FLAG_GENERATE_MMIC= 1<<2, |
988 | IEEE80211_KEY_FLAG_PAIRWISE = 1<<3, | 995 | IEEE80211_KEY_FLAG_PAIRWISE = 1<<3, |
989 | IEEE80211_KEY_FLAG_SW_MGMT = 1<<4, | 996 | IEEE80211_KEY_FLAG_SW_MGMT_TX = 1<<4, |
990 | IEEE80211_KEY_FLAG_PUT_IV_SPACE = 1<<5, | 997 | IEEE80211_KEY_FLAG_PUT_IV_SPACE = 1<<5, |
998 | IEEE80211_KEY_FLAG_RX_MGMT = 1<<6, | ||
991 | }; | 999 | }; |
992 | 1000 | ||
993 | /** | 1001 | /** |