diff options
Diffstat (limited to 'include')
30 files changed, 898 insertions, 492 deletions
diff --git a/include/linux/cgroup_subsys.h b/include/linux/cgroup_subsys.h index 9c22396e8b50..9c8d31bacf46 100644 --- a/include/linux/cgroup_subsys.h +++ b/include/linux/cgroup_subsys.h | |||
@@ -54,3 +54,9 @@ SUBSYS(freezer) | |||
54 | #endif | 54 | #endif |
55 | 55 | ||
56 | /* */ | 56 | /* */ |
57 | |||
58 | #ifdef CONFIG_NET_CLS_CGROUP | ||
59 | SUBSYS(net_cls) | ||
60 | #endif | ||
61 | |||
62 | /* */ | ||
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) */ |
179 | enum { | 179 | enum 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..56b0eb25d927 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> |
@@ -97,7 +97,10 @@ | |||
97 | #define IEEE80211_MAX_FRAME_LEN 2352 | 97 | #define IEEE80211_MAX_FRAME_LEN 2352 |
98 | 98 | ||
99 | #define IEEE80211_MAX_SSID_LEN 32 | 99 | #define IEEE80211_MAX_SSID_LEN 32 |
100 | |||
100 | #define IEEE80211_MAX_MESH_ID_LEN 32 | 101 | #define IEEE80211_MAX_MESH_ID_LEN 32 |
102 | #define IEEE80211_MESH_CONFIG_LEN 19 | ||
103 | |||
101 | #define IEEE80211_QOS_CTL_LEN 2 | 104 | #define IEEE80211_QOS_CTL_LEN 2 |
102 | #define IEEE80211_QOS_CTL_TID_MASK 0x000F | 105 | #define IEEE80211_QOS_CTL_TID_MASK 0x000F |
103 | #define IEEE80211_QOS_CTL_TAG1D_MASK 0x0007 | 106 | #define IEEE80211_QOS_CTL_TAG1D_MASK 0x0007 |
@@ -666,6 +669,13 @@ struct ieee80211_cts { | |||
666 | u8 ra[6]; | 669 | u8 ra[6]; |
667 | } __attribute__ ((packed)); | 670 | } __attribute__ ((packed)); |
668 | 671 | ||
672 | struct ieee80211_pspoll { | ||
673 | __le16 frame_control; | ||
674 | __le16 aid; | ||
675 | u8 bssid[6]; | ||
676 | u8 ta[6]; | ||
677 | } __attribute__ ((packed)); | ||
678 | |||
669 | /** | 679 | /** |
670 | * struct ieee80211_bar - HT Block Ack Request | 680 | * struct ieee80211_bar - HT Block Ack Request |
671 | * | 681 | * |
@@ -685,28 +695,88 @@ struct ieee80211_bar { | |||
685 | #define IEEE80211_BAR_CTRL_ACK_POLICY_NORMAL 0x0000 | 695 | #define IEEE80211_BAR_CTRL_ACK_POLICY_NORMAL 0x0000 |
686 | #define IEEE80211_BAR_CTRL_CBMTID_COMPRESSED_BA 0x0004 | 696 | #define IEEE80211_BAR_CTRL_CBMTID_COMPRESSED_BA 0x0004 |
687 | 697 | ||
698 | |||
699 | #define IEEE80211_HT_MCS_MASK_LEN 10 | ||
700 | |||
701 | /** | ||
702 | * struct ieee80211_mcs_info - MCS information | ||
703 | * @rx_mask: RX mask | ||
704 | * @rx_highest: highest supported RX rate | ||
705 | * @tx_params: TX parameters | ||
706 | */ | ||
707 | struct ieee80211_mcs_info { | ||
708 | u8 rx_mask[IEEE80211_HT_MCS_MASK_LEN]; | ||
709 | __le16 rx_highest; | ||
710 | u8 tx_params; | ||
711 | u8 reserved[3]; | ||
712 | } __attribute__((packed)); | ||
713 | |||
714 | /* 802.11n HT capability MSC set */ | ||
715 | #define IEEE80211_HT_MCS_RX_HIGHEST_MASK 0x3ff | ||
716 | #define IEEE80211_HT_MCS_TX_DEFINED 0x01 | ||
717 | #define IEEE80211_HT_MCS_TX_RX_DIFF 0x02 | ||
718 | /* value 0 == 1 stream etc */ | ||
719 | #define IEEE80211_HT_MCS_TX_MAX_STREAMS_MASK 0x0C | ||
720 | #define IEEE80211_HT_MCS_TX_MAX_STREAMS_SHIFT 2 | ||
721 | #define IEEE80211_HT_MCS_TX_MAX_STREAMS 4 | ||
722 | #define IEEE80211_HT_MCS_TX_UNEQUAL_MODULATION 0x10 | ||
723 | |||
724 | /* | ||
725 | * 802.11n D5.0 20.3.5 / 20.6 says: | ||
726 | * - indices 0 to 7 and 32 are single spatial stream | ||
727 | * - 8 to 31 are multiple spatial streams using equal modulation | ||
728 | * [8..15 for two streams, 16..23 for three and 24..31 for four] | ||
729 | * - remainder are multiple spatial streams using unequal modulation | ||
730 | */ | ||
731 | #define IEEE80211_HT_MCS_UNEQUAL_MODULATION_START 33 | ||
732 | #define IEEE80211_HT_MCS_UNEQUAL_MODULATION_START_BYTE \ | ||
733 | (IEEE80211_HT_MCS_UNEQUAL_MODULATION_START / 8) | ||
734 | |||
688 | /** | 735 | /** |
689 | * struct ieee80211_ht_cap - HT capabilities | 736 | * struct ieee80211_ht_cap - HT capabilities |
690 | * | 737 | * |
691 | * This structure refers to "HT capabilities element" as | 738 | * This structure is the "HT capabilities element" as |
692 | * described in 802.11n draft section 7.3.2.52 | 739 | * described in 802.11n D5.0 7.3.2.57 |
693 | */ | 740 | */ |
694 | struct ieee80211_ht_cap { | 741 | struct ieee80211_ht_cap { |
695 | __le16 cap_info; | 742 | __le16 cap_info; |
696 | u8 ampdu_params_info; | 743 | u8 ampdu_params_info; |
697 | u8 supp_mcs_set[16]; | 744 | |
745 | /* 16 bytes MCS information */ | ||
746 | struct ieee80211_mcs_info mcs; | ||
747 | |||
698 | __le16 extended_ht_cap_info; | 748 | __le16 extended_ht_cap_info; |
699 | __le32 tx_BF_cap_info; | 749 | __le32 tx_BF_cap_info; |
700 | u8 antenna_selection_info; | 750 | u8 antenna_selection_info; |
701 | } __attribute__ ((packed)); | 751 | } __attribute__ ((packed)); |
702 | 752 | ||
753 | /* 802.11n HT capabilities masks (for cap_info) */ | ||
754 | #define IEEE80211_HT_CAP_LDPC_CODING 0x0001 | ||
755 | #define IEEE80211_HT_CAP_SUP_WIDTH_20_40 0x0002 | ||
756 | #define IEEE80211_HT_CAP_SM_PS 0x000C | ||
757 | #define IEEE80211_HT_CAP_GRN_FLD 0x0010 | ||
758 | #define IEEE80211_HT_CAP_SGI_20 0x0020 | ||
759 | #define IEEE80211_HT_CAP_SGI_40 0x0040 | ||
760 | #define IEEE80211_HT_CAP_TX_STBC 0x0080 | ||
761 | #define IEEE80211_HT_CAP_RX_STBC 0x0300 | ||
762 | #define IEEE80211_HT_CAP_DELAY_BA 0x0400 | ||
763 | #define IEEE80211_HT_CAP_MAX_AMSDU 0x0800 | ||
764 | #define IEEE80211_HT_CAP_DSSSCCK40 0x1000 | ||
765 | #define IEEE80211_HT_CAP_PSMP_SUPPORT 0x2000 | ||
766 | #define IEEE80211_HT_CAP_40MHZ_INTOLERANT 0x4000 | ||
767 | #define IEEE80211_HT_CAP_LSIG_TXOP_PROT 0x8000 | ||
768 | |||
769 | /* 802.11n HT capability AMPDU settings (for ampdu_params_info) */ | ||
770 | #define IEEE80211_HT_AMPDU_PARM_FACTOR 0x03 | ||
771 | #define IEEE80211_HT_AMPDU_PARM_DENSITY 0x1C | ||
772 | |||
703 | /** | 773 | /** |
704 | * struct ieee80211_ht_cap - HT additional information | 774 | * struct ieee80211_ht_info - HT information |
705 | * | 775 | * |
706 | * This structure refers to "HT information element" as | 776 | * This structure is the "HT information element" as |
707 | * described in 802.11n draft section 7.3.2.53 | 777 | * described in 802.11n D5.0 7.3.2.58 |
708 | */ | 778 | */ |
709 | struct ieee80211_ht_addt_info { | 779 | struct ieee80211_ht_info { |
710 | u8 control_chan; | 780 | u8 control_chan; |
711 | u8 ht_param; | 781 | u8 ht_param; |
712 | __le16 operation_mode; | 782 | __le16 operation_mode; |
@@ -714,36 +784,33 @@ struct ieee80211_ht_addt_info { | |||
714 | u8 basic_set[16]; | 784 | u8 basic_set[16]; |
715 | } __attribute__ ((packed)); | 785 | } __attribute__ ((packed)); |
716 | 786 | ||
717 | /* 802.11n HT capabilities masks */ | 787 | /* for ht_param */ |
718 | #define IEEE80211_HT_CAP_SUP_WIDTH 0x0002 | 788 | #define IEEE80211_HT_PARAM_CHA_SEC_OFFSET 0x03 |
719 | #define IEEE80211_HT_CAP_SM_PS 0x000C | 789 | #define IEEE80211_HT_PARAM_CHA_SEC_NONE 0x00 |
720 | #define IEEE80211_HT_CAP_GRN_FLD 0x0010 | 790 | #define IEEE80211_HT_PARAM_CHA_SEC_ABOVE 0x01 |
721 | #define IEEE80211_HT_CAP_SGI_20 0x0020 | 791 | #define IEEE80211_HT_PARAM_CHA_SEC_BELOW 0x03 |
722 | #define IEEE80211_HT_CAP_SGI_40 0x0040 | 792 | #define IEEE80211_HT_PARAM_CHAN_WIDTH_ANY 0x04 |
723 | #define IEEE80211_HT_CAP_DELAY_BA 0x0400 | 793 | #define IEEE80211_HT_PARAM_RIFS_MODE 0x08 |
724 | #define IEEE80211_HT_CAP_MAX_AMSDU 0x0800 | 794 | #define IEEE80211_HT_PARAM_SPSMP_SUPPORT 0x10 |
725 | #define IEEE80211_HT_CAP_DSSSCCK40 0x1000 | 795 | #define IEEE80211_HT_PARAM_SERV_INTERVAL_GRAN 0xE0 |
726 | /* 802.11n HT capability AMPDU settings */ | 796 | |
727 | #define IEEE80211_HT_CAP_AMPDU_FACTOR 0x03 | 797 | /* for operation_mode */ |
728 | #define IEEE80211_HT_CAP_AMPDU_DENSITY 0x1C | 798 | #define IEEE80211_HT_OP_MODE_PROTECTION 0x0003 |
729 | /* 802.11n HT capability MSC set */ | 799 | #define IEEE80211_HT_OP_MODE_PROTECTION_NONE 0 |
730 | #define IEEE80211_SUPP_MCS_SET_UEQM 4 | 800 | #define IEEE80211_HT_OP_MODE_PROTECTION_NONMEMBER 1 |
731 | #define IEEE80211_HT_CAP_MAX_STREAMS 4 | 801 | #define IEEE80211_HT_OP_MODE_PROTECTION_20MHZ 2 |
732 | #define IEEE80211_SUPP_MCS_SET_LEN 10 | 802 | #define IEEE80211_HT_OP_MODE_PROTECTION_NONHT_MIXED 3 |
733 | /* maximum streams the spec allows */ | 803 | #define IEEE80211_HT_OP_MODE_NON_GF_STA_PRSNT 0x0004 |
734 | #define IEEE80211_HT_CAP_MCS_TX_DEFINED 0x01 | 804 | #define IEEE80211_HT_OP_MODE_NON_HT_STA_PRSNT 0x0010 |
735 | #define IEEE80211_HT_CAP_MCS_TX_RX_DIFF 0x02 | 805 | |
736 | #define IEEE80211_HT_CAP_MCS_TX_STREAMS 0x0C | 806 | /* for stbc_param */ |
737 | #define IEEE80211_HT_CAP_MCS_TX_UEQM 0x10 | 807 | #define IEEE80211_HT_STBC_PARAM_DUAL_BEACON 0x0040 |
738 | /* 802.11n HT IE masks */ | 808 | #define IEEE80211_HT_STBC_PARAM_DUAL_CTS_PROT 0x0080 |
739 | #define IEEE80211_HT_IE_CHA_SEC_OFFSET 0x03 | 809 | #define IEEE80211_HT_STBC_PARAM_STBC_BEACON 0x0100 |
740 | #define IEEE80211_HT_IE_CHA_SEC_NONE 0x00 | 810 | #define IEEE80211_HT_STBC_PARAM_LSIG_TXOP_FULLPROT 0x0200 |
741 | #define IEEE80211_HT_IE_CHA_SEC_ABOVE 0x01 | 811 | #define IEEE80211_HT_STBC_PARAM_PCO_ACTIVE 0x0400 |
742 | #define IEEE80211_HT_IE_CHA_SEC_BELOW 0x03 | 812 | #define IEEE80211_HT_STBC_PARAM_PCO_PHASE 0x0800 |
743 | #define IEEE80211_HT_IE_CHA_WIDTH 0x04 | 813 | |
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 | 814 | ||
748 | /* block-ack parameters */ | 815 | /* block-ack parameters */ |
749 | #define IEEE80211_ADDBA_PARAM_POLICY_MASK 0x0002 | 816 | #define IEEE80211_ADDBA_PARAM_POLICY_MASK 0x0002 |
@@ -769,8 +836,7 @@ struct ieee80211_ht_addt_info { | |||
769 | /* Authentication algorithms */ | 836 | /* Authentication algorithms */ |
770 | #define WLAN_AUTH_OPEN 0 | 837 | #define WLAN_AUTH_OPEN 0 |
771 | #define WLAN_AUTH_SHARED_KEY 1 | 838 | #define WLAN_AUTH_SHARED_KEY 1 |
772 | #define WLAN_AUTH_FAST_BSS_TRANSITION 2 | 839 | #define WLAN_AUTH_LEAP 2 |
773 | #define WLAN_AUTH_LEAP 128 | ||
774 | 840 | ||
775 | #define WLAN_AUTH_CHALLENGE_LEN 128 | 841 | #define WLAN_AUTH_CHALLENGE_LEN 128 |
776 | 842 | ||
@@ -949,7 +1015,7 @@ enum ieee80211_eid { | |||
949 | WLAN_EID_EXT_SUPP_RATES = 50, | 1015 | WLAN_EID_EXT_SUPP_RATES = 50, |
950 | /* 802.11n */ | 1016 | /* 802.11n */ |
951 | WLAN_EID_HT_CAPABILITY = 45, | 1017 | WLAN_EID_HT_CAPABILITY = 45, |
952 | WLAN_EID_HT_EXTRA_INFO = 61, | 1018 | WLAN_EID_HT_INFORMATION = 61, |
953 | /* 802.11i */ | 1019 | /* 802.11i */ |
954 | WLAN_EID_RSN = 48, | 1020 | WLAN_EID_RSN = 48, |
955 | WLAN_EID_WPA = 221, | 1021 | WLAN_EID_WPA = 221, |
@@ -1057,4 +1123,4 @@ static inline u8 *ieee80211_get_DA(struct ieee80211_hdr *hdr) | |||
1057 | return hdr->addr1; | 1123 | return hdr->addr1; |
1058 | } | 1124 | } |
1059 | 1125 | ||
1060 | #endif /* IEEE80211_H */ | 1126 | #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 | ||
1769 | extern 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..79827345351d 100644 --- a/include/linux/nl80211.h +++ b/include/linux/nl80211.h | |||
@@ -25,8 +25,9 @@ | |||
25 | * | 25 | * |
26 | * @NL80211_CMD_GET_WIPHY: request information about a wiphy or dump request | 26 | * @NL80211_CMD_GET_WIPHY: request information about a wiphy or dump request |
27 | * to get a list of all present wiphys. | 27 | * to get a list of all present wiphys. |
28 | * @NL80211_CMD_SET_WIPHY: set wiphy name, needs %NL80211_ATTR_WIPHY and | 28 | * @NL80211_CMD_SET_WIPHY: set wiphy parameters, needs %NL80211_ATTR_WIPHY or |
29 | * %NL80211_ATTR_WIPHY_NAME. | 29 | * %NL80211_ATTR_IFINDEX; can be used to set %NL80211_ATTR_WIPHY_NAME |
30 | * and/or %NL80211_ATTR_WIPHY_TXQ_PARAMS. | ||
30 | * @NL80211_CMD_NEW_WIPHY: Newly created wiphy, response to get request | 31 | * @NL80211_CMD_NEW_WIPHY: Newly created wiphy, response to get request |
31 | * or rename notification. Has attributes %NL80211_ATTR_WIPHY and | 32 | * or rename notification. Has attributes %NL80211_ATTR_WIPHY and |
32 | * %NL80211_ATTR_WIPHY_NAME. | 33 | * %NL80211_ATTR_WIPHY_NAME. |
@@ -106,6 +107,12 @@ | |||
106 | * to the the specified ISO/IEC 3166-1 alpha2 country code. The core will | 107 | * 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. | 108 | * store this as a valid request and then query userspace for it. |
108 | * | 109 | * |
110 | * @NL80211_CMD_GET_MESH_PARAMS: Get mesh networking properties for the | ||
111 | * interface identified by %NL80211_ATTR_IFINDEX | ||
112 | * | ||
113 | * @NL80211_CMD_SET_MESH_PARAMS: Set mesh networking properties for the | ||
114 | * interface identified by %NL80211_ATTR_IFINDEX | ||
115 | * | ||
109 | * @NL80211_CMD_MAX: highest used command number | 116 | * @NL80211_CMD_MAX: highest used command number |
110 | * @__NL80211_CMD_AFTER_LAST: internal use | 117 | * @__NL80211_CMD_AFTER_LAST: internal use |
111 | */ | 118 | */ |
@@ -148,6 +155,9 @@ enum nl80211_commands { | |||
148 | NL80211_CMD_SET_REG, | 155 | NL80211_CMD_SET_REG, |
149 | NL80211_CMD_REQ_SET_REG, | 156 | NL80211_CMD_REQ_SET_REG, |
150 | 157 | ||
158 | NL80211_CMD_GET_MESH_PARAMS, | ||
159 | NL80211_CMD_SET_MESH_PARAMS, | ||
160 | |||
151 | /* add new commands above here */ | 161 | /* add new commands above here */ |
152 | 162 | ||
153 | /* used to define NL80211_CMD_MAX below */ | 163 | /* used to define NL80211_CMD_MAX below */ |
@@ -169,6 +179,7 @@ enum nl80211_commands { | |||
169 | * @NL80211_ATTR_WIPHY: index of wiphy to operate on, cf. | 179 | * @NL80211_ATTR_WIPHY: index of wiphy to operate on, cf. |
170 | * /sys/class/ieee80211/<phyname>/index | 180 | * /sys/class/ieee80211/<phyname>/index |
171 | * @NL80211_ATTR_WIPHY_NAME: wiphy name (used for renaming) | 181 | * @NL80211_ATTR_WIPHY_NAME: wiphy name (used for renaming) |
182 | * @NL80211_ATTR_WIPHY_TXQ_PARAMS: a nested array of TX queue parameters | ||
172 | * | 183 | * |
173 | * @NL80211_ATTR_IFINDEX: network interface index of the device to operate on | 184 | * @NL80211_ATTR_IFINDEX: network interface index of the device to operate on |
174 | * @NL80211_ATTR_IFNAME: network interface name | 185 | * @NL80211_ATTR_IFNAME: network interface name |
@@ -234,6 +245,9 @@ enum nl80211_commands { | |||
234 | * (u8, 0 or 1) | 245 | * (u8, 0 or 1) |
235 | * @NL80211_ATTR_BSS_SHORT_SLOT_TIME: whether short slot time enabled | 246 | * @NL80211_ATTR_BSS_SHORT_SLOT_TIME: whether short slot time enabled |
236 | * (u8, 0 or 1) | 247 | * (u8, 0 or 1) |
248 | * @NL80211_ATTR_BSS_BASIC_RATES: basic rates, array of basic | ||
249 | * rates in format defined by IEEE 802.11 7.3.2.2 but without the length | ||
250 | * restriction (at most %NL80211_MAX_SUPP_RATES). | ||
237 | * | 251 | * |
238 | * @NL80211_ATTR_HT_CAPABILITY: HT Capability information element (from | 252 | * @NL80211_ATTR_HT_CAPABILITY: HT Capability information element (from |
239 | * association request when used with NL80211_CMD_NEW_STATION) | 253 | * association request when used with NL80211_CMD_NEW_STATION) |
@@ -296,6 +310,12 @@ enum nl80211_attrs { | |||
296 | NL80211_ATTR_REG_ALPHA2, | 310 | NL80211_ATTR_REG_ALPHA2, |
297 | NL80211_ATTR_REG_RULES, | 311 | NL80211_ATTR_REG_RULES, |
298 | 312 | ||
313 | NL80211_ATTR_MESH_PARAMS, | ||
314 | |||
315 | NL80211_ATTR_BSS_BASIC_RATES, | ||
316 | |||
317 | NL80211_ATTR_WIPHY_TXQ_PARAMS, | ||
318 | |||
299 | /* add attributes here, update the policy in nl80211.c */ | 319 | /* add attributes here, update the policy in nl80211.c */ |
300 | 320 | ||
301 | __NL80211_ATTR_AFTER_LAST, | 321 | __NL80211_ATTR_AFTER_LAST, |
@@ -307,6 +327,8 @@ enum nl80211_attrs { | |||
307 | * here | 327 | * here |
308 | */ | 328 | */ |
309 | #define NL80211_ATTR_HT_CAPABILITY NL80211_ATTR_HT_CAPABILITY | 329 | #define NL80211_ATTR_HT_CAPABILITY NL80211_ATTR_HT_CAPABILITY |
330 | #define NL80211_ATTR_BSS_BASIC_RATES NL80211_ATTR_BSS_BASIC_RATES | ||
331 | #define NL80211_ATTR_WIPHY_TXQ_PARAMS NL80211_ATTR_WIPHY_TXQ_PARAMS | ||
310 | 332 | ||
311 | #define NL80211_MAX_SUPP_RATES 32 | 333 | #define NL80211_MAX_SUPP_RATES 32 |
312 | #define NL80211_MAX_SUPP_REG_RULES 32 | 334 | #define NL80211_MAX_SUPP_REG_RULES 32 |
@@ -452,17 +474,29 @@ enum nl80211_mpath_info { | |||
452 | * an array of nested frequency attributes | 474 | * an array of nested frequency attributes |
453 | * @NL80211_BAND_ATTR_RATES: supported bitrates in this band, | 475 | * @NL80211_BAND_ATTR_RATES: supported bitrates in this band, |
454 | * an array of nested bitrate attributes | 476 | * an array of nested bitrate attributes |
477 | * @NL80211_BAND_ATTR_HT_MCS_SET: 16-byte attribute containing the MCS set as | ||
478 | * defined in 802.11n | ||
479 | * @NL80211_BAND_ATTR_HT_CAPA: HT capabilities, as in the HT information IE | ||
480 | * @NL80211_BAND_ATTR_HT_AMPDU_FACTOR: A-MPDU factor, as in 11n | ||
481 | * @NL80211_BAND_ATTR_HT_AMPDU_DENSITY: A-MPDU density, as in 11n | ||
455 | */ | 482 | */ |
456 | enum nl80211_band_attr { | 483 | enum nl80211_band_attr { |
457 | __NL80211_BAND_ATTR_INVALID, | 484 | __NL80211_BAND_ATTR_INVALID, |
458 | NL80211_BAND_ATTR_FREQS, | 485 | NL80211_BAND_ATTR_FREQS, |
459 | NL80211_BAND_ATTR_RATES, | 486 | NL80211_BAND_ATTR_RATES, |
460 | 487 | ||
488 | NL80211_BAND_ATTR_HT_MCS_SET, | ||
489 | NL80211_BAND_ATTR_HT_CAPA, | ||
490 | NL80211_BAND_ATTR_HT_AMPDU_FACTOR, | ||
491 | NL80211_BAND_ATTR_HT_AMPDU_DENSITY, | ||
492 | |||
461 | /* keep last */ | 493 | /* keep last */ |
462 | __NL80211_BAND_ATTR_AFTER_LAST, | 494 | __NL80211_BAND_ATTR_AFTER_LAST, |
463 | NL80211_BAND_ATTR_MAX = __NL80211_BAND_ATTR_AFTER_LAST - 1 | 495 | NL80211_BAND_ATTR_MAX = __NL80211_BAND_ATTR_AFTER_LAST - 1 |
464 | }; | 496 | }; |
465 | 497 | ||
498 | #define NL80211_BAND_ATTR_HT_CAPA NL80211_BAND_ATTR_HT_CAPA | ||
499 | |||
466 | /** | 500 | /** |
467 | * enum nl80211_frequency_attr - frequency attributes | 501 | * enum nl80211_frequency_attr - frequency attributes |
468 | * @NL80211_FREQUENCY_ATTR_FREQ: Frequency in MHz | 502 | * @NL80211_FREQUENCY_ATTR_FREQ: Frequency in MHz |
@@ -594,4 +628,113 @@ enum nl80211_mntr_flags { | |||
594 | NL80211_MNTR_FLAG_MAX = __NL80211_MNTR_FLAG_AFTER_LAST - 1 | 628 | NL80211_MNTR_FLAG_MAX = __NL80211_MNTR_FLAG_AFTER_LAST - 1 |
595 | }; | 629 | }; |
596 | 630 | ||
631 | /** | ||
632 | * enum nl80211_meshconf_params - mesh configuration parameters | ||
633 | * | ||
634 | * Mesh configuration parameters | ||
635 | * | ||
636 | * @__NL80211_MESHCONF_INVALID: internal use | ||
637 | * | ||
638 | * @NL80211_MESHCONF_RETRY_TIMEOUT: specifies the initial retry timeout in | ||
639 | * millisecond units, used by the Peer Link Open message | ||
640 | * | ||
641 | * @NL80211_MESHCONF_CONFIRM_TIMEOUT: specifies the inital confirm timeout, in | ||
642 | * millisecond units, used by the peer link management to close a peer link | ||
643 | * | ||
644 | * @NL80211_MESHCONF_HOLDING_TIMEOUT: specifies the holding timeout, in | ||
645 | * millisecond units | ||
646 | * | ||
647 | * @NL80211_MESHCONF_MAX_PEER_LINKS: maximum number of peer links allowed | ||
648 | * on this mesh interface | ||
649 | * | ||
650 | * @NL80211_MESHCONF_MAX_RETRIES: specifies the maximum number of peer link | ||
651 | * open retries that can be sent to establish a new peer link instance in a | ||
652 | * mesh | ||
653 | * | ||
654 | * @NL80211_MESHCONF_TTL: specifies the value of TTL field set at a source mesh | ||
655 | * point. | ||
656 | * | ||
657 | * @NL80211_MESHCONF_AUTO_OPEN_PLINKS: whether we should automatically | ||
658 | * open peer links when we detect compatible mesh peers. | ||
659 | * | ||
660 | * @NL80211_MESHCONF_HWMP_MAX_PREQ_RETRIES: the number of action frames | ||
661 | * containing a PREQ that an MP can send to a particular destination (path | ||
662 | * target) | ||
663 | * | ||
664 | * @NL80211_MESHCONF_PATH_REFRESH_TIME: how frequently to refresh mesh paths | ||
665 | * (in milliseconds) | ||
666 | * | ||
667 | * @NL80211_MESHCONF_MIN_DISCOVERY_TIMEOUT: minimum length of time to wait | ||
668 | * until giving up on a path discovery (in milliseconds) | ||
669 | * | ||
670 | * @NL80211_MESHCONF_HWMP_ACTIVE_PATH_TIMEOUT: The time (in TUs) for which mesh | ||
671 | * points receiving a PREQ shall consider the forwarding information from the | ||
672 | * root to be valid. (TU = time unit) | ||
673 | * | ||
674 | * @NL80211_MESHCONF_HWMP_PREQ_MIN_INTERVAL: The minimum interval of time (in | ||
675 | * TUs) during which an MP can send only one action frame containing a PREQ | ||
676 | * reference element | ||
677 | * | ||
678 | * @NL80211_MESHCONF_HWMP_NET_DIAM_TRVS_TIME: The interval of time (in TUs) | ||
679 | * that it takes for an HWMP information element to propagate across the mesh | ||
680 | * | ||
681 | * @NL80211_MESHCONF_ATTR_MAX: highest possible mesh configuration attribute | ||
682 | * | ||
683 | * @__NL80211_MESHCONF_ATTR_AFTER_LAST: internal use | ||
684 | */ | ||
685 | enum nl80211_meshconf_params { | ||
686 | __NL80211_MESHCONF_INVALID, | ||
687 | NL80211_MESHCONF_RETRY_TIMEOUT, | ||
688 | NL80211_MESHCONF_CONFIRM_TIMEOUT, | ||
689 | NL80211_MESHCONF_HOLDING_TIMEOUT, | ||
690 | NL80211_MESHCONF_MAX_PEER_LINKS, | ||
691 | NL80211_MESHCONF_MAX_RETRIES, | ||
692 | NL80211_MESHCONF_TTL, | ||
693 | NL80211_MESHCONF_AUTO_OPEN_PLINKS, | ||
694 | NL80211_MESHCONF_HWMP_MAX_PREQ_RETRIES, | ||
695 | NL80211_MESHCONF_PATH_REFRESH_TIME, | ||
696 | NL80211_MESHCONF_MIN_DISCOVERY_TIMEOUT, | ||
697 | NL80211_MESHCONF_HWMP_ACTIVE_PATH_TIMEOUT, | ||
698 | NL80211_MESHCONF_HWMP_PREQ_MIN_INTERVAL, | ||
699 | NL80211_MESHCONF_HWMP_NET_DIAM_TRVS_TIME, | ||
700 | |||
701 | /* keep last */ | ||
702 | __NL80211_MESHCONF_ATTR_AFTER_LAST, | ||
703 | NL80211_MESHCONF_ATTR_MAX = __NL80211_MESHCONF_ATTR_AFTER_LAST - 1 | ||
704 | }; | ||
705 | |||
706 | /** | ||
707 | * enum nl80211_txq_attr - TX queue parameter attributes | ||
708 | * @__NL80211_TXQ_ATTR_INVALID: Attribute number 0 is reserved | ||
709 | * @NL80211_TXQ_ATTR_QUEUE: TX queue identifier (NL80211_TXQ_Q_*) | ||
710 | * @NL80211_TXQ_ATTR_TXOP: Maximum burst time in units of 32 usecs, 0 meaning | ||
711 | * disabled | ||
712 | * @NL80211_TXQ_ATTR_CWMIN: Minimum contention window [a value of the form | ||
713 | * 2^n-1 in the range 1..32767] | ||
714 | * @NL80211_TXQ_ATTR_CWMAX: Maximum contention window [a value of the form | ||
715 | * 2^n-1 in the range 1..32767] | ||
716 | * @NL80211_TXQ_ATTR_AIFS: Arbitration interframe space [0..255] | ||
717 | * @__NL80211_TXQ_ATTR_AFTER_LAST: Internal | ||
718 | * @NL80211_TXQ_ATTR_MAX: Maximum TXQ attribute number | ||
719 | */ | ||
720 | enum nl80211_txq_attr { | ||
721 | __NL80211_TXQ_ATTR_INVALID, | ||
722 | NL80211_TXQ_ATTR_QUEUE, | ||
723 | NL80211_TXQ_ATTR_TXOP, | ||
724 | NL80211_TXQ_ATTR_CWMIN, | ||
725 | NL80211_TXQ_ATTR_CWMAX, | ||
726 | NL80211_TXQ_ATTR_AIFS, | ||
727 | |||
728 | /* keep last */ | ||
729 | __NL80211_TXQ_ATTR_AFTER_LAST, | ||
730 | NL80211_TXQ_ATTR_MAX = __NL80211_TXQ_ATTR_AFTER_LAST - 1 | ||
731 | }; | ||
732 | |||
733 | enum nl80211_txq_q { | ||
734 | NL80211_TXQ_Q_VO, | ||
735 | NL80211_TXQ_Q_VI, | ||
736 | NL80211_TXQ_Q_BE, | ||
737 | NL80211_TXQ_Q_BK | ||
738 | }; | ||
739 | |||
597 | #endif /* __LINUX_NL80211_H */ | 740 | #endif /* __LINUX_NL80211_H */ |
diff --git a/include/linux/pkt_cls.h b/include/linux/pkt_cls.h index 7cf7824df778..e6aa8482ad7a 100644 --- a/include/linux/pkt_cls.h +++ b/include/linux/pkt_cls.h | |||
@@ -394,6 +394,20 @@ enum | |||
394 | 394 | ||
395 | #define TCA_BASIC_MAX (__TCA_BASIC_MAX - 1) | 395 | #define TCA_BASIC_MAX (__TCA_BASIC_MAX - 1) |
396 | 396 | ||
397 | |||
398 | /* Cgroup classifier */ | ||
399 | |||
400 | enum | ||
401 | { | ||
402 | TCA_CGROUP_UNSPEC, | ||
403 | TCA_CGROUP_ACT, | ||
404 | TCA_CGROUP_POLICE, | ||
405 | TCA_CGROUP_EMATCHES, | ||
406 | __TCA_CGROUP_MAX, | ||
407 | }; | ||
408 | |||
409 | #define TCA_CGROUP_MAX (__TCA_CGROUP_MAX - 1) | ||
410 | |||
397 | /* Extended Matches */ | 411 | /* Extended Matches */ |
398 | 412 | ||
399 | struct tcf_ematch_tree_hdr | 413 | struct tcf_ematch_tree_hdr |
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 | ||
1873 | static inline struct sec_path *skb_sec_path(struct sk_buff *skb) | ||
1874 | { | ||
1875 | return skb->sp; | ||
1876 | } | ||
1877 | #else | ||
1878 | static inline struct sec_path *skb_sec_path(struct sk_buff *skb) | ||
1879 | { | ||
1880 | return NULL; | ||
1881 | } | ||
1882 | #endif | ||
1883 | |||
1867 | static inline int skb_is_gso(const struct sk_buff *skb) | 1884 | static 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/smsc911x.h b/include/linux/smsc911x.h new file mode 100644 index 000000000000..47c4ffd10dbb --- /dev/null +++ b/include/linux/smsc911x.h | |||
@@ -0,0 +1,42 @@ | |||
1 | /*************************************************************************** | ||
2 | * | ||
3 | * Copyright (C) 2004-2008 SMSC | ||
4 | * Copyright (C) 2005-2008 ARM | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or | ||
7 | * modify it under the terms of the GNU General Public License | ||
8 | * as published by the Free Software Foundation; either version 2 | ||
9 | * of the License, or (at your option) any later version. | ||
10 | * | ||
11 | * This program is distributed in the hope that it will be useful, | ||
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
14 | * GNU General Public License for more details. | ||
15 | * | ||
16 | * You should have received a copy of the GNU General Public License | ||
17 | * along with this program; if not, write to the Free Software | ||
18 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | ||
19 | * | ||
20 | ***************************************************************************/ | ||
21 | #ifndef __LINUX_SMSC911X_H__ | ||
22 | #define __LINUX_SMSC911X_H__ | ||
23 | |||
24 | #include <linux/phy.h> | ||
25 | |||
26 | /* platform_device configuration data, should be assigned to | ||
27 | * the platform_device's dev.platform_data */ | ||
28 | struct smsc911x_platform_config { | ||
29 | unsigned int irq_polarity; | ||
30 | unsigned int irq_type; | ||
31 | phy_interface_t phy_interface; | ||
32 | }; | ||
33 | |||
34 | /* Constants for platform_device irq polarity configuration */ | ||
35 | #define SMSC911X_IRQ_POLARITY_ACTIVE_LOW 0 | ||
36 | #define SMSC911X_IRQ_POLARITY_ACTIVE_HIGH 1 | ||
37 | |||
38 | /* Constants for platform_device irq type configuration */ | ||
39 | #define SMSC911X_IRQ_TYPE_OPEN_DRAIN 0 | ||
40 | #define SMSC911X_IRQ_TYPE_PUSH_PULL 1 | ||
41 | |||
42 | #endif /* __LINUX_SMSC911X_H__ */ | ||
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 | ||
444 | struct 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..1d57835d73f2 100644 --- a/include/net/cfg80211.h +++ b/include/net/cfg80211.h | |||
@@ -280,11 +280,16 @@ struct mpath_info { | |||
280 | * (0 = no, 1 = yes, -1 = do not change) | 280 | * (0 = no, 1 = yes, -1 = do not change) |
281 | * @use_short_slot_time: Whether the use of short slot time is allowed | 281 | * @use_short_slot_time: Whether the use of short slot time is allowed |
282 | * (0 = no, 1 = yes, -1 = do not change) | 282 | * (0 = no, 1 = yes, -1 = do not change) |
283 | * @basic_rates: basic rates in IEEE 802.11 format | ||
284 | * (or NULL for no change) | ||
285 | * @basic_rates_len: number of basic rates | ||
283 | */ | 286 | */ |
284 | struct bss_parameters { | 287 | struct bss_parameters { |
285 | int use_cts_prot; | 288 | int use_cts_prot; |
286 | int use_short_preamble; | 289 | int use_short_preamble; |
287 | int use_short_slot_time; | 290 | int use_short_slot_time; |
291 | u8 *basic_rates; | ||
292 | u8 basic_rates_len; | ||
288 | }; | 293 | }; |
289 | 294 | ||
290 | /** | 295 | /** |
@@ -331,22 +336,59 @@ struct ieee80211_regdomain { | |||
331 | struct ieee80211_reg_rule reg_rules[]; | 336 | struct ieee80211_reg_rule reg_rules[]; |
332 | }; | 337 | }; |
333 | 338 | ||
334 | #define MHZ_TO_KHZ(freq) (freq * 1000) | 339 | #define MHZ_TO_KHZ(freq) ((freq) * 1000) |
335 | #define KHZ_TO_MHZ(freq) (freq / 1000) | 340 | #define KHZ_TO_MHZ(freq) ((freq) / 1000) |
336 | #define DBI_TO_MBI(gain) (gain * 100) | 341 | #define DBI_TO_MBI(gain) ((gain) * 100) |
337 | #define MBI_TO_DBI(gain) (gain / 100) | 342 | #define MBI_TO_DBI(gain) ((gain) / 100) |
338 | #define DBM_TO_MBM(gain) (gain * 100) | 343 | #define DBM_TO_MBM(gain) ((gain) * 100) |
339 | #define MBM_TO_DBM(gain) (gain / 100) | 344 | #define MBM_TO_DBM(gain) ((gain) / 100) |
340 | 345 | ||
341 | #define REG_RULE(start, end, bw, gain, eirp, reg_flags) { \ | 346 | #define REG_RULE(start, end, bw, gain, eirp, reg_flags) { \ |
342 | .freq_range.start_freq_khz = (start) * 1000, \ | 347 | .freq_range.start_freq_khz = MHZ_TO_KHZ(start), \ |
343 | .freq_range.end_freq_khz = (end) * 1000, \ | 348 | .freq_range.end_freq_khz = MHZ_TO_KHZ(end), \ |
344 | .freq_range.max_bandwidth_khz = (bw) * 1000, \ | 349 | .freq_range.max_bandwidth_khz = MHZ_TO_KHZ(bw), \ |
345 | .power_rule.max_antenna_gain = (gain) * 100, \ | 350 | .power_rule.max_antenna_gain = DBI_TO_MBI(gain), \ |
346 | .power_rule.max_eirp = (eirp) * 100, \ | 351 | .power_rule.max_eirp = DBM_TO_MBM(eirp), \ |
347 | .flags = reg_flags, \ | 352 | .flags = reg_flags, \ |
348 | } | 353 | } |
349 | 354 | ||
355 | struct mesh_config { | ||
356 | /* Timeouts in ms */ | ||
357 | /* Mesh plink management parameters */ | ||
358 | u16 dot11MeshRetryTimeout; | ||
359 | u16 dot11MeshConfirmTimeout; | ||
360 | u16 dot11MeshHoldingTimeout; | ||
361 | u16 dot11MeshMaxPeerLinks; | ||
362 | u8 dot11MeshMaxRetries; | ||
363 | u8 dot11MeshTTL; | ||
364 | bool auto_open_plinks; | ||
365 | /* HWMP parameters */ | ||
366 | u8 dot11MeshHWMPmaxPREQretries; | ||
367 | u32 path_refresh_time; | ||
368 | u16 min_discovery_timeout; | ||
369 | u32 dot11MeshHWMPactivePathTimeout; | ||
370 | u16 dot11MeshHWMPpreqMinInterval; | ||
371 | u16 dot11MeshHWMPnetDiameterTraversalTime; | ||
372 | }; | ||
373 | |||
374 | /** | ||
375 | * struct ieee80211_txq_params - TX queue parameters | ||
376 | * @queue: TX queue identifier (NL80211_TXQ_Q_*) | ||
377 | * @txop: Maximum burst time in units of 32 usecs, 0 meaning disabled | ||
378 | * @cwmin: Minimum contention window [a value of the form 2^n-1 in the range | ||
379 | * 1..32767] | ||
380 | * @cwmax: Maximum contention window [a value of the form 2^n-1 in the range | ||
381 | * 1..32767] | ||
382 | * @aifs: Arbitration interframe space [0..255] | ||
383 | */ | ||
384 | struct ieee80211_txq_params { | ||
385 | enum nl80211_txq_q queue; | ||
386 | u16 txop; | ||
387 | u16 cwmin; | ||
388 | u16 cwmax; | ||
389 | u8 aifs; | ||
390 | }; | ||
391 | |||
350 | /* from net/wireless.h */ | 392 | /* from net/wireless.h */ |
351 | struct wiphy; | 393 | struct wiphy; |
352 | 394 | ||
@@ -397,9 +439,17 @@ struct wiphy; | |||
397 | * | 439 | * |
398 | * @change_station: Modify a given station. | 440 | * @change_station: Modify a given station. |
399 | * | 441 | * |
442 | * @get_mesh_params: Put the current mesh parameters into *params | ||
443 | * | ||
444 | * @set_mesh_params: Set mesh parameters. | ||
445 | * The mask is a bitfield which tells us which parameters to | ||
446 | * set, and which to leave alone. | ||
447 | * | ||
400 | * @set_mesh_cfg: set mesh parameters (by now, just mesh id) | 448 | * @set_mesh_cfg: set mesh parameters (by now, just mesh id) |
401 | * | 449 | * |
402 | * @change_bss: Modify parameters for a given BSS. | 450 | * @change_bss: Modify parameters for a given BSS. |
451 | * | ||
452 | * @set_txq_params: Set TX queue parameters | ||
403 | */ | 453 | */ |
404 | struct cfg80211_ops { | 454 | struct cfg80211_ops { |
405 | int (*add_virtual_intf)(struct wiphy *wiphy, char *name, | 455 | int (*add_virtual_intf)(struct wiphy *wiphy, char *name, |
@@ -452,9 +502,17 @@ struct cfg80211_ops { | |||
452 | int (*dump_mpath)(struct wiphy *wiphy, struct net_device *dev, | 502 | int (*dump_mpath)(struct wiphy *wiphy, struct net_device *dev, |
453 | int idx, u8 *dst, u8 *next_hop, | 503 | int idx, u8 *dst, u8 *next_hop, |
454 | struct mpath_info *pinfo); | 504 | struct mpath_info *pinfo); |
455 | 505 | int (*get_mesh_params)(struct wiphy *wiphy, | |
506 | struct net_device *dev, | ||
507 | struct mesh_config *conf); | ||
508 | int (*set_mesh_params)(struct wiphy *wiphy, | ||
509 | struct net_device *dev, | ||
510 | const struct mesh_config *nconf, u32 mask); | ||
456 | int (*change_bss)(struct wiphy *wiphy, struct net_device *dev, | 511 | int (*change_bss)(struct wiphy *wiphy, struct net_device *dev, |
457 | struct bss_parameters *params); | 512 | struct bss_parameters *params); |
513 | |||
514 | int (*set_txq_params)(struct wiphy *wiphy, | ||
515 | struct ieee80211_txq_params *params); | ||
458 | }; | 516 | }; |
459 | 517 | ||
460 | #endif /* __NET_CFG80211_H */ | 518 | #endif /* __NET_CFG80211_H */ |
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. */ | ||
132 | const 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 */ | ||
247 | enum 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 */ | ||
281 | enum 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 */ |
310 | enum ieee80211_actioncategories { | 219 | enum 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. */ | ||
540 | struct ieee80211_hdr { | ||
541 | __le16 frame_ctl; | ||
542 | __le16 duration_id; | ||
543 | u8 payload[0]; | ||
544 | } __attribute__ ((packed)); | ||
545 | |||
546 | struct ieee80211_hdr_1addr { | 446 | struct 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 | ||
593 | struct 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 | |||
605 | struct ieee80211_info_element { | 493 | struct 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 | ||
1138 | static 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 | |||
1154 | static inline int ieee80211_is_valid_mode(struct ieee80211_device *ieee, | 1025 | static 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 | ||
1209 | static inline u8 *ieee80211_get_payload(struct ieee80211_hdr *hdr) | 1080 | static 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. */ | ||
15 | const 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..53856003aa18 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 | */ | ||
94 | struct 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 | */ | ||
165 | struct 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 | */ |
263 | enum mac80211_tx_control_flags { | 246 | enum 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), | 262 | enum 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 | */ |
304 | struct ieee80211_tx_altrate { | 298 | struct 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 | */ | ||
391 | static inline void | ||
392 | ieee80211_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 | */ |
450 | enum ieee80211_conf_flags { | 487 | enum 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), | 493 | static 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 | |||
499 | struct 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 | */ | ||
516 | enum 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 | */ |
481 | struct ieee80211_conf { | 547 | struct 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 | */ |
508 | struct ieee80211_vif { | 573 | struct 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 | }; |
@@ -550,14 +616,12 @@ struct ieee80211_if_init_conf { | |||
550 | * enum ieee80211_if_conf_change - interface config change flags | 616 | * enum ieee80211_if_conf_change - interface config change flags |
551 | * | 617 | * |
552 | * @IEEE80211_IFCC_BSSID: The BSSID changed. | 618 | * @IEEE80211_IFCC_BSSID: The BSSID changed. |
553 | * @IEEE80211_IFCC_SSID: The SSID changed. | ||
554 | * @IEEE80211_IFCC_BEACON: The beacon for this interface changed | 619 | * @IEEE80211_IFCC_BEACON: The beacon for this interface changed |
555 | * (currently AP and MESH only), use ieee80211_beacon_get(). | 620 | * (currently AP and MESH only), use ieee80211_beacon_get(). |
556 | */ | 621 | */ |
557 | enum ieee80211_if_conf_change { | 622 | enum ieee80211_if_conf_change { |
558 | IEEE80211_IFCC_BSSID = BIT(0), | 623 | IEEE80211_IFCC_BSSID = BIT(0), |
559 | IEEE80211_IFCC_SSID = BIT(1), | 624 | IEEE80211_IFCC_BEACON = BIT(1), |
560 | IEEE80211_IFCC_BEACON = BIT(2), | ||
561 | }; | 625 | }; |
562 | 626 | ||
563 | /** | 627 | /** |
@@ -565,11 +629,6 @@ enum ieee80211_if_conf_change { | |||
565 | * | 629 | * |
566 | * @changed: parameters that have changed, see &enum ieee80211_if_conf_change. | 630 | * @changed: parameters that have changed, see &enum ieee80211_if_conf_change. |
567 | * @bssid: BSSID of the network we are associated to/creating. | 631 | * @bssid: BSSID of the network we are associated to/creating. |
568 | * @ssid: used (together with @ssid_len) by drivers for hardware that | ||
569 | * generate beacons independently. The pointer is valid only during the | ||
570 | * config_interface() call, so copy the value somewhere if you need | ||
571 | * it. | ||
572 | * @ssid_len: length of the @ssid field. | ||
573 | * | 632 | * |
574 | * This structure is passed to the config_interface() callback of | 633 | * This structure is passed to the config_interface() callback of |
575 | * &struct ieee80211_hw. | 634 | * &struct ieee80211_hw. |
@@ -577,8 +636,6 @@ enum ieee80211_if_conf_change { | |||
577 | struct ieee80211_if_conf { | 636 | struct ieee80211_if_conf { |
578 | u32 changed; | 637 | u32 changed; |
579 | u8 *bssid; | 638 | u8 *bssid; |
580 | u8 *ssid; | ||
581 | size_t ssid_len; | ||
582 | }; | 639 | }; |
583 | 640 | ||
584 | /** | 641 | /** |
@@ -685,7 +742,7 @@ enum set_key_cmd { | |||
685 | * @addr: MAC address | 742 | * @addr: MAC address |
686 | * @aid: AID we assigned to the station if we're an AP | 743 | * @aid: AID we assigned to the station if we're an AP |
687 | * @supp_rates: Bitmap of supported rates (per band) | 744 | * @supp_rates: Bitmap of supported rates (per band) |
688 | * @ht_info: HT capabilities of this STA | 745 | * @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 | 746 | * @drv_priv: data area for driver use, will always be aligned to |
690 | * sizeof(void *), size is determined in hw information. | 747 | * sizeof(void *), size is determined in hw information. |
691 | */ | 748 | */ |
@@ -693,7 +750,7 @@ struct ieee80211_sta { | |||
693 | u64 supp_rates[IEEE80211_NUM_BANDS]; | 750 | u64 supp_rates[IEEE80211_NUM_BANDS]; |
694 | u8 addr[ETH_ALEN]; | 751 | u8 addr[ETH_ALEN]; |
695 | u16 aid; | 752 | u16 aid; |
696 | struct ieee80211_ht_info ht_info; | 753 | struct ieee80211_sta_ht_cap ht_cap; |
697 | 754 | ||
698 | /* must be last */ | 755 | /* must be last */ |
699 | u8 drv_priv[0] __attribute__((__aligned__(sizeof(void *)))); | 756 | u8 drv_priv[0] __attribute__((__aligned__(sizeof(void *)))); |
@@ -777,6 +834,9 @@ enum ieee80211_tkip_key_type { | |||
777 | * @IEEE80211_HW_SPECTRUM_MGMT: | 834 | * @IEEE80211_HW_SPECTRUM_MGMT: |
778 | * Hardware supports spectrum management defined in 802.11h | 835 | * Hardware supports spectrum management defined in 802.11h |
779 | * Measurement, Channel Switch, Quieting, TPC | 836 | * Measurement, Channel Switch, Quieting, TPC |
837 | * | ||
838 | * @IEEE80211_HW_AMPDU_AGGREGATION: | ||
839 | * Hardware supports 11n A-MPDU aggregation. | ||
780 | */ | 840 | */ |
781 | enum ieee80211_hw_flags { | 841 | enum ieee80211_hw_flags { |
782 | IEEE80211_HW_RX_INCLUDES_FCS = 1<<1, | 842 | IEEE80211_HW_RX_INCLUDES_FCS = 1<<1, |
@@ -788,6 +848,7 @@ enum ieee80211_hw_flags { | |||
788 | IEEE80211_HW_SIGNAL_DBM = 1<<7, | 848 | IEEE80211_HW_SIGNAL_DBM = 1<<7, |
789 | IEEE80211_HW_NOISE_DBM = 1<<8, | 849 | IEEE80211_HW_NOISE_DBM = 1<<8, |
790 | IEEE80211_HW_SPECTRUM_MGMT = 1<<9, | 850 | IEEE80211_HW_SPECTRUM_MGMT = 1<<9, |
851 | IEEE80211_HW_AMPDU_AGGREGATION = 1<<10, | ||
791 | }; | 852 | }; |
792 | 853 | ||
793 | /** | 854 | /** |
@@ -846,8 +907,8 @@ enum ieee80211_hw_flags { | |||
846 | * @sta_data_size: size (in bytes) of the drv_priv data area | 907 | * @sta_data_size: size (in bytes) of the drv_priv data area |
847 | * within &struct ieee80211_sta. | 908 | * within &struct ieee80211_sta. |
848 | * | 909 | * |
849 | * @max_altrates: maximum number of alternate rate retry stages | 910 | * @max_rates: maximum number of alternate rate retry stages |
850 | * @max_altrate_tries: maximum number of tries for each stage | 911 | * @max_rate_tries: maximum number of tries for each stage |
851 | */ | 912 | */ |
852 | struct ieee80211_hw { | 913 | struct ieee80211_hw { |
853 | struct ieee80211_conf conf; | 914 | struct ieee80211_conf conf; |
@@ -864,12 +925,10 @@ struct ieee80211_hw { | |||
864 | u16 ampdu_queues; | 925 | u16 ampdu_queues; |
865 | u16 max_listen_interval; | 926 | u16 max_listen_interval; |
866 | s8 max_signal; | 927 | s8 max_signal; |
867 | u8 max_altrates; | 928 | u8 max_rates; |
868 | u8 max_altrate_tries; | 929 | u8 max_rate_tries; |
869 | }; | 930 | }; |
870 | 931 | ||
871 | struct ieee80211_hw *wiphy_to_hw(struct wiphy *wiphy); | ||
872 | |||
873 | /** | 932 | /** |
874 | * SET_IEEE80211_DEV - set device for 802.11 hardware | 933 | * SET_IEEE80211_DEV - set device for 802.11 hardware |
875 | * | 934 | * |
@@ -882,7 +941,7 @@ static inline void SET_IEEE80211_DEV(struct ieee80211_hw *hw, struct device *dev | |||
882 | } | 941 | } |
883 | 942 | ||
884 | /** | 943 | /** |
885 | * SET_IEEE80211_PERM_ADDR - set the permanenet MAC address for 802.11 hardware | 944 | * SET_IEEE80211_PERM_ADDR - set the permanent MAC address for 802.11 hardware |
886 | * | 945 | * |
887 | * @hw: the &struct ieee80211_hw to set the MAC address for | 946 | * @hw: the &struct ieee80211_hw to set the MAC address for |
888 | * @addr: the address to set | 947 | * @addr: the address to set |
@@ -906,9 +965,9 @@ static inline struct ieee80211_rate * | |||
906 | ieee80211_get_tx_rate(const struct ieee80211_hw *hw, | 965 | ieee80211_get_tx_rate(const struct ieee80211_hw *hw, |
907 | const struct ieee80211_tx_info *c) | 966 | const struct ieee80211_tx_info *c) |
908 | { | 967 | { |
909 | if (WARN_ON(c->tx_rate_idx < 0)) | 968 | if (WARN_ON(c->control.rates[0].idx < 0)) |
910 | return NULL; | 969 | return NULL; |
911 | return &hw->wiphy->bands[c->band]->bitrates[c->tx_rate_idx]; | 970 | return &hw->wiphy->bands[c->band]->bitrates[c->control.rates[0].idx]; |
912 | } | 971 | } |
913 | 972 | ||
914 | static inline struct ieee80211_rate * | 973 | static inline struct ieee80211_rate * |
@@ -924,9 +983,9 @@ static inline struct ieee80211_rate * | |||
924 | ieee80211_get_alt_retry_rate(const struct ieee80211_hw *hw, | 983 | ieee80211_get_alt_retry_rate(const struct ieee80211_hw *hw, |
925 | const struct ieee80211_tx_info *c, int idx) | 984 | const struct ieee80211_tx_info *c, int idx) |
926 | { | 985 | { |
927 | if (c->control.retries[idx].rate_idx < 0) | 986 | if (c->control.rates[idx + 1].idx < 0) |
928 | return NULL; | 987 | return NULL; |
929 | return &hw->wiphy->bands[c->band]->bitrates[c->control.retries[idx].rate_idx]; | 988 | return &hw->wiphy->bands[c->band]->bitrates[c->control.rates[idx + 1].idx]; |
930 | } | 989 | } |
931 | 990 | ||
932 | /** | 991 | /** |
@@ -975,7 +1034,7 @@ ieee80211_get_alt_retry_rate(const struct ieee80211_hw *hw, | |||
975 | * This happens everytime the iv16 wraps around (every 65536 packets). The | 1034 | * 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 | 1035 | * 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 | 1036 | * 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 | 1037 | * provided by update_tkip_key only. The trigger that makes mac80211 call this |
979 | * handler is software decryption with wrap around of iv16. | 1038 | * handler is software decryption with wrap around of iv16. |
980 | */ | 1039 | */ |
981 | 1040 | ||
@@ -1068,12 +1127,14 @@ enum ieee80211_filter_flags { | |||
1068 | * @IEEE80211_AMPDU_RX_STOP: stop Rx aggregation | 1127 | * @IEEE80211_AMPDU_RX_STOP: stop Rx aggregation |
1069 | * @IEEE80211_AMPDU_TX_START: start Tx aggregation | 1128 | * @IEEE80211_AMPDU_TX_START: start Tx aggregation |
1070 | * @IEEE80211_AMPDU_TX_STOP: stop Tx aggregation | 1129 | * @IEEE80211_AMPDU_TX_STOP: stop Tx aggregation |
1130 | * @IEEE80211_AMPDU_TX_RESUME: resume TX aggregation | ||
1071 | */ | 1131 | */ |
1072 | enum ieee80211_ampdu_mlme_action { | 1132 | enum ieee80211_ampdu_mlme_action { |
1073 | IEEE80211_AMPDU_RX_START, | 1133 | IEEE80211_AMPDU_RX_START, |
1074 | IEEE80211_AMPDU_RX_STOP, | 1134 | IEEE80211_AMPDU_RX_STOP, |
1075 | IEEE80211_AMPDU_TX_START, | 1135 | IEEE80211_AMPDU_TX_START, |
1076 | IEEE80211_AMPDU_TX_STOP, | 1136 | IEEE80211_AMPDU_TX_STOP, |
1137 | IEEE80211_AMPDU_TX_RESUME, | ||
1077 | }; | 1138 | }; |
1078 | 1139 | ||
1079 | /** | 1140 | /** |
@@ -1109,7 +1170,7 @@ enum ieee80211_ampdu_mlme_action { | |||
1109 | * Must be implemented. | 1170 | * Must be implemented. |
1110 | * | 1171 | * |
1111 | * @add_interface: Called when a netdevice attached to the hardware is | 1172 | * @add_interface: Called when a netdevice attached to the hardware is |
1112 | * enabled. Because it is not called for monitor mode devices, @open | 1173 | * enabled. Because it is not called for monitor mode devices, @start |
1113 | * and @stop must be implemented. | 1174 | * and @stop must be implemented. |
1114 | * The driver should perform any initialization it needs before | 1175 | * The driver should perform any initialization it needs before |
1115 | * the device can be enabled. The initial configuration for the | 1176 | * the device can be enabled. The initial configuration for the |
@@ -1175,10 +1236,8 @@ enum ieee80211_ampdu_mlme_action { | |||
1175 | * the device does fragmentation by itself; if this method is assigned then | 1236 | * the device does fragmentation by itself; if this method is assigned then |
1176 | * the stack will not do fragmentation. | 1237 | * the stack will not do fragmentation. |
1177 | * | 1238 | * |
1178 | * @set_retry_limit: Configuration of retry limits (if device needs it) | ||
1179 | * | ||
1180 | * @sta_notify: Notifies low level driver about addition or removal | 1239 | * @sta_notify: Notifies low level driver about addition or removal |
1181 | * of assocaited station or AP. | 1240 | * of associated station or AP. |
1182 | * | 1241 | * |
1183 | * @conf_tx: Configure TX queue parameters (EDCF (aifs, cw_min, cw_max), | 1242 | * @conf_tx: Configure TX queue parameters (EDCF (aifs, cw_min, cw_max), |
1184 | * bursting) for a hardware TX queue. | 1243 | * bursting) for a hardware TX queue. |
@@ -1219,7 +1278,7 @@ struct ieee80211_ops { | |||
1219 | struct ieee80211_if_init_conf *conf); | 1278 | struct ieee80211_if_init_conf *conf); |
1220 | void (*remove_interface)(struct ieee80211_hw *hw, | 1279 | void (*remove_interface)(struct ieee80211_hw *hw, |
1221 | struct ieee80211_if_init_conf *conf); | 1280 | struct ieee80211_if_init_conf *conf); |
1222 | int (*config)(struct ieee80211_hw *hw, struct ieee80211_conf *conf); | 1281 | int (*config)(struct ieee80211_hw *hw, u32 changed); |
1223 | int (*config_interface)(struct ieee80211_hw *hw, | 1282 | int (*config_interface)(struct ieee80211_hw *hw, |
1224 | struct ieee80211_vif *vif, | 1283 | struct ieee80211_vif *vif, |
1225 | struct ieee80211_if_conf *conf); | 1284 | struct ieee80211_if_conf *conf); |
@@ -1246,8 +1305,6 @@ struct ieee80211_ops { | |||
1246 | u32 *iv32, u16 *iv16); | 1305 | u32 *iv32, u16 *iv16); |
1247 | int (*set_rts_threshold)(struct ieee80211_hw *hw, u32 value); | 1306 | int (*set_rts_threshold)(struct ieee80211_hw *hw, u32 value); |
1248 | int (*set_frag_threshold)(struct ieee80211_hw *hw, u32 value); | 1307 | 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, | 1308 | void (*sta_notify)(struct ieee80211_hw *hw, struct ieee80211_vif *vif, |
1252 | enum sta_notify_cmd, struct ieee80211_sta *sta); | 1309 | enum sta_notify_cmd, struct ieee80211_sta *sta); |
1253 | int (*conf_tx)(struct ieee80211_hw *hw, u16 queue, | 1310 | int (*conf_tx)(struct ieee80211_hw *hw, u16 queue, |
@@ -1480,7 +1537,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 | 1537 | * 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 | 1538 | * 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 | 1539 | * hardware interrupt). Returned skb is used only once and low-level driver |
1483 | * is responsible of freeing it. | 1540 | * is responsible for freeing it. |
1484 | */ | 1541 | */ |
1485 | struct sk_buff *ieee80211_beacon_get(struct ieee80211_hw *hw, | 1542 | struct sk_buff *ieee80211_beacon_get(struct ieee80211_hw *hw, |
1486 | struct ieee80211_vif *vif); | 1543 | struct ieee80211_vif *vif); |
@@ -1823,24 +1880,38 @@ struct ieee80211_sta *ieee80211_find_sta(struct ieee80211_hw *hw, | |||
1823 | 1880 | ||
1824 | 1881 | ||
1825 | /* Rate control API */ | 1882 | /* Rate control API */ |
1883 | |||
1826 | /** | 1884 | /** |
1827 | * struct rate_selection - rate information for/from rate control algorithms | 1885 | * struct ieee80211_tx_rate_control - rate control information for/from RC algo |
1828 | * | 1886 | * |
1829 | * @rate_idx: selected transmission rate index | 1887 | * @hw: The hardware the algorithm is invoked for. |
1830 | * @nonerp_idx: Non-ERP rate to use instead if ERP cannot be used | 1888 | * @sband: The band this frame is being transmitted on. |
1831 | * @probe_idx: rate for probing (or -1) | 1889 | * @bss_conf: the current BSS configuration |
1832 | * @max_rate_idx: maximum rate index that can be used, this is | 1890 | * @reported_rate: The rate control algorithm can fill this in to indicate |
1833 | * input to the algorithm and will be enforced | 1891 | * which rate should be reported to userspace as the current rate and |
1834 | */ | 1892 | * used for rate calculations in the mesh network. |
1835 | struct rate_selection { | 1893 | * @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; | 1894 | * RTS threshold |
1895 | * @short_preamble: whether mac80211 will request short-preamble transmission | ||
1896 | * if the selected rate supports it | ||
1897 | * @max_rate_idx: user-requested maximum rate (not MCS for now) | ||
1898 | * @skb: the skb that will be transmitted, the control information in it needs | ||
1899 | * to be filled in | ||
1900 | */ | ||
1901 | struct ieee80211_tx_rate_control { | ||
1902 | struct ieee80211_hw *hw; | ||
1903 | struct ieee80211_supported_band *sband; | ||
1904 | struct ieee80211_bss_conf *bss_conf; | ||
1905 | struct sk_buff *skb; | ||
1906 | struct ieee80211_tx_rate reported_rate; | ||
1907 | bool rts, short_preamble; | ||
1908 | u8 max_rate_idx; | ||
1837 | }; | 1909 | }; |
1838 | 1910 | ||
1839 | struct rate_control_ops { | 1911 | struct rate_control_ops { |
1840 | struct module *module; | 1912 | struct module *module; |
1841 | const char *name; | 1913 | const char *name; |
1842 | void *(*alloc)(struct ieee80211_hw *hw, struct dentry *debugfsdir); | 1914 | void *(*alloc)(struct ieee80211_hw *hw, struct dentry *debugfsdir); |
1843 | void (*clear)(void *priv); | ||
1844 | void (*free)(void *priv); | 1915 | void (*free)(void *priv); |
1845 | 1916 | ||
1846 | void *(*alloc_sta)(void *priv, struct ieee80211_sta *sta, gfp_t gfp); | 1917 | void *(*alloc_sta)(void *priv, struct ieee80211_sta *sta, gfp_t gfp); |
@@ -1852,10 +1923,8 @@ struct rate_control_ops { | |||
1852 | void (*tx_status)(void *priv, struct ieee80211_supported_band *sband, | 1923 | void (*tx_status)(void *priv, struct ieee80211_supported_band *sband, |
1853 | struct ieee80211_sta *sta, void *priv_sta, | 1924 | struct ieee80211_sta *sta, void *priv_sta, |
1854 | struct sk_buff *skb); | 1925 | struct sk_buff *skb); |
1855 | void (*get_rate)(void *priv, struct ieee80211_supported_band *sband, | 1926 | void (*get_rate)(void *priv, struct ieee80211_sta *sta, void *priv_sta, |
1856 | struct ieee80211_sta *sta, void *priv_sta, | 1927 | struct ieee80211_tx_rate_control *txrc); |
1857 | struct sk_buff *skb, | ||
1858 | struct rate_selection *sel); | ||
1859 | 1928 | ||
1860 | void (*add_sta_debugfs)(void *priv, void *priv_sta, | 1929 | void (*add_sta_debugfs)(void *priv, void *priv_sta, |
1861 | struct dentry *dir); | 1930 | struct dentry *dir); |
diff --git a/include/net/ndisc.h b/include/net/ndisc.h index 11dd0137c6a5..ce532f2222ce 100644 --- a/include/net/ndisc.h +++ b/include/net/ndisc.h | |||
@@ -108,6 +108,20 @@ extern void ndisc_send_redirect(struct sk_buff *skb, | |||
108 | 108 | ||
109 | extern int ndisc_mc_map(struct in6_addr *addr, char *buf, struct net_device *dev, int dir); | 109 | extern int ndisc_mc_map(struct in6_addr *addr, char *buf, struct net_device *dev, int dir); |
110 | 110 | ||
111 | extern struct sk_buff *ndisc_build_skb(struct net_device *dev, | ||
112 | const struct in6_addr *daddr, | ||
113 | const struct in6_addr *saddr, | ||
114 | struct icmp6hdr *icmp6h, | ||
115 | const struct in6_addr *target, | ||
116 | int llinfo); | ||
117 | |||
118 | extern void ndisc_send_skb(struct sk_buff *skb, | ||
119 | struct net_device *dev, | ||
120 | struct neighbour *neigh, | ||
121 | const struct in6_addr *daddr, | ||
122 | const struct in6_addr *saddr, | ||
123 | struct icmp6hdr *icmp6h); | ||
124 | |||
111 | 125 | ||
112 | 126 | ||
113 | /* | 127 | /* |
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 | |||
112 | static inline void nf_ct_dump_tuple_ip(const struct nf_conntrack_tuple *t) | 112 | static 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 | ||
122 | static inline void nf_ct_dump_tuple_ipv6(const struct nf_conntrack_tuple *t) | 122 | static 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, | |||
233 | extern struct nlattr * nla_find(struct nlattr *head, int len, int attrtype); | 233 | extern struct nlattr * nla_find(struct nlattr *head, int len, int attrtype); |
234 | extern size_t nla_strlcpy(char *dst, const struct nlattr *nla, | 234 | extern size_t nla_strlcpy(char *dst, const struct nlattr *nla, |
235 | size_t dstsize); | 235 | size_t dstsize); |
236 | extern int nla_memcpy(void *dest, struct nlattr *src, int count); | 236 | extern int nla_memcpy(void *dest, const struct nlattr *src, int count); |
237 | extern int nla_memcmp(const struct nlattr *nla, const void *data, | 237 | extern int nla_memcmp(const struct nlattr *nla, const void *data, |
238 | size_t size); | 238 | size_t size); |
239 | extern int nla_strcmp(const struct nlattr *nla, const char *str); | 239 | extern 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 | */ |
743 | static inline int nla_parse_nested(struct nlattr *tb[], int maxtype, | 743 | static 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 | */ |
878 | static inline u32 nla_get_u32(struct nlattr *nla) | 878 | static 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 | */ |
887 | static inline __be32 nla_get_be32(struct nlattr *nla) | 887 | static 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 | */ |
896 | static inline u16 nla_get_u16(struct nlattr *nla) | 896 | static 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 | */ |
905 | static inline __be16 nla_get_be16(struct nlattr *nla) | 905 | static 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 | */ |
914 | static inline __le16 nla_get_le16(struct nlattr *nla) | 914 | static 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 | */ |
923 | static inline u8 nla_get_u8(struct nlattr *nla) | 923 | static 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 | */ |
932 | static inline u64 nla_get_u64(struct nlattr *nla) | 932 | static 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 | */ |
945 | static inline int nla_get_flag(struct nlattr *nla) | 945 | static 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 | */ |
956 | static inline unsigned long nla_get_msecs(struct nlattr *nla) | 956 | static 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 | ||
436 | static 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 */ | ||
442 | static 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() */ | ||
456 | static 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 | |||
435 | static inline int __qdisc_requeue(struct sk_buff *skb, struct Qdisc *sch, | 470 | static 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 | ||
368 | static __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 | |||
377 | static __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 | |||
364 | static __inline__ void __sk_add_node(struct sock *sk, struct hlist_head *list) | 389 | static __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 | ||
400 | static __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 | |||
405 | static __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 | |||
375 | static __inline__ void __sk_del_bind_node(struct sock *sk) | 411 | static __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 | ||
53 | extern struct hlist_head udp_hash[UDP_HTABLE_SIZE]; | 53 | struct udp_hslot { |
54 | extern rwlock_t udp_hash_lock; | 54 | struct hlist_head head; |
55 | spinlock_t lock; | ||
56 | } __attribute__((aligned(2 * sizeof(long)))); | ||
57 | struct udp_table { | ||
58 | struct udp_hslot hash[UDP_HTABLE_SIZE]; | ||
59 | }; | ||
60 | extern struct udp_table udp_table; | ||
61 | extern 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 | ||
113 | static inline void udp_lib_unhash(struct sock *sk) | 120 | extern 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 | ||
123 | static inline void udp_lib_close(struct sock *sk, long timeout) | 122 | static 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, | |||
187 | struct udp_seq_afinfo { | 186 | struct 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 | ||
13 | extern struct proto udplite_prot; | 13 | extern struct proto udplite_prot; |
14 | extern struct hlist_head udplite_hash[UDP_HTABLE_SIZE]; | 14 | extern 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..412351560b76 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 | */ |
147 | struct ieee80211_ht_info { | 148 | struct 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 | /** |
@@ -262,9 +263,9 @@ static inline struct device *wiphy_dev(struct wiphy *wiphy) | |||
262 | /** | 263 | /** |
263 | * wiphy_name - get wiphy name | 264 | * wiphy_name - get wiphy name |
264 | */ | 265 | */ |
265 | static inline char *wiphy_name(struct wiphy *wiphy) | 266 | static inline const char *wiphy_name(struct wiphy *wiphy) |
266 | { | 267 | { |
267 | return wiphy->dev.bus_id; | 268 | return dev_name(&wiphy->dev); |
268 | } | 269 | } |
269 | 270 | ||
270 | /** | 271 | /** |
@@ -340,55 +341,36 @@ 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 | * ieee80211_get_response_rate - get basic rate for a given rate |
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 | * | 345 | * |
351 | * The Wireless subsystem can use this function to hint to the wireless core | 346 | * @sband: the band to look for rates in |
352 | * what it believes should be the current regulatory domain by | 347 | * @basic_rates: bitmap of basic rates |
353 | * giving it an ISO/IEC 3166 alpha2 country code it knows its regulatory | 348 | * @bitrate: the bitrate for which to find the basic rate |
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 | * | 349 | * |
350 | * This function returns the basic rate corresponding to a given | ||
351 | * bitrate, that is the next lower bitrate contained in the basic | ||
352 | * rate map, which is, for this function, given as a bitmap of | ||
353 | * indices of rates in the band's bitrate table. | ||
366 | */ | 354 | */ |
367 | extern int __regulatory_hint(struct wiphy *wiphy, enum reg_set_by set_by, | 355 | struct ieee80211_rate * |
368 | const char *alpha2, struct ieee80211_regdomain *rd); | 356 | ieee80211_get_response_rate(struct ieee80211_supported_band *sband, |
357 | u64 basic_rates, int bitrate); | ||
358 | |||
369 | /** | 359 | /** |
370 | * regulatory_hint - driver hint to the wireless core a regulatory domain | 360 | * regulatory_hint - driver hint to the wireless core a regulatory domain |
371 | * @wiphy: the driver's very own &struct wiphy | 361 | * @wiphy: the wireless device giving the hint (used only for reporting |
362 | * conflicts) | ||
372 | * @alpha2: the ISO/IEC 3166 alpha2 the driver claims its regulatory domain | 363 | * @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 | 364 | * 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 | 365 | * set this to NULL you should still set rd->alpha2 to some accepted |
375 | * alpha2. | 366 | * 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 | * | 367 | * |
379 | * Wireless drivers can use this function to hint to the wireless core | 368 | * Wireless drivers can use this function to hint to the wireless core |
380 | * what it believes should be the current regulatory domain by | 369 | * what it believes should be the current regulatory domain by |
381 | * giving it an ISO/IEC 3166 alpha2 country code it knows its regulatory | 370 | * 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. | 371 | * 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 | 372 | * If the driver provides an ISO/IEC 3166 alpha2 userspace will be queried |
384 | * for a regulatory domain structure for the respective country. If | 373 | * 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 | */ | 374 | */ |
392 | extern int regulatory_hint(struct wiphy *wiphy, | 375 | extern void regulatory_hint(struct wiphy *wiphy, const char *alpha2); |
393 | const char *alpha2, struct ieee80211_regdomain *rd); | ||
394 | #endif /* __NET_WIRELESS_H */ | 376 | #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 | ||
468 | struct xfrm_policy | 468 | struct 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 | ||
885 | static inline void xfrm_dst_destroy(struct xfrm_dst *xdst) | 885 | static 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 | ||
898 | extern void xfrm_dst_ifdown(struct dst_entry *dst, struct net_device *dev); | 899 | extern 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 | ||
1539 | static inline struct xfrm_state *xfrm_input_state(struct sk_buff *skb) | 1541 | static 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 */ |