aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/linux/dccp.h13
-rw-r--r--include/linux/ieee80211.h142
-rw-r--r--include/linux/if.h1
-rw-r--r--include/linux/kernel.h12
-rw-r--r--include/linux/netdevice.h33
-rw-r--r--include/linux/nl80211.h98
-rw-r--r--include/linux/rculist.h17
-rw-r--r--include/linux/skbuff.h19
-rw-r--r--include/linux/sunrpc/svc_xprt.h8
-rw-r--r--include/linux/xfrm.h14
-rw-r--r--include/net/cfg80211.h32
-rw-r--r--include/net/dst.h3
-rw-r--r--include/net/ieee80211.h133
-rw-r--r--include/net/ip_vs.h11
-rw-r--r--include/net/lib80211.h18
-rw-r--r--include/net/mac80211.h414
-rw-r--r--include/net/netfilter/nf_conntrack_tuple.h12
-rw-r--r--include/net/netlink.h22
-rw-r--r--include/net/netns/ipv4.h2
-rw-r--r--include/net/sch_generic.h35
-rw-r--r--include/net/sctp/sctp.h8
-rw-r--r--include/net/sock.h43
-rw-r--r--include/net/udp.h25
-rw-r--r--include/net/udplite.h2
-rw-r--r--include/net/wireless.h58
-rw-r--r--include/net/xfrm.h5
26 files changed, 709 insertions, 471 deletions
diff --git a/include/linux/dccp.h b/include/linux/dccp.h
index 6080449fbec9..484b8a1fb023 100644
--- a/include/linux/dccp.h
+++ b/include/linux/dccp.h
@@ -176,19 +176,20 @@ enum {
176}; 176};
177 177
178/* DCCP features (RFC 4340 section 6.4) */ 178/* DCCP features (RFC 4340 section 6.4) */
179enum { 179enum dccp_feature_numbers {
180 DCCPF_RESERVED = 0, 180 DCCPF_RESERVED = 0,
181 DCCPF_CCID = 1, 181 DCCPF_CCID = 1,
182 DCCPF_SHORT_SEQNOS = 2, /* XXX: not yet implemented */ 182 DCCPF_SHORT_SEQNOS = 2,
183 DCCPF_SEQUENCE_WINDOW = 3, 183 DCCPF_SEQUENCE_WINDOW = 3,
184 DCCPF_ECN_INCAPABLE = 4, /* XXX: not yet implemented */ 184 DCCPF_ECN_INCAPABLE = 4,
185 DCCPF_ACK_RATIO = 5, 185 DCCPF_ACK_RATIO = 5,
186 DCCPF_SEND_ACK_VECTOR = 6, 186 DCCPF_SEND_ACK_VECTOR = 6,
187 DCCPF_SEND_NDP_COUNT = 7, 187 DCCPF_SEND_NDP_COUNT = 7,
188 DCCPF_MIN_CSUM_COVER = 8, 188 DCCPF_MIN_CSUM_COVER = 8,
189 DCCPF_DATA_CHECKSUM = 9, /* XXX: not yet implemented */ 189 DCCPF_DATA_CHECKSUM = 9,
190 /* 10-127 reserved */ 190 /* 10-127 reserved */
191 DCCPF_MIN_CCID_SPECIFIC = 128, 191 DCCPF_MIN_CCID_SPECIFIC = 128,
192 DCCPF_SEND_LEV_RATE = 192, /* RFC 4342, sec. 8.4 */
192 DCCPF_MAX_CCID_SPECIFIC = 255, 193 DCCPF_MAX_CCID_SPECIFIC = 255,
193}; 194};
194 195
@@ -411,6 +412,7 @@ extern void dccp_minisock_init(struct dccp_minisock *dmsk);
411 * @dreq_iss: initial sequence number sent on the Response (RFC 4340, 7.1) 412 * @dreq_iss: initial sequence number sent on the Response (RFC 4340, 7.1)
412 * @dreq_isr: initial sequence number received on the Request 413 * @dreq_isr: initial sequence number received on the Request
413 * @dreq_service: service code present on the Request (there is just one) 414 * @dreq_service: service code present on the Request (there is just one)
415 * @dreq_featneg: feature negotiation options for this connection
414 * The following two fields are analogous to the ones in dccp_sock: 416 * The following two fields are analogous to the ones in dccp_sock:
415 * @dreq_timestamp_echo: last received timestamp to echo (13.1) 417 * @dreq_timestamp_echo: last received timestamp to echo (13.1)
416 * @dreq_timestamp_echo: the time of receiving the last @dreq_timestamp_echo 418 * @dreq_timestamp_echo: the time of receiving the last @dreq_timestamp_echo
@@ -420,6 +422,7 @@ struct dccp_request_sock {
420 __u64 dreq_iss; 422 __u64 dreq_iss;
421 __u64 dreq_isr; 423 __u64 dreq_isr;
422 __be32 dreq_service; 424 __be32 dreq_service;
425 struct list_head dreq_featneg;
423 __u32 dreq_timestamp_echo; 426 __u32 dreq_timestamp_echo;
424 __u32 dreq_timestamp_time; 427 __u32 dreq_timestamp_time;
425}; 428};
@@ -497,6 +500,7 @@ struct dccp_ackvec;
497 * @dccps_mss_cache - current value of MSS (path MTU minus header sizes) 500 * @dccps_mss_cache - current value of MSS (path MTU minus header sizes)
498 * @dccps_rate_last - timestamp for rate-limiting DCCP-Sync (RFC 4340, 7.5.4) 501 * @dccps_rate_last - timestamp for rate-limiting DCCP-Sync (RFC 4340, 7.5.4)
499 * @dccps_minisock - associated minisock (accessed via dccp_msk) 502 * @dccps_minisock - associated minisock (accessed via dccp_msk)
503 * @dccps_featneg - tracks feature-negotiation state (mostly during handshake)
500 * @dccps_hc_rx_ackvec - rx half connection ack vector 504 * @dccps_hc_rx_ackvec - rx half connection ack vector
501 * @dccps_hc_rx_ccid - CCID used for the receiver (or receiving half-connection) 505 * @dccps_hc_rx_ccid - CCID used for the receiver (or receiving half-connection)
502 * @dccps_hc_tx_ccid - CCID used for the sender (or sending half-connection) 506 * @dccps_hc_tx_ccid - CCID used for the sender (or sending half-connection)
@@ -534,6 +538,7 @@ struct dccp_sock {
534 __u64 dccps_ndp_count:48; 538 __u64 dccps_ndp_count:48;
535 unsigned long dccps_rate_last; 539 unsigned long dccps_rate_last;
536 struct dccp_minisock dccps_minisock; 540 struct dccp_minisock dccps_minisock;
541 struct list_head dccps_featneg;
537 struct dccp_ackvec *dccps_hc_rx_ackvec; 542 struct dccp_ackvec *dccps_hc_rx_ackvec;
538 struct ccid *dccps_hc_rx_ccid; 543 struct ccid *dccps_hc_rx_ccid;
539 struct ccid *dccps_hc_tx_ccid; 544 struct ccid *dccps_hc_tx_ccid;
diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h
index 14126bc36641..aad99195a4cc 100644
--- a/include/linux/ieee80211.h
+++ b/include/linux/ieee80211.h
@@ -12,8 +12,8 @@
12 * published by the Free Software Foundation. 12 * published by the Free Software Foundation.
13 */ 13 */
14 14
15#ifndef IEEE80211_H 15#ifndef LINUX_IEEE80211_H
16#define IEEE80211_H 16#define LINUX_IEEE80211_H
17 17
18#include <linux/types.h> 18#include <linux/types.h>
19#include <asm/byteorder.h> 19#include <asm/byteorder.h>
@@ -685,28 +685,88 @@ struct ieee80211_bar {
685#define IEEE80211_BAR_CTRL_ACK_POLICY_NORMAL 0x0000 685#define IEEE80211_BAR_CTRL_ACK_POLICY_NORMAL 0x0000
686#define IEEE80211_BAR_CTRL_CBMTID_COMPRESSED_BA 0x0004 686#define IEEE80211_BAR_CTRL_CBMTID_COMPRESSED_BA 0x0004
687 687
688
689#define IEEE80211_HT_MCS_MASK_LEN 10
690
691/**
692 * struct ieee80211_mcs_info - MCS information
693 * @rx_mask: RX mask
694 * @rx_highest: highest supported RX rate
695 * @tx_params: TX parameters
696 */
697struct ieee80211_mcs_info {
698 u8 rx_mask[IEEE80211_HT_MCS_MASK_LEN];
699 __le16 rx_highest;
700 u8 tx_params;
701 u8 reserved[3];
702} __attribute__((packed));
703
704/* 802.11n HT capability MSC set */
705#define IEEE80211_HT_MCS_RX_HIGHEST_MASK 0x3ff
706#define IEEE80211_HT_MCS_TX_DEFINED 0x01
707#define IEEE80211_HT_MCS_TX_RX_DIFF 0x02
708/* value 0 == 1 stream etc */
709#define IEEE80211_HT_MCS_TX_MAX_STREAMS_MASK 0x0C
710#define IEEE80211_HT_MCS_TX_MAX_STREAMS_SHIFT 2
711#define IEEE80211_HT_MCS_TX_MAX_STREAMS 4
712#define IEEE80211_HT_MCS_TX_UNEQUAL_MODULATION 0x10
713
714/*
715 * 802.11n D5.0 20.3.5 / 20.6 says:
716 * - indices 0 to 7 and 32 are single spatial stream
717 * - 8 to 31 are multiple spatial streams using equal modulation
718 * [8..15 for two streams, 16..23 for three and 24..31 for four]
719 * - remainder are multiple spatial streams using unequal modulation
720 */
721#define IEEE80211_HT_MCS_UNEQUAL_MODULATION_START 33
722#define IEEE80211_HT_MCS_UNEQUAL_MODULATION_START_BYTE \
723 (IEEE80211_HT_MCS_UNEQUAL_MODULATION_START / 8)
724
688/** 725/**
689 * struct ieee80211_ht_cap - HT capabilities 726 * struct ieee80211_ht_cap - HT capabilities
690 * 727 *
691 * This structure refers to "HT capabilities element" as 728 * This structure is the "HT capabilities element" as
692 * described in 802.11n draft section 7.3.2.52 729 * described in 802.11n D5.0 7.3.2.57
693 */ 730 */
694struct ieee80211_ht_cap { 731struct ieee80211_ht_cap {
695 __le16 cap_info; 732 __le16 cap_info;
696 u8 ampdu_params_info; 733 u8 ampdu_params_info;
697 u8 supp_mcs_set[16]; 734
735 /* 16 bytes MCS information */
736 struct ieee80211_mcs_info mcs;
737
698 __le16 extended_ht_cap_info; 738 __le16 extended_ht_cap_info;
699 __le32 tx_BF_cap_info; 739 __le32 tx_BF_cap_info;
700 u8 antenna_selection_info; 740 u8 antenna_selection_info;
701} __attribute__ ((packed)); 741} __attribute__ ((packed));
702 742
743/* 802.11n HT capabilities masks (for cap_info) */
744#define IEEE80211_HT_CAP_LDPC_CODING 0x0001
745#define IEEE80211_HT_CAP_SUP_WIDTH_20_40 0x0002
746#define IEEE80211_HT_CAP_SM_PS 0x000C
747#define IEEE80211_HT_CAP_GRN_FLD 0x0010
748#define IEEE80211_HT_CAP_SGI_20 0x0020
749#define IEEE80211_HT_CAP_SGI_40 0x0040
750#define IEEE80211_HT_CAP_TX_STBC 0x0080
751#define IEEE80211_HT_CAP_RX_STBC 0x0300
752#define IEEE80211_HT_CAP_DELAY_BA 0x0400
753#define IEEE80211_HT_CAP_MAX_AMSDU 0x0800
754#define IEEE80211_HT_CAP_DSSSCCK40 0x1000
755#define IEEE80211_HT_CAP_PSMP_SUPPORT 0x2000
756#define IEEE80211_HT_CAP_40MHZ_INTOLERANT 0x4000
757#define IEEE80211_HT_CAP_LSIG_TXOP_PROT 0x8000
758
759/* 802.11n HT capability AMPDU settings (for ampdu_params_info) */
760#define IEEE80211_HT_AMPDU_PARM_FACTOR 0x03
761#define IEEE80211_HT_AMPDU_PARM_DENSITY 0x1C
762
703/** 763/**
704 * struct ieee80211_ht_cap - HT additional information 764 * struct ieee80211_ht_info - HT information
705 * 765 *
706 * This structure refers to "HT information element" as 766 * This structure is the "HT information element" as
707 * described in 802.11n draft section 7.3.2.53 767 * described in 802.11n D5.0 7.3.2.58
708 */ 768 */
709struct ieee80211_ht_addt_info { 769struct ieee80211_ht_info {
710 u8 control_chan; 770 u8 control_chan;
711 u8 ht_param; 771 u8 ht_param;
712 __le16 operation_mode; 772 __le16 operation_mode;
@@ -714,36 +774,33 @@ struct ieee80211_ht_addt_info {
714 u8 basic_set[16]; 774 u8 basic_set[16];
715} __attribute__ ((packed)); 775} __attribute__ ((packed));
716 776
717/* 802.11n HT capabilities masks */ 777/* for ht_param */
718#define IEEE80211_HT_CAP_SUP_WIDTH 0x0002 778#define IEEE80211_HT_PARAM_CHA_SEC_OFFSET 0x03
719#define IEEE80211_HT_CAP_SM_PS 0x000C 779#define IEEE80211_HT_PARAM_CHA_SEC_NONE 0x00
720#define IEEE80211_HT_CAP_GRN_FLD 0x0010 780#define IEEE80211_HT_PARAM_CHA_SEC_ABOVE 0x01
721#define IEEE80211_HT_CAP_SGI_20 0x0020 781#define IEEE80211_HT_PARAM_CHA_SEC_BELOW 0x03
722#define IEEE80211_HT_CAP_SGI_40 0x0040 782#define IEEE80211_HT_PARAM_CHAN_WIDTH_ANY 0x04
723#define IEEE80211_HT_CAP_DELAY_BA 0x0400 783#define IEEE80211_HT_PARAM_RIFS_MODE 0x08
724#define IEEE80211_HT_CAP_MAX_AMSDU 0x0800 784#define IEEE80211_HT_PARAM_SPSMP_SUPPORT 0x10
725#define IEEE80211_HT_CAP_DSSSCCK40 0x1000 785#define IEEE80211_HT_PARAM_SERV_INTERVAL_GRAN 0xE0
726/* 802.11n HT capability AMPDU settings */ 786
727#define IEEE80211_HT_CAP_AMPDU_FACTOR 0x03 787/* for operation_mode */
728#define IEEE80211_HT_CAP_AMPDU_DENSITY 0x1C 788#define IEEE80211_HT_OP_MODE_PROTECTION 0x0003
729/* 802.11n HT capability MSC set */ 789#define IEEE80211_HT_OP_MODE_PROTECTION_NONE 0
730#define IEEE80211_SUPP_MCS_SET_UEQM 4 790#define IEEE80211_HT_OP_MODE_PROTECTION_NONMEMBER 1
731#define IEEE80211_HT_CAP_MAX_STREAMS 4 791#define IEEE80211_HT_OP_MODE_PROTECTION_20MHZ 2
732#define IEEE80211_SUPP_MCS_SET_LEN 10 792#define IEEE80211_HT_OP_MODE_PROTECTION_NONHT_MIXED 3
733/* maximum streams the spec allows */ 793#define IEEE80211_HT_OP_MODE_NON_GF_STA_PRSNT 0x0004
734#define IEEE80211_HT_CAP_MCS_TX_DEFINED 0x01 794#define IEEE80211_HT_OP_MODE_NON_HT_STA_PRSNT 0x0010
735#define IEEE80211_HT_CAP_MCS_TX_RX_DIFF 0x02 795
736#define IEEE80211_HT_CAP_MCS_TX_STREAMS 0x0C 796/* for stbc_param */
737#define IEEE80211_HT_CAP_MCS_TX_UEQM 0x10 797#define IEEE80211_HT_STBC_PARAM_DUAL_BEACON 0x0040
738/* 802.11n HT IE masks */ 798#define IEEE80211_HT_STBC_PARAM_DUAL_CTS_PROT 0x0080
739#define IEEE80211_HT_IE_CHA_SEC_OFFSET 0x03 799#define IEEE80211_HT_STBC_PARAM_STBC_BEACON 0x0100
740#define IEEE80211_HT_IE_CHA_SEC_NONE 0x00 800#define IEEE80211_HT_STBC_PARAM_LSIG_TXOP_FULLPROT 0x0200
741#define IEEE80211_HT_IE_CHA_SEC_ABOVE 0x01 801#define IEEE80211_HT_STBC_PARAM_PCO_ACTIVE 0x0400
742#define IEEE80211_HT_IE_CHA_SEC_BELOW 0x03 802#define IEEE80211_HT_STBC_PARAM_PCO_PHASE 0x0800
743#define IEEE80211_HT_IE_CHA_WIDTH 0x04 803
744#define IEEE80211_HT_IE_HT_PROTECTION 0x0003
745#define IEEE80211_HT_IE_NON_GF_STA_PRSNT 0x0004
746#define IEEE80211_HT_IE_NON_HT_STA_PRSNT 0x0010
747 804
748/* block-ack parameters */ 805/* block-ack parameters */
749#define IEEE80211_ADDBA_PARAM_POLICY_MASK 0x0002 806#define IEEE80211_ADDBA_PARAM_POLICY_MASK 0x0002
@@ -769,8 +826,7 @@ struct ieee80211_ht_addt_info {
769/* Authentication algorithms */ 826/* Authentication algorithms */
770#define WLAN_AUTH_OPEN 0 827#define WLAN_AUTH_OPEN 0
771#define WLAN_AUTH_SHARED_KEY 1 828#define WLAN_AUTH_SHARED_KEY 1
772#define WLAN_AUTH_FAST_BSS_TRANSITION 2 829#define WLAN_AUTH_LEAP 2
773#define WLAN_AUTH_LEAP 128
774 830
775#define WLAN_AUTH_CHALLENGE_LEN 128 831#define WLAN_AUTH_CHALLENGE_LEN 128
776 832
@@ -949,7 +1005,7 @@ enum ieee80211_eid {
949 WLAN_EID_EXT_SUPP_RATES = 50, 1005 WLAN_EID_EXT_SUPP_RATES = 50,
950 /* 802.11n */ 1006 /* 802.11n */
951 WLAN_EID_HT_CAPABILITY = 45, 1007 WLAN_EID_HT_CAPABILITY = 45,
952 WLAN_EID_HT_EXTRA_INFO = 61, 1008 WLAN_EID_HT_INFORMATION = 61,
953 /* 802.11i */ 1009 /* 802.11i */
954 WLAN_EID_RSN = 48, 1010 WLAN_EID_RSN = 48,
955 WLAN_EID_WPA = 221, 1011 WLAN_EID_WPA = 221,
@@ -1057,4 +1113,4 @@ static inline u8 *ieee80211_get_DA(struct ieee80211_hdr *hdr)
1057 return hdr->addr1; 1113 return hdr->addr1;
1058} 1114}
1059 1115
1060#endif /* IEEE80211_H */ 1116#endif /* LINUX_IEEE80211_H */
diff --git a/include/linux/if.h b/include/linux/if.h
index 65246846c844..2a6e29620a96 100644
--- a/include/linux/if.h
+++ b/include/linux/if.h
@@ -65,6 +65,7 @@
65#define IFF_BONDING 0x20 /* bonding master or slave */ 65#define IFF_BONDING 0x20 /* bonding master or slave */
66#define IFF_SLAVE_NEEDARP 0x40 /* need ARPs for validation */ 66#define IFF_SLAVE_NEEDARP 0x40 /* need ARPs for validation */
67#define IFF_ISATAP 0x80 /* ISATAP interface (RFC4214) */ 67#define IFF_ISATAP 0x80 /* ISATAP interface (RFC4214) */
68#define IFF_MASTER_ARPMON 0x100 /* bonding master, ARP mon in use */
68 69
69#define IF_GET_IFACE 0x0001 /* for querying only */ 70#define IF_GET_IFACE 0x0001 /* for querying only */
70#define IF_GET_PROTO 0x0002 71#define IF_GET_PROTO 0x0002
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index fba141d3ca07..ed60f8718d80 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -357,18 +357,6 @@ static inline char *pack_hex_byte(char *buf, u8 byte)
357 ((unsigned char *)&addr)[3] 357 ((unsigned char *)&addr)[3]
358#define NIPQUAD_FMT "%u.%u.%u.%u" 358#define NIPQUAD_FMT "%u.%u.%u.%u"
359 359
360#define NIP6(addr) \
361 ntohs((addr).s6_addr16[0]), \
362 ntohs((addr).s6_addr16[1]), \
363 ntohs((addr).s6_addr16[2]), \
364 ntohs((addr).s6_addr16[3]), \
365 ntohs((addr).s6_addr16[4]), \
366 ntohs((addr).s6_addr16[5]), \
367 ntohs((addr).s6_addr16[6]), \
368 ntohs((addr).s6_addr16[7])
369#define NIP6_FMT "%04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x"
370#define NIP6_SEQFMT "%04x%04x%04x%04x%04x%04x%04x%04x"
371
372#if defined(__LITTLE_ENDIAN) 360#if defined(__LITTLE_ENDIAN)
373#define HIPQUAD(addr) \ 361#define HIPQUAD(addr) \
374 ((unsigned char *)&addr)[3], \ 362 ((unsigned char *)&addr)[3], \
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 9d77b1d7dca8..12d7f4469dc9 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -1742,26 +1742,31 @@ static inline int skb_bond_should_drop(struct sk_buff *skb)
1742 struct net_device *dev = skb->dev; 1742 struct net_device *dev = skb->dev;
1743 struct net_device *master = dev->master; 1743 struct net_device *master = dev->master;
1744 1744
1745 if (master && 1745 if (master) {
1746 (dev->priv_flags & IFF_SLAVE_INACTIVE)) { 1746 if (master->priv_flags & IFF_MASTER_ARPMON)
1747 if ((dev->priv_flags & IFF_SLAVE_NEEDARP) && 1747 dev->last_rx = jiffies;
1748 skb->protocol == __constant_htons(ETH_P_ARP)) 1748
1749 return 0; 1749 if (dev->priv_flags & IFF_SLAVE_INACTIVE) {
1750 1750 if ((dev->priv_flags & IFF_SLAVE_NEEDARP) &&
1751 if (master->priv_flags & IFF_MASTER_ALB) { 1751 skb->protocol == __constant_htons(ETH_P_ARP))
1752 if (skb->pkt_type != PACKET_BROADCAST &&
1753 skb->pkt_type != PACKET_MULTICAST)
1754 return 0; 1752 return 0;
1755 }
1756 if (master->priv_flags & IFF_MASTER_8023AD &&
1757 skb->protocol == __constant_htons(ETH_P_SLOW))
1758 return 0;
1759 1753
1760 return 1; 1754 if (master->priv_flags & IFF_MASTER_ALB) {
1755 if (skb->pkt_type != PACKET_BROADCAST &&
1756 skb->pkt_type != PACKET_MULTICAST)
1757 return 0;
1758 }
1759 if (master->priv_flags & IFF_MASTER_8023AD &&
1760 skb->protocol == __constant_htons(ETH_P_SLOW))
1761 return 0;
1762
1763 return 1;
1764 }
1761 } 1765 }
1762 return 0; 1766 return 0;
1763} 1767}
1764 1768
1769extern struct pernet_operations __net_initdata loopback_net_ops;
1765#endif /* __KERNEL__ */ 1770#endif /* __KERNEL__ */
1766 1771
1767#endif /* _LINUX_DEV_H */ 1772#endif /* _LINUX_DEV_H */
diff --git a/include/linux/nl80211.h b/include/linux/nl80211.h
index 9bad65400fba..e4cc7869b22f 100644
--- a/include/linux/nl80211.h
+++ b/include/linux/nl80211.h
@@ -106,6 +106,12 @@
106 * to the the specified ISO/IEC 3166-1 alpha2 country code. The core will 106 * to the the specified ISO/IEC 3166-1 alpha2 country code. The core will
107 * store this as a valid request and then query userspace for it. 107 * store this as a valid request and then query userspace for it.
108 * 108 *
109 * @NL80211_CMD_GET_MESH_PARAMS: Get mesh networking properties for the
110 * interface identified by %NL80211_ATTR_IFINDEX
111 *
112 * @NL80211_CMD_SET_MESH_PARAMS: Set mesh networking properties for the
113 * interface identified by %NL80211_ATTR_IFINDEX
114 *
109 * @NL80211_CMD_MAX: highest used command number 115 * @NL80211_CMD_MAX: highest used command number
110 * @__NL80211_CMD_AFTER_LAST: internal use 116 * @__NL80211_CMD_AFTER_LAST: internal use
111 */ 117 */
@@ -148,6 +154,9 @@ enum nl80211_commands {
148 NL80211_CMD_SET_REG, 154 NL80211_CMD_SET_REG,
149 NL80211_CMD_REQ_SET_REG, 155 NL80211_CMD_REQ_SET_REG,
150 156
157 NL80211_CMD_GET_MESH_PARAMS,
158 NL80211_CMD_SET_MESH_PARAMS,
159
151 /* add new commands above here */ 160 /* add new commands above here */
152 161
153 /* used to define NL80211_CMD_MAX below */ 162 /* used to define NL80211_CMD_MAX below */
@@ -296,6 +305,8 @@ enum nl80211_attrs {
296 NL80211_ATTR_REG_ALPHA2, 305 NL80211_ATTR_REG_ALPHA2,
297 NL80211_ATTR_REG_RULES, 306 NL80211_ATTR_REG_RULES,
298 307
308 NL80211_ATTR_MESH_PARAMS,
309
299 /* add attributes here, update the policy in nl80211.c */ 310 /* add attributes here, update the policy in nl80211.c */
300 311
301 __NL80211_ATTR_AFTER_LAST, 312 __NL80211_ATTR_AFTER_LAST,
@@ -452,17 +463,29 @@ enum nl80211_mpath_info {
452 * an array of nested frequency attributes 463 * an array of nested frequency attributes
453 * @NL80211_BAND_ATTR_RATES: supported bitrates in this band, 464 * @NL80211_BAND_ATTR_RATES: supported bitrates in this band,
454 * an array of nested bitrate attributes 465 * an array of nested bitrate attributes
466 * @NL80211_BAND_ATTR_HT_MCS_SET: 16-byte attribute containing the MCS set as
467 * defined in 802.11n
468 * @NL80211_BAND_ATTR_HT_CAPA: HT capabilities, as in the HT information IE
469 * @NL80211_BAND_ATTR_HT_AMPDU_FACTOR: A-MPDU factor, as in 11n
470 * @NL80211_BAND_ATTR_HT_AMPDU_DENSITY: A-MPDU density, as in 11n
455 */ 471 */
456enum nl80211_band_attr { 472enum nl80211_band_attr {
457 __NL80211_BAND_ATTR_INVALID, 473 __NL80211_BAND_ATTR_INVALID,
458 NL80211_BAND_ATTR_FREQS, 474 NL80211_BAND_ATTR_FREQS,
459 NL80211_BAND_ATTR_RATES, 475 NL80211_BAND_ATTR_RATES,
460 476
477 NL80211_BAND_ATTR_HT_MCS_SET,
478 NL80211_BAND_ATTR_HT_CAPA,
479 NL80211_BAND_ATTR_HT_AMPDU_FACTOR,
480 NL80211_BAND_ATTR_HT_AMPDU_DENSITY,
481
461 /* keep last */ 482 /* keep last */
462 __NL80211_BAND_ATTR_AFTER_LAST, 483 __NL80211_BAND_ATTR_AFTER_LAST,
463 NL80211_BAND_ATTR_MAX = __NL80211_BAND_ATTR_AFTER_LAST - 1 484 NL80211_BAND_ATTR_MAX = __NL80211_BAND_ATTR_AFTER_LAST - 1
464}; 485};
465 486
487#define NL80211_BAND_ATTR_HT_CAPA NL80211_BAND_ATTR_HT_CAPA
488
466/** 489/**
467 * enum nl80211_frequency_attr - frequency attributes 490 * enum nl80211_frequency_attr - frequency attributes
468 * @NL80211_FREQUENCY_ATTR_FREQ: Frequency in MHz 491 * @NL80211_FREQUENCY_ATTR_FREQ: Frequency in MHz
@@ -594,4 +617,79 @@ enum nl80211_mntr_flags {
594 NL80211_MNTR_FLAG_MAX = __NL80211_MNTR_FLAG_AFTER_LAST - 1 617 NL80211_MNTR_FLAG_MAX = __NL80211_MNTR_FLAG_AFTER_LAST - 1
595}; 618};
596 619
620/**
621 * enum nl80211_meshconf_params - mesh configuration parameters
622 *
623 * Mesh configuration parameters
624 *
625 * @__NL80211_MESHCONF_INVALID: internal use
626 *
627 * @NL80211_MESHCONF_RETRY_TIMEOUT: specifies the initial retry timeout in
628 * millisecond units, used by the Peer Link Open message
629 *
630 * @NL80211_MESHCONF_CONFIRM_TIMEOUT: specifies the inital confirm timeout, in
631 * millisecond units, used by the peer link management to close a peer link
632 *
633 * @NL80211_MESHCONF_HOLDING_TIMEOUT: specifies the holding timeout, in
634 * millisecond units
635 *
636 * @NL80211_MESHCONF_MAX_PEER_LINKS: maximum number of peer links allowed
637 * on this mesh interface
638 *
639 * @NL80211_MESHCONF_MAX_RETRIES: specifies the maximum number of peer link
640 * open retries that can be sent to establish a new peer link instance in a
641 * mesh
642 *
643 * @NL80211_MESHCONF_TTL: specifies the value of TTL field set at a source mesh
644 * point.
645 *
646 * @NL80211_MESHCONF_AUTO_OPEN_PLINKS: whether we should automatically
647 * open peer links when we detect compatible mesh peers.
648 *
649 * @NL80211_MESHCONF_HWMP_MAX_PREQ_RETRIES: the number of action frames
650 * containing a PREQ that an MP can send to a particular destination (path
651 * target)
652 *
653 * @NL80211_MESHCONF_PATH_REFRESH_TIME: how frequently to refresh mesh paths
654 * (in milliseconds)
655 *
656 * @NL80211_MESHCONF_MIN_DISCOVERY_TIMEOUT: minimum length of time to wait
657 * until giving up on a path discovery (in milliseconds)
658 *
659 * @NL80211_MESHCONF_HWMP_ACTIVE_PATH_TIMEOUT: The time (in TUs) for which mesh
660 * points receiving a PREQ shall consider the forwarding information from the
661 * root to be valid. (TU = time unit)
662 *
663 * @NL80211_MESHCONF_HWMP_PREQ_MIN_INTERVAL: The minimum interval of time (in
664 * TUs) during which an MP can send only one action frame containing a PREQ
665 * reference element
666 *
667 * @NL80211_MESHCONF_HWMP_NET_DIAM_TRVS_TIME: The interval of time (in TUs)
668 * that it takes for an HWMP information element to propagate across the mesh
669 *
670 * @NL80211_MESHCONF_ATTR_MAX: highest possible mesh configuration attribute
671 *
672 * @__NL80211_MESHCONF_ATTR_AFTER_LAST: internal use
673 */
674enum nl80211_meshconf_params {
675 __NL80211_MESHCONF_INVALID,
676 NL80211_MESHCONF_RETRY_TIMEOUT,
677 NL80211_MESHCONF_CONFIRM_TIMEOUT,
678 NL80211_MESHCONF_HOLDING_TIMEOUT,
679 NL80211_MESHCONF_MAX_PEER_LINKS,
680 NL80211_MESHCONF_MAX_RETRIES,
681 NL80211_MESHCONF_TTL,
682 NL80211_MESHCONF_AUTO_OPEN_PLINKS,
683 NL80211_MESHCONF_HWMP_MAX_PREQ_RETRIES,
684 NL80211_MESHCONF_PATH_REFRESH_TIME,
685 NL80211_MESHCONF_MIN_DISCOVERY_TIMEOUT,
686 NL80211_MESHCONF_HWMP_ACTIVE_PATH_TIMEOUT,
687 NL80211_MESHCONF_HWMP_PREQ_MIN_INTERVAL,
688 NL80211_MESHCONF_HWMP_NET_DIAM_TRVS_TIME,
689
690 /* keep last */
691 __NL80211_MESHCONF_ATTR_AFTER_LAST,
692 NL80211_MESHCONF_ATTR_MAX = __NL80211_MESHCONF_ATTR_AFTER_LAST - 1
693};
694
597#endif /* __LINUX_NL80211_H */ 695#endif /* __LINUX_NL80211_H */
diff --git a/include/linux/rculist.h b/include/linux/rculist.h
index e649bd3f2c97..3ba2998b22ba 100644
--- a/include/linux/rculist.h
+++ b/include/linux/rculist.h
@@ -383,5 +383,22 @@ static inline void hlist_add_after_rcu(struct hlist_node *prev,
383 ({ tpos = hlist_entry(pos, typeof(*tpos), member); 1; }); \ 383 ({ tpos = hlist_entry(pos, typeof(*tpos), member); 1; }); \
384 pos = rcu_dereference(pos->next)) 384 pos = rcu_dereference(pos->next))
385 385
386/**
387 * hlist_for_each_entry_rcu_safenext - iterate over rcu list of given type
388 * @tpos: the type * to use as a loop cursor.
389 * @pos: the &struct hlist_node to use as a loop cursor.
390 * @head: the head for your list.
391 * @member: the name of the hlist_node within the struct.
392 * @next: the &struct hlist_node to use as a next cursor
393 *
394 * Special version of hlist_for_each_entry_rcu that make sure
395 * each next pointer is fetched before each iteration.
396 */
397#define hlist_for_each_entry_rcu_safenext(tpos, pos, head, member, next) \
398 for (pos = rcu_dereference((head)->first); \
399 pos && ({ next = pos->next; smp_rmb(); prefetch(next); 1; }) && \
400 ({ tpos = hlist_entry(pos, typeof(*tpos), member); 1; }); \
401 pos = rcu_dereference(next))
402
386#endif /* __KERNEL__ */ 403#endif /* __KERNEL__ */
387#endif 404#endif
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index 2725f4e5a9bf..a01b6f84e3bc 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -250,6 +250,9 @@ typedef unsigned char *sk_buff_data_t;
250 * @tc_verd: traffic control verdict 250 * @tc_verd: traffic control verdict
251 * @ndisc_nodetype: router type (from link layer) 251 * @ndisc_nodetype: router type (from link layer)
252 * @do_not_encrypt: set to prevent encryption of this frame 252 * @do_not_encrypt: set to prevent encryption of this frame
253 * @requeue: set to indicate that the wireless core should attempt
254 * a software retry on this frame if we failed to
255 * receive an ACK for it
253 * @dma_cookie: a cookie to one of several possible DMA operations 256 * @dma_cookie: a cookie to one of several possible DMA operations
254 * done by skb DMA functions 257 * done by skb DMA functions
255 * @secmark: security marking 258 * @secmark: security marking
@@ -269,8 +272,9 @@ struct sk_buff {
269 struct dst_entry *dst; 272 struct dst_entry *dst;
270 struct rtable *rtable; 273 struct rtable *rtable;
271 }; 274 };
275#ifdef CONFIG_XFRM
272 struct sec_path *sp; 276 struct sec_path *sp;
273 277#endif
274 /* 278 /*
275 * This is the control buffer. It is free to use for every 279 * This is the control buffer. It is free to use for every
276 * layer. Please put your private variables there. If you 280 * layer. Please put your private variables there. If you
@@ -325,6 +329,7 @@ struct sk_buff {
325#endif 329#endif
326#if defined(CONFIG_MAC80211) || defined(CONFIG_MAC80211_MODULE) 330#if defined(CONFIG_MAC80211) || defined(CONFIG_MAC80211_MODULE)
327 __u8 do_not_encrypt:1; 331 __u8 do_not_encrypt:1;
332 __u8 requeue:1;
328#endif 333#endif
329 /* 0/13/14 bit hole */ 334 /* 0/13/14 bit hole */
330 335
@@ -1864,6 +1869,18 @@ static inline void skb_copy_queue_mapping(struct sk_buff *to, const struct sk_bu
1864 to->queue_mapping = from->queue_mapping; 1869 to->queue_mapping = from->queue_mapping;
1865} 1870}
1866 1871
1872#ifdef CONFIG_XFRM
1873static inline struct sec_path *skb_sec_path(struct sk_buff *skb)
1874{
1875 return skb->sp;
1876}
1877#else
1878static inline struct sec_path *skb_sec_path(struct sk_buff *skb)
1879{
1880 return NULL;
1881}
1882#endif
1883
1867static inline int skb_is_gso(const struct sk_buff *skb) 1884static inline int skb_is_gso(const struct sk_buff *skb)
1868{ 1885{
1869 return skb_shinfo(skb)->gso_size; 1886 return skb_shinfo(skb)->gso_size;
diff --git a/include/linux/sunrpc/svc_xprt.h b/include/linux/sunrpc/svc_xprt.h
index 6fd7b016517f..0127daca4354 100644
--- a/include/linux/sunrpc/svc_xprt.h
+++ b/include/linux/sunrpc/svc_xprt.h
@@ -139,14 +139,14 @@ static inline char *__svc_print_addr(struct sockaddr *addr,
139{ 139{
140 switch (addr->sa_family) { 140 switch (addr->sa_family) {
141 case AF_INET: 141 case AF_INET:
142 snprintf(buf, len, "%u.%u.%u.%u, port=%u", 142 snprintf(buf, len, "%pI4, port=%u",
143 NIPQUAD(((struct sockaddr_in *) addr)->sin_addr), 143 &((struct sockaddr_in *)addr)->sin_addr,
144 ntohs(((struct sockaddr_in *) addr)->sin_port)); 144 ntohs(((struct sockaddr_in *) addr)->sin_port));
145 break; 145 break;
146 146
147 case AF_INET6: 147 case AF_INET6:
148 snprintf(buf, len, "%x:%x:%x:%x:%x:%x:%x:%x, port=%u", 148 snprintf(buf, len, "%pI6, port=%u",
149 NIP6(((struct sockaddr_in6 *) addr)->sin6_addr), 149 &((struct sockaddr_in6 *)addr)->sin6_addr,
150 ntohs(((struct sockaddr_in6 *) addr)->sin6_port)); 150 ntohs(((struct sockaddr_in6 *) addr)->sin6_port));
151 break; 151 break;
152 152
diff --git a/include/linux/xfrm.h b/include/linux/xfrm.h
index 4bc1e6b86cb2..52f3abd453a1 100644
--- a/include/linux/xfrm.h
+++ b/include/linux/xfrm.h
@@ -199,6 +199,9 @@ enum {
199#define XFRM_MSG_NEWSPDINFO XFRM_MSG_NEWSPDINFO 199#define XFRM_MSG_NEWSPDINFO XFRM_MSG_NEWSPDINFO
200 XFRM_MSG_GETSPDINFO, 200 XFRM_MSG_GETSPDINFO,
201#define XFRM_MSG_GETSPDINFO XFRM_MSG_GETSPDINFO 201#define XFRM_MSG_GETSPDINFO XFRM_MSG_GETSPDINFO
202
203 XFRM_MSG_MAPPING,
204#define XFRM_MSG_MAPPING XFRM_MSG_MAPPING
202 __XFRM_MSG_MAX 205 __XFRM_MSG_MAX
203}; 206};
204#define XFRM_MSG_MAX (__XFRM_MSG_MAX - 1) 207#define XFRM_MSG_MAX (__XFRM_MSG_MAX - 1)
@@ -438,6 +441,15 @@ struct xfrm_user_migrate {
438 __u16 new_family; 441 __u16 new_family;
439}; 442};
440 443
444struct xfrm_user_mapping {
445 struct xfrm_usersa_id id;
446 __u32 reqid;
447 xfrm_address_t old_saddr;
448 xfrm_address_t new_saddr;
449 __be16 old_sport;
450 __be16 new_sport;
451};
452
441#ifndef __KERNEL__ 453#ifndef __KERNEL__
442/* backwards compatibility for userspace */ 454/* backwards compatibility for userspace */
443#define XFRMGRP_ACQUIRE 1 455#define XFRMGRP_ACQUIRE 1
@@ -464,6 +476,8 @@ enum xfrm_nlgroups {
464#define XFRMNLGRP_REPORT XFRMNLGRP_REPORT 476#define XFRMNLGRP_REPORT XFRMNLGRP_REPORT
465 XFRMNLGRP_MIGRATE, 477 XFRMNLGRP_MIGRATE,
466#define XFRMNLGRP_MIGRATE XFRMNLGRP_MIGRATE 478#define XFRMNLGRP_MIGRATE XFRMNLGRP_MIGRATE
479 XFRMNLGRP_MAPPING,
480#define XFRMNLGRP_MAPPING XFRMNLGRP_MAPPING
467 __XFRMNLGRP_MAX 481 __XFRMNLGRP_MAX
468}; 482};
469#define XFRMNLGRP_MAX (__XFRMNLGRP_MAX - 1) 483#define XFRMNLGRP_MAX (__XFRMNLGRP_MAX - 1)
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index 0e85ec39b638..03e1e88c6a09 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -347,6 +347,25 @@ struct ieee80211_regdomain {
347 .flags = reg_flags, \ 347 .flags = reg_flags, \
348 } 348 }
349 349
350struct mesh_config {
351 /* Timeouts in ms */
352 /* Mesh plink management parameters */
353 u16 dot11MeshRetryTimeout;
354 u16 dot11MeshConfirmTimeout;
355 u16 dot11MeshHoldingTimeout;
356 u16 dot11MeshMaxPeerLinks;
357 u8 dot11MeshMaxRetries;
358 u8 dot11MeshTTL;
359 bool auto_open_plinks;
360 /* HWMP parameters */
361 u8 dot11MeshHWMPmaxPREQretries;
362 u32 path_refresh_time;
363 u16 min_discovery_timeout;
364 u32 dot11MeshHWMPactivePathTimeout;
365 u16 dot11MeshHWMPpreqMinInterval;
366 u16 dot11MeshHWMPnetDiameterTraversalTime;
367};
368
350/* from net/wireless.h */ 369/* from net/wireless.h */
351struct wiphy; 370struct wiphy;
352 371
@@ -397,6 +416,12 @@ struct wiphy;
397 * 416 *
398 * @change_station: Modify a given station. 417 * @change_station: Modify a given station.
399 * 418 *
419 * @get_mesh_params: Put the current mesh parameters into *params
420 *
421 * @set_mesh_params: Set mesh parameters.
422 * The mask is a bitfield which tells us which parameters to
423 * set, and which to leave alone.
424 *
400 * @set_mesh_cfg: set mesh parameters (by now, just mesh id) 425 * @set_mesh_cfg: set mesh parameters (by now, just mesh id)
401 * 426 *
402 * @change_bss: Modify parameters for a given BSS. 427 * @change_bss: Modify parameters for a given BSS.
@@ -452,7 +477,12 @@ struct cfg80211_ops {
452 int (*dump_mpath)(struct wiphy *wiphy, struct net_device *dev, 477 int (*dump_mpath)(struct wiphy *wiphy, struct net_device *dev,
453 int idx, u8 *dst, u8 *next_hop, 478 int idx, u8 *dst, u8 *next_hop,
454 struct mpath_info *pinfo); 479 struct mpath_info *pinfo);
455 480 int (*get_mesh_params)(struct wiphy *wiphy,
481 struct net_device *dev,
482 struct mesh_config *conf);
483 int (*set_mesh_params)(struct wiphy *wiphy,
484 struct net_device *dev,
485 const struct mesh_config *nconf, u32 mask);
456 int (*change_bss)(struct wiphy *wiphy, struct net_device *dev, 486 int (*change_bss)(struct wiphy *wiphy, struct net_device *dev,
457 struct bss_parameters *params); 487 struct bss_parameters *params);
458}; 488};
diff --git a/include/net/dst.h b/include/net/dst.h
index 8a8b71e5f3f1..f96c4ba4dd32 100644
--- a/include/net/dst.h
+++ b/include/net/dst.h
@@ -59,8 +59,9 @@ struct dst_entry
59 59
60 struct neighbour *neighbour; 60 struct neighbour *neighbour;
61 struct hh_cache *hh; 61 struct hh_cache *hh;
62#ifdef CONFIG_XFRM
62 struct xfrm_state *xfrm; 63 struct xfrm_state *xfrm;
63 64#endif
64 int (*input)(struct sk_buff*); 65 int (*input)(struct sk_buff*);
65 int (*output)(struct sk_buff*); 66 int (*output)(struct sk_buff*);
66 67
diff --git a/include/net/ieee80211.h b/include/net/ieee80211.h
index 93a56de3594b..738734a4653b 100644
--- a/include/net/ieee80211.h
+++ b/include/net/ieee80211.h
@@ -28,6 +28,7 @@
28#include <linux/if_ether.h> /* ETH_ALEN */ 28#include <linux/if_ether.h> /* ETH_ALEN */
29#include <linux/kernel.h> /* ARRAY_SIZE */ 29#include <linux/kernel.h> /* ARRAY_SIZE */
30#include <linux/wireless.h> 30#include <linux/wireless.h>
31#include <linux/ieee80211.h>
31 32
32#define IEEE80211_VERSION "git-1.1.13" 33#define IEEE80211_VERSION "git-1.1.13"
33 34
@@ -127,10 +128,6 @@ static inline bool ieee80211_ratelimit_debug(u32 level)
127} 128}
128#endif /* CONFIG_IEEE80211_DEBUG */ 129#endif /* CONFIG_IEEE80211_DEBUG */
129 130
130/* escape_essid() is intended to be used in debug (and possibly error)
131 * messages. It should never be used for passing essid to user space. */
132const char *escape_essid(const char *essid, u8 essid_len);
133
134/* 131/*
135 * To use the debug system: 132 * To use the debug system:
136 * 133 *
@@ -218,94 +215,6 @@ struct ieee80211_snap_hdr {
218#define WLAN_GET_SEQ_FRAG(seq) ((seq) & IEEE80211_SCTL_FRAG) 215#define WLAN_GET_SEQ_FRAG(seq) ((seq) & IEEE80211_SCTL_FRAG)
219#define WLAN_GET_SEQ_SEQ(seq) (((seq) & IEEE80211_SCTL_SEQ) >> 4) 216#define WLAN_GET_SEQ_SEQ(seq) (((seq) & IEEE80211_SCTL_SEQ) >> 4)
220 217
221/* Authentication algorithms */
222#define WLAN_AUTH_OPEN 0
223#define WLAN_AUTH_SHARED_KEY 1
224#define WLAN_AUTH_LEAP 2
225
226#define WLAN_AUTH_CHALLENGE_LEN 128
227
228#define WLAN_CAPABILITY_ESS (1<<0)
229#define WLAN_CAPABILITY_IBSS (1<<1)
230#define WLAN_CAPABILITY_CF_POLLABLE (1<<2)
231#define WLAN_CAPABILITY_CF_POLL_REQUEST (1<<3)
232#define WLAN_CAPABILITY_PRIVACY (1<<4)
233#define WLAN_CAPABILITY_SHORT_PREAMBLE (1<<5)
234#define WLAN_CAPABILITY_PBCC (1<<6)
235#define WLAN_CAPABILITY_CHANNEL_AGILITY (1<<7)
236#define WLAN_CAPABILITY_SPECTRUM_MGMT (1<<8)
237#define WLAN_CAPABILITY_QOS (1<<9)
238#define WLAN_CAPABILITY_SHORT_SLOT_TIME (1<<10)
239#define WLAN_CAPABILITY_DSSS_OFDM (1<<13)
240
241/* 802.11g ERP information element */
242#define WLAN_ERP_NON_ERP_PRESENT (1<<0)
243#define WLAN_ERP_USE_PROTECTION (1<<1)
244#define WLAN_ERP_BARKER_PREAMBLE (1<<2)
245
246/* Status codes */
247enum ieee80211_statuscode {
248 WLAN_STATUS_SUCCESS = 0,
249 WLAN_STATUS_UNSPECIFIED_FAILURE = 1,
250 WLAN_STATUS_CAPS_UNSUPPORTED = 10,
251 WLAN_STATUS_REASSOC_NO_ASSOC = 11,
252 WLAN_STATUS_ASSOC_DENIED_UNSPEC = 12,
253 WLAN_STATUS_NOT_SUPPORTED_AUTH_ALG = 13,
254 WLAN_STATUS_UNKNOWN_AUTH_TRANSACTION = 14,
255 WLAN_STATUS_CHALLENGE_FAIL = 15,
256 WLAN_STATUS_AUTH_TIMEOUT = 16,
257 WLAN_STATUS_AP_UNABLE_TO_HANDLE_NEW_STA = 17,
258 WLAN_STATUS_ASSOC_DENIED_RATES = 18,
259 /* 802.11b */
260 WLAN_STATUS_ASSOC_DENIED_NOSHORTPREAMBLE = 19,
261 WLAN_STATUS_ASSOC_DENIED_NOPBCC = 20,
262 WLAN_STATUS_ASSOC_DENIED_NOAGILITY = 21,
263 /* 802.11h */
264 WLAN_STATUS_ASSOC_DENIED_NOSPECTRUM = 22,
265 WLAN_STATUS_ASSOC_REJECTED_BAD_POWER = 23,
266 WLAN_STATUS_ASSOC_REJECTED_BAD_SUPP_CHAN = 24,
267 /* 802.11g */
268 WLAN_STATUS_ASSOC_DENIED_NOSHORTTIME = 25,
269 WLAN_STATUS_ASSOC_DENIED_NODSSSOFDM = 26,
270 /* 802.11i */
271 WLAN_STATUS_INVALID_IE = 40,
272 WLAN_STATUS_INVALID_GROUP_CIPHER = 41,
273 WLAN_STATUS_INVALID_PAIRWISE_CIPHER = 42,
274 WLAN_STATUS_INVALID_AKMP = 43,
275 WLAN_STATUS_UNSUPP_RSN_VERSION = 44,
276 WLAN_STATUS_INVALID_RSN_IE_CAP = 45,
277 WLAN_STATUS_CIPHER_SUITE_REJECTED = 46,
278};
279
280/* Reason codes */
281enum ieee80211_reasoncode {
282 WLAN_REASON_UNSPECIFIED = 1,
283 WLAN_REASON_PREV_AUTH_NOT_VALID = 2,
284 WLAN_REASON_DEAUTH_LEAVING = 3,
285 WLAN_REASON_DISASSOC_DUE_TO_INACTIVITY = 4,
286 WLAN_REASON_DISASSOC_AP_BUSY = 5,
287 WLAN_REASON_CLASS2_FRAME_FROM_NONAUTH_STA = 6,
288 WLAN_REASON_CLASS3_FRAME_FROM_NONASSOC_STA = 7,
289 WLAN_REASON_DISASSOC_STA_HAS_LEFT = 8,
290 WLAN_REASON_STA_REQ_ASSOC_WITHOUT_AUTH = 9,
291 /* 802.11h */
292 WLAN_REASON_DISASSOC_BAD_POWER = 10,
293 WLAN_REASON_DISASSOC_BAD_SUPP_CHAN = 11,
294 /* 802.11i */
295 WLAN_REASON_INVALID_IE = 13,
296 WLAN_REASON_MIC_FAILURE = 14,
297 WLAN_REASON_4WAY_HANDSHAKE_TIMEOUT = 15,
298 WLAN_REASON_GROUP_KEY_HANDSHAKE_TIMEOUT = 16,
299 WLAN_REASON_IE_DIFFERENT = 17,
300 WLAN_REASON_INVALID_GROUP_CIPHER = 18,
301 WLAN_REASON_INVALID_PAIRWISE_CIPHER = 19,
302 WLAN_REASON_INVALID_AKMP = 20,
303 WLAN_REASON_UNSUPP_RSN_VERSION = 21,
304 WLAN_REASON_INVALID_RSN_IE_CAP = 22,
305 WLAN_REASON_IEEE8021X_FAILED = 23,
306 WLAN_REASON_CIPHER_SUITE_REJECTED = 24,
307};
308
309/* Action categories - 802.11h */ 218/* Action categories - 802.11h */
310enum ieee80211_actioncategories { 219enum ieee80211_actioncategories {
311 WLAN_ACTION_SPECTRUM_MGMT = 0, 220 WLAN_ACTION_SPECTRUM_MGMT = 0,
@@ -534,15 +443,6 @@ enum ieee80211_mfie {
534 MFIE_TYPE_QOS_PARAMETER = 222, 443 MFIE_TYPE_QOS_PARAMETER = 222,
535}; 444};
536 445
537/* Minimal header; can be used for passing 802.11 frames with sufficient
538 * information to determine what type of underlying data type is actually
539 * stored in the data. */
540struct ieee80211_hdr {
541 __le16 frame_ctl;
542 __le16 duration_id;
543 u8 payload[0];
544} __attribute__ ((packed));
545
546struct ieee80211_hdr_1addr { 446struct ieee80211_hdr_1addr {
547 __le16 frame_ctl; 447 __le16 frame_ctl;
548 __le16 duration_id; 448 __le16 duration_id;
@@ -590,18 +490,6 @@ struct ieee80211_hdr_3addrqos {
590 __le16 qos_ctl; 490 __le16 qos_ctl;
591} __attribute__ ((packed)); 491} __attribute__ ((packed));
592 492
593struct ieee80211_hdr_4addrqos {
594 __le16 frame_ctl;
595 __le16 duration_id;
596 u8 addr1[ETH_ALEN];
597 u8 addr2[ETH_ALEN];
598 u8 addr3[ETH_ALEN];
599 __le16 seq_ctl;
600 u8 addr4[ETH_ALEN];
601 u8 payload[0];
602 __le16 qos_ctl;
603} __attribute__ ((packed));
604
605struct ieee80211_info_element { 493struct ieee80211_info_element {
606 u8 id; 494 u8 id;
607 u8 len; 495 u8 len;
@@ -733,7 +621,6 @@ struct ieee80211_txb {
733 621
734#define MAX_WPA_IE_LEN 64 622#define MAX_WPA_IE_LEN 64
735 623
736#define NETWORK_EMPTY_ESSID (1<<0)
737#define NETWORK_HAS_OFDM (1<<1) 624#define NETWORK_HAS_OFDM (1<<1)
738#define NETWORK_HAS_CCK (1<<2) 625#define NETWORK_HAS_CCK (1<<2)
739 626
@@ -1135,22 +1022,6 @@ static inline void *ieee80211_priv(struct net_device *dev)
1135 return ((struct ieee80211_device *)netdev_priv(dev))->priv; 1022 return ((struct ieee80211_device *)netdev_priv(dev))->priv;
1136} 1023}
1137 1024
1138static inline int ieee80211_is_empty_essid(const char *essid, int essid_len)
1139{
1140 /* Single white space is for Linksys APs */
1141 if (essid_len == 1 && essid[0] == ' ')
1142 return 1;
1143
1144 /* Otherwise, if the entire essid is 0, we assume it is hidden */
1145 while (essid_len) {
1146 essid_len--;
1147 if (essid[essid_len] != '\0')
1148 return 0;
1149 }
1150
1151 return 1;
1152}
1153
1154static inline int ieee80211_is_valid_mode(struct ieee80211_device *ieee, 1025static inline int ieee80211_is_valid_mode(struct ieee80211_device *ieee,
1155 int mode) 1026 int mode)
1156{ 1027{
@@ -1208,7 +1079,7 @@ static inline int ieee80211_get_hdrlen(u16 fc)
1208 1079
1209static inline u8 *ieee80211_get_payload(struct ieee80211_hdr *hdr) 1080static inline u8 *ieee80211_get_payload(struct ieee80211_hdr *hdr)
1210{ 1081{
1211 switch (ieee80211_get_hdrlen(le16_to_cpu(hdr->frame_ctl))) { 1082 switch (ieee80211_get_hdrlen(le16_to_cpu(hdr->frame_control))) {
1212 case IEEE80211_1ADDR_LEN: 1083 case IEEE80211_1ADDR_LEN:
1213 return ((struct ieee80211_hdr_1addr *)hdr)->payload; 1084 return ((struct ieee80211_hdr_1addr *)hdr)->payload;
1214 case IEEE80211_2ADDR_LEN: 1085 case IEEE80211_2ADDR_LEN:
diff --git a/include/net/ip_vs.h b/include/net/ip_vs.h
index fe9fcf73c85e..8f6abf4883e3 100644
--- a/include/net/ip_vs.h
+++ b/include/net/ip_vs.h
@@ -87,12 +87,12 @@ static inline const char *ip_vs_dbg_addr(int af, char *buf, size_t buf_len,
87 int len; 87 int len;
88#ifdef CONFIG_IP_VS_IPV6 88#ifdef CONFIG_IP_VS_IPV6
89 if (af == AF_INET6) 89 if (af == AF_INET6)
90 len = snprintf(&buf[*idx], buf_len - *idx, "[" NIP6_FMT "]", 90 len = snprintf(&buf[*idx], buf_len - *idx, "[%pI6]",
91 NIP6(addr->in6)) + 1; 91 &addr->in6) + 1;
92 else 92 else
93#endif 93#endif
94 len = snprintf(&buf[*idx], buf_len - *idx, NIPQUAD_FMT, 94 len = snprintf(&buf[*idx], buf_len - *idx, "%pI4",
95 NIPQUAD(addr->ip)) + 1; 95 &addr->ip) + 1;
96 96
97 *idx += len; 97 *idx += len;
98 BUG_ON(*idx > buf_len + 1); 98 BUG_ON(*idx > buf_len + 1);
@@ -503,9 +503,6 @@ struct ip_vs_scheduler {
503 char *name; /* scheduler name */ 503 char *name; /* scheduler name */
504 atomic_t refcnt; /* reference counter */ 504 atomic_t refcnt; /* reference counter */
505 struct module *module; /* THIS_MODULE/NULL */ 505 struct module *module; /* THIS_MODULE/NULL */
506#ifdef CONFIG_IP_VS_IPV6
507 int supports_ipv6; /* scheduler has IPv6 support */
508#endif
509 506
510 /* scheduler initializing service */ 507 /* scheduler initializing service */
511 int (*init_service)(struct ip_vs_service *svc); 508 int (*init_service)(struct ip_vs_service *svc);
diff --git a/include/net/lib80211.h b/include/net/lib80211.h
new file mode 100644
index 000000000000..e1558a187ac0
--- /dev/null
+++ b/include/net/lib80211.h
@@ -0,0 +1,18 @@
1/*
2 * lib80211.h -- common bits for IEEE802.11 wireless drivers
3 *
4 * Copyright (c) 2008, John W. Linville <linville@tuxdriver.com>
5 *
6 */
7
8#ifndef LIB80211_H
9#define LIB80211_H
10
11#include <linux/ieee80211.h>
12
13/* print_ssid() is intended to be used in debug (and possibly error)
14 * messages. It should never be used for passing ssid to user space. */
15const char *print_ssid(char *buf, const char *ssid, u8 ssid_len);
16#define DECLARE_SSID_BUF(var) char var[IEEE80211_MAX_SSID_LEN * 4 + 1] __maybe_unused
17
18#endif /* LIB80211_H */
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index 8856e2d60e9f..0b983bed3829 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -3,7 +3,7 @@
3 * 3 *
4 * Copyright 2002-2005, Devicescape Software, Inc. 4 * Copyright 2002-2005, Devicescape Software, Inc.
5 * Copyright 2006-2007 Jiri Benc <jbenc@suse.cz> 5 * Copyright 2006-2007 Jiri Benc <jbenc@suse.cz>
6 * Copyright 2007 Johannes Berg <johannes@sipsolutions.net> 6 * Copyright 2007-2008 Johannes Berg <johannes@sipsolutions.net>
7 * 7 *
8 * This program is free software; you can redistribute it and/or modify 8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as 9 * it under the terms of the GNU General Public License version 2 as
@@ -82,22 +82,6 @@ enum ieee80211_notification_types {
82}; 82};
83 83
84/** 84/**
85 * struct ieee80211_ht_bss_info - describing BSS's HT characteristics
86 *
87 * This structure describes most essential parameters needed
88 * to describe 802.11n HT characteristics in a BSS.
89 *
90 * @primary_channel: channel number of primery channel
91 * @bss_cap: 802.11n's general BSS capabilities (e.g. channel width)
92 * @bss_op_mode: 802.11n's BSS operation modes (e.g. HT protection)
93 */
94struct ieee80211_ht_bss_info {
95 u8 primary_channel;
96 u8 bss_cap; /* use IEEE80211_HT_IE_CHA_ */
97 u8 bss_op_mode; /* use IEEE80211_HT_IE_ */
98};
99
100/**
101 * enum ieee80211_max_queues - maximum number of queues 85 * enum ieee80211_max_queues - maximum number of queues
102 * 86 *
103 * @IEEE80211_MAX_QUEUES: Maximum number of regular device queues. 87 * @IEEE80211_MAX_QUEUES: Maximum number of regular device queues.
@@ -115,7 +99,7 @@ enum ieee80211_max_queues {
115 * The information provided in this structure is required for QoS 99 * The information provided in this structure is required for QoS
116 * transmit queue configuration. Cf. IEEE 802.11 7.3.2.29. 100 * transmit queue configuration. Cf. IEEE 802.11 7.3.2.29.
117 * 101 *
118 * @aifs: arbitration interface space [0..255] 102 * @aifs: arbitration interframe space [0..255]
119 * @cw_min: minimum contention window [a value of the form 103 * @cw_min: minimum contention window [a value of the form
120 * 2^n-1 in the range 1..32767] 104 * 2^n-1 in the range 1..32767]
121 * @cw_max: maximum contention window [like @cw_min] 105 * @cw_max: maximum contention window [like @cw_min]
@@ -172,6 +156,19 @@ enum ieee80211_bss_change {
172}; 156};
173 157
174/** 158/**
159 * struct ieee80211_bss_ht_conf - BSS's changing HT configuration
160 * @secondary_channel_offset: secondary channel offset, uses
161 * %IEEE80211_HT_PARAM_CHA_SEC_ values
162 * @width_40_ok: indicates that 40 MHz bandwidth may be used for TX
163 * @operation_mode: HT operation mode (like in &struct ieee80211_ht_info)
164 */
165struct ieee80211_bss_ht_conf {
166 u8 secondary_channel_offset;
167 bool width_40_ok;
168 u16 operation_mode;
169};
170
171/**
175 * struct ieee80211_bss_conf - holds the BSS's changing parameters 172 * struct ieee80211_bss_conf - holds the BSS's changing parameters
176 * 173 *
177 * This structure keeps information about a BSS (and an association 174 * This structure keeps information about a BSS (and an association
@@ -180,15 +177,17 @@ enum ieee80211_bss_change {
180 * @assoc: association status 177 * @assoc: association status
181 * @aid: association ID number, valid only when @assoc is true 178 * @aid: association ID number, valid only when @assoc is true
182 * @use_cts_prot: use CTS protection 179 * @use_cts_prot: use CTS protection
183 * @use_short_preamble: use 802.11b short preamble 180 * @use_short_preamble: use 802.11b short preamble;
184 * @use_short_slot: use short slot time (only relevant for ERP) 181 * if the hardware cannot handle this it must set the
182 * IEEE80211_HW_2GHZ_SHORT_PREAMBLE_INCAPABLE hardware flag
183 * @use_short_slot: use short slot time (only relevant for ERP);
184 * if the hardware cannot handle this it must set the
185 * IEEE80211_HW_2GHZ_SHORT_SLOT_INCAPABLE hardware flag
185 * @dtim_period: num of beacons before the next DTIM, for PSM 186 * @dtim_period: num of beacons before the next DTIM, for PSM
186 * @timestamp: beacon timestamp 187 * @timestamp: beacon timestamp
187 * @beacon_int: beacon interval 188 * @beacon_int: beacon interval
188 * @assoc_capability: capabilities taken from assoc resp 189 * @assoc_capability: capabilities taken from assoc resp
189 * @assoc_ht: association in HT mode 190 * @ht: BSS's HT configuration
190 * @ht_conf: ht capabilities
191 * @ht_bss_conf: ht extended capabilities
192 * @basic_rates: bitmap of basic rates, each bit stands for an 191 * @basic_rates: bitmap of basic rates, each bit stands for an
193 * index into the rate table configured by the driver in 192 * index into the rate table configured by the driver in
194 * the current band. 193 * the current band.
@@ -206,10 +205,7 @@ struct ieee80211_bss_conf {
206 u16 assoc_capability; 205 u16 assoc_capability;
207 u64 timestamp; 206 u64 timestamp;
208 u64 basic_rates; 207 u64 basic_rates;
209 /* ht related data */ 208 struct ieee80211_bss_ht_conf ht;
210 bool assoc_ht;
211 struct ieee80211_ht_info *ht_conf;
212 struct ieee80211_ht_bss_info *ht_bss_conf;
213}; 209};
214 210
215/** 211/**
@@ -218,29 +214,24 @@ struct ieee80211_bss_conf {
218 * These flags are used with the @flags member of &ieee80211_tx_info. 214 * These flags are used with the @flags member of &ieee80211_tx_info.
219 * 215 *
220 * @IEEE80211_TX_CTL_REQ_TX_STATUS: request TX status callback for this frame. 216 * @IEEE80211_TX_CTL_REQ_TX_STATUS: request TX status callback for this frame.
221 * @IEEE80211_TX_CTL_USE_RTS_CTS: use RTS-CTS before sending frame 217 * @IEEE80211_TX_CTL_ASSIGN_SEQ: The driver has to assign a sequence
222 * @IEEE80211_TX_CTL_USE_CTS_PROTECT: use CTS protection for the frame (e.g., 218 * number to this frame, taking care of not overwriting the fragment
223 * for combined 802.11g / 802.11b networks) 219 * number and increasing the sequence number only when the
220 * IEEE80211_TX_CTL_FIRST_FRAGMENT flag is set. mac80211 will properly
221 * assign sequence numbers to QoS-data frames but cannot do so correctly
222 * for non-QoS-data and management frames because beacons need them from
223 * that counter as well and mac80211 cannot guarantee proper sequencing.
224 * If this flag is set, the driver should instruct the hardware to
225 * assign a sequence number to the frame or assign one itself. Cf. IEEE
226 * 802.11-2007 7.1.3.4.1 paragraph 3. This flag will always be set for
227 * beacons and always be clear for frames without a sequence number field.
224 * @IEEE80211_TX_CTL_NO_ACK: tell the low level not to wait for an ack 228 * @IEEE80211_TX_CTL_NO_ACK: tell the low level not to wait for an ack
225 * @IEEE80211_TX_CTL_RATE_CTRL_PROBE: TBD
226 * @IEEE80211_TX_CTL_CLEAR_PS_FILT: clear powersave filter for destination 229 * @IEEE80211_TX_CTL_CLEAR_PS_FILT: clear powersave filter for destination
227 * station 230 * station
228 * @IEEE80211_TX_CTL_REQUEUE: TBD
229 * @IEEE80211_TX_CTL_FIRST_FRAGMENT: this is a first fragment of the frame 231 * @IEEE80211_TX_CTL_FIRST_FRAGMENT: this is a first fragment of the frame
230 * @IEEE80211_TX_CTL_SHORT_PREAMBLE: TBD
231 * @IEEE80211_TX_CTL_LONG_RETRY_LIMIT: this frame should be send using the
232 * through set_retry_limit configured long retry value
233 * @IEEE80211_TX_CTL_SEND_AFTER_DTIM: send this frame after DTIM beacon 232 * @IEEE80211_TX_CTL_SEND_AFTER_DTIM: send this frame after DTIM beacon
234 * @IEEE80211_TX_CTL_AMPDU: this frame should be sent as part of an A-MPDU 233 * @IEEE80211_TX_CTL_AMPDU: this frame should be sent as part of an A-MPDU
235 * @IEEE80211_TX_CTL_OFDM_HT: this frame can be sent in HT OFDM rates. number 234 * @IEEE80211_TX_CTL_INJECTED: Frame was injected, internal to mac80211.
236 * of streams when this flag is on can be extracted from antenna_sel_tx,
237 * so if 1 antenna is marked use SISO, 2 antennas marked use MIMO, n
238 * antennas marked use MIMO_n.
239 * @IEEE80211_TX_CTL_GREEN_FIELD: use green field protection for this frame
240 * @IEEE80211_TX_CTL_40_MHZ_WIDTH: send this frame using 40 Mhz channel width
241 * @IEEE80211_TX_CTL_DUP_DATA: duplicate data frame on both 20 Mhz channels
242 * @IEEE80211_TX_CTL_SHORT_GI: send this frame using short guard interval
243 * @IEEE80211_TX_CTL_INJECTED: TBD
244 * @IEEE80211_TX_STAT_TX_FILTERED: The frame was not transmitted 235 * @IEEE80211_TX_STAT_TX_FILTERED: The frame was not transmitted
245 * because the destination STA was in powersave mode. 236 * because the destination STA was in powersave mode.
246 * @IEEE80211_TX_STAT_ACK: Frame was acknowledged 237 * @IEEE80211_TX_STAT_ACK: Frame was acknowledged
@@ -248,62 +239,66 @@ struct ieee80211_bss_conf {
248 * is for the whole aggregation. 239 * is for the whole aggregation.
249 * @IEEE80211_TX_STAT_AMPDU_NO_BACK: no block ack was returned, 240 * @IEEE80211_TX_STAT_AMPDU_NO_BACK: no block ack was returned,
250 * so consider using block ack request (BAR). 241 * so consider using block ack request (BAR).
251 * @IEEE80211_TX_CTL_ASSIGN_SEQ: The driver has to assign a sequence 242 * @IEEE80211_TX_CTL_RATE_CTRL_PROBE: internal to mac80211, can be
252 * number to this frame, taking care of not overwriting the fragment 243 * set by rate control algorithms to indicate probe rate, will
253 * number and increasing the sequence number only when the 244 * be cleared for fragmented frames (except on the last fragment)
254 * IEEE80211_TX_CTL_FIRST_FRAGMENT flags is set. mac80211 will properly
255 * assign sequence numbers to QoS-data frames but cannot do so correctly
256 * for non-QoS-data and management frames because beacons need them from
257 * that counter as well and mac80211 cannot guarantee proper sequencing.
258 * If this flag is set, the driver should instruct the hardware to
259 * assign a sequence number to the frame or assign one itself. Cf. IEEE
260 * 802.11-2007 7.1.3.4.1 paragraph 3. This flag will always be set for
261 * beacons always be clear for frames without a sequence number field.
262 */ 245 */
263enum mac80211_tx_control_flags { 246enum mac80211_tx_control_flags {
264 IEEE80211_TX_CTL_REQ_TX_STATUS = BIT(0), 247 IEEE80211_TX_CTL_REQ_TX_STATUS = BIT(0),
265 IEEE80211_TX_CTL_USE_RTS_CTS = BIT(2), 248 IEEE80211_TX_CTL_ASSIGN_SEQ = BIT(1),
266 IEEE80211_TX_CTL_USE_CTS_PROTECT = BIT(3), 249 IEEE80211_TX_CTL_NO_ACK = BIT(2),
267 IEEE80211_TX_CTL_NO_ACK = BIT(4), 250 IEEE80211_TX_CTL_CLEAR_PS_FILT = BIT(3),
268 IEEE80211_TX_CTL_RATE_CTRL_PROBE = BIT(5), 251 IEEE80211_TX_CTL_FIRST_FRAGMENT = BIT(4),
269 IEEE80211_TX_CTL_CLEAR_PS_FILT = BIT(6), 252 IEEE80211_TX_CTL_SEND_AFTER_DTIM = BIT(5),
270 IEEE80211_TX_CTL_REQUEUE = BIT(7), 253 IEEE80211_TX_CTL_AMPDU = BIT(6),
271 IEEE80211_TX_CTL_FIRST_FRAGMENT = BIT(8), 254 IEEE80211_TX_CTL_INJECTED = BIT(7),
272 IEEE80211_TX_CTL_SHORT_PREAMBLE = BIT(9), 255 IEEE80211_TX_STAT_TX_FILTERED = BIT(8),
273 IEEE80211_TX_CTL_LONG_RETRY_LIMIT = BIT(10), 256 IEEE80211_TX_STAT_ACK = BIT(9),
274 IEEE80211_TX_CTL_SEND_AFTER_DTIM = BIT(12), 257 IEEE80211_TX_STAT_AMPDU = BIT(10),
275 IEEE80211_TX_CTL_AMPDU = BIT(13), 258 IEEE80211_TX_STAT_AMPDU_NO_BACK = BIT(11),
276 IEEE80211_TX_CTL_OFDM_HT = BIT(14), 259 IEEE80211_TX_CTL_RATE_CTRL_PROBE = BIT(12),
277 IEEE80211_TX_CTL_GREEN_FIELD = BIT(15), 260};
278 IEEE80211_TX_CTL_40_MHZ_WIDTH = BIT(16), 261
279 IEEE80211_TX_CTL_DUP_DATA = BIT(17), 262enum mac80211_rate_control_flags {
280 IEEE80211_TX_CTL_SHORT_GI = BIT(18), 263 IEEE80211_TX_RC_USE_RTS_CTS = BIT(0),
281 IEEE80211_TX_CTL_INJECTED = BIT(19), 264 IEEE80211_TX_RC_USE_CTS_PROTECT = BIT(1),
282 IEEE80211_TX_STAT_TX_FILTERED = BIT(20), 265 IEEE80211_TX_RC_USE_SHORT_PREAMBLE = BIT(2),
283 IEEE80211_TX_STAT_ACK = BIT(21), 266
284 IEEE80211_TX_STAT_AMPDU = BIT(22), 267 /* rate index is an MCS rate number instead of an index */
285 IEEE80211_TX_STAT_AMPDU_NO_BACK = BIT(23), 268 IEEE80211_TX_RC_MCS = BIT(3),
286 IEEE80211_TX_CTL_ASSIGN_SEQ = BIT(24), 269 IEEE80211_TX_RC_GREEN_FIELD = BIT(4),
270 IEEE80211_TX_RC_40_MHZ_WIDTH = BIT(5),
271 IEEE80211_TX_RC_DUP_DATA = BIT(6),
272 IEEE80211_TX_RC_SHORT_GI = BIT(7),
287}; 273};
288 274
289 275
290#define IEEE80211_TX_INFO_DRIVER_DATA_SIZE \ 276/* there are 40 bytes if you don't need the rateset to be kept */
291 (sizeof(((struct sk_buff *)0)->cb) - 8) 277#define IEEE80211_TX_INFO_DRIVER_DATA_SIZE 40
292#define IEEE80211_TX_INFO_DRIVER_DATA_PTRS \ 278
293 (IEEE80211_TX_INFO_DRIVER_DATA_SIZE / sizeof(void *)) 279/* if you do need the rateset, then you have less space */
280#define IEEE80211_TX_INFO_RATE_DRIVER_DATA_SIZE 24
294 281
295/* maximum number of alternate rate retry stages */ 282/* maximum number of rate stages */
296#define IEEE80211_TX_MAX_ALTRATE 3 283#define IEEE80211_TX_MAX_RATES 5
297 284
298/** 285/**
299 * struct ieee80211_tx_altrate - alternate rate selection/status 286 * struct ieee80211_tx_rate - rate selection/status
300 * 287 *
301 * @rate_idx: rate index to attempt to send with 288 * @idx: rate index to attempt to send with
302 * @limit: number of retries before fallback 289 * @flags: rate control flags (&enum mac80211_rate_control_flags)
290 * @count: number of tries in this rate before going to the next rate
291 *
292 * A value of -1 for @idx indicates an invalid rate and, if used
293 * in an array of retry rates, that no more rates should be tried.
294 *
295 * When used for transmit status reporting, the driver should
296 * always report the rate along with the flags it used.
303 */ 297 */
304struct ieee80211_tx_altrate { 298struct ieee80211_tx_rate {
305 s8 rate_idx; 299 s8 idx;
306 u8 limit; 300 u8 count;
301 u8 flags;
307}; 302};
308 303
309/** 304/**
@@ -318,15 +313,12 @@ struct ieee80211_tx_altrate {
318 * it may be NULL. 313 * it may be NULL.
319 * 314 *
320 * @flags: transmit info flags, defined above 315 * @flags: transmit info flags, defined above
321 * @band: TBD 316 * @band: the band to transmit on (use for checking for races)
322 * @tx_rate_idx: TBD 317 * @antenna_sel_tx: antenna to use, 0 for automatic diversity
323 * @antenna_sel_tx: TBD
324 * @control: union for control data 318 * @control: union for control data
325 * @status: union for status data 319 * @status: union for status data
326 * @driver_data: array of driver_data pointers 320 * @driver_data: array of driver_data pointers
327 * @retry_count: number of retries 321 * @retry_count: number of retries
328 * @excessive_retries: set to 1 if the frame was retried many times
329 * but not acknowledged
330 * @ampdu_ack_len: number of aggregated frames. 322 * @ampdu_ack_len: number of aggregated frames.
331 * relevant only if IEEE80211_TX_STATUS_AMPDU was set. 323 * relevant only if IEEE80211_TX_STATUS_AMPDU was set.
332 * @ampdu_ack_map: block ack bit map for the aggregation. 324 * @ampdu_ack_map: block ack bit map for the aggregation.
@@ -337,31 +329,43 @@ struct ieee80211_tx_info {
337 /* common information */ 329 /* common information */
338 u32 flags; 330 u32 flags;
339 u8 band; 331 u8 band;
340 s8 tx_rate_idx; 332
341 u8 antenna_sel_tx; 333 u8 antenna_sel_tx;
342 334
343 /* 1 byte hole */ 335 /* 2 byte hole */
344 336
345 union { 337 union {
346 struct { 338 struct {
339 union {
340 /* rate control */
341 struct {
342 struct ieee80211_tx_rate rates[
343 IEEE80211_TX_MAX_RATES];
344 s8 rts_cts_rate_idx;
345 };
346 /* only needed before rate control */
347 unsigned long jiffies;
348 };
347 /* NB: vif can be NULL for injected frames */ 349 /* NB: vif can be NULL for injected frames */
348 struct ieee80211_vif *vif; 350 struct ieee80211_vif *vif;
349 struct ieee80211_key_conf *hw_key; 351 struct ieee80211_key_conf *hw_key;
350 struct ieee80211_sta *sta; 352 struct ieee80211_sta *sta;
351 unsigned long jiffies;
352 s8 rts_cts_rate_idx;
353 u8 retry_limit;
354 struct ieee80211_tx_altrate retries[IEEE80211_TX_MAX_ALTRATE];
355 } control; 353 } control;
356 struct { 354 struct {
355 struct ieee80211_tx_rate rates[IEEE80211_TX_MAX_RATES];
356 u8 ampdu_ack_len;
357 u64 ampdu_ack_map; 357 u64 ampdu_ack_map;
358 int ack_signal; 358 int ack_signal;
359 struct ieee80211_tx_altrate retries[IEEE80211_TX_MAX_ALTRATE + 1]; 359 /* 8 bytes free */
360 u8 retry_count;
361 bool excessive_retries;
362 u8 ampdu_ack_len;
363 } status; 360 } status;
364 void *driver_data[IEEE80211_TX_INFO_DRIVER_DATA_PTRS]; 361 struct {
362 struct ieee80211_tx_rate driver_rates[
363 IEEE80211_TX_MAX_RATES];
364 void *rate_driver_data[
365 IEEE80211_TX_INFO_RATE_DRIVER_DATA_SIZE / sizeof(void *)];
366 };
367 void *driver_data[
368 IEEE80211_TX_INFO_DRIVER_DATA_SIZE / sizeof(void *)];
365 }; 369 };
366}; 370};
367 371
@@ -370,6 +374,41 @@ static inline struct ieee80211_tx_info *IEEE80211_SKB_CB(struct sk_buff *skb)
370 return (struct ieee80211_tx_info *)skb->cb; 374 return (struct ieee80211_tx_info *)skb->cb;
371} 375}
372 376
377/**
378 * ieee80211_tx_info_clear_status - clear TX status
379 *
380 * @info: The &struct ieee80211_tx_info to be cleared.
381 *
382 * When the driver passes an skb back to mac80211, it must report
383 * a number of things in TX status. This function clears everything
384 * in the TX status but the rate control information (it does clear
385 * the count since you need to fill that in anyway).
386 *
387 * NOTE: You can only use this function if you do NOT use
388 * info->driver_data! Use info->rate_driver_data
389 * instead if you need only the less space that allows.
390 */
391static inline void
392ieee80211_tx_info_clear_status(struct ieee80211_tx_info *info)
393{
394 int i;
395
396 BUILD_BUG_ON(offsetof(struct ieee80211_tx_info, status.rates) !=
397 offsetof(struct ieee80211_tx_info, control.rates));
398 BUILD_BUG_ON(offsetof(struct ieee80211_tx_info, status.rates) !=
399 offsetof(struct ieee80211_tx_info, driver_rates));
400 BUILD_BUG_ON(offsetof(struct ieee80211_tx_info, status.rates) != 8);
401 /* clear the rate counts */
402 for (i = 0; i < IEEE80211_TX_MAX_RATES; i++)
403 info->status.rates[i].count = 0;
404
405 BUILD_BUG_ON(
406 offsetof(struct ieee80211_tx_info, status.ampdu_ack_len) != 23);
407 memset(&info->status.ampdu_ack_len, 0,
408 sizeof(struct ieee80211_tx_info) -
409 offsetof(struct ieee80211_tx_info, status.ampdu_ack_len));
410}
411
373 412
374/** 413/**
375 * enum mac80211_rx_flags - receive flags 414 * enum mac80211_rx_flags - receive flags
@@ -442,21 +481,48 @@ struct ieee80211_rx_status {
442 * 481 *
443 * Flags to define PHY configuration options 482 * Flags to define PHY configuration options
444 * 483 *
445 * @IEEE80211_CONF_SHORT_SLOT_TIME: use 802.11g short slot time
446 * @IEEE80211_CONF_RADIOTAP: add radiotap header at receive time (if supported) 484 * @IEEE80211_CONF_RADIOTAP: add radiotap header at receive time (if supported)
447 * @IEEE80211_CONF_SUPPORT_HT_MODE: use 802.11n HT capabilities (if supported)
448 * @IEEE80211_CONF_PS: Enable 802.11 power save mode 485 * @IEEE80211_CONF_PS: Enable 802.11 power save mode
449 */ 486 */
450enum ieee80211_conf_flags { 487enum ieee80211_conf_flags {
451 /* 488 IEEE80211_CONF_RADIOTAP = (1<<0),
452 * TODO: IEEE80211_CONF_SHORT_SLOT_TIME will be removed once drivers 489 IEEE80211_CONF_PS = (1<<1),
453 * have been converted to use bss_info_changed() for slot time 490};
454 * configuration 491
455 */ 492/* XXX: remove all this once drivers stop trying to use it */
456 IEEE80211_CONF_SHORT_SLOT_TIME = (1<<0), 493static inline int __deprecated __IEEE80211_CONF_SHORT_SLOT_TIME(void)
457 IEEE80211_CONF_RADIOTAP = (1<<1), 494{
458 IEEE80211_CONF_SUPPORT_HT_MODE = (1<<2), 495 return 0;
459 IEEE80211_CONF_PS = (1<<3), 496}
497#define IEEE80211_CONF_SHORT_SLOT_TIME (__IEEE80211_CONF_SHORT_SLOT_TIME())
498
499struct ieee80211_ht_conf {
500 bool enabled;
501};
502
503/**
504 * enum ieee80211_conf_changed - denotes which configuration changed
505 *
506 * @IEEE80211_CONF_CHANGE_RADIO_ENABLED: the value of radio_enabled changed
507 * @IEEE80211_CONF_CHANGE_BEACON_INTERVAL: the beacon interval changed
508 * @IEEE80211_CONF_CHANGE_LISTEN_INTERVAL: the listen interval changed
509 * @IEEE80211_CONF_CHANGE_RADIOTAP: the radiotap flag changed
510 * @IEEE80211_CONF_CHANGE_PS: the PS flag changed
511 * @IEEE80211_CONF_CHANGE_POWER: the TX power changed
512 * @IEEE80211_CONF_CHANGE_CHANNEL: the channel changed
513 * @IEEE80211_CONF_CHANGE_RETRY_LIMITS: retry limits changed
514 * @IEEE80211_CONF_CHANGE_HT: HT configuration changed
515 */
516enum ieee80211_conf_changed {
517 IEEE80211_CONF_CHANGE_RADIO_ENABLED = BIT(0),
518 IEEE80211_CONF_CHANGE_BEACON_INTERVAL = BIT(1),
519 IEEE80211_CONF_CHANGE_LISTEN_INTERVAL = BIT(2),
520 IEEE80211_CONF_CHANGE_RADIOTAP = BIT(3),
521 IEEE80211_CONF_CHANGE_PS = BIT(4),
522 IEEE80211_CONF_CHANGE_POWER = BIT(5),
523 IEEE80211_CONF_CHANGE_CHANNEL = BIT(6),
524 IEEE80211_CONF_CHANGE_RETRY_LIMITS = BIT(7),
525 IEEE80211_CONF_CHANGE_HT = BIT(8),
460}; 526};
461 527
462/** 528/**
@@ -465,34 +531,31 @@ enum ieee80211_conf_flags {
465 * This struct indicates how the driver shall configure the hardware. 531 * This struct indicates how the driver shall configure the hardware.
466 * 532 *
467 * @radio_enabled: when zero, driver is required to switch off the radio. 533 * @radio_enabled: when zero, driver is required to switch off the radio.
468 * TODO make a flag
469 * @beacon_int: beacon interval (TODO make interface config) 534 * @beacon_int: beacon interval (TODO make interface config)
470 * @listen_interval: listen interval in units of beacon interval 535 * @listen_interval: listen interval in units of beacon interval
471 * @flags: configuration flags defined above 536 * @flags: configuration flags defined above
472 * @power_level: requested transmit power (in dBm) 537 * @power_level: requested transmit power (in dBm)
473 * @max_antenna_gain: maximum antenna gain (in dBi)
474 * @antenna_sel_tx: transmit antenna selection, 0: default/diversity,
475 * 1/2: antenna 0/1
476 * @antenna_sel_rx: receive antenna selection, like @antenna_sel_tx
477 * @ht_conf: describes current self configuration of 802.11n HT capabilies
478 * @ht_bss_conf: describes current BSS configuration of 802.11n HT parameters
479 * @channel: the channel to tune to 538 * @channel: the channel to tune to
539 * @ht: the HT configuration for the device
540 * @long_frame_max_tx_count: Maximum number of transmissions for a "long" frame
541 * (a frame not RTS protected), called "dot11LongRetryLimit" in 802.11,
542 * but actually means the number of transmissions not the number of retries
543 * @short_frame_max_tx_count: Maximum number of transmissions for a "short"
544 * frame, called "dot11ShortRetryLimit" in 802.11, but actually means the
545 * number of transmissions not the number of retries
480 */ 546 */
481struct ieee80211_conf { 547struct ieee80211_conf {
482 int radio_enabled;
483
484 int beacon_int; 548 int beacon_int;
485 u16 listen_interval;
486 u32 flags; 549 u32 flags;
487 int power_level; 550 int power_level;
488 int max_antenna_gain;
489 u8 antenna_sel_tx;
490 u8 antenna_sel_rx;
491 551
492 struct ieee80211_channel *channel; 552 u16 listen_interval;
553 bool radio_enabled;
493 554
494 struct ieee80211_ht_info ht_conf; 555 u8 long_frame_max_tx_count, short_frame_max_tx_count;
495 struct ieee80211_ht_bss_info ht_bss_conf; 556
557 struct ieee80211_channel *channel;
558 struct ieee80211_ht_conf ht;
496}; 559};
497 560
498/** 561/**
@@ -502,11 +565,14 @@ struct ieee80211_conf {
502 * use during the life of a virtual interface. 565 * use during the life of a virtual interface.
503 * 566 *
504 * @type: type of this virtual interface 567 * @type: type of this virtual interface
568 * @bss_conf: BSS configuration for this interface, either our own
569 * or the BSS we're associated to
505 * @drv_priv: data area for driver use, will always be aligned to 570 * @drv_priv: data area for driver use, will always be aligned to
506 * sizeof(void *). 571 * sizeof(void *).
507 */ 572 */
508struct ieee80211_vif { 573struct ieee80211_vif {
509 enum nl80211_iftype type; 574 enum nl80211_iftype type;
575 struct ieee80211_bss_conf bss_conf;
510 /* must be last */ 576 /* must be last */
511 u8 drv_priv[0] __attribute__((__aligned__(sizeof(void *)))); 577 u8 drv_priv[0] __attribute__((__aligned__(sizeof(void *))));
512}; 578};
@@ -685,7 +751,7 @@ enum set_key_cmd {
685 * @addr: MAC address 751 * @addr: MAC address
686 * @aid: AID we assigned to the station if we're an AP 752 * @aid: AID we assigned to the station if we're an AP
687 * @supp_rates: Bitmap of supported rates (per band) 753 * @supp_rates: Bitmap of supported rates (per band)
688 * @ht_info: HT capabilities of this STA 754 * @ht_cap: HT capabilities of this STA; restricted to our own TX capabilities
689 * @drv_priv: data area for driver use, will always be aligned to 755 * @drv_priv: data area for driver use, will always be aligned to
690 * sizeof(void *), size is determined in hw information. 756 * sizeof(void *), size is determined in hw information.
691 */ 757 */
@@ -693,7 +759,7 @@ struct ieee80211_sta {
693 u64 supp_rates[IEEE80211_NUM_BANDS]; 759 u64 supp_rates[IEEE80211_NUM_BANDS];
694 u8 addr[ETH_ALEN]; 760 u8 addr[ETH_ALEN];
695 u16 aid; 761 u16 aid;
696 struct ieee80211_ht_info ht_info; 762 struct ieee80211_sta_ht_cap ht_cap;
697 763
698 /* must be last */ 764 /* must be last */
699 u8 drv_priv[0] __attribute__((__aligned__(sizeof(void *)))); 765 u8 drv_priv[0] __attribute__((__aligned__(sizeof(void *))));
@@ -777,6 +843,9 @@ enum ieee80211_tkip_key_type {
777 * @IEEE80211_HW_SPECTRUM_MGMT: 843 * @IEEE80211_HW_SPECTRUM_MGMT:
778 * Hardware supports spectrum management defined in 802.11h 844 * Hardware supports spectrum management defined in 802.11h
779 * Measurement, Channel Switch, Quieting, TPC 845 * Measurement, Channel Switch, Quieting, TPC
846 *
847 * @IEEE80211_HW_AMPDU_AGGREGATION:
848 * Hardware supports 11n A-MPDU aggregation.
780 */ 849 */
781enum ieee80211_hw_flags { 850enum ieee80211_hw_flags {
782 IEEE80211_HW_RX_INCLUDES_FCS = 1<<1, 851 IEEE80211_HW_RX_INCLUDES_FCS = 1<<1,
@@ -788,6 +857,7 @@ enum ieee80211_hw_flags {
788 IEEE80211_HW_SIGNAL_DBM = 1<<7, 857 IEEE80211_HW_SIGNAL_DBM = 1<<7,
789 IEEE80211_HW_NOISE_DBM = 1<<8, 858 IEEE80211_HW_NOISE_DBM = 1<<8,
790 IEEE80211_HW_SPECTRUM_MGMT = 1<<9, 859 IEEE80211_HW_SPECTRUM_MGMT = 1<<9,
860 IEEE80211_HW_AMPDU_AGGREGATION = 1<<10,
791}; 861};
792 862
793/** 863/**
@@ -846,8 +916,8 @@ enum ieee80211_hw_flags {
846 * @sta_data_size: size (in bytes) of the drv_priv data area 916 * @sta_data_size: size (in bytes) of the drv_priv data area
847 * within &struct ieee80211_sta. 917 * within &struct ieee80211_sta.
848 * 918 *
849 * @max_altrates: maximum number of alternate rate retry stages 919 * @max_rates: maximum number of alternate rate retry stages
850 * @max_altrate_tries: maximum number of tries for each stage 920 * @max_rate_tries: maximum number of tries for each stage
851 */ 921 */
852struct ieee80211_hw { 922struct ieee80211_hw {
853 struct ieee80211_conf conf; 923 struct ieee80211_conf conf;
@@ -864,12 +934,10 @@ struct ieee80211_hw {
864 u16 ampdu_queues; 934 u16 ampdu_queues;
865 u16 max_listen_interval; 935 u16 max_listen_interval;
866 s8 max_signal; 936 s8 max_signal;
867 u8 max_altrates; 937 u8 max_rates;
868 u8 max_altrate_tries; 938 u8 max_rate_tries;
869}; 939};
870 940
871struct ieee80211_hw *wiphy_to_hw(struct wiphy *wiphy);
872
873/** 941/**
874 * SET_IEEE80211_DEV - set device for 802.11 hardware 942 * SET_IEEE80211_DEV - set device for 802.11 hardware
875 * 943 *
@@ -882,7 +950,7 @@ static inline void SET_IEEE80211_DEV(struct ieee80211_hw *hw, struct device *dev
882} 950}
883 951
884/** 952/**
885 * SET_IEEE80211_PERM_ADDR - set the permanenet MAC address for 802.11 hardware 953 * SET_IEEE80211_PERM_ADDR - set the permanent MAC address for 802.11 hardware
886 * 954 *
887 * @hw: the &struct ieee80211_hw to set the MAC address for 955 * @hw: the &struct ieee80211_hw to set the MAC address for
888 * @addr: the address to set 956 * @addr: the address to set
@@ -906,9 +974,9 @@ static inline struct ieee80211_rate *
906ieee80211_get_tx_rate(const struct ieee80211_hw *hw, 974ieee80211_get_tx_rate(const struct ieee80211_hw *hw,
907 const struct ieee80211_tx_info *c) 975 const struct ieee80211_tx_info *c)
908{ 976{
909 if (WARN_ON(c->tx_rate_idx < 0)) 977 if (WARN_ON(c->control.rates[0].idx < 0))
910 return NULL; 978 return NULL;
911 return &hw->wiphy->bands[c->band]->bitrates[c->tx_rate_idx]; 979 return &hw->wiphy->bands[c->band]->bitrates[c->control.rates[0].idx];
912} 980}
913 981
914static inline struct ieee80211_rate * 982static inline struct ieee80211_rate *
@@ -924,9 +992,9 @@ static inline struct ieee80211_rate *
924ieee80211_get_alt_retry_rate(const struct ieee80211_hw *hw, 992ieee80211_get_alt_retry_rate(const struct ieee80211_hw *hw,
925 const struct ieee80211_tx_info *c, int idx) 993 const struct ieee80211_tx_info *c, int idx)
926{ 994{
927 if (c->control.retries[idx].rate_idx < 0) 995 if (c->control.rates[idx + 1].idx < 0)
928 return NULL; 996 return NULL;
929 return &hw->wiphy->bands[c->band]->bitrates[c->control.retries[idx].rate_idx]; 997 return &hw->wiphy->bands[c->band]->bitrates[c->control.rates[idx + 1].idx];
930} 998}
931 999
932/** 1000/**
@@ -975,7 +1043,7 @@ ieee80211_get_alt_retry_rate(const struct ieee80211_hw *hw,
975 * This happens everytime the iv16 wraps around (every 65536 packets). The 1043 * This happens everytime the iv16 wraps around (every 65536 packets). The
976 * set_key() call will happen only once for each key (unless the AP did 1044 * set_key() call will happen only once for each key (unless the AP did
977 * rekeying), it will not include a valid phase 1 key. The valid phase 1 key is 1045 * rekeying), it will not include a valid phase 1 key. The valid phase 1 key is
978 * provided by udpate_tkip_key only. The trigger that makes mac80211 call this 1046 * provided by update_tkip_key only. The trigger that makes mac80211 call this
979 * handler is software decryption with wrap around of iv16. 1047 * handler is software decryption with wrap around of iv16.
980 */ 1048 */
981 1049
@@ -1109,7 +1177,7 @@ enum ieee80211_ampdu_mlme_action {
1109 * Must be implemented. 1177 * Must be implemented.
1110 * 1178 *
1111 * @add_interface: Called when a netdevice attached to the hardware is 1179 * @add_interface: Called when a netdevice attached to the hardware is
1112 * enabled. Because it is not called for monitor mode devices, @open 1180 * enabled. Because it is not called for monitor mode devices, @start
1113 * and @stop must be implemented. 1181 * and @stop must be implemented.
1114 * The driver should perform any initialization it needs before 1182 * The driver should perform any initialization it needs before
1115 * the device can be enabled. The initial configuration for the 1183 * the device can be enabled. The initial configuration for the
@@ -1175,10 +1243,8 @@ enum ieee80211_ampdu_mlme_action {
1175 * the device does fragmentation by itself; if this method is assigned then 1243 * the device does fragmentation by itself; if this method is assigned then
1176 * the stack will not do fragmentation. 1244 * the stack will not do fragmentation.
1177 * 1245 *
1178 * @set_retry_limit: Configuration of retry limits (if device needs it)
1179 *
1180 * @sta_notify: Notifies low level driver about addition or removal 1246 * @sta_notify: Notifies low level driver about addition or removal
1181 * of assocaited station or AP. 1247 * of associated station or AP.
1182 * 1248 *
1183 * @conf_tx: Configure TX queue parameters (EDCF (aifs, cw_min, cw_max), 1249 * @conf_tx: Configure TX queue parameters (EDCF (aifs, cw_min, cw_max),
1184 * bursting) for a hardware TX queue. 1250 * bursting) for a hardware TX queue.
@@ -1219,7 +1285,7 @@ struct ieee80211_ops {
1219 struct ieee80211_if_init_conf *conf); 1285 struct ieee80211_if_init_conf *conf);
1220 void (*remove_interface)(struct ieee80211_hw *hw, 1286 void (*remove_interface)(struct ieee80211_hw *hw,
1221 struct ieee80211_if_init_conf *conf); 1287 struct ieee80211_if_init_conf *conf);
1222 int (*config)(struct ieee80211_hw *hw, struct ieee80211_conf *conf); 1288 int (*config)(struct ieee80211_hw *hw, u32 changed);
1223 int (*config_interface)(struct ieee80211_hw *hw, 1289 int (*config_interface)(struct ieee80211_hw *hw,
1224 struct ieee80211_vif *vif, 1290 struct ieee80211_vif *vif,
1225 struct ieee80211_if_conf *conf); 1291 struct ieee80211_if_conf *conf);
@@ -1246,8 +1312,6 @@ struct ieee80211_ops {
1246 u32 *iv32, u16 *iv16); 1312 u32 *iv32, u16 *iv16);
1247 int (*set_rts_threshold)(struct ieee80211_hw *hw, u32 value); 1313 int (*set_rts_threshold)(struct ieee80211_hw *hw, u32 value);
1248 int (*set_frag_threshold)(struct ieee80211_hw *hw, u32 value); 1314 int (*set_frag_threshold)(struct ieee80211_hw *hw, u32 value);
1249 int (*set_retry_limit)(struct ieee80211_hw *hw,
1250 u32 short_retry, u32 long_retr);
1251 void (*sta_notify)(struct ieee80211_hw *hw, struct ieee80211_vif *vif, 1315 void (*sta_notify)(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
1252 enum sta_notify_cmd, struct ieee80211_sta *sta); 1316 enum sta_notify_cmd, struct ieee80211_sta *sta);
1253 int (*conf_tx)(struct ieee80211_hw *hw, u16 queue, 1317 int (*conf_tx)(struct ieee80211_hw *hw, u16 queue,
@@ -1480,7 +1544,7 @@ void ieee80211_tx_status_irqsafe(struct ieee80211_hw *hw,
1480 * the next beacon frame from the 802.11 code. The low-level is responsible 1544 * the next beacon frame from the 802.11 code. The low-level is responsible
1481 * for calling this function before beacon data is needed (e.g., based on 1545 * for calling this function before beacon data is needed (e.g., based on
1482 * hardware interrupt). Returned skb is used only once and low-level driver 1546 * hardware interrupt). Returned skb is used only once and low-level driver
1483 * is responsible of freeing it. 1547 * is responsible for freeing it.
1484 */ 1548 */
1485struct sk_buff *ieee80211_beacon_get(struct ieee80211_hw *hw, 1549struct sk_buff *ieee80211_beacon_get(struct ieee80211_hw *hw,
1486 struct ieee80211_vif *vif); 1550 struct ieee80211_vif *vif);
@@ -1823,24 +1887,38 @@ struct ieee80211_sta *ieee80211_find_sta(struct ieee80211_hw *hw,
1823 1887
1824 1888
1825/* Rate control API */ 1889/* Rate control API */
1890
1826/** 1891/**
1827 * struct rate_selection - rate information for/from rate control algorithms 1892 * struct ieee80211_tx_rate_control - rate control information for/from RC algo
1828 * 1893 *
1829 * @rate_idx: selected transmission rate index 1894 * @hw: The hardware the algorithm is invoked for.
1830 * @nonerp_idx: Non-ERP rate to use instead if ERP cannot be used 1895 * @sband: The band this frame is being transmitted on.
1831 * @probe_idx: rate for probing (or -1) 1896 * @bss_conf: the current BSS configuration
1832 * @max_rate_idx: maximum rate index that can be used, this is 1897 * @reported_rate: The rate control algorithm can fill this in to indicate
1833 * input to the algorithm and will be enforced 1898 * which rate should be reported to userspace as the current rate and
1834 */ 1899 * used for rate calculations in the mesh network.
1835struct rate_selection { 1900 * @rts: whether RTS will be used for this frame because it is longer than the
1836 s8 rate_idx, nonerp_idx, probe_idx, max_rate_idx; 1901 * RTS threshold
1902 * @short_preamble: whether mac80211 will request short-preamble transmission
1903 * if the selected rate supports it
1904 * @max_rate_idx: user-requested maximum rate (not MCS for now)
1905 * @skb: the skb that will be transmitted, the control information in it needs
1906 * to be filled in
1907 */
1908struct ieee80211_tx_rate_control {
1909 struct ieee80211_hw *hw;
1910 struct ieee80211_supported_band *sband;
1911 struct ieee80211_bss_conf *bss_conf;
1912 struct sk_buff *skb;
1913 struct ieee80211_tx_rate reported_rate;
1914 bool rts, short_preamble;
1915 u8 max_rate_idx;
1837}; 1916};
1838 1917
1839struct rate_control_ops { 1918struct rate_control_ops {
1840 struct module *module; 1919 struct module *module;
1841 const char *name; 1920 const char *name;
1842 void *(*alloc)(struct ieee80211_hw *hw, struct dentry *debugfsdir); 1921 void *(*alloc)(struct ieee80211_hw *hw, struct dentry *debugfsdir);
1843 void (*clear)(void *priv);
1844 void (*free)(void *priv); 1922 void (*free)(void *priv);
1845 1923
1846 void *(*alloc_sta)(void *priv, struct ieee80211_sta *sta, gfp_t gfp); 1924 void *(*alloc_sta)(void *priv, struct ieee80211_sta *sta, gfp_t gfp);
@@ -1852,10 +1930,8 @@ struct rate_control_ops {
1852 void (*tx_status)(void *priv, struct ieee80211_supported_band *sband, 1930 void (*tx_status)(void *priv, struct ieee80211_supported_band *sband,
1853 struct ieee80211_sta *sta, void *priv_sta, 1931 struct ieee80211_sta *sta, void *priv_sta,
1854 struct sk_buff *skb); 1932 struct sk_buff *skb);
1855 void (*get_rate)(void *priv, struct ieee80211_supported_band *sband, 1933 void (*get_rate)(void *priv, struct ieee80211_sta *sta, void *priv_sta,
1856 struct ieee80211_sta *sta, void *priv_sta, 1934 struct ieee80211_tx_rate_control *txrc);
1857 struct sk_buff *skb,
1858 struct rate_selection *sel);
1859 1935
1860 void (*add_sta_debugfs)(void *priv, void *priv_sta, 1936 void (*add_sta_debugfs)(void *priv, void *priv_sta,
1861 struct dentry *dir); 1937 struct dentry *dir);
diff --git a/include/net/netfilter/nf_conntrack_tuple.h b/include/net/netfilter/nf_conntrack_tuple.h
index a6874ba22d54..f2f6aa73dc10 100644
--- a/include/net/netfilter/nf_conntrack_tuple.h
+++ b/include/net/netfilter/nf_conntrack_tuple.h
@@ -112,20 +112,20 @@ struct nf_conntrack_tuple_mask
112static inline void nf_ct_dump_tuple_ip(const struct nf_conntrack_tuple *t) 112static inline void nf_ct_dump_tuple_ip(const struct nf_conntrack_tuple *t)
113{ 113{
114#ifdef DEBUG 114#ifdef DEBUG
115 printk("tuple %p: %u " NIPQUAD_FMT ":%hu -> " NIPQUAD_FMT ":%hu\n", 115 printk("tuple %p: %u %pI4:%hu -> %pI4:%hu\n",
116 t, t->dst.protonum, 116 t, t->dst.protonum,
117 NIPQUAD(t->src.u3.ip), ntohs(t->src.u.all), 117 &t->src.u3.ip, ntohs(t->src.u.all),
118 NIPQUAD(t->dst.u3.ip), ntohs(t->dst.u.all)); 118 &t->dst.u3.ip, ntohs(t->dst.u.all));
119#endif 119#endif
120} 120}
121 121
122static inline void nf_ct_dump_tuple_ipv6(const struct nf_conntrack_tuple *t) 122static inline void nf_ct_dump_tuple_ipv6(const struct nf_conntrack_tuple *t)
123{ 123{
124#ifdef DEBUG 124#ifdef DEBUG
125 printk("tuple %p: %u " NIP6_FMT " %hu -> " NIP6_FMT " %hu\n", 125 printk("tuple %p: %u %pI6 %hu -> %pI6 %hu\n",
126 t, t->dst.protonum, 126 t, t->dst.protonum,
127 NIP6(*(struct in6_addr *)t->src.u3.all), ntohs(t->src.u.all), 127 t->src.u3.all, ntohs(t->src.u.all),
128 NIP6(*(struct in6_addr *)t->dst.u3.all), ntohs(t->dst.u.all)); 128 t->dst.u3.all, ntohs(t->dst.u.all));
129#endif 129#endif
130} 130}
131 131
diff --git a/include/net/netlink.h b/include/net/netlink.h
index 3643bbb8e585..46b7764f1774 100644
--- a/include/net/netlink.h
+++ b/include/net/netlink.h
@@ -233,7 +233,7 @@ extern int nla_parse(struct nlattr *tb[], int maxtype,
233extern struct nlattr * nla_find(struct nlattr *head, int len, int attrtype); 233extern struct nlattr * nla_find(struct nlattr *head, int len, int attrtype);
234extern size_t nla_strlcpy(char *dst, const struct nlattr *nla, 234extern size_t nla_strlcpy(char *dst, const struct nlattr *nla,
235 size_t dstsize); 235 size_t dstsize);
236extern int nla_memcpy(void *dest, struct nlattr *src, int count); 236extern int nla_memcpy(void *dest, const struct nlattr *src, int count);
237extern int nla_memcmp(const struct nlattr *nla, const void *data, 237extern int nla_memcmp(const struct nlattr *nla, const void *data,
238 size_t size); 238 size_t size);
239extern int nla_strcmp(const struct nlattr *nla, const char *str); 239extern int nla_strcmp(const struct nlattr *nla, const char *str);
@@ -741,7 +741,7 @@ static inline struct nlattr *nla_find_nested(struct nlattr *nla, int attrtype)
741 * See nla_parse() 741 * See nla_parse()
742 */ 742 */
743static inline int nla_parse_nested(struct nlattr *tb[], int maxtype, 743static inline int nla_parse_nested(struct nlattr *tb[], int maxtype,
744 struct nlattr *nla, 744 const struct nlattr *nla,
745 const struct nla_policy *policy) 745 const struct nla_policy *policy)
746{ 746{
747 return nla_parse(tb, maxtype, nla_data(nla), nla_len(nla), policy); 747 return nla_parse(tb, maxtype, nla_data(nla), nla_len(nla), policy);
@@ -875,7 +875,7 @@ static inline int nla_put_msecs(struct sk_buff *skb, int attrtype,
875 * nla_get_u32 - return payload of u32 attribute 875 * nla_get_u32 - return payload of u32 attribute
876 * @nla: u32 netlink attribute 876 * @nla: u32 netlink attribute
877 */ 877 */
878static inline u32 nla_get_u32(struct nlattr *nla) 878static inline u32 nla_get_u32(const struct nlattr *nla)
879{ 879{
880 return *(u32 *) nla_data(nla); 880 return *(u32 *) nla_data(nla);
881} 881}
@@ -884,7 +884,7 @@ static inline u32 nla_get_u32(struct nlattr *nla)
884 * nla_get_be32 - return payload of __be32 attribute 884 * nla_get_be32 - return payload of __be32 attribute
885 * @nla: __be32 netlink attribute 885 * @nla: __be32 netlink attribute
886 */ 886 */
887static inline __be32 nla_get_be32(struct nlattr *nla) 887static inline __be32 nla_get_be32(const struct nlattr *nla)
888{ 888{
889 return *(__be32 *) nla_data(nla); 889 return *(__be32 *) nla_data(nla);
890} 890}
@@ -893,7 +893,7 @@ static inline __be32 nla_get_be32(struct nlattr *nla)
893 * nla_get_u16 - return payload of u16 attribute 893 * nla_get_u16 - return payload of u16 attribute
894 * @nla: u16 netlink attribute 894 * @nla: u16 netlink attribute
895 */ 895 */
896static inline u16 nla_get_u16(struct nlattr *nla) 896static inline u16 nla_get_u16(const struct nlattr *nla)
897{ 897{
898 return *(u16 *) nla_data(nla); 898 return *(u16 *) nla_data(nla);
899} 899}
@@ -902,7 +902,7 @@ static inline u16 nla_get_u16(struct nlattr *nla)
902 * nla_get_be16 - return payload of __be16 attribute 902 * nla_get_be16 - return payload of __be16 attribute
903 * @nla: __be16 netlink attribute 903 * @nla: __be16 netlink attribute
904 */ 904 */
905static inline __be16 nla_get_be16(struct nlattr *nla) 905static inline __be16 nla_get_be16(const struct nlattr *nla)
906{ 906{
907 return *(__be16 *) nla_data(nla); 907 return *(__be16 *) nla_data(nla);
908} 908}
@@ -911,7 +911,7 @@ static inline __be16 nla_get_be16(struct nlattr *nla)
911 * nla_get_le16 - return payload of __le16 attribute 911 * nla_get_le16 - return payload of __le16 attribute
912 * @nla: __le16 netlink attribute 912 * @nla: __le16 netlink attribute
913 */ 913 */
914static inline __le16 nla_get_le16(struct nlattr *nla) 914static inline __le16 nla_get_le16(const struct nlattr *nla)
915{ 915{
916 return *(__le16 *) nla_data(nla); 916 return *(__le16 *) nla_data(nla);
917} 917}
@@ -920,7 +920,7 @@ static inline __le16 nla_get_le16(struct nlattr *nla)
920 * nla_get_u8 - return payload of u8 attribute 920 * nla_get_u8 - return payload of u8 attribute
921 * @nla: u8 netlink attribute 921 * @nla: u8 netlink attribute
922 */ 922 */
923static inline u8 nla_get_u8(struct nlattr *nla) 923static inline u8 nla_get_u8(const struct nlattr *nla)
924{ 924{
925 return *(u8 *) nla_data(nla); 925 return *(u8 *) nla_data(nla);
926} 926}
@@ -929,7 +929,7 @@ static inline u8 nla_get_u8(struct nlattr *nla)
929 * nla_get_u64 - return payload of u64 attribute 929 * nla_get_u64 - return payload of u64 attribute
930 * @nla: u64 netlink attribute 930 * @nla: u64 netlink attribute
931 */ 931 */
932static inline u64 nla_get_u64(struct nlattr *nla) 932static inline u64 nla_get_u64(const struct nlattr *nla)
933{ 933{
934 u64 tmp; 934 u64 tmp;
935 935
@@ -942,7 +942,7 @@ static inline u64 nla_get_u64(struct nlattr *nla)
942 * nla_get_flag - return payload of flag attribute 942 * nla_get_flag - return payload of flag attribute
943 * @nla: flag netlink attribute 943 * @nla: flag netlink attribute
944 */ 944 */
945static inline int nla_get_flag(struct nlattr *nla) 945static inline int nla_get_flag(const struct nlattr *nla)
946{ 946{
947 return !!nla; 947 return !!nla;
948} 948}
@@ -953,7 +953,7 @@ static inline int nla_get_flag(struct nlattr *nla)
953 * 953 *
954 * Returns the number of milliseconds in jiffies. 954 * Returns the number of milliseconds in jiffies.
955 */ 955 */
956static inline unsigned long nla_get_msecs(struct nlattr *nla) 956static inline unsigned long nla_get_msecs(const struct nlattr *nla)
957{ 957{
958 u64 msecs = nla_get_u64(nla); 958 u64 msecs = nla_get_u64(nla);
959 959
diff --git a/include/net/netns/ipv4.h b/include/net/netns/ipv4.h
index ece1c926b5d1..977f482d97a9 100644
--- a/include/net/netns/ipv4.h
+++ b/include/net/netns/ipv4.h
@@ -49,6 +49,8 @@ struct netns_ipv4 {
49 int sysctl_icmp_ratelimit; 49 int sysctl_icmp_ratelimit;
50 int sysctl_icmp_ratemask; 50 int sysctl_icmp_ratemask;
51 int sysctl_icmp_errors_use_inbound_ifaddr; 51 int sysctl_icmp_errors_use_inbound_ifaddr;
52 int sysctl_rt_cache_rebuild_count;
53 int current_rt_cache_rebuild_count;
52 54
53 struct timer_list rt_secret_timer; 55 struct timer_list rt_secret_timer;
54 atomic_t rt_genid; 56 atomic_t rt_genid;
diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h
index 3fe49d808957..64ae1ba9f554 100644
--- a/include/net/sch_generic.h
+++ b/include/net/sch_generic.h
@@ -111,6 +111,7 @@ struct Qdisc_ops
111 111
112 int (*enqueue)(struct sk_buff *, struct Qdisc *); 112 int (*enqueue)(struct sk_buff *, struct Qdisc *);
113 struct sk_buff * (*dequeue)(struct Qdisc *); 113 struct sk_buff * (*dequeue)(struct Qdisc *);
114 struct sk_buff * (*peek)(struct Qdisc *);
114 int (*requeue)(struct sk_buff *, struct Qdisc *); 115 int (*requeue)(struct sk_buff *, struct Qdisc *);
115 unsigned int (*drop)(struct Qdisc *); 116 unsigned int (*drop)(struct Qdisc *);
116 117
@@ -432,6 +433,40 @@ static inline struct sk_buff *qdisc_dequeue_tail(struct Qdisc *sch)
432 return __qdisc_dequeue_tail(sch, &sch->q); 433 return __qdisc_dequeue_tail(sch, &sch->q);
433} 434}
434 435
436static inline struct sk_buff *qdisc_peek_head(struct Qdisc *sch)
437{
438 return skb_peek(&sch->q);
439}
440
441/* generic pseudo peek method for non-work-conserving qdisc */
442static inline struct sk_buff *qdisc_peek_dequeued(struct Qdisc *sch)
443{
444 /* we can reuse ->gso_skb because peek isn't called for root qdiscs */
445 if (!sch->gso_skb) {
446 sch->gso_skb = sch->dequeue(sch);
447 if (sch->gso_skb)
448 /* it's still part of the queue */
449 sch->q.qlen++;
450 }
451
452 return sch->gso_skb;
453}
454
455/* use instead of qdisc->dequeue() for all qdiscs queried with ->peek() */
456static inline struct sk_buff *qdisc_dequeue_peeked(struct Qdisc *sch)
457{
458 struct sk_buff *skb = sch->gso_skb;
459
460 if (skb) {
461 sch->gso_skb = NULL;
462 sch->q.qlen--;
463 } else {
464 skb = sch->dequeue(sch);
465 }
466
467 return skb;
468}
469
435static inline int __qdisc_requeue(struct sk_buff *skb, struct Qdisc *sch, 470static inline int __qdisc_requeue(struct sk_buff *skb, struct Qdisc *sch,
436 struct sk_buff_head *list) 471 struct sk_buff_head *list)
437{ 472{
diff --git a/include/net/sctp/sctp.h b/include/net/sctp/sctp.h
index ed71b110edf7..23797506f593 100644
--- a/include/net/sctp/sctp.h
+++ b/include/net/sctp/sctp.h
@@ -285,15 +285,15 @@ extern int sctp_debug_flag;
285 if (sctp_debug_flag) { \ 285 if (sctp_debug_flag) { \
286 if (saddr->sa.sa_family == AF_INET6) { \ 286 if (saddr->sa.sa_family == AF_INET6) { \
287 printk(KERN_DEBUG \ 287 printk(KERN_DEBUG \
288 lead NIP6_FMT trail, \ 288 lead "%pI6" trail, \
289 leadparm, \ 289 leadparm, \
290 NIP6(saddr->v6.sin6_addr), \ 290 &saddr->v6.sin6_addr, \
291 otherparms); \ 291 otherparms); \
292 } else { \ 292 } else { \
293 printk(KERN_DEBUG \ 293 printk(KERN_DEBUG \
294 lead NIPQUAD_FMT trail, \ 294 lead "%pI4" trail, \
295 leadparm, \ 295 leadparm, \
296 NIPQUAD(saddr->v4.sin_addr.s_addr), \ 296 &saddr->v4.sin_addr.s_addr, \
297 otherparms); \ 297 otherparms); \
298 } \ 298 } \
299 } 299 }
diff --git a/include/net/sock.h b/include/net/sock.h
index c04f9e18ea22..08291c1be41e 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -229,7 +229,9 @@ struct sock {
229 } sk_backlog; 229 } sk_backlog;
230 wait_queue_head_t *sk_sleep; 230 wait_queue_head_t *sk_sleep;
231 struct dst_entry *sk_dst_cache; 231 struct dst_entry *sk_dst_cache;
232#ifdef CONFIG_XFRM
232 struct xfrm_policy *sk_policy[2]; 233 struct xfrm_policy *sk_policy[2];
234#endif
233 rwlock_t sk_dst_lock; 235 rwlock_t sk_dst_lock;
234 atomic_t sk_rmem_alloc; 236 atomic_t sk_rmem_alloc;
235 atomic_t sk_wmem_alloc; 237 atomic_t sk_wmem_alloc;
@@ -269,7 +271,9 @@ struct sock {
269 struct sk_buff *sk_send_head; 271 struct sk_buff *sk_send_head;
270 __u32 sk_sndmsg_off; 272 __u32 sk_sndmsg_off;
271 int sk_write_pending; 273 int sk_write_pending;
274#ifdef CONFIG_SECURITY
272 void *sk_security; 275 void *sk_security;
276#endif
273 __u32 sk_mark; 277 __u32 sk_mark;
274 /* XXX 4 bytes hole on 64 bit */ 278 /* XXX 4 bytes hole on 64 bit */
275 void (*sk_state_change)(struct sock *sk); 279 void (*sk_state_change)(struct sock *sk);
@@ -361,6 +365,27 @@ static __inline__ int sk_del_node_init(struct sock *sk)
361 return rc; 365 return rc;
362} 366}
363 367
368static __inline__ int __sk_del_node_init_rcu(struct sock *sk)
369{
370 if (sk_hashed(sk)) {
371 hlist_del_init_rcu(&sk->sk_node);
372 return 1;
373 }
374 return 0;
375}
376
377static __inline__ int sk_del_node_init_rcu(struct sock *sk)
378{
379 int rc = __sk_del_node_init_rcu(sk);
380
381 if (rc) {
382 /* paranoid for a while -acme */
383 WARN_ON(atomic_read(&sk->sk_refcnt) == 1);
384 __sock_put(sk);
385 }
386 return rc;
387}
388
364static __inline__ void __sk_add_node(struct sock *sk, struct hlist_head *list) 389static __inline__ void __sk_add_node(struct sock *sk, struct hlist_head *list)
365{ 390{
366 hlist_add_head(&sk->sk_node, list); 391 hlist_add_head(&sk->sk_node, list);
@@ -372,6 +397,17 @@ static __inline__ void sk_add_node(struct sock *sk, struct hlist_head *list)
372 __sk_add_node(sk, list); 397 __sk_add_node(sk, list);
373} 398}
374 399
400static __inline__ void __sk_add_node_rcu(struct sock *sk, struct hlist_head *list)
401{
402 hlist_add_head_rcu(&sk->sk_node, list);
403}
404
405static __inline__ void sk_add_node_rcu(struct sock *sk, struct hlist_head *list)
406{
407 sock_hold(sk);
408 __sk_add_node_rcu(sk, list);
409}
410
375static __inline__ void __sk_del_bind_node(struct sock *sk) 411static __inline__ void __sk_del_bind_node(struct sock *sk)
376{ 412{
377 __hlist_del(&sk->sk_bind_node); 413 __hlist_del(&sk->sk_bind_node);
@@ -385,6 +421,8 @@ static __inline__ void sk_add_bind_node(struct sock *sk,
385 421
386#define sk_for_each(__sk, node, list) \ 422#define sk_for_each(__sk, node, list) \
387 hlist_for_each_entry(__sk, node, list, sk_node) 423 hlist_for_each_entry(__sk, node, list, sk_node)
424#define sk_for_each_rcu_safenext(__sk, node, list, next) \
425 hlist_for_each_entry_rcu_safenext(__sk, node, list, sk_node, next)
388#define sk_for_each_from(__sk, node) \ 426#define sk_for_each_from(__sk, node) \
389 if (__sk && ({ node = &(__sk)->sk_node; 1; })) \ 427 if (__sk && ({ node = &(__sk)->sk_node; 1; })) \
390 hlist_for_each_entry_from(__sk, node, sk_node) 428 hlist_for_each_entry_from(__sk, node, sk_node)
@@ -587,8 +625,9 @@ struct proto {
587 int *sysctl_rmem; 625 int *sysctl_rmem;
588 int max_header; 626 int max_header;
589 627
590 struct kmem_cache *slab; 628 struct kmem_cache *slab;
591 unsigned int obj_size; 629 unsigned int obj_size;
630 int slab_flags;
592 631
593 atomic_t *orphan_count; 632 atomic_t *orphan_count;
594 633
@@ -597,7 +636,7 @@ struct proto {
597 636
598 union { 637 union {
599 struct inet_hashinfo *hashinfo; 638 struct inet_hashinfo *hashinfo;
600 struct hlist_head *udp_hash; 639 struct udp_table *udp_table;
601 struct raw_hashinfo *raw_hash; 640 struct raw_hashinfo *raw_hash;
602 } h; 641 } h;
603 642
diff --git a/include/net/udp.h b/include/net/udp.h
index 1e205095ea68..df2bfe545374 100644
--- a/include/net/udp.h
+++ b/include/net/udp.h
@@ -50,8 +50,15 @@ struct udp_skb_cb {
50}; 50};
51#define UDP_SKB_CB(__skb) ((struct udp_skb_cb *)((__skb)->cb)) 51#define UDP_SKB_CB(__skb) ((struct udp_skb_cb *)((__skb)->cb))
52 52
53extern struct hlist_head udp_hash[UDP_HTABLE_SIZE]; 53struct udp_hslot {
54extern rwlock_t udp_hash_lock; 54 struct hlist_head head;
55 spinlock_t lock;
56} __attribute__((aligned(2 * sizeof(long))));
57struct udp_table {
58 struct udp_hslot hash[UDP_HTABLE_SIZE];
59};
60extern struct udp_table udp_table;
61extern void udp_table_init(struct udp_table *);
55 62
56 63
57/* Note: this must match 'valbool' in sock_setsockopt */ 64/* Note: this must match 'valbool' in sock_setsockopt */
@@ -110,15 +117,7 @@ static inline void udp_lib_hash(struct sock *sk)
110 BUG(); 117 BUG();
111} 118}
112 119
113static inline void udp_lib_unhash(struct sock *sk) 120extern void udp_lib_unhash(struct sock *sk);
114{
115 write_lock_bh(&udp_hash_lock);
116 if (sk_del_node_init(sk)) {
117 inet_sk(sk)->num = 0;
118 sock_prot_inuse_add(sock_net(sk), sk->sk_prot, -1);
119 }
120 write_unlock_bh(&udp_hash_lock);
121}
122 121
123static inline void udp_lib_close(struct sock *sk, long timeout) 122static inline void udp_lib_close(struct sock *sk, long timeout)
124{ 123{
@@ -187,7 +186,7 @@ extern struct sock *udp4_lib_lookup(struct net *net, __be32 saddr, __be16 sport,
187struct udp_seq_afinfo { 186struct udp_seq_afinfo {
188 char *name; 187 char *name;
189 sa_family_t family; 188 sa_family_t family;
190 struct hlist_head *hashtable; 189 struct udp_table *udp_table;
191 struct file_operations seq_fops; 190 struct file_operations seq_fops;
192 struct seq_operations seq_ops; 191 struct seq_operations seq_ops;
193}; 192};
@@ -196,7 +195,7 @@ struct udp_iter_state {
196 struct seq_net_private p; 195 struct seq_net_private p;
197 sa_family_t family; 196 sa_family_t family;
198 int bucket; 197 int bucket;
199 struct hlist_head *hashtable; 198 struct udp_table *udp_table;
200}; 199};
201 200
202#ifdef CONFIG_PROC_FS 201#ifdef CONFIG_PROC_FS
diff --git a/include/net/udplite.h b/include/net/udplite.h
index b76b2e377af4..afdffe607b24 100644
--- a/include/net/udplite.h
+++ b/include/net/udplite.h
@@ -11,7 +11,7 @@
11#define UDPLITE_RECV_CSCOV 11 /* receiver partial coverage (threshold ) */ 11#define UDPLITE_RECV_CSCOV 11 /* receiver partial coverage (threshold ) */
12 12
13extern struct proto udplite_prot; 13extern struct proto udplite_prot;
14extern struct hlist_head udplite_hash[UDP_HTABLE_SIZE]; 14extern struct udp_table udplite_table;
15 15
16/* 16/*
17 * Checksum computation is all in software, hence simpler getfrag. 17 * Checksum computation is all in software, hence simpler getfrag.
diff --git a/include/net/wireless.h b/include/net/wireless.h
index 721efb363db7..41294c5f6f8f 100644
--- a/include/net/wireless.h
+++ b/include/net/wireless.h
@@ -10,6 +10,7 @@
10#include <linux/netdevice.h> 10#include <linux/netdevice.h>
11#include <linux/debugfs.h> 11#include <linux/debugfs.h>
12#include <linux/list.h> 12#include <linux/list.h>
13#include <linux/ieee80211.h>
13#include <net/cfg80211.h> 14#include <net/cfg80211.h>
14 15
15/** 16/**
@@ -133,23 +134,23 @@ struct ieee80211_rate {
133}; 134};
134 135
135/** 136/**
136 * struct ieee80211_ht_info - describing STA's HT capabilities 137 * struct ieee80211_sta_ht_cap - STA's HT capabilities
137 * 138 *
138 * This structure describes most essential parameters needed 139 * This structure describes most essential parameters needed
139 * to describe 802.11n HT capabilities for an STA. 140 * to describe 802.11n HT capabilities for an STA.
140 * 141 *
141 * @ht_supported: is HT supported by STA, 0: no, 1: yes 142 * @ht_supported: is HT supported by the STA
142 * @cap: HT capabilities map as described in 802.11n spec 143 * @cap: HT capabilities map as described in 802.11n spec
143 * @ampdu_factor: Maximum A-MPDU length factor 144 * @ampdu_factor: Maximum A-MPDU length factor
144 * @ampdu_density: Minimum A-MPDU spacing 145 * @ampdu_density: Minimum A-MPDU spacing
145 * @supp_mcs_set: Supported MCS set as described in 802.11n spec 146 * @mcs: Supported MCS rates
146 */ 147 */
147struct ieee80211_ht_info { 148struct ieee80211_sta_ht_cap {
148 u16 cap; /* use IEEE80211_HT_CAP_ */ 149 u16 cap; /* use IEEE80211_HT_CAP_ */
149 u8 ht_supported; 150 bool ht_supported;
150 u8 ampdu_factor; 151 u8 ampdu_factor;
151 u8 ampdu_density; 152 u8 ampdu_density;
152 u8 supp_mcs_set[16]; 153 struct ieee80211_mcs_info mcs;
153}; 154};
154 155
155/** 156/**
@@ -173,7 +174,7 @@ struct ieee80211_supported_band {
173 enum ieee80211_band band; 174 enum ieee80211_band band;
174 int n_channels; 175 int n_channels;
175 int n_bitrates; 176 int n_bitrates;
176 struct ieee80211_ht_info ht_info; 177 struct ieee80211_sta_ht_cap ht_cap;
177}; 178};
178 179
179/** 180/**
@@ -340,55 +341,20 @@ ieee80211_get_channel(struct wiphy *wiphy, int freq)
340} 341}
341 342
342/** 343/**
343 * __regulatory_hint - hint to the wireless core a regulatory domain
344 * @wiphy: if a driver is providing the hint this is the driver's very
345 * own &struct wiphy
346 * @alpha2: the ISO/IEC 3166 alpha2 being claimed the regulatory domain
347 * should be in. If @rd is set this should be NULL
348 * @rd: a complete regulatory domain, if passed the caller need not worry
349 * about freeing it
350 *
351 * The Wireless subsystem can use this function to hint to the wireless core
352 * what it believes should be the current regulatory domain by
353 * giving it an ISO/IEC 3166 alpha2 country code it knows its regulatory
354 * domain should be in or by providing a completely build regulatory domain.
355 *
356 * Returns -EALREADY if *a regulatory domain* has already been set. Note that
357 * this could be by another driver. It is safe for drivers to continue if
358 * -EALREADY is returned, if drivers are not capable of world roaming they
359 * should not register more channels than they support. Right now we only
360 * support listening to the first driver hint. If the driver is capable
361 * of world roaming but wants to respect its own EEPROM mappings for
362 * specific regulatory domains it should register the @reg_notifier callback
363 * on the &struct wiphy. Returns 0 if the hint went through fine or through an
364 * intersection operation. Otherwise a standard error code is returned.
365 *
366 */
367extern int __regulatory_hint(struct wiphy *wiphy, enum reg_set_by set_by,
368 const char *alpha2, struct ieee80211_regdomain *rd);
369/**
370 * regulatory_hint - driver hint to the wireless core a regulatory domain 344 * regulatory_hint - driver hint to the wireless core a regulatory domain
371 * @wiphy: the driver's very own &struct wiphy 345 * @wiphy: the wireless device giving the hint (used only for reporting
346 * conflicts)
372 * @alpha2: the ISO/IEC 3166 alpha2 the driver claims its regulatory domain 347 * @alpha2: the ISO/IEC 3166 alpha2 the driver claims its regulatory domain
373 * should be in. If @rd is set this should be NULL. Note that if you 348 * should be in. If @rd is set this should be NULL. Note that if you
374 * set this to NULL you should still set rd->alpha2 to some accepted 349 * set this to NULL you should still set rd->alpha2 to some accepted
375 * alpha2. 350 * alpha2.
376 * @rd: a complete regulatory domain provided by the driver. If passed
377 * the driver does not need to worry about freeing it.
378 * 351 *
379 * Wireless drivers can use this function to hint to the wireless core 352 * Wireless drivers can use this function to hint to the wireless core
380 * what it believes should be the current regulatory domain by 353 * what it believes should be the current regulatory domain by
381 * giving it an ISO/IEC 3166 alpha2 country code it knows its regulatory 354 * giving it an ISO/IEC 3166 alpha2 country code it knows its regulatory
382 * domain should be in or by providing a completely build regulatory domain. 355 * domain should be in or by providing a completely build regulatory domain.
383 * If the driver provides an ISO/IEC 3166 alpha2 userspace will be queried 356 * If the driver provides an ISO/IEC 3166 alpha2 userspace will be queried
384 * for a regulatory domain structure for the respective country. If 357 * for a regulatory domain structure for the respective country.
385 * a regulatory domain is build and passed you should set the alpha2
386 * if possible, otherwise set it to the special value of "99" which tells
387 * the wireless core it is unknown. If you pass a built regulatory domain
388 * and we return non zero you are in charge of kfree()'ing the structure.
389 *
390 * See __regulatory_hint() documentation for possible return values.
391 */ 358 */
392extern int regulatory_hint(struct wiphy *wiphy, 359extern void regulatory_hint(struct wiphy *wiphy, const char *alpha2);
393 const char *alpha2, struct ieee80211_regdomain *rd);
394#endif /* __NET_WIRELESS_H */ 360#endif /* __NET_WIRELESS_H */
diff --git a/include/net/xfrm.h b/include/net/xfrm.h
index 11c890ad8ebb..45e11b3631e4 100644
--- a/include/net/xfrm.h
+++ b/include/net/xfrm.h
@@ -467,7 +467,6 @@ struct xfrm_policy_walk {
467 467
468struct xfrm_policy 468struct xfrm_policy
469{ 469{
470 struct xfrm_policy *next;
471 struct hlist_node bydst; 470 struct hlist_node bydst;
472 struct hlist_node byidx; 471 struct hlist_node byidx;
473 472
@@ -882,6 +881,7 @@ struct xfrm_dst
882 u32 path_cookie; 881 u32 path_cookie;
883}; 882};
884 883
884#ifdef CONFIG_XFRM
885static inline void xfrm_dst_destroy(struct xfrm_dst *xdst) 885static inline void xfrm_dst_destroy(struct xfrm_dst *xdst)
886{ 886{
887 dst_release(xdst->route); 887 dst_release(xdst->route);
@@ -894,6 +894,7 @@ static inline void xfrm_dst_destroy(struct xfrm_dst *xdst)
894 xdst->partner = NULL; 894 xdst->partner = NULL;
895#endif 895#endif
896} 896}
897#endif
897 898
898extern void xfrm_dst_ifdown(struct dst_entry *dst, struct net_device *dev); 899extern void xfrm_dst_ifdown(struct dst_entry *dst, struct net_device *dev);
899 900
@@ -1536,9 +1537,11 @@ static inline void xfrm_states_delete(struct xfrm_state **states, int n)
1536} 1537}
1537#endif 1538#endif
1538 1539
1540#ifdef CONFIG_XFRM
1539static inline struct xfrm_state *xfrm_input_state(struct sk_buff *skb) 1541static inline struct xfrm_state *xfrm_input_state(struct sk_buff *skb)
1540{ 1542{
1541 return skb->sp->xvec[skb->sp->len - 1]; 1543 return skb->sp->xvec[skb->sp->len - 1];
1542} 1544}
1545#endif
1543 1546
1544#endif /* _NET_XFRM_H */ 1547#endif /* _NET_XFRM_H */