aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/cfg80211.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/net/cfg80211.h')
-rw-r--r--include/net/cfg80211.h78
1 files changed, 66 insertions, 12 deletions
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index 9e17a83d3432..f20da7d63b1e 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -56,9 +56,9 @@ enum ieee80211_band {
56 * on this channel. 56 * on this channel.
57 * @IEEE80211_CHAN_NO_IBSS: IBSS is not allowed on this channel. 57 * @IEEE80211_CHAN_NO_IBSS: IBSS is not allowed on this channel.
58 * @IEEE80211_CHAN_RADAR: Radar detection is required on this channel. 58 * @IEEE80211_CHAN_RADAR: Radar detection is required on this channel.
59 * @IEEE80211_CHAN_NO_FAT_ABOVE: extension channel above this channel 59 * @IEEE80211_CHAN_NO_HT40PLUS: extension channel above this channel
60 * is not permitted. 60 * is not permitted.
61 * @IEEE80211_CHAN_NO_FAT_BELOW: extension channel below this channel 61 * @IEEE80211_CHAN_NO_HT40MINUS: extension channel below this channel
62 * is not permitted. 62 * is not permitted.
63 */ 63 */
64enum ieee80211_channel_flags { 64enum ieee80211_channel_flags {
@@ -66,10 +66,13 @@ enum ieee80211_channel_flags {
66 IEEE80211_CHAN_PASSIVE_SCAN = 1<<1, 66 IEEE80211_CHAN_PASSIVE_SCAN = 1<<1,
67 IEEE80211_CHAN_NO_IBSS = 1<<2, 67 IEEE80211_CHAN_NO_IBSS = 1<<2,
68 IEEE80211_CHAN_RADAR = 1<<3, 68 IEEE80211_CHAN_RADAR = 1<<3,
69 IEEE80211_CHAN_NO_FAT_ABOVE = 1<<4, 69 IEEE80211_CHAN_NO_HT40PLUS = 1<<4,
70 IEEE80211_CHAN_NO_FAT_BELOW = 1<<5, 70 IEEE80211_CHAN_NO_HT40MINUS = 1<<5,
71}; 71};
72 72
73#define IEEE80211_CHAN_NO_HT40 \
74 (IEEE80211_CHAN_NO_HT40PLUS | IEEE80211_CHAN_NO_HT40MINUS)
75
73/** 76/**
74 * struct ieee80211_channel - channel definition 77 * struct ieee80211_channel - channel definition
75 * 78 *
@@ -778,10 +781,11 @@ enum wiphy_params_flags {
778 * @get_key: get information about the key with the given parameters. 781 * @get_key: get information about the key with the given parameters.
779 * @mac_addr will be %NULL when requesting information for a group 782 * @mac_addr will be %NULL when requesting information for a group
780 * key. All pointers given to the @callback function need not be valid 783 * key. All pointers given to the @callback function need not be valid
781 * after it returns. 784 * after it returns. This function should return an error if it is
785 * not possible to retrieve the key, -ENOENT if it doesn't exist.
782 * 786 *
783 * @del_key: remove a key given the @mac_addr (%NULL for a group key) 787 * @del_key: remove a key given the @mac_addr (%NULL for a group key)
784 * and @key_index 788 * and @key_index, return -ENOENT if the key doesn't exist.
785 * 789 *
786 * @set_default_key: set the default key on an interface 790 * @set_default_key: set the default key on an interface
787 * 791 *
@@ -994,7 +998,7 @@ struct wiphy {
994 * know whether it points to a wiphy your driver has registered 998 * know whether it points to a wiphy your driver has registered
995 * or not. Assign this to something global to your driver to 999 * or not. Assign this to something global to your driver to
996 * help determine whether you own this wiphy or not. */ 1000 * help determine whether you own this wiphy or not. */
997 void *privid; 1001 const void *privid;
998 1002
999 struct ieee80211_supported_band *bands[IEEE80211_NUM_BANDS]; 1003 struct ieee80211_supported_band *bands[IEEE80211_NUM_BANDS];
1000 1004
@@ -1070,7 +1074,7 @@ static inline const char *wiphy_name(struct wiphy *wiphy)
1070 * The returned pointer must be assigned to each netdev's 1074 * The returned pointer must be assigned to each netdev's
1071 * ieee80211_ptr for proper operation. 1075 * ieee80211_ptr for proper operation.
1072 */ 1076 */
1073struct wiphy *wiphy_new(struct cfg80211_ops *ops, int sizeof_priv); 1077struct wiphy *wiphy_new(const struct cfg80211_ops *ops, int sizeof_priv);
1074 1078
1075/** 1079/**
1076 * wiphy_register - register a wiphy with cfg80211 1080 * wiphy_register - register a wiphy with cfg80211
@@ -1240,6 +1244,53 @@ extern int ieee80211_radiotap_iterator_init(
1240extern int ieee80211_radiotap_iterator_next( 1244extern int ieee80211_radiotap_iterator_next(
1241 struct ieee80211_radiotap_iterator *iterator); 1245 struct ieee80211_radiotap_iterator *iterator);
1242 1246
1247extern const unsigned char rfc1042_header[6];
1248extern const unsigned char bridge_tunnel_header[6];
1249
1250/**
1251 * ieee80211_get_hdrlen_from_skb - get header length from data
1252 *
1253 * Given an skb with a raw 802.11 header at the data pointer this function
1254 * returns the 802.11 header length in bytes (not including encryption
1255 * headers). If the data in the sk_buff is too short to contain a valid 802.11
1256 * header the function returns 0.
1257 *
1258 * @skb: the frame
1259 */
1260unsigned int ieee80211_get_hdrlen_from_skb(const struct sk_buff *skb);
1261
1262/**
1263 * ieee80211_hdrlen - get header length in bytes from frame control
1264 * @fc: frame control field in little-endian format
1265 */
1266unsigned int ieee80211_hdrlen(__le16 fc);
1267
1268/**
1269 * ieee80211_data_to_8023 - convert an 802.11 data frame to 802.3
1270 * @skb: the 802.11 data frame
1271 * @addr: the device MAC address
1272 * @iftype: the virtual interface type
1273 */
1274int ieee80211_data_to_8023(struct sk_buff *skb, u8 *addr,
1275 enum nl80211_iftype iftype);
1276
1277/**
1278 * ieee80211_data_from_8023 - convert an 802.3 frame to 802.11
1279 * @skb: the 802.3 frame
1280 * @addr: the device MAC address
1281 * @iftype: the virtual interface type
1282 * @bssid: the network bssid (used only for iftype STATION and ADHOC)
1283 * @qos: build 802.11 QoS data frame
1284 */
1285int ieee80211_data_from_8023(struct sk_buff *skb, u8 *addr,
1286 enum nl80211_iftype iftype, u8 *bssid, bool qos);
1287
1288/**
1289 * cfg80211_classify8021d - determine the 802.1p/1d tag for a data frame
1290 * @skb: the data frame
1291 */
1292unsigned int cfg80211_classify8021d(struct sk_buff *skb);
1293
1243/* 1294/*
1244 * Regulatory helper functions for wiphys 1295 * Regulatory helper functions for wiphys
1245 */ 1296 */
@@ -1303,9 +1354,10 @@ extern void wiphy_apply_custom_regulatory(
1303 * freq_reg_info - get regulatory information for the given frequency 1354 * freq_reg_info - get regulatory information for the given frequency
1304 * @wiphy: the wiphy for which we want to process this rule for 1355 * @wiphy: the wiphy for which we want to process this rule for
1305 * @center_freq: Frequency in KHz for which we want regulatory information for 1356 * @center_freq: Frequency in KHz for which we want regulatory information for
1306 * @bandwidth: the bandwidth requirement you have in KHz, if you do not have one 1357 * @desired_bw_khz: the desired max bandwidth you want to use per
1307 * you can set this to 0. If this frequency is allowed we then set 1358 * channel. Note that this is still 20 MHz if you want to use HT40
1308 * this value to the maximum allowed bandwidth. 1359 * as HT40 makes use of two channels for its 40 MHz width bandwidth.
1360 * If set to 0 we'll assume you want the standard 20 MHz.
1309 * @reg_rule: the regulatory rule which we have for this frequency 1361 * @reg_rule: the regulatory rule which we have for this frequency
1310 * 1362 *
1311 * Use this function to get the regulatory rule for a specific frequency on 1363 * Use this function to get the regulatory rule for a specific frequency on
@@ -1320,7 +1372,9 @@ extern void wiphy_apply_custom_regulatory(
1320 * freq_in_rule_band() for our current definition of a band -- this is purely 1372 * freq_in_rule_band() for our current definition of a band -- this is purely
1321 * subjective and right now its 802.11 specific. 1373 * subjective and right now its 802.11 specific.
1322 */ 1374 */
1323extern int freq_reg_info(struct wiphy *wiphy, u32 center_freq, u32 *bandwidth, 1375extern int freq_reg_info(struct wiphy *wiphy,
1376 u32 center_freq,
1377 u32 desired_bw_khz,
1324 const struct ieee80211_reg_rule **reg_rule); 1378 const struct ieee80211_reg_rule **reg_rule);
1325 1379
1326/* 1380/*