aboutsummaryrefslogtreecommitdiffstats
path: root/include/net
diff options
context:
space:
mode:
Diffstat (limited to 'include/net')
-rw-r--r--include/net/ieee80211.h177
-rw-r--r--include/net/ieee80211_crypt.h3
2 files changed, 176 insertions, 4 deletions
diff --git a/include/net/ieee80211.h b/include/net/ieee80211.h
index 9a92aef8b0b2..4725ff861c57 100644
--- a/include/net/ieee80211.h
+++ b/include/net/ieee80211.h
@@ -220,6 +220,7 @@ struct ieee80211_snap_hdr {
220/* Authentication algorithms */ 220/* Authentication algorithms */
221#define WLAN_AUTH_OPEN 0 221#define WLAN_AUTH_OPEN 0
222#define WLAN_AUTH_SHARED_KEY 1 222#define WLAN_AUTH_SHARED_KEY 1
223#define WLAN_AUTH_LEAP 2
223 224
224#define WLAN_AUTH_CHALLENGE_LEN 128 225#define WLAN_AUTH_CHALLENGE_LEN 128
225 226
@@ -299,6 +300,23 @@ enum ieee80211_reasoncode {
299 WLAN_REASON_CIPHER_SUITE_REJECTED = 24, 300 WLAN_REASON_CIPHER_SUITE_REJECTED = 24,
300}; 301};
301 302
303/* Action categories - 802.11h */
304enum ieee80211_actioncategories {
305 WLAN_ACTION_SPECTRUM_MGMT = 0,
306 /* Reserved 1-127 */
307 /* Error 128-255 */
308};
309
310/* Action details - 802.11h */
311enum ieee80211_actiondetails {
312 WLAN_ACTION_CATEGORY_MEASURE_REQUEST = 0,
313 WLAN_ACTION_CATEGORY_MEASURE_REPORT = 1,
314 WLAN_ACTION_CATEGORY_TPC_REQUEST = 2,
315 WLAN_ACTION_CATEGORY_TPC_REPORT = 3,
316 WLAN_ACTION_CATEGORY_CHANNEL_SWITCH = 4,
317 /* 5 - 255 Reserved */
318};
319
302#define IEEE80211_STATMASK_SIGNAL (1<<0) 320#define IEEE80211_STATMASK_SIGNAL (1<<0)
303#define IEEE80211_STATMASK_RSSI (1<<1) 321#define IEEE80211_STATMASK_RSSI (1<<1)
304#define IEEE80211_STATMASK_NOISE (1<<2) 322#define IEEE80211_STATMASK_NOISE (1<<2)
@@ -377,6 +395,8 @@ struct ieee80211_rx_stats {
377 u8 mask; 395 u8 mask;
378 u8 freq; 396 u8 freq;
379 u16 len; 397 u16 len;
398 u64 tsf;
399 u32 beacon_time;
380}; 400};
381 401
382/* IEEE 802.11 requires that STA supports concurrent reception of at least 402/* IEEE 802.11 requires that STA supports concurrent reception of at least
@@ -608,6 +628,28 @@ struct ieee80211_auth {
608 struct ieee80211_info_element info_element[0]; 628 struct ieee80211_info_element info_element[0];
609} __attribute__ ((packed)); 629} __attribute__ ((packed));
610 630
631struct ieee80211_channel_switch {
632 u8 id;
633 u8 len;
634 u8 mode;
635 u8 channel;
636 u8 count;
637} __attribute__ ((packed));
638
639struct ieee80211_action {
640 struct ieee80211_hdr_3addr header;
641 u8 category;
642 u8 action;
643 union {
644 struct ieee80211_action_exchange {
645 u8 token;
646 struct ieee80211_info_element info_element[0];
647 } exchange;
648 struct ieee80211_channel_switch channel_switch;
649
650 } format;
651} __attribute__ ((packed));
652
611struct ieee80211_disassoc { 653struct ieee80211_disassoc {
612 struct ieee80211_hdr_3addr header; 654 struct ieee80211_hdr_3addr header;
613 __le16 reason; 655 __le16 reason;
@@ -692,7 +734,15 @@ struct ieee80211_txb {
692/* QoS structure */ 734/* QoS structure */
693#define NETWORK_HAS_QOS_PARAMETERS (1<<3) 735#define NETWORK_HAS_QOS_PARAMETERS (1<<3)
694#define NETWORK_HAS_QOS_INFORMATION (1<<4) 736#define NETWORK_HAS_QOS_INFORMATION (1<<4)
695#define NETWORK_HAS_QOS_MASK (NETWORK_HAS_QOS_PARAMETERS | NETWORK_HAS_QOS_INFORMATION) 737#define NETWORK_HAS_QOS_MASK (NETWORK_HAS_QOS_PARAMETERS | \
738 NETWORK_HAS_QOS_INFORMATION)
739
740/* 802.11h */
741#define NETWORK_HAS_POWER_CONSTRAINT (1<<5)
742#define NETWORK_HAS_CSA (1<<6)
743#define NETWORK_HAS_QUIET (1<<7)
744#define NETWORK_HAS_IBSS_DFS (1<<8)
745#define NETWORK_HAS_TPC_REPORT (1<<9)
696 746
697#define QOS_QUEUE_NUM 4 747#define QOS_QUEUE_NUM 4
698#define QOS_OUI_LEN 3 748#define QOS_OUI_LEN 3
@@ -748,6 +798,91 @@ struct ieee80211_tim_parameters {
748 798
749/*******************************************************/ 799/*******************************************************/
750 800
801enum { /* ieee80211_basic_report.map */
802 IEEE80211_BASIC_MAP_BSS = (1 << 0),
803 IEEE80211_BASIC_MAP_OFDM = (1 << 1),
804 IEEE80211_BASIC_MAP_UNIDENTIFIED = (1 << 2),
805 IEEE80211_BASIC_MAP_RADAR = (1 << 3),
806 IEEE80211_BASIC_MAP_UNMEASURED = (1 << 4),
807 /* Bits 5-7 are reserved */
808
809};
810struct ieee80211_basic_report {
811 u8 channel;
812 __le64 start_time;
813 __le16 duration;
814 u8 map;
815} __attribute__ ((packed));
816
817enum { /* ieee80211_measurement_request.mode */
818 /* Bit 0 is reserved */
819 IEEE80211_MEASUREMENT_ENABLE = (1 << 1),
820 IEEE80211_MEASUREMENT_REQUEST = (1 << 2),
821 IEEE80211_MEASUREMENT_REPORT = (1 << 3),
822 /* Bits 4-7 are reserved */
823};
824
825enum {
826 IEEE80211_REPORT_BASIC = 0, /* required */
827 IEEE80211_REPORT_CCA = 1, /* optional */
828 IEEE80211_REPORT_RPI = 2, /* optional */
829 /* 3-255 reserved */
830};
831
832struct ieee80211_measurement_params {
833 u8 channel;
834 __le64 start_time;
835 __le16 duration;
836} __attribute__ ((packed));
837
838struct ieee80211_measurement_request {
839 struct ieee80211_info_element ie;
840 u8 token;
841 u8 mode;
842 u8 type;
843 struct ieee80211_measurement_params params[0];
844} __attribute__ ((packed));
845
846struct ieee80211_measurement_report {
847 struct ieee80211_info_element ie;
848 u8 token;
849 u8 mode;
850 u8 type;
851 union {
852 struct ieee80211_basic_report basic[0];
853 } u;
854} __attribute__ ((packed));
855
856struct ieee80211_tpc_report {
857 u8 transmit_power;
858 u8 link_margin;
859} __attribute__ ((packed));
860
861struct ieee80211_channel_map {
862 u8 channel;
863 u8 map;
864} __attribute__ ((packed));
865
866struct ieee80211_ibss_dfs {
867 struct ieee80211_info_element ie;
868 u8 owner[ETH_ALEN];
869 u8 recovery_interval;
870 struct ieee80211_channel_map channel_map[0];
871};
872
873struct ieee80211_csa {
874 u8 mode;
875 u8 channel;
876 u8 count;
877} __attribute__ ((packed));
878
879struct ieee80211_quiet {
880 u8 count;
881 u8 period;
882 u8 duration;
883 u8 offset;
884} __attribute__ ((packed));
885
751struct ieee80211_network { 886struct ieee80211_network {
752 /* These entries are used to identify a unique network */ 887 /* These entries are used to identify a unique network */
753 u8 bssid[ETH_ALEN]; 888 u8 bssid[ETH_ALEN];
@@ -767,7 +902,7 @@ struct ieee80211_network {
767 u8 rates_ex_len; 902 u8 rates_ex_len;
768 unsigned long last_scanned; 903 unsigned long last_scanned;
769 u8 mode; 904 u8 mode;
770 u8 flags; 905 u32 flags;
771 u32 last_associate; 906 u32 last_associate;
772 u32 time_stamp[2]; 907 u32 time_stamp[2];
773 u16 beacon_interval; 908 u16 beacon_interval;
@@ -779,6 +914,25 @@ struct ieee80211_network {
779 u8 rsn_ie[MAX_WPA_IE_LEN]; 914 u8 rsn_ie[MAX_WPA_IE_LEN];
780 size_t rsn_ie_len; 915 size_t rsn_ie_len;
781 struct ieee80211_tim_parameters tim; 916 struct ieee80211_tim_parameters tim;
917
918 /* 802.11h info */
919
920 /* Power Constraint - mandatory if spctrm mgmt required */
921 u8 power_constraint;
922
923 /* TPC Report - mandatory if spctrm mgmt required */
924 struct ieee80211_tpc_report tpc_report;
925
926 /* IBSS DFS - mandatory if spctrm mgmt required and IBSS
927 * NOTE: This is variable length and so must be allocated dynamically */
928 struct ieee80211_ibss_dfs *ibss_dfs;
929
930 /* Channel Switch Announcement - optional if spctrm mgmt required */
931 struct ieee80211_csa csa;
932
933 /* Quiet - optional if spctrm mgmt required */
934 struct ieee80211_quiet quiet;
935
782 struct list_head list; 936 struct list_head list;
783}; 937};
784 938
@@ -924,7 +1078,10 @@ struct ieee80211_device {
924 int (*handle_auth) (struct net_device * dev, 1078 int (*handle_auth) (struct net_device * dev,
925 struct ieee80211_auth * auth); 1079 struct ieee80211_auth * auth);
926 int (*handle_deauth) (struct net_device * dev, 1080 int (*handle_deauth) (struct net_device * dev,
927 struct ieee80211_auth * auth); 1081 struct ieee80211_deauth * auth);
1082 int (*handle_action) (struct net_device * dev,
1083 struct ieee80211_action * action,
1084 struct ieee80211_rx_stats * stats);
928 int (*handle_disassoc) (struct net_device * dev, 1085 int (*handle_disassoc) (struct net_device * dev,
929 struct ieee80211_disassoc * assoc); 1086 struct ieee80211_disassoc * assoc);
930 int (*handle_beacon) (struct net_device * dev, 1087 int (*handle_beacon) (struct net_device * dev,
@@ -1093,6 +1250,7 @@ extern int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
1093extern void ieee80211_rx_mgt(struct ieee80211_device *ieee, 1250extern void ieee80211_rx_mgt(struct ieee80211_device *ieee,
1094 struct ieee80211_hdr_4addr *header, 1251 struct ieee80211_hdr_4addr *header,
1095 struct ieee80211_rx_stats *stats); 1252 struct ieee80211_rx_stats *stats);
1253extern void ieee80211_network_reset(struct ieee80211_network *network);
1096 1254
1097/* ieee80211_geo.c */ 1255/* ieee80211_geo.c */
1098extern const struct ieee80211_geo *ieee80211_get_geo(struct ieee80211_device 1256extern const struct ieee80211_geo *ieee80211_get_geo(struct ieee80211_device
@@ -1105,6 +1263,11 @@ extern int ieee80211_is_valid_channel(struct ieee80211_device *ieee,
1105extern int ieee80211_channel_to_index(struct ieee80211_device *ieee, 1263extern int ieee80211_channel_to_index(struct ieee80211_device *ieee,
1106 u8 channel); 1264 u8 channel);
1107extern u8 ieee80211_freq_to_channel(struct ieee80211_device *ieee, u32 freq); 1265extern u8 ieee80211_freq_to_channel(struct ieee80211_device *ieee, u32 freq);
1266extern u8 ieee80211_get_channel_flags(struct ieee80211_device *ieee,
1267 u8 channel);
1268extern const struct ieee80211_channel *ieee80211_get_channel(struct
1269 ieee80211_device
1270 *ieee, u8 channel);
1108 1271
1109/* ieee80211_wx.c */ 1272/* ieee80211_wx.c */
1110extern int ieee80211_wx_get_scan(struct ieee80211_device *ieee, 1273extern int ieee80211_wx_get_scan(struct ieee80211_device *ieee,
@@ -1122,6 +1285,14 @@ extern int ieee80211_wx_set_encodeext(struct ieee80211_device *ieee,
1122extern int ieee80211_wx_get_encodeext(struct ieee80211_device *ieee, 1285extern int ieee80211_wx_get_encodeext(struct ieee80211_device *ieee,
1123 struct iw_request_info *info, 1286 struct iw_request_info *info,
1124 union iwreq_data *wrqu, char *extra); 1287 union iwreq_data *wrqu, char *extra);
1288extern int ieee80211_wx_set_auth(struct net_device *dev,
1289 struct iw_request_info *info,
1290 union iwreq_data *wrqu,
1291 char *extra);
1292extern int ieee80211_wx_get_auth(struct net_device *dev,
1293 struct iw_request_info *info,
1294 union iwreq_data *wrqu,
1295 char *extra);
1125 1296
1126static inline void ieee80211_increment_scans(struct ieee80211_device *ieee) 1297static inline void ieee80211_increment_scans(struct ieee80211_device *ieee)
1127{ 1298{
diff --git a/include/net/ieee80211_crypt.h b/include/net/ieee80211_crypt.h
index cd82c3e998e4..eb476414fd72 100644
--- a/include/net/ieee80211_crypt.h
+++ b/include/net/ieee80211_crypt.h
@@ -47,7 +47,8 @@ struct ieee80211_crypto_ops {
47 /* deinitialize crypto context and free allocated private data */ 47 /* deinitialize crypto context and free allocated private data */
48 void (*deinit) (void *priv); 48 void (*deinit) (void *priv);
49 49
50 int (*build_iv) (struct sk_buff * skb, int hdr_len, void *priv); 50 int (*build_iv) (struct sk_buff * skb, int hdr_len,
51 u8 *key, int keylen, void *priv);
51 52
52 /* encrypt/decrypt return < 0 on error or >= 0 on success. The return 53 /* encrypt/decrypt return < 0 on error or >= 0 on success. The return
53 * value from decrypt_mpdu is passed as the keyidx value for 54 * value from decrypt_mpdu is passed as the keyidx value for