aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/ieee80211.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/net/ieee80211.h')
-rw-r--r--include/net/ieee80211.h103
1 files changed, 99 insertions, 4 deletions
diff --git a/include/net/ieee80211.h b/include/net/ieee80211.h
index 46466f5a2b45..72bd2b17eeb4 100644
--- a/include/net/ieee80211.h
+++ b/include/net/ieee80211.h
@@ -92,6 +92,7 @@
92#define IEEE80211_STYPE_CFACK 0x0050 92#define IEEE80211_STYPE_CFACK 0x0050
93#define IEEE80211_STYPE_CFPOLL 0x0060 93#define IEEE80211_STYPE_CFPOLL 0x0060
94#define IEEE80211_STYPE_CFACKPOLL 0x0070 94#define IEEE80211_STYPE_CFACKPOLL 0x0070
95#define IEEE80211_STYPE_QOS_DATA 0x0080
95 96
96#define IEEE80211_SCTL_FRAG 0x000F 97#define IEEE80211_SCTL_FRAG 0x000F
97#define IEEE80211_SCTL_SEQ 0xFFF0 98#define IEEE80211_SCTL_SEQ 0xFFF0
@@ -153,6 +154,7 @@ const char *escape_essid(const char *essid, u8 essid_len);
153 154
154#define IEEE80211_DL_TX (1<<8) 155#define IEEE80211_DL_TX (1<<8)
155#define IEEE80211_DL_RX (1<<9) 156#define IEEE80211_DL_RX (1<<9)
157#define IEEE80211_DL_QOS (1<<31)
156 158
157#define IEEE80211_ERROR(f, a...) printk(KERN_ERR "ieee80211: " f, ## a) 159#define IEEE80211_ERROR(f, a...) printk(KERN_ERR "ieee80211: " f, ## a)
158#define IEEE80211_WARNING(f, a...) printk(KERN_WARNING "ieee80211: " f, ## a) 160#define IEEE80211_WARNING(f, a...) printk(KERN_WARNING "ieee80211: " f, ## a)
@@ -166,6 +168,7 @@ const char *escape_essid(const char *essid, u8 essid_len);
166#define IEEE80211_DEBUG_DROP(f, a...) IEEE80211_DEBUG(IEEE80211_DL_DROP, f, ## a) 168#define IEEE80211_DEBUG_DROP(f, a...) IEEE80211_DEBUG(IEEE80211_DL_DROP, f, ## a)
167#define IEEE80211_DEBUG_TX(f, a...) IEEE80211_DEBUG(IEEE80211_DL_TX, f, ## a) 169#define IEEE80211_DEBUG_TX(f, a...) IEEE80211_DEBUG(IEEE80211_DL_TX, f, ## a)
168#define IEEE80211_DEBUG_RX(f, a...) IEEE80211_DEBUG(IEEE80211_DL_RX, f, ## a) 170#define IEEE80211_DEBUG_RX(f, a...) IEEE80211_DEBUG(IEEE80211_DL_RX, f, ## a)
171#define IEEE80211_DEBUG_QOS(f, a...) IEEE80211_DEBUG(IEEE80211_DL_QOS, f, ## a)
169#include <linux/netdevice.h> 172#include <linux/netdevice.h>
170#include <linux/wireless.h> 173#include <linux/wireless.h>
171#include <linux/if_arp.h> /* ARPHRD_ETHER */ 174#include <linux/if_arp.h> /* ARPHRD_ETHER */
@@ -493,6 +496,7 @@ enum ieee80211_mfie {
493 MFIE_TYPE_RSN = 48, 496 MFIE_TYPE_RSN = 48,
494 MFIE_TYPE_RATES_EX = 50, 497 MFIE_TYPE_RATES_EX = 50,
495 MFIE_TYPE_GENERIC = 221, 498 MFIE_TYPE_GENERIC = 221,
499 MFIE_TYPE_QOS_PARAMETER = 222,
496}; 500};
497 501
498/* Minimal header; can be used for passing 802.11 frames with sufficient 502/* Minimal header; can be used for passing 802.11 frames with sufficient
@@ -540,6 +544,29 @@ struct ieee80211_hdr_4addr {
540 u8 payload[0]; 544 u8 payload[0];
541} __attribute__ ((packed)); 545} __attribute__ ((packed));
542 546
547struct ieee80211_hdr_3addrqos {
548 u16 frame_ctl;
549 u16 duration_id;
550 u8 addr1[ETH_ALEN];
551 u8 addr2[ETH_ALEN];
552 u8 addr3[ETH_ALEN];
553 u16 seq_ctl;
554 u8 payload[0];
555 u16 qos_ctl;
556} __attribute__ ((packed));
557
558struct ieee80211_hdr_4addrqos {
559 u16 frame_ctl;
560 u16 duration_id;
561 u8 addr1[ETH_ALEN];
562 u8 addr2[ETH_ALEN];
563 u8 addr3[ETH_ALEN];
564 u16 seq_ctl;
565 u8 addr4[ETH_ALEN];
566 u8 payload[0];
567 u16 qos_ctl;
568} __attribute__ ((packed));
569
543struct ieee80211_info_element { 570struct ieee80211_info_element {
544 u8 id; 571 u8 id;
545 u8 len; 572 u8 len;
@@ -641,9 +668,68 @@ struct ieee80211_txb {
641 668
642#define MAX_WPA_IE_LEN 64 669#define MAX_WPA_IE_LEN 64
643 670
644#define NETWORK_EMPTY_ESSID (1<<0) 671#define NETWORK_EMPTY_ESSID (1<<0)
645#define NETWORK_HAS_OFDM (1<<1) 672#define NETWORK_HAS_OFDM (1<<1)
646#define NETWORK_HAS_CCK (1<<2) 673#define NETWORK_HAS_CCK (1<<2)
674
675/* QoS structure */
676#define NETWORK_HAS_QOS_PARAMETERS (1<<3)
677#define NETWORK_HAS_QOS_INFORMATION (1<<4)
678#define NETWORK_HAS_QOS_MASK (NETWORK_HAS_QOS_PARAMETERS | NETWORK_HAS_QOS_INFORMATION)
679
680#define QOS_QUEUE_NUM 4
681#define QOS_OUI_LEN 3
682#define QOS_OUI_TYPE 2
683#define QOS_ELEMENT_ID 221
684#define QOS_OUI_INFO_SUB_TYPE 0
685#define QOS_OUI_PARAM_SUB_TYPE 1
686#define QOS_VERSION_1 1
687#define QOS_AIFSN_MIN_VALUE 2
688
689struct ieee80211_qos_information_element {
690 u8 elementID;
691 u8 length;
692 u8 qui[QOS_OUI_LEN];
693 u8 qui_type;
694 u8 qui_subtype;
695 u8 version;
696 u8 ac_info;
697} __attribute__ ((packed));
698
699struct ieee80211_qos_ac_parameter {
700 u8 aci_aifsn;
701 u8 ecw_min_max;
702 u16 tx_op_limit;
703} __attribute__ ((packed));
704
705struct ieee80211_qos_parameter_info {
706 struct ieee80211_qos_information_element info_element;
707 u8 reserved;
708 struct ieee80211_qos_ac_parameter ac_params_record[QOS_QUEUE_NUM];
709} __attribute__ ((packed));
710
711struct ieee80211_qos_parameters {
712 u16 cw_min[QOS_QUEUE_NUM];
713 u16 cw_max[QOS_QUEUE_NUM];
714 u8 aifs[QOS_QUEUE_NUM];
715 u8 flag[QOS_QUEUE_NUM];
716 u16 tx_op_limit[QOS_QUEUE_NUM];
717} __attribute__ ((packed));
718
719struct ieee80211_qos_data {
720 struct ieee80211_qos_parameters parameters;
721 int active;
722 int supported;
723 u8 param_count;
724 u8 old_param_count;
725};
726
727struct ieee80211_tim_parameters {
728 u8 tim_count;
729 u8 tim_period;
730} __attribute__ ((packed));
731
732/*******************************************************/
647 733
648struct ieee80211_network { 734struct ieee80211_network {
649 /* These entries are used to identify a unique network */ 735 /* These entries are used to identify a unique network */
@@ -653,6 +739,8 @@ struct ieee80211_network {
653 u8 ssid[IW_ESSID_MAX_SIZE + 1]; 739 u8 ssid[IW_ESSID_MAX_SIZE + 1];
654 u8 ssid_len; 740 u8 ssid_len;
655 741
742 struct ieee80211_qos_data qos_data;
743
656 /* These are network statistics */ 744 /* These are network statistics */
657 struct ieee80211_rx_stats stats; 745 struct ieee80211_rx_stats stats;
658 u16 capability; 746 u16 capability;
@@ -672,6 +760,7 @@ struct ieee80211_network {
672 size_t wpa_ie_len; 760 size_t wpa_ie_len;
673 u8 rsn_ie[MAX_WPA_IE_LEN]; 761 u8 rsn_ie[MAX_WPA_IE_LEN];
674 size_t rsn_ie_len; 762 size_t rsn_ie_len;
763 struct ieee80211_tim_parameters tim;
675 struct list_head list; 764 struct list_head list;
676}; 765};
677 766
@@ -769,10 +858,13 @@ struct ieee80211_device {
769 void (*set_security) (struct net_device * dev, 858 void (*set_security) (struct net_device * dev,
770 struct ieee80211_security * sec); 859 struct ieee80211_security * sec);
771 int (*hard_start_xmit) (struct ieee80211_txb * txb, 860 int (*hard_start_xmit) (struct ieee80211_txb * txb,
772 struct net_device * dev); 861 struct net_device * dev, int pri);
773 int (*reset_port) (struct net_device * dev); 862 int (*reset_port) (struct net_device * dev);
774 int (*is_queue_full) (struct net_device * dev, int pri); 863 int (*is_queue_full) (struct net_device * dev, int pri);
775 864
865 int (*handle_management) (struct net_device * dev,
866 struct ieee80211_network * network, u16 type);
867
776 /* Typical STA methods */ 868 /* Typical STA methods */
777 int (*handle_auth) (struct net_device * dev, 869 int (*handle_auth) (struct net_device * dev,
778 struct ieee80211_auth * auth); 870 struct ieee80211_auth * auth);
@@ -854,11 +946,14 @@ extern inline int ieee80211_is_valid_mode(struct ieee80211_device *ieee,
854extern inline int ieee80211_get_hdrlen(u16 fc) 946extern inline int ieee80211_get_hdrlen(u16 fc)
855{ 947{
856 int hdrlen = IEEE80211_3ADDR_LEN; 948 int hdrlen = IEEE80211_3ADDR_LEN;
949 u16 stype = WLAN_FC_GET_STYPE(fc);
857 950
858 switch (WLAN_FC_GET_TYPE(fc)) { 951 switch (WLAN_FC_GET_TYPE(fc)) {
859 case IEEE80211_FTYPE_DATA: 952 case IEEE80211_FTYPE_DATA:
860 if ((fc & IEEE80211_FCTL_FROMDS) && (fc & IEEE80211_FCTL_TODS)) 953 if ((fc & IEEE80211_FCTL_FROMDS) && (fc & IEEE80211_FCTL_TODS))
861 hdrlen = IEEE80211_4ADDR_LEN; 954 hdrlen = IEEE80211_4ADDR_LEN;
955 if (stype & IEEE80211_STYPE_QOS_DATA)
956 hdrlen += 2;
862 break; 957 break;
863 case IEEE80211_FTYPE_CTL: 958 case IEEE80211_FTYPE_CTL:
864 switch (WLAN_FC_GET_STYPE(fc)) { 959 switch (WLAN_FC_GET_STYPE(fc)) {