aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/ieee80211.h
diff options
context:
space:
mode:
authorZhu Yi <yi.zhu@intel.com>2006-01-19 03:21:27 -0500
committerJohn W. Linville <linville@tuxdriver.com>2006-01-27 17:08:07 -0500
commitb79e20b60997e427b701055a2c69fb0c1d507aa9 (patch)
tree318bf28699ed6042c667f01c8017c3d9d73c9f7d /include/net/ieee80211.h
parent9184d9348a7a0e60d70d5f4c23de79fdbc72b9a3 (diff)
[PATCH] ieee80211: Add 802.11h data type and structures
Add 802.11h data types and structure definitions to ieee80211.h. Signed-off-by: Hong Liu <hong.liu@intel.com> Signed-off-by: Zhu Yi <yi.zhu@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'include/net/ieee80211.h')
-rw-r--r--include/net/ieee80211.h168
1 files changed, 165 insertions, 3 deletions
diff --git a/include/net/ieee80211.h b/include/net/ieee80211.h
index 3424a3ed66c4..ff6ef9e1a691 100644
--- a/include/net/ieee80211.h
+++ b/include/net/ieee80211.h
@@ -300,6 +300,23 @@ enum ieee80211_reasoncode {
300 WLAN_REASON_CIPHER_SUITE_REJECTED = 24, 300 WLAN_REASON_CIPHER_SUITE_REJECTED = 24,
301}; 301};
302 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
303#define IEEE80211_STATMASK_SIGNAL (1<<0) 320#define IEEE80211_STATMASK_SIGNAL (1<<0)
304#define IEEE80211_STATMASK_RSSI (1<<1) 321#define IEEE80211_STATMASK_RSSI (1<<1)
305#define IEEE80211_STATMASK_NOISE (1<<2) 322#define IEEE80211_STATMASK_NOISE (1<<2)
@@ -378,6 +395,8 @@ struct ieee80211_rx_stats {
378 u8 mask; 395 u8 mask;
379 u8 freq; 396 u8 freq;
380 u16 len; 397 u16 len;
398 u64 tsf;
399 u32 beacon_time;
381}; 400};
382 401
383/* 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
@@ -609,6 +628,28 @@ struct ieee80211_auth {
609 struct ieee80211_info_element info_element[0]; 628 struct ieee80211_info_element info_element[0];
610} __attribute__ ((packed)); 629} __attribute__ ((packed));
611 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
612struct ieee80211_disassoc { 653struct ieee80211_disassoc {
613 struct ieee80211_hdr_3addr header; 654 struct ieee80211_hdr_3addr header;
614 __le16 reason; 655 __le16 reason;
@@ -693,7 +734,15 @@ struct ieee80211_txb {
693/* QoS structure */ 734/* QoS structure */
694#define NETWORK_HAS_QOS_PARAMETERS (1<<3) 735#define NETWORK_HAS_QOS_PARAMETERS (1<<3)
695#define NETWORK_HAS_QOS_INFORMATION (1<<4) 736#define NETWORK_HAS_QOS_INFORMATION (1<<4)
696#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)
697 746
698#define QOS_QUEUE_NUM 4 747#define QOS_QUEUE_NUM 4
699#define QOS_OUI_LEN 3 748#define QOS_OUI_LEN 3
@@ -749,6 +798,91 @@ struct ieee80211_tim_parameters {
749 798
750/*******************************************************/ 799/*******************************************************/
751 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
752struct ieee80211_network { 886struct ieee80211_network {
753 /* These entries are used to identify a unique network */ 887 /* These entries are used to identify a unique network */
754 u8 bssid[ETH_ALEN]; 888 u8 bssid[ETH_ALEN];
@@ -768,7 +902,7 @@ struct ieee80211_network {
768 u8 rates_ex_len; 902 u8 rates_ex_len;
769 unsigned long last_scanned; 903 unsigned long last_scanned;
770 u8 mode; 904 u8 mode;
771 u8 flags; 905 u32 flags;
772 u32 last_associate; 906 u32 last_associate;
773 u32 time_stamp[2]; 907 u32 time_stamp[2];
774 u16 beacon_interval; 908 u16 beacon_interval;
@@ -780,6 +914,25 @@ struct ieee80211_network {
780 u8 rsn_ie[MAX_WPA_IE_LEN]; 914 u8 rsn_ie[MAX_WPA_IE_LEN];
781 size_t rsn_ie_len; 915 size_t rsn_ie_len;
782 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
783 struct list_head list; 936 struct list_head list;
784}; 937};
785 938
@@ -925,7 +1078,10 @@ struct ieee80211_device {
925 int (*handle_auth) (struct net_device * dev, 1078 int (*handle_auth) (struct net_device * dev,
926 struct ieee80211_auth * auth); 1079 struct ieee80211_auth * auth);
927 int (*handle_deauth) (struct net_device * dev, 1080 int (*handle_deauth) (struct net_device * dev,
928 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);
929 int (*handle_disassoc) (struct net_device * dev, 1085 int (*handle_disassoc) (struct net_device * dev,
930 struct ieee80211_disassoc * assoc); 1086 struct ieee80211_disassoc * assoc);
931 int (*handle_beacon) (struct net_device * dev, 1087 int (*handle_beacon) (struct net_device * dev,
@@ -1094,6 +1250,7 @@ extern int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
1094extern void ieee80211_rx_mgt(struct ieee80211_device *ieee, 1250extern void ieee80211_rx_mgt(struct ieee80211_device *ieee,
1095 struct ieee80211_hdr_4addr *header, 1251 struct ieee80211_hdr_4addr *header,
1096 struct ieee80211_rx_stats *stats); 1252 struct ieee80211_rx_stats *stats);
1253extern void ieee80211_network_reset(struct ieee80211_network *network);
1097 1254
1098/* ieee80211_geo.c */ 1255/* ieee80211_geo.c */
1099extern const struct ieee80211_geo *ieee80211_get_geo(struct ieee80211_device 1256extern const struct ieee80211_geo *ieee80211_get_geo(struct ieee80211_device
@@ -1106,6 +1263,11 @@ extern int ieee80211_is_valid_channel(struct ieee80211_device *ieee,
1106extern int ieee80211_channel_to_index(struct ieee80211_device *ieee, 1263extern int ieee80211_channel_to_index(struct ieee80211_device *ieee,
1107 u8 channel); 1264 u8 channel);
1108extern 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);
1109 1271
1110/* ieee80211_wx.c */ 1272/* ieee80211_wx.c */
1111extern int ieee80211_wx_get_scan(struct ieee80211_device *ieee, 1273extern int ieee80211_wx_get_scan(struct ieee80211_device *ieee,