aboutsummaryrefslogtreecommitdiffstats
path: root/include/net
diff options
context:
space:
mode:
Diffstat (limited to 'include/net')
-rw-r--r--include/net/af_ieee802154.h (renamed from include/net/ieee802154/af_ieee802154.h)0
-rw-r--r--include/net/cfg80211.h544
-rw-r--r--include/net/genetlink.h66
-rw-r--r--include/net/ieee802154.h (renamed from include/net/ieee802154/mac_def.h)4
-rw-r--r--include/net/ieee802154/nl802154.h41
-rw-r--r--include/net/ieee802154_netdev.h (renamed from include/net/ieee802154/netdevice.h)0
-rw-r--r--include/net/ip6_fib.h6
-rw-r--r--include/net/ip_vs.h119
-rw-r--r--include/net/ipv6.h12
-rw-r--r--include/net/irda/ircomm_event.h2
-rw-r--r--include/net/irda/ircomm_tty_attach.h4
-rw-r--r--include/net/irda/irlap_event.h2
-rw-r--r--include/net/irda/irlmp_event.h4
-rw-r--r--include/net/iw_handler.h2
-rw-r--r--include/net/mac80211.h133
-rw-r--r--include/net/neighbour.h4
-rw-r--r--include/net/net_namespace.h26
-rw-r--r--include/net/netns/x_tables.h3
-rw-r--r--include/net/nl802154.h117
-rw-r--r--include/net/phonet/pn_dev.h2
-rw-r--r--include/net/pkt_sched.h3
-rw-r--r--include/net/sch_generic.h15
-rw-r--r--include/net/scm.h2
-rw-r--r--include/net/sctp/constants.h4
-rw-r--r--include/net/udp.h3
-rw-r--r--include/net/xfrm.h2
26 files changed, 842 insertions, 278 deletions
diff --git a/include/net/ieee802154/af_ieee802154.h b/include/net/af_ieee802154.h
index 0d78605fb1a6..0d78605fb1a6 100644
--- a/include/net/ieee802154/af_ieee802154.h
+++ b/include/net/af_ieee802154.h
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index d1892d66701a..64df51d9a89f 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -538,11 +538,11 @@ struct cfg80211_ssid {
538 * @ssids: SSIDs to scan for (active scan only) 538 * @ssids: SSIDs to scan for (active scan only)
539 * @n_ssids: number of SSIDs 539 * @n_ssids: number of SSIDs
540 * @channels: channels to scan on. 540 * @channels: channels to scan on.
541 * @n_channels: number of channels for each band 541 * @n_channels: total number of channels to scan
542 * @ie: optional information element(s) to add into Probe Request or %NULL 542 * @ie: optional information element(s) to add into Probe Request or %NULL
543 * @ie_len: length of ie in octets 543 * @ie_len: length of ie in octets
544 * @wiphy: the wiphy this was for 544 * @wiphy: the wiphy this was for
545 * @ifidx: the interface index 545 * @dev: the interface
546 */ 546 */
547struct cfg80211_scan_request { 547struct cfg80211_scan_request {
548 struct cfg80211_ssid *ssids; 548 struct cfg80211_ssid *ssids;
@@ -554,7 +554,8 @@ struct cfg80211_scan_request {
554 554
555 /* internal */ 555 /* internal */
556 struct wiphy *wiphy; 556 struct wiphy *wiphy;
557 int ifidx; 557 struct net_device *dev;
558 bool aborted;
558}; 559};
559 560
560/** 561/**
@@ -584,7 +585,6 @@ enum cfg80211_signal_type {
584 * is no guarantee that these are well-formed!) 585 * is no guarantee that these are well-formed!)
585 * @len_information_elements: total length of the information elements 586 * @len_information_elements: total length of the information elements
586 * @signal: signal strength value (type depends on the wiphy's signal_type) 587 * @signal: signal strength value (type depends on the wiphy's signal_type)
587 * @hold: BSS should not expire
588 * @free_priv: function pointer to free private data 588 * @free_priv: function pointer to free private data
589 * @priv: private area for driver use, has at least wiphy->bss_priv_size bytes 589 * @priv: private area for driver use, has at least wiphy->bss_priv_size bytes
590 */ 590 */
@@ -605,37 +605,59 @@ struct cfg80211_bss {
605}; 605};
606 606
607/** 607/**
608 * ieee80211_bss_get_ie - find IE with given ID
609 * @bss: the bss to search
610 * @ie: the IE ID
611 * Returns %NULL if not found.
612 */
613const u8 *ieee80211_bss_get_ie(struct cfg80211_bss *bss, u8 ie);
614
615
616/**
617 * struct cfg80211_crypto_settings - Crypto settings
618 * @wpa_versions: indicates which, if any, WPA versions are enabled
619 * (from enum nl80211_wpa_versions)
620 * @cipher_group: group key cipher suite (or 0 if unset)
621 * @n_ciphers_pairwise: number of AP supported unicast ciphers
622 * @ciphers_pairwise: unicast key cipher suites
623 * @n_akm_suites: number of AKM suites
624 * @akm_suites: AKM suites
625 * @control_port: Whether user space controls IEEE 802.1X port, i.e.,
626 * sets/clears %NL80211_STA_FLAG_AUTHORIZED. If true, the driver is
627 * required to assume that the port is unauthorized until authorized by
628 * user space. Otherwise, port is marked authorized by default.
629 */
630struct cfg80211_crypto_settings {
631 u32 wpa_versions;
632 u32 cipher_group;
633 int n_ciphers_pairwise;
634 u32 ciphers_pairwise[NL80211_MAX_NR_CIPHER_SUITES];
635 int n_akm_suites;
636 u32 akm_suites[NL80211_MAX_NR_AKM_SUITES];
637 bool control_port;
638};
639
640/**
608 * struct cfg80211_auth_request - Authentication request data 641 * struct cfg80211_auth_request - Authentication request data
609 * 642 *
610 * This structure provides information needed to complete IEEE 802.11 643 * This structure provides information needed to complete IEEE 802.11
611 * authentication. 644 * authentication.
612 * NOTE: This structure will likely change when more code from mac80211 is 645 *
613 * moved into cfg80211 so that non-mac80211 drivers can benefit from it, too. 646 * @bss: The BSS to authenticate with.
614 * Before using this in a driver that does not use mac80211, it would be better
615 * to check the status of that work and better yet, volunteer to work on it.
616 *
617 * @chan: The channel to use or %NULL if not specified (auto-select based on
618 * scan results)
619 * @peer_addr: The address of the peer STA (AP BSSID in infrastructure case);
620 * this field is required to be present; if the driver wants to help with
621 * BSS selection, it should use (yet to be added) MLME event to allow user
622 * space SME to be notified of roaming candidate, so that the SME can then
623 * use the authentication request with the recommended BSSID and whatever
624 * other data may be needed for authentication/association
625 * @ssid: SSID or %NULL if not yet available
626 * @ssid_len: Length of ssid in octets
627 * @auth_type: Authentication type (algorithm) 647 * @auth_type: Authentication type (algorithm)
628 * @ie: Extra IEs to add to Authentication frame or %NULL 648 * @ie: Extra IEs to add to Authentication frame or %NULL
629 * @ie_len: Length of ie buffer in octets 649 * @ie_len: Length of ie buffer in octets
650 * @key_len: length of WEP key for shared key authentication
651 * @key_idx: index of WEP key for shared key authentication
652 * @key: WEP key for shared key authentication
630 */ 653 */
631struct cfg80211_auth_request { 654struct cfg80211_auth_request {
632 struct ieee80211_channel *chan; 655 struct cfg80211_bss *bss;
633 u8 *peer_addr;
634 const u8 *ssid;
635 size_t ssid_len;
636 enum nl80211_auth_type auth_type;
637 const u8 *ie; 656 const u8 *ie;
638 size_t ie_len; 657 size_t ie_len;
658 enum nl80211_auth_type auth_type;
659 const u8 *key;
660 u8 key_len, key_idx;
639}; 661};
640 662
641/** 663/**
@@ -643,35 +665,19 @@ struct cfg80211_auth_request {
643 * 665 *
644 * This structure provides information needed to complete IEEE 802.11 666 * This structure provides information needed to complete IEEE 802.11
645 * (re)association. 667 * (re)association.
646 * NOTE: This structure will likely change when more code from mac80211 is 668 * @bss: The BSS to associate with.
647 * moved into cfg80211 so that non-mac80211 drivers can benefit from it, too.
648 * Before using this in a driver that does not use mac80211, it would be better
649 * to check the status of that work and better yet, volunteer to work on it.
650 *
651 * @chan: The channel to use or %NULL if not specified (auto-select based on
652 * scan results)
653 * @peer_addr: The address of the peer STA (AP BSSID); this field is required
654 * to be present and the STA must be in State 2 (authenticated) with the
655 * peer STA
656 * @ssid: SSID
657 * @ssid_len: Length of ssid in octets
658 * @ie: Extra IEs to add to (Re)Association Request frame or %NULL 669 * @ie: Extra IEs to add to (Re)Association Request frame or %NULL
659 * @ie_len: Length of ie buffer in octets 670 * @ie_len: Length of ie buffer in octets
660 * @use_mfp: Use management frame protection (IEEE 802.11w) in this association 671 * @use_mfp: Use management frame protection (IEEE 802.11w) in this association
661 * @control_port: Whether user space controls IEEE 802.1X port, i.e., 672 * @crypto: crypto settings
662 * sets/clears %NL80211_STA_FLAG_AUTHORIZED. If true, the driver is 673 * @prev_bssid: previous BSSID, if not %NULL use reassociate frame
663 * required to assume that the port is unauthorized until authorized by
664 * user space. Otherwise, port is marked authorized by default.
665 */ 674 */
666struct cfg80211_assoc_request { 675struct cfg80211_assoc_request {
667 struct ieee80211_channel *chan; 676 struct cfg80211_bss *bss;
668 u8 *peer_addr; 677 const u8 *ie, *prev_bssid;
669 const u8 *ssid;
670 size_t ssid_len;
671 const u8 *ie;
672 size_t ie_len; 678 size_t ie_len;
679 struct cfg80211_crypto_settings crypto;
673 bool use_mfp; 680 bool use_mfp;
674 bool control_port;
675}; 681};
676 682
677/** 683/**
@@ -680,16 +686,16 @@ struct cfg80211_assoc_request {
680 * This structure provides information needed to complete IEEE 802.11 686 * This structure provides information needed to complete IEEE 802.11
681 * deauthentication. 687 * deauthentication.
682 * 688 *
683 * @peer_addr: The address of the peer STA (AP BSSID); this field is required 689 * @bss: the BSS to deauthenticate from
684 * to be present and the STA must be authenticated with the peer STA
685 * @ie: Extra IEs to add to Deauthentication frame or %NULL 690 * @ie: Extra IEs to add to Deauthentication frame or %NULL
686 * @ie_len: Length of ie buffer in octets 691 * @ie_len: Length of ie buffer in octets
692 * @reason_code: The reason code for the deauthentication
687 */ 693 */
688struct cfg80211_deauth_request { 694struct cfg80211_deauth_request {
689 u8 *peer_addr; 695 struct cfg80211_bss *bss;
690 u16 reason_code;
691 const u8 *ie; 696 const u8 *ie;
692 size_t ie_len; 697 size_t ie_len;
698 u16 reason_code;
693}; 699};
694 700
695/** 701/**
@@ -698,16 +704,16 @@ struct cfg80211_deauth_request {
698 * This structure provides information needed to complete IEEE 802.11 704 * This structure provides information needed to complete IEEE 802.11
699 * disassocation. 705 * disassocation.
700 * 706 *
701 * @peer_addr: The address of the peer STA (AP BSSID); this field is required 707 * @bss: the BSS to disassociate from
702 * to be present and the STA must be associated with the peer STA
703 * @ie: Extra IEs to add to Disassociation frame or %NULL 708 * @ie: Extra IEs to add to Disassociation frame or %NULL
704 * @ie_len: Length of ie buffer in octets 709 * @ie_len: Length of ie buffer in octets
710 * @reason_code: The reason code for the disassociation
705 */ 711 */
706struct cfg80211_disassoc_request { 712struct cfg80211_disassoc_request {
707 u8 *peer_addr; 713 struct cfg80211_bss *bss;
708 u16 reason_code;
709 const u8 *ie; 714 const u8 *ie;
710 size_t ie_len; 715 size_t ie_len;
716 u16 reason_code;
711}; 717};
712 718
713/** 719/**
@@ -726,6 +732,8 @@ struct cfg80211_disassoc_request {
726 * @ie: information element(s) to include in the beacon 732 * @ie: information element(s) to include in the beacon
727 * @ie_len: length of that 733 * @ie_len: length of that
728 * @beacon_interval: beacon interval to use 734 * @beacon_interval: beacon interval to use
735 * @privacy: this is a protected network, keys will be configured
736 * after joining
729 */ 737 */
730struct cfg80211_ibss_params { 738struct cfg80211_ibss_params {
731 u8 *ssid; 739 u8 *ssid;
@@ -735,6 +743,42 @@ struct cfg80211_ibss_params {
735 u8 ssid_len, ie_len; 743 u8 ssid_len, ie_len;
736 u16 beacon_interval; 744 u16 beacon_interval;
737 bool channel_fixed; 745 bool channel_fixed;
746 bool privacy;
747};
748
749/**
750 * struct cfg80211_connect_params - Connection parameters
751 *
752 * This structure provides information needed to complete IEEE 802.11
753 * authentication and association.
754 *
755 * @channel: The channel to use or %NULL if not specified (auto-select based
756 * on scan results)
757 * @bssid: The AP BSSID or %NULL if not specified (auto-select based on scan
758 * results)
759 * @ssid: SSID
760 * @ssid_len: Length of ssid in octets
761 * @auth_type: Authentication type (algorithm)
762 * @assoc_ie: IEs for association request
763 * @assoc_ie_len: Length of assoc_ie in octets
764 * @privacy: indicates whether privacy-enabled APs should be used
765 * @crypto: crypto settings
766 * @key_len: length of WEP key for shared key authentication
767 * @key_idx: index of WEP key for shared key authentication
768 * @key: WEP key for shared key authentication
769 */
770struct cfg80211_connect_params {
771 struct ieee80211_channel *channel;
772 u8 *bssid;
773 u8 *ssid;
774 size_t ssid_len;
775 enum nl80211_auth_type auth_type;
776 u8 *ie;
777 size_t ie_len;
778 bool privacy;
779 struct cfg80211_crypto_settings crypto;
780 const u8 *key;
781 u8 key_len, key_idx;
738}; 782};
739 783
740/** 784/**
@@ -764,6 +808,26 @@ enum tx_power_setting {
764 TX_POWER_FIXED, 808 TX_POWER_FIXED,
765}; 809};
766 810
811/*
812 * cfg80211_bitrate_mask - masks for bitrate control
813 */
814struct cfg80211_bitrate_mask {
815/*
816 * As discussed in Berlin, this struct really
817 * should look like this:
818
819 struct {
820 u32 legacy;
821 u8 mcs[IEEE80211_HT_MCS_MASK_LEN];
822 } control[IEEE80211_NUM_BANDS];
823
824 * Since we can always fix in-kernel users, let's keep
825 * it simpler for now:
826 */
827 u32 fixed; /* fixed bitrate, 0 == not fixed */
828 u32 maxrate; /* in kbps, 0 == no limit */
829};
830
767/** 831/**
768 * struct cfg80211_ops - backend description for wireless configuration 832 * struct cfg80211_ops - backend description for wireless configuration
769 * 833 *
@@ -781,7 +845,8 @@ enum tx_power_setting {
781 * @resume: wiphy device needs to be resumed 845 * @resume: wiphy device needs to be resumed
782 * 846 *
783 * @add_virtual_intf: create a new virtual interface with the given name, 847 * @add_virtual_intf: create a new virtual interface with the given name,
784 * must set the struct wireless_dev's iftype. 848 * must set the struct wireless_dev's iftype. Beware: You must create
849 * the new netdev in the wiphy's network namespace!
785 * 850 *
786 * @del_virtual_intf: remove the virtual interface determined by ifindex. 851 * @del_virtual_intf: remove the virtual interface determined by ifindex.
787 * 852 *
@@ -841,6 +906,12 @@ enum tx_power_setting {
841 * @deauth: Request to deauthenticate from the specified peer 906 * @deauth: Request to deauthenticate from the specified peer
842 * @disassoc: Request to disassociate from the specified peer 907 * @disassoc: Request to disassociate from the specified peer
843 * 908 *
909 * @connect: Connect to the ESS with the specified parameters. When connected,
910 * call cfg80211_connect_result() with status code %WLAN_STATUS_SUCCESS.
911 * If the connection fails for some reason, call cfg80211_connect_result()
912 * with the status from the AP.
913 * @disconnect: Disconnect from the BSS/ESS.
914 *
844 * @join_ibss: Join the specified IBSS (or create if necessary). Once done, call 915 * @join_ibss: Join the specified IBSS (or create if necessary). Once done, call
845 * cfg80211_ibss_joined(), also call that function when changing BSSID due 916 * cfg80211_ibss_joined(), also call that function when changing BSSID due
846 * to a merge. 917 * to a merge.
@@ -857,6 +928,8 @@ enum tx_power_setting {
857 * 928 *
858 * @rfkill_poll: polls the hw rfkill line, use cfg80211 reporting 929 * @rfkill_poll: polls the hw rfkill line, use cfg80211 reporting
859 * functions to adjust rfkill hw state 930 * functions to adjust rfkill hw state
931 *
932 * @testmode_cmd: run a test mode command
860 */ 933 */
861struct cfg80211_ops { 934struct cfg80211_ops {
862 int (*suspend)(struct wiphy *wiphy); 935 int (*suspend)(struct wiphy *wiphy);
@@ -865,8 +938,9 @@ struct cfg80211_ops {
865 int (*add_virtual_intf)(struct wiphy *wiphy, char *name, 938 int (*add_virtual_intf)(struct wiphy *wiphy, char *name,
866 enum nl80211_iftype type, u32 *flags, 939 enum nl80211_iftype type, u32 *flags,
867 struct vif_params *params); 940 struct vif_params *params);
868 int (*del_virtual_intf)(struct wiphy *wiphy, int ifindex); 941 int (*del_virtual_intf)(struct wiphy *wiphy, struct net_device *dev);
869 int (*change_virtual_intf)(struct wiphy *wiphy, int ifindex, 942 int (*change_virtual_intf)(struct wiphy *wiphy,
943 struct net_device *dev,
870 enum nl80211_iftype type, u32 *flags, 944 enum nl80211_iftype type, u32 *flags,
871 struct vif_params *params); 945 struct vif_params *params);
872 946
@@ -939,9 +1013,16 @@ struct cfg80211_ops {
939 int (*assoc)(struct wiphy *wiphy, struct net_device *dev, 1013 int (*assoc)(struct wiphy *wiphy, struct net_device *dev,
940 struct cfg80211_assoc_request *req); 1014 struct cfg80211_assoc_request *req);
941 int (*deauth)(struct wiphy *wiphy, struct net_device *dev, 1015 int (*deauth)(struct wiphy *wiphy, struct net_device *dev,
942 struct cfg80211_deauth_request *req); 1016 struct cfg80211_deauth_request *req,
1017 void *cookie);
943 int (*disassoc)(struct wiphy *wiphy, struct net_device *dev, 1018 int (*disassoc)(struct wiphy *wiphy, struct net_device *dev,
944 struct cfg80211_disassoc_request *req); 1019 struct cfg80211_disassoc_request *req,
1020 void *cookie);
1021
1022 int (*connect)(struct wiphy *wiphy, struct net_device *dev,
1023 struct cfg80211_connect_params *sme);
1024 int (*disconnect)(struct wiphy *wiphy, struct net_device *dev,
1025 u16 reason_code);
945 1026
946 int (*join_ibss)(struct wiphy *wiphy, struct net_device *dev, 1027 int (*join_ibss)(struct wiphy *wiphy, struct net_device *dev,
947 struct cfg80211_ibss_params *params); 1028 struct cfg80211_ibss_params *params);
@@ -953,7 +1034,23 @@ struct cfg80211_ops {
953 enum tx_power_setting type, int dbm); 1034 enum tx_power_setting type, int dbm);
954 int (*get_tx_power)(struct wiphy *wiphy, int *dbm); 1035 int (*get_tx_power)(struct wiphy *wiphy, int *dbm);
955 1036
1037 int (*set_wds_peer)(struct wiphy *wiphy, struct net_device *dev,
1038 u8 *addr);
1039
956 void (*rfkill_poll)(struct wiphy *wiphy); 1040 void (*rfkill_poll)(struct wiphy *wiphy);
1041
1042#ifdef CONFIG_NL80211_TESTMODE
1043 int (*testmode_cmd)(struct wiphy *wiphy, void *data, int len);
1044#endif
1045
1046 int (*set_bitrate_mask)(struct wiphy *wiphy,
1047 struct net_device *dev,
1048 const u8 *peer,
1049 const struct cfg80211_bitrate_mask *mask);
1050
1051 /* some temporary stuff to finish wext */
1052 int (*set_power_mgmt)(struct wiphy *wiphy, struct net_device *dev,
1053 bool enabled, int timeout);
957}; 1054};
958 1055
959/* 1056/*
@@ -996,6 +1093,9 @@ struct cfg80211_ops {
996 * @frag_threshold: Fragmentation threshold (dot11FragmentationThreshold); 1093 * @frag_threshold: Fragmentation threshold (dot11FragmentationThreshold);
997 * -1 = fragmentation disabled, only odd values >= 256 used 1094 * -1 = fragmentation disabled, only odd values >= 256 used
998 * @rts_threshold: RTS threshold (dot11RTSThreshold); -1 = RTS/CTS disabled 1095 * @rts_threshold: RTS threshold (dot11RTSThreshold); -1 = RTS/CTS disabled
1096 * @net: the network namespace this wiphy currently lives in
1097 * @netnsok: if set to false, do not allow changing the netns of this
1098 * wiphy at all
999 */ 1099 */
1000struct wiphy { 1100struct wiphy {
1001 /* assign these fields before you register the wiphy */ 1101 /* assign these fields before you register the wiphy */
@@ -1010,6 +1110,8 @@ struct wiphy {
1010 bool strict_regulatory; 1110 bool strict_regulatory;
1011 bool disable_beacon_hints; 1111 bool disable_beacon_hints;
1012 1112
1113 bool netnsok;
1114
1013 enum cfg80211_signal_type signal_type; 1115 enum cfg80211_signal_type signal_type;
1014 1116
1015 int bss_priv_size; 1117 int bss_priv_size;
@@ -1048,9 +1150,35 @@ struct wiphy {
1048 /* dir in debugfs: ieee80211/<wiphyname> */ 1150 /* dir in debugfs: ieee80211/<wiphyname> */
1049 struct dentry *debugfsdir; 1151 struct dentry *debugfsdir;
1050 1152
1153#ifdef CONFIG_NET_NS
1154 /* the network namespace this phy lives in currently */
1155 struct net *_net;
1156#endif
1157
1051 char priv[0] __attribute__((__aligned__(NETDEV_ALIGN))); 1158 char priv[0] __attribute__((__aligned__(NETDEV_ALIGN)));
1052}; 1159};
1053 1160
1161#ifdef CONFIG_NET_NS
1162static inline struct net *wiphy_net(struct wiphy *wiphy)
1163{
1164 return wiphy->_net;
1165}
1166
1167static inline void wiphy_net_set(struct wiphy *wiphy, struct net *net)
1168{
1169 wiphy->_net = net;
1170}
1171#else
1172static inline struct net *wiphy_net(struct wiphy *wiphy)
1173{
1174 return &init_net;
1175}
1176
1177static inline void wiphy_net_set(struct wiphy *wiphy, struct net *net)
1178{
1179}
1180#endif
1181
1054/** 1182/**
1055 * wiphy_priv - return priv from wiphy 1183 * wiphy_priv - return priv from wiphy
1056 * 1184 *
@@ -1063,6 +1191,17 @@ static inline void *wiphy_priv(struct wiphy *wiphy)
1063} 1191}
1064 1192
1065/** 1193/**
1194 * priv_to_wiphy - return the wiphy containing the priv
1195 *
1196 * @priv: a pointer previously returned by wiphy_priv
1197 */
1198static inline struct wiphy *priv_to_wiphy(void *priv)
1199{
1200 BUG_ON(!priv);
1201 return container_of(priv, struct wiphy, priv);
1202}
1203
1204/**
1066 * set_wiphy_dev - set device pointer for wiphy 1205 * set_wiphy_dev - set device pointer for wiphy
1067 * 1206 *
1068 * @wiphy: The wiphy whose device to bind 1207 * @wiphy: The wiphy whose device to bind
@@ -1134,6 +1273,13 @@ extern void wiphy_unregister(struct wiphy *wiphy);
1134 */ 1273 */
1135extern void wiphy_free(struct wiphy *wiphy); 1274extern void wiphy_free(struct wiphy *wiphy);
1136 1275
1276/* internal structs */
1277struct cfg80211_conn;
1278struct cfg80211_internal_bss;
1279struct cfg80211_cached_keys;
1280
1281#define MAX_AUTH_BSSES 4
1282
1137/** 1283/**
1138 * struct wireless_dev - wireless per-netdev state 1284 * struct wireless_dev - wireless per-netdev state
1139 * 1285 *
@@ -1157,22 +1303,43 @@ struct wireless_dev {
1157 struct wiphy *wiphy; 1303 struct wiphy *wiphy;
1158 enum nl80211_iftype iftype; 1304 enum nl80211_iftype iftype;
1159 1305
1160 /* private to the generic wireless code */ 1306 /* the remainder of this struct should be private to cfg80211 */
1161 struct list_head list; 1307 struct list_head list;
1162 struct net_device *netdev; 1308 struct net_device *netdev;
1163 1309
1164 /* currently used for IBSS - might be rearranged in the future */ 1310 struct mutex mtx;
1165 struct cfg80211_bss *current_bss; 1311
1166 u8 bssid[ETH_ALEN]; 1312 /* currently used for IBSS and SME - might be rearranged later */
1167 u8 ssid[IEEE80211_MAX_SSID_LEN]; 1313 u8 ssid[IEEE80211_MAX_SSID_LEN];
1168 u8 ssid_len; 1314 u8 ssid_len;
1315 enum {
1316 CFG80211_SME_IDLE,
1317 CFG80211_SME_CONNECTING,
1318 CFG80211_SME_CONNECTED,
1319 } sme_state;
1320 struct cfg80211_conn *conn;
1321 struct cfg80211_cached_keys *connect_keys;
1322
1323 struct list_head event_list;
1324 spinlock_t event_lock;
1325
1326 struct cfg80211_internal_bss *authtry_bsses[MAX_AUTH_BSSES];
1327 struct cfg80211_internal_bss *auth_bsses[MAX_AUTH_BSSES];
1328 struct cfg80211_internal_bss *current_bss; /* associated / joined */
1169 1329
1170#ifdef CONFIG_WIRELESS_EXT 1330#ifdef CONFIG_WIRELESS_EXT
1171 /* wext data */ 1331 /* wext data */
1172 struct { 1332 struct {
1173 struct cfg80211_ibss_params ibss; 1333 struct cfg80211_ibss_params ibss;
1334 struct cfg80211_connect_params connect;
1335 struct cfg80211_cached_keys *keys;
1336 u8 *ie;
1337 size_t ie_len;
1174 u8 bssid[ETH_ALEN]; 1338 u8 bssid[ETH_ALEN];
1339 u8 ssid[IEEE80211_MAX_SSID_LEN];
1175 s8 default_key, default_mgmt_key; 1340 s8 default_key, default_mgmt_key;
1341 bool ps;
1342 int ps_timeout;
1176 } wext; 1343 } wext;
1177#endif 1344#endif
1178}; 1345};
@@ -1352,20 +1519,6 @@ unsigned int cfg80211_classify8021d(struct sk_buff *skb);
1352extern int regulatory_hint(struct wiphy *wiphy, const char *alpha2); 1519extern int regulatory_hint(struct wiphy *wiphy, const char *alpha2);
1353 1520
1354/** 1521/**
1355 * regulatory_hint_11d - hints a country IE as a regulatory domain
1356 * @wiphy: the wireless device giving the hint (used only for reporting
1357 * conflicts)
1358 * @country_ie: pointer to the country IE
1359 * @country_ie_len: length of the country IE
1360 *
1361 * We will intersect the rd with the what CRDA tells us should apply
1362 * for the alpha2 this country IE belongs to, this prevents APs from
1363 * sending us incorrect or outdated information against a country.
1364 */
1365extern void regulatory_hint_11d(struct wiphy *wiphy,
1366 u8 *country_ie,
1367 u8 country_ie_len);
1368/**
1369 * wiphy_apply_custom_regulatory - apply a custom driver regulatory domain 1522 * wiphy_apply_custom_regulatory - apply a custom driver regulatory domain
1370 * @wiphy: the wireless device we want to process the regulatory domain on 1523 * @wiphy: the wireless device we want to process the regulatory domain on
1371 * @regd: the custom regulatory domain to use for this wiphy 1524 * @regd: the custom regulatory domain to use for this wiphy
@@ -1433,27 +1586,34 @@ int cfg80211_wext_siwmlme(struct net_device *dev,
1433int cfg80211_wext_giwrange(struct net_device *dev, 1586int cfg80211_wext_giwrange(struct net_device *dev,
1434 struct iw_request_info *info, 1587 struct iw_request_info *info,
1435 struct iw_point *data, char *extra); 1588 struct iw_point *data, char *extra);
1436int cfg80211_ibss_wext_siwfreq(struct net_device *dev, 1589int cfg80211_wext_siwgenie(struct net_device *dev,
1437 struct iw_request_info *info, 1590 struct iw_request_info *info,
1438 struct iw_freq *freq, char *extra); 1591 struct iw_point *data, char *extra);
1439int cfg80211_ibss_wext_giwfreq(struct net_device *dev, 1592int cfg80211_wext_siwauth(struct net_device *dev,
1440 struct iw_request_info *info, 1593 struct iw_request_info *info,
1441 struct iw_freq *freq, char *extra); 1594 struct iw_param *data, char *extra);
1442int cfg80211_ibss_wext_siwessid(struct net_device *dev, 1595int cfg80211_wext_giwauth(struct net_device *dev,
1443 struct iw_request_info *info, 1596 struct iw_request_info *info,
1444 struct iw_point *data, char *ssid); 1597 struct iw_param *data, char *extra);
1445int cfg80211_ibss_wext_giwessid(struct net_device *dev,
1446 struct iw_request_info *info,
1447 struct iw_point *data, char *ssid);
1448int cfg80211_ibss_wext_siwap(struct net_device *dev,
1449 struct iw_request_info *info,
1450 struct sockaddr *ap_addr, char *extra);
1451int cfg80211_ibss_wext_giwap(struct net_device *dev,
1452 struct iw_request_info *info,
1453 struct sockaddr *ap_addr, char *extra);
1454 1598
1455struct ieee80211_channel *cfg80211_wext_freq(struct wiphy *wiphy, 1599int cfg80211_wext_siwfreq(struct net_device *dev,
1456 struct iw_freq *freq); 1600 struct iw_request_info *info,
1601 struct iw_freq *freq, char *extra);
1602int cfg80211_wext_giwfreq(struct net_device *dev,
1603 struct iw_request_info *info,
1604 struct iw_freq *freq, char *extra);
1605int cfg80211_wext_siwessid(struct net_device *dev,
1606 struct iw_request_info *info,
1607 struct iw_point *data, char *ssid);
1608int cfg80211_wext_giwessid(struct net_device *dev,
1609 struct iw_request_info *info,
1610 struct iw_point *data, char *ssid);
1611int cfg80211_wext_siwrate(struct net_device *dev,
1612 struct iw_request_info *info,
1613 struct iw_param *rate, char *extra);
1614int cfg80211_wext_giwrate(struct net_device *dev,
1615 struct iw_request_info *info,
1616 struct iw_param *rate, char *extra);
1457 1617
1458int cfg80211_wext_siwrts(struct net_device *dev, 1618int cfg80211_wext_siwrts(struct net_device *dev,
1459 struct iw_request_info *info, 1619 struct iw_request_info *info,
@@ -1488,6 +1648,21 @@ int cfg80211_wext_siwtxpower(struct net_device *dev,
1488int cfg80211_wext_giwtxpower(struct net_device *dev, 1648int cfg80211_wext_giwtxpower(struct net_device *dev,
1489 struct iw_request_info *info, 1649 struct iw_request_info *info,
1490 union iwreq_data *data, char *keybuf); 1650 union iwreq_data *data, char *keybuf);
1651struct iw_statistics *cfg80211_wireless_stats(struct net_device *dev);
1652
1653int cfg80211_wext_siwpower(struct net_device *dev,
1654 struct iw_request_info *info,
1655 struct iw_param *wrq, char *extra);
1656int cfg80211_wext_giwpower(struct net_device *dev,
1657 struct iw_request_info *info,
1658 struct iw_param *wrq, char *extra);
1659
1660int cfg80211_wext_siwap(struct net_device *dev,
1661 struct iw_request_info *info,
1662 struct sockaddr *ap_addr, char *extra);
1663int cfg80211_wext_giwap(struct net_device *dev,
1664 struct iw_request_info *info,
1665 struct sockaddr *ap_addr, char *extra);
1491 1666
1492/* 1667/*
1493 * callbacks for asynchronous cfg80211 methods, notification 1668 * callbacks for asynchronous cfg80211 methods, notification
@@ -1569,7 +1744,7 @@ void cfg80211_unlink_bss(struct wiphy *wiphy, struct cfg80211_bss *bss);
1569 * This function is called whenever an authentication has been processed in 1744 * This function is called whenever an authentication has been processed in
1570 * station mode. The driver is required to call either this function or 1745 * station mode. The driver is required to call either this function or
1571 * cfg80211_send_auth_timeout() to indicate the result of cfg80211_ops::auth() 1746 * cfg80211_send_auth_timeout() to indicate the result of cfg80211_ops::auth()
1572 * call. 1747 * call. This function may sleep.
1573 */ 1748 */
1574void cfg80211_send_rx_auth(struct net_device *dev, const u8 *buf, size_t len); 1749void cfg80211_send_rx_auth(struct net_device *dev, const u8 *buf, size_t len);
1575 1750
@@ -1577,6 +1752,8 @@ void cfg80211_send_rx_auth(struct net_device *dev, const u8 *buf, size_t len);
1577 * cfg80211_send_auth_timeout - notification of timed out authentication 1752 * cfg80211_send_auth_timeout - notification of timed out authentication
1578 * @dev: network device 1753 * @dev: network device
1579 * @addr: The MAC address of the device with which the authentication timed out 1754 * @addr: The MAC address of the device with which the authentication timed out
1755 *
1756 * This function may sleep.
1580 */ 1757 */
1581void cfg80211_send_auth_timeout(struct net_device *dev, const u8 *addr); 1758void cfg80211_send_auth_timeout(struct net_device *dev, const u8 *addr);
1582 1759
@@ -1589,7 +1766,7 @@ void cfg80211_send_auth_timeout(struct net_device *dev, const u8 *addr);
1589 * This function is called whenever a (re)association response has been 1766 * This function is called whenever a (re)association response has been
1590 * processed in station mode. The driver is required to call either this 1767 * processed in station mode. The driver is required to call either this
1591 * function or cfg80211_send_assoc_timeout() to indicate the result of 1768 * function or cfg80211_send_assoc_timeout() to indicate the result of
1592 * cfg80211_ops::assoc() call. 1769 * cfg80211_ops::assoc() call. This function may sleep.
1593 */ 1770 */
1594void cfg80211_send_rx_assoc(struct net_device *dev, const u8 *buf, size_t len); 1771void cfg80211_send_rx_assoc(struct net_device *dev, const u8 *buf, size_t len);
1595 1772
@@ -1597,6 +1774,8 @@ void cfg80211_send_rx_assoc(struct net_device *dev, const u8 *buf, size_t len);
1597 * cfg80211_send_assoc_timeout - notification of timed out association 1774 * cfg80211_send_assoc_timeout - notification of timed out association
1598 * @dev: network device 1775 * @dev: network device
1599 * @addr: The MAC address of the device with which the association timed out 1776 * @addr: The MAC address of the device with which the association timed out
1777 *
1778 * This function may sleep.
1600 */ 1779 */
1601void cfg80211_send_assoc_timeout(struct net_device *dev, const u8 *addr); 1780void cfg80211_send_assoc_timeout(struct net_device *dev, const u8 *addr);
1602 1781
@@ -1605,41 +1784,30 @@ void cfg80211_send_assoc_timeout(struct net_device *dev, const u8 *addr);
1605 * @dev: network device 1784 * @dev: network device
1606 * @buf: deauthentication frame (header + body) 1785 * @buf: deauthentication frame (header + body)
1607 * @len: length of the frame data 1786 * @len: length of the frame data
1787 * @cookie: cookie from ->deauth if called within that callback,
1788 * %NULL otherwise
1608 * 1789 *
1609 * This function is called whenever deauthentication has been processed in 1790 * This function is called whenever deauthentication has been processed in
1610 * station mode. This includes both received deauthentication frames and 1791 * station mode. This includes both received deauthentication frames and
1611 * locally generated ones. 1792 * locally generated ones. This function may sleep.
1612 */ 1793 */
1613void cfg80211_send_deauth(struct net_device *dev, const u8 *buf, size_t len); 1794void cfg80211_send_deauth(struct net_device *dev, const u8 *buf, size_t len,
1795 void *cookie);
1614 1796
1615/** 1797/**
1616 * cfg80211_send_disassoc - notification of processed disassociation 1798 * cfg80211_send_disassoc - notification of processed disassociation
1617 * @dev: network device 1799 * @dev: network device
1618 * @buf: disassociation response frame (header + body) 1800 * @buf: disassociation response frame (header + body)
1619 * @len: length of the frame data 1801 * @len: length of the frame data
1802 * @cookie: cookie from ->disassoc if called within that callback,
1803 * %NULL otherwise
1620 * 1804 *
1621 * This function is called whenever disassociation has been processed in 1805 * This function is called whenever disassociation has been processed in
1622 * station mode. This includes both received disassociation frames and locally 1806 * station mode. This includes both received disassociation frames and locally
1623 * generated ones. 1807 * generated ones. This function may sleep.
1624 */
1625void cfg80211_send_disassoc(struct net_device *dev, const u8 *buf, size_t len);
1626
1627/**
1628 * cfg80211_hold_bss - exclude bss from expiration
1629 * @bss: bss which should not expire
1630 *
1631 * In a case when the BSS is not updated but it shouldn't expire this
1632 * function can be used to mark the BSS to be excluded from expiration.
1633 */ 1808 */
1634void cfg80211_hold_bss(struct cfg80211_bss *bss); 1809void cfg80211_send_disassoc(struct net_device *dev, const u8 *buf, size_t len,
1635 1810 void *cookie);
1636/**
1637 * cfg80211_unhold_bss - remove expiration exception from the BSS
1638 * @bss: bss which can expire again
1639 *
1640 * This function marks the BSS to be expirable again.
1641 */
1642void cfg80211_unhold_bss(struct cfg80211_bss *bss);
1643 1811
1644/** 1812/**
1645 * cfg80211_michael_mic_failure - notification of Michael MIC failure (TKIP) 1813 * cfg80211_michael_mic_failure - notification of Michael MIC failure (TKIP)
@@ -1648,6 +1816,7 @@ void cfg80211_unhold_bss(struct cfg80211_bss *bss);
1648 * @key_type: The key type that the received frame used 1816 * @key_type: The key type that the received frame used
1649 * @key_id: Key identifier (0..3) 1817 * @key_id: Key identifier (0..3)
1650 * @tsc: The TSC value of the frame that generated the MIC failure (6 octets) 1818 * @tsc: The TSC value of the frame that generated the MIC failure (6 octets)
1819 * @gfp: allocation flags
1651 * 1820 *
1652 * This function is called whenever the local MAC detects a MIC failure in a 1821 * This function is called whenever the local MAC detects a MIC failure in a
1653 * received frame. This matches with MLME-MICHAELMICFAILURE.indication() 1822 * received frame. This matches with MLME-MICHAELMICFAILURE.indication()
@@ -1655,7 +1824,7 @@ void cfg80211_unhold_bss(struct cfg80211_bss *bss);
1655 */ 1824 */
1656void cfg80211_michael_mic_failure(struct net_device *dev, const u8 *addr, 1825void cfg80211_michael_mic_failure(struct net_device *dev, const u8 *addr,
1657 enum nl80211_key_type key_type, int key_id, 1826 enum nl80211_key_type key_type, int key_id,
1658 const u8 *tsc); 1827 const u8 *tsc, gfp_t gfp);
1659 1828
1660/** 1829/**
1661 * cfg80211_ibss_joined - notify cfg80211 that device joined an IBSS 1830 * cfg80211_ibss_joined - notify cfg80211 that device joined an IBSS
@@ -1692,4 +1861,137 @@ void wiphy_rfkill_start_polling(struct wiphy *wiphy);
1692 */ 1861 */
1693void wiphy_rfkill_stop_polling(struct wiphy *wiphy); 1862void wiphy_rfkill_stop_polling(struct wiphy *wiphy);
1694 1863
1864#ifdef CONFIG_NL80211_TESTMODE
1865/**
1866 * cfg80211_testmode_alloc_reply_skb - allocate testmode reply
1867 * @wiphy: the wiphy
1868 * @approxlen: an upper bound of the length of the data that will
1869 * be put into the skb
1870 *
1871 * This function allocates and pre-fills an skb for a reply to
1872 * the testmode command. Since it is intended for a reply, calling
1873 * it outside of the @testmode_cmd operation is invalid.
1874 *
1875 * The returned skb (or %NULL if any errors happen) is pre-filled
1876 * with the wiphy index and set up in a way that any data that is
1877 * put into the skb (with skb_put(), nla_put() or similar) will end
1878 * up being within the %NL80211_ATTR_TESTDATA attribute, so all that
1879 * needs to be done with the skb is adding data for the corresponding
1880 * userspace tool which can then read that data out of the testdata
1881 * attribute. You must not modify the skb in any other way.
1882 *
1883 * When done, call cfg80211_testmode_reply() with the skb and return
1884 * its error code as the result of the @testmode_cmd operation.
1885 */
1886struct sk_buff *cfg80211_testmode_alloc_reply_skb(struct wiphy *wiphy,
1887 int approxlen);
1888
1889/**
1890 * cfg80211_testmode_reply - send the reply skb
1891 * @skb: The skb, must have been allocated with
1892 * cfg80211_testmode_alloc_reply_skb()
1893 *
1894 * Returns an error code or 0 on success, since calling this
1895 * function will usually be the last thing before returning
1896 * from the @testmode_cmd you should return the error code.
1897 * Note that this function consumes the skb regardless of the
1898 * return value.
1899 */
1900int cfg80211_testmode_reply(struct sk_buff *skb);
1901
1902/**
1903 * cfg80211_testmode_alloc_event_skb - allocate testmode event
1904 * @wiphy: the wiphy
1905 * @approxlen: an upper bound of the length of the data that will
1906 * be put into the skb
1907 * @gfp: allocation flags
1908 *
1909 * This function allocates and pre-fills an skb for an event on the
1910 * testmode multicast group.
1911 *
1912 * The returned skb (or %NULL if any errors happen) is set up in the
1913 * same way as with cfg80211_testmode_alloc_reply_skb() but prepared
1914 * for an event. As there, you should simply add data to it that will
1915 * then end up in the %NL80211_ATTR_TESTDATA attribute. Again, you must
1916 * not modify the skb in any other way.
1917 *
1918 * When done filling the skb, call cfg80211_testmode_event() with the
1919 * skb to send the event.
1920 */
1921struct sk_buff *cfg80211_testmode_alloc_event_skb(struct wiphy *wiphy,
1922 int approxlen, gfp_t gfp);
1923
1924/**
1925 * cfg80211_testmode_event - send the event
1926 * @skb: The skb, must have been allocated with
1927 * cfg80211_testmode_alloc_event_skb()
1928 * @gfp: allocation flags
1929 *
1930 * This function sends the given @skb, which must have been allocated
1931 * by cfg80211_testmode_alloc_event_skb(), as an event. It always
1932 * consumes it.
1933 */
1934void cfg80211_testmode_event(struct sk_buff *skb, gfp_t gfp);
1935
1936#define CFG80211_TESTMODE_CMD(cmd) .testmode_cmd = (cmd),
1937#else
1938#define CFG80211_TESTMODE_CMD(cmd)
1939#endif
1940
1941/**
1942 * cfg80211_connect_result - notify cfg80211 of connection result
1943 *
1944 * @dev: network device
1945 * @bssid: the BSSID of the AP
1946 * @req_ie: association request IEs (maybe be %NULL)
1947 * @req_ie_len: association request IEs length
1948 * @resp_ie: association response IEs (may be %NULL)
1949 * @resp_ie_len: assoc response IEs length
1950 * @status: status code, 0 for successful connection, use
1951 * %WLAN_STATUS_UNSPECIFIED_FAILURE if your device cannot give you
1952 * the real status code for failures.
1953 * @gfp: allocation flags
1954 *
1955 * It should be called by the underlying driver whenever connect() has
1956 * succeeded.
1957 */
1958void cfg80211_connect_result(struct net_device *dev, const u8 *bssid,
1959 const u8 *req_ie, size_t req_ie_len,
1960 const u8 *resp_ie, size_t resp_ie_len,
1961 u16 status, gfp_t gfp);
1962
1963/**
1964 * cfg80211_roamed - notify cfg80211 of roaming
1965 *
1966 * @dev: network device
1967 * @bssid: the BSSID of the new AP
1968 * @req_ie: association request IEs (maybe be %NULL)
1969 * @req_ie_len: association request IEs length
1970 * @resp_ie: association response IEs (may be %NULL)
1971 * @resp_ie_len: assoc response IEs length
1972 * @gfp: allocation flags
1973 *
1974 * It should be called by the underlying driver whenever it roamed
1975 * from one AP to another while connected.
1976 */
1977void cfg80211_roamed(struct net_device *dev, const u8 *bssid,
1978 const u8 *req_ie, size_t req_ie_len,
1979 const u8 *resp_ie, size_t resp_ie_len, gfp_t gfp);
1980
1981/**
1982 * cfg80211_disconnected - notify cfg80211 that connection was dropped
1983 *
1984 * @dev: network device
1985 * @ie: information elements of the deauth/disassoc frame (may be %NULL)
1986 * @ie_len: length of IEs
1987 * @reason: reason code for the disconnection, set it to 0 if unknown
1988 * @gfp: allocation flags
1989 *
1990 * After it calls this function, the driver should enter an idle state
1991 * and not try to connect to any AP any more.
1992 */
1993void cfg80211_disconnected(struct net_device *dev, u16 reason,
1994 u8 *ie, size_t ie_len, gfp_t gfp);
1995
1996
1695#endif /* __NET_CFG80211_H */ 1997#endif /* __NET_CFG80211_H */
diff --git a/include/net/genetlink.h b/include/net/genetlink.h
index 1b0e3ee4ddd8..2a1c06874c42 100644
--- a/include/net/genetlink.h
+++ b/include/net/genetlink.h
@@ -3,6 +3,7 @@
3 3
4#include <linux/genetlink.h> 4#include <linux/genetlink.h>
5#include <net/netlink.h> 5#include <net/netlink.h>
6#include <net/net_namespace.h>
6 7
7/** 8/**
8 * struct genl_multicast_group - generic netlink multicast group 9 * struct genl_multicast_group - generic netlink multicast group
@@ -27,6 +28,8 @@ struct genl_multicast_group
27 * @name: name of family 28 * @name: name of family
28 * @version: protocol version 29 * @version: protocol version
29 * @maxattr: maximum number of attributes supported 30 * @maxattr: maximum number of attributes supported
31 * @netnsok: set to true if the family can handle network
32 * namespaces and should be presented in all of them
30 * @attrbuf: buffer to store parsed attributes 33 * @attrbuf: buffer to store parsed attributes
31 * @ops_list: list of all assigned operations 34 * @ops_list: list of all assigned operations
32 * @family_list: family list 35 * @family_list: family list
@@ -39,6 +42,7 @@ struct genl_family
39 char name[GENL_NAMSIZ]; 42 char name[GENL_NAMSIZ];
40 unsigned int version; 43 unsigned int version;
41 unsigned int maxattr; 44 unsigned int maxattr;
45 bool netnsok;
42 struct nlattr ** attrbuf; /* private */ 46 struct nlattr ** attrbuf; /* private */
43 struct list_head ops_list; /* private */ 47 struct list_head ops_list; /* private */
44 struct list_head family_list; /* private */ 48 struct list_head family_list; /* private */
@@ -62,8 +66,32 @@ struct genl_info
62 struct genlmsghdr * genlhdr; 66 struct genlmsghdr * genlhdr;
63 void * userhdr; 67 void * userhdr;
64 struct nlattr ** attrs; 68 struct nlattr ** attrs;
69#ifdef CONFIG_NET_NS
70 struct net * _net;
71#endif
65}; 72};
66 73
74#ifdef CONFIG_NET_NS
75static inline struct net *genl_info_net(struct genl_info *info)
76{
77 return info->_net;
78}
79
80static inline void genl_info_net_set(struct genl_info *info, struct net *net)
81{
82 info->_net = net;
83}
84#else
85static inline struct net *genl_info_net(struct genl_info *info)
86{
87 return &init_net;
88}
89
90static inline void genl_info_net_set(struct genl_info *info, struct net *net)
91{
92}
93#endif
94
67/** 95/**
68 * struct genl_ops - generic netlink operations 96 * struct genl_ops - generic netlink operations
69 * @cmd: command identifier 97 * @cmd: command identifier
@@ -98,8 +126,6 @@ extern int genl_register_mc_group(struct genl_family *family,
98extern void genl_unregister_mc_group(struct genl_family *family, 126extern void genl_unregister_mc_group(struct genl_family *family,
99 struct genl_multicast_group *grp); 127 struct genl_multicast_group *grp);
100 128
101extern struct sock *genl_sock;
102
103/** 129/**
104 * genlmsg_put - Add generic netlink header to netlink message 130 * genlmsg_put - Add generic netlink header to netlink message
105 * @skb: socket buffer holding the message 131 * @skb: socket buffer holding the message
@@ -170,7 +196,21 @@ static inline void genlmsg_cancel(struct sk_buff *skb, void *hdr)
170} 196}
171 197
172/** 198/**
173 * genlmsg_multicast - multicast a netlink message 199 * genlmsg_multicast_netns - multicast a netlink message to a specific netns
200 * @net: the net namespace
201 * @skb: netlink message as socket buffer
202 * @pid: own netlink pid to avoid sending to yourself
203 * @group: multicast group id
204 * @flags: allocation flags
205 */
206static inline int genlmsg_multicast_netns(struct net *net, struct sk_buff *skb,
207 u32 pid, unsigned int group, gfp_t flags)
208{
209 return nlmsg_multicast(net->genl_sock, skb, pid, group, flags);
210}
211
212/**
213 * genlmsg_multicast - multicast a netlink message to the default netns
174 * @skb: netlink message as socket buffer 214 * @skb: netlink message as socket buffer
175 * @pid: own netlink pid to avoid sending to yourself 215 * @pid: own netlink pid to avoid sending to yourself
176 * @group: multicast group id 216 * @group: multicast group id
@@ -179,17 +219,29 @@ static inline void genlmsg_cancel(struct sk_buff *skb, void *hdr)
179static inline int genlmsg_multicast(struct sk_buff *skb, u32 pid, 219static inline int genlmsg_multicast(struct sk_buff *skb, u32 pid,
180 unsigned int group, gfp_t flags) 220 unsigned int group, gfp_t flags)
181{ 221{
182 return nlmsg_multicast(genl_sock, skb, pid, group, flags); 222 return genlmsg_multicast_netns(&init_net, skb, pid, group, flags);
183} 223}
184 224
185/** 225/**
226 * genlmsg_multicast_allns - multicast a netlink message to all net namespaces
227 * @skb: netlink message as socket buffer
228 * @pid: own netlink pid to avoid sending to yourself
229 * @group: multicast group id
230 * @flags: allocation flags
231 *
232 * This function must hold the RTNL or rcu_read_lock().
233 */
234int genlmsg_multicast_allns(struct sk_buff *skb, u32 pid,
235 unsigned int group, gfp_t flags);
236
237/**
186 * genlmsg_unicast - unicast a netlink message 238 * genlmsg_unicast - unicast a netlink message
187 * @skb: netlink message as socket buffer 239 * @skb: netlink message as socket buffer
188 * @pid: netlink pid of the destination socket 240 * @pid: netlink pid of the destination socket
189 */ 241 */
190static inline int genlmsg_unicast(struct sk_buff *skb, u32 pid) 242static inline int genlmsg_unicast(struct net *net, struct sk_buff *skb, u32 pid)
191{ 243{
192 return nlmsg_unicast(genl_sock, skb, pid); 244 return nlmsg_unicast(net->genl_sock, skb, pid);
193} 245}
194 246
195/** 247/**
@@ -199,7 +251,7 @@ static inline int genlmsg_unicast(struct sk_buff *skb, u32 pid)
199 */ 251 */
200static inline int genlmsg_reply(struct sk_buff *skb, struct genl_info *info) 252static inline int genlmsg_reply(struct sk_buff *skb, struct genl_info *info)
201{ 253{
202 return genlmsg_unicast(skb, info->snd_pid); 254 return genlmsg_unicast(genl_info_net(info), skb, info->snd_pid);
203} 255}
204 256
205/** 257/**
diff --git a/include/net/ieee802154/mac_def.h b/include/net/ieee802154.h
index 8cb684635650..d52685defb11 100644
--- a/include/net/ieee802154/mac_def.h
+++ b/include/net/ieee802154.h
@@ -23,8 +23,8 @@
23 * Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> 23 * Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
24 */ 24 */
25 25
26#ifndef IEEE802154_MAC_DEF_H 26#ifndef NET_IEEE802154_H
27#define IEEE802154_MAC_DEF_H 27#define NET_IEEE802154_H
28 28
29#define IEEE802154_FC_TYPE_BEACON 0x0 /* Frame is beacon */ 29#define IEEE802154_FC_TYPE_BEACON 0x0 /* Frame is beacon */
30#define IEEE802154_FC_TYPE_DATA 0x1 /* Frame is data */ 30#define IEEE802154_FC_TYPE_DATA 0x1 /* Frame is data */
diff --git a/include/net/ieee802154/nl802154.h b/include/net/ieee802154/nl802154.h
deleted file mode 100644
index 78efcdf52b59..000000000000
--- a/include/net/ieee802154/nl802154.h
+++ /dev/null
@@ -1,41 +0,0 @@
1/*
2 * nl802154.h
3 *
4 * Copyright (C) 2007, 2008, 2009 Siemens AG
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2
8 * as published by the Free Software Foundation.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License along
16 * with this program; if not, write to the Free Software Foundation, Inc.,
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 */
20
21#ifndef IEEE802154_NL_H
22#define IEEE802154_NL_H
23
24struct net_device;
25struct ieee802154_addr;
26
27int ieee802154_nl_assoc_indic(struct net_device *dev,
28 struct ieee802154_addr *addr, u8 cap);
29int ieee802154_nl_assoc_confirm(struct net_device *dev,
30 u16 short_addr, u8 status);
31int ieee802154_nl_disassoc_indic(struct net_device *dev,
32 struct ieee802154_addr *addr, u8 reason);
33int ieee802154_nl_disassoc_confirm(struct net_device *dev,
34 u8 status);
35int ieee802154_nl_scan_confirm(struct net_device *dev,
36 u8 status, u8 scan_type, u32 unscanned,
37 u8 *edl/*, struct list_head *pan_desc_list */);
38int ieee802154_nl_beacon_indic(struct net_device *dev, u16 panid,
39 u16 coord_addr);
40
41#endif
diff --git a/include/net/ieee802154/netdevice.h b/include/net/ieee802154_netdev.h
index e2506af3e7c8..e2506af3e7c8 100644
--- a/include/net/ieee802154/netdevice.h
+++ b/include/net/ieee802154_netdev.h
diff --git a/include/net/ip6_fib.h b/include/net/ip6_fib.h
index 7c5c0f79168a..15b492a9aa79 100644
--- a/include/net/ip6_fib.h
+++ b/include/net/ip6_fib.h
@@ -22,6 +22,12 @@
22#include <net/flow.h> 22#include <net/flow.h>
23#include <net/netlink.h> 23#include <net/netlink.h>
24 24
25#ifdef CONFIG_IPV6_MULTIPLE_TABLES
26#define FIB6_TABLE_HASHSZ 256
27#else
28#define FIB6_TABLE_HASHSZ 1
29#endif
30
25struct rt6_info; 31struct rt6_info;
26 32
27struct fib6_config 33struct fib6_config
diff --git a/include/net/ip_vs.h b/include/net/ip_vs.h
index bbae1e87efcd..98978e73f666 100644
--- a/include/net/ip_vs.h
+++ b/include/net/ip_vs.h
@@ -99,47 +99,47 @@ static inline const char *ip_vs_dbg_addr(int af, char *buf, size_t buf_len,
99 return &buf[*idx - len]; 99 return &buf[*idx - len];
100} 100}
101 101
102#define IP_VS_DBG_BUF(level, msg...) \ 102#define IP_VS_DBG_BUF(level, msg, ...) \
103 do { \ 103 do { \
104 char ip_vs_dbg_buf[160]; \ 104 char ip_vs_dbg_buf[160]; \
105 int ip_vs_dbg_idx = 0; \ 105 int ip_vs_dbg_idx = 0; \
106 if (level <= ip_vs_get_debug_level()) \ 106 if (level <= ip_vs_get_debug_level()) \
107 printk(KERN_DEBUG "IPVS: " msg); \ 107 printk(KERN_DEBUG pr_fmt(msg), ##__VA_ARGS__); \
108 } while (0) 108 } while (0)
109#define IP_VS_ERR_BUF(msg...) \ 109#define IP_VS_ERR_BUF(msg...) \
110 do { \ 110 do { \
111 char ip_vs_dbg_buf[160]; \ 111 char ip_vs_dbg_buf[160]; \
112 int ip_vs_dbg_idx = 0; \ 112 int ip_vs_dbg_idx = 0; \
113 printk(KERN_ERR "IPVS: " msg); \ 113 pr_err(msg); \
114 } while (0) 114 } while (0)
115 115
116/* Only use from within IP_VS_DBG_BUF() or IP_VS_ERR_BUF macros */ 116/* Only use from within IP_VS_DBG_BUF() or IP_VS_ERR_BUF macros */
117#define IP_VS_DBG_ADDR(af, addr) \ 117#define IP_VS_DBG_ADDR(af, addr) \
118 ip_vs_dbg_addr(af, ip_vs_dbg_buf, \ 118 ip_vs_dbg_addr(af, ip_vs_dbg_buf, \
119 sizeof(ip_vs_dbg_buf), addr, \ 119 sizeof(ip_vs_dbg_buf), addr, \
120 &ip_vs_dbg_idx) 120 &ip_vs_dbg_idx)
121 121
122#define IP_VS_DBG(level, msg...) \ 122#define IP_VS_DBG(level, msg, ...) \
123 do { \ 123 do { \
124 if (level <= ip_vs_get_debug_level()) \ 124 if (level <= ip_vs_get_debug_level()) \
125 printk(KERN_DEBUG "IPVS: " msg); \ 125 printk(KERN_DEBUG pr_fmt(msg), ##__VA_ARGS__); \
126 } while (0) 126 } while (0)
127#define IP_VS_DBG_RL(msg...) \ 127#define IP_VS_DBG_RL(msg, ...) \
128 do { \ 128 do { \
129 if (net_ratelimit()) \ 129 if (net_ratelimit()) \
130 printk(KERN_DEBUG "IPVS: " msg); \ 130 printk(KERN_DEBUG pr_fmt(msg), ##__VA_ARGS__); \
131 } while (0) 131 } while (0)
132#define IP_VS_DBG_PKT(level, pp, skb, ofs, msg) \ 132#define IP_VS_DBG_PKT(level, pp, skb, ofs, msg) \
133 do { \ 133 do { \
134 if (level <= ip_vs_get_debug_level()) \ 134 if (level <= ip_vs_get_debug_level()) \
135 pp->debug_packet(pp, skb, ofs, msg); \ 135 pp->debug_packet(pp, skb, ofs, msg); \
136 } while (0) 136 } while (0)
137#define IP_VS_DBG_RL_PKT(level, pp, skb, ofs, msg) \ 137#define IP_VS_DBG_RL_PKT(level, pp, skb, ofs, msg) \
138 do { \ 138 do { \
139 if (level <= ip_vs_get_debug_level() && \ 139 if (level <= ip_vs_get_debug_level() && \
140 net_ratelimit()) \ 140 net_ratelimit()) \
141 pp->debug_packet(pp, skb, ofs, msg); \ 141 pp->debug_packet(pp, skb, ofs, msg); \
142 } while (0) 142 } while (0)
143#else /* NO DEBUGGING at ALL */ 143#else /* NO DEBUGGING at ALL */
144#define IP_VS_DBG_BUF(level, msg...) do {} while (0) 144#define IP_VS_DBG_BUF(level, msg...) do {} while (0)
145#define IP_VS_ERR_BUF(msg...) do {} while (0) 145#define IP_VS_ERR_BUF(msg...) do {} while (0)
@@ -150,29 +150,27 @@ static inline const char *ip_vs_dbg_addr(int af, char *buf, size_t buf_len,
150#endif 150#endif
151 151
152#define IP_VS_BUG() BUG() 152#define IP_VS_BUG() BUG()
153#define IP_VS_ERR(msg...) printk(KERN_ERR "IPVS: " msg) 153#define IP_VS_ERR_RL(msg, ...) \
154#define IP_VS_INFO(msg...) printk(KERN_INFO "IPVS: " msg) 154 do { \
155#define IP_VS_WARNING(msg...) \ 155 if (net_ratelimit()) \
156 printk(KERN_WARNING "IPVS: " msg) 156 pr_err(msg, ##__VA_ARGS__); \
157#define IP_VS_ERR_RL(msg...) \ 157 } while (0)
158 do { \
159 if (net_ratelimit()) \
160 printk(KERN_ERR "IPVS: " msg); \
161 } while (0)
162 158
163#ifdef CONFIG_IP_VS_DEBUG 159#ifdef CONFIG_IP_VS_DEBUG
164#define EnterFunction(level) \ 160#define EnterFunction(level) \
165 do { \ 161 do { \
166 if (level <= ip_vs_get_debug_level()) \ 162 if (level <= ip_vs_get_debug_level()) \
167 printk(KERN_DEBUG "Enter: %s, %s line %i\n", \ 163 printk(KERN_DEBUG \
168 __func__, __FILE__, __LINE__); \ 164 pr_fmt("Enter: %s, %s line %i\n"), \
169 } while (0) 165 __func__, __FILE__, __LINE__); \
170#define LeaveFunction(level) \ 166 } while (0)
171 do { \ 167#define LeaveFunction(level) \
172 if (level <= ip_vs_get_debug_level()) \ 168 do { \
173 printk(KERN_DEBUG "Leave: %s, %s line %i\n", \ 169 if (level <= ip_vs_get_debug_level()) \
174 __func__, __FILE__, __LINE__); \ 170 printk(KERN_DEBUG \
175 } while (0) 171 pr_fmt("Leave: %s, %s line %i\n"), \
172 __func__, __FILE__, __LINE__); \
173 } while (0)
176#else 174#else
177#define EnterFunction(level) do {} while (0) 175#define EnterFunction(level) do {} while (0)
178#define LeaveFunction(level) do {} while (0) 176#define LeaveFunction(level) do {} while (0)
@@ -740,7 +738,8 @@ extern void ip_vs_protocol_cleanup(void);
740extern void ip_vs_protocol_timeout_change(int flags); 738extern void ip_vs_protocol_timeout_change(int flags);
741extern int *ip_vs_create_timeout_table(int *table, int size); 739extern int *ip_vs_create_timeout_table(int *table, int size);
742extern int 740extern int
743ip_vs_set_state_timeout(int *table, int num, char **names, char *name, int to); 741ip_vs_set_state_timeout(int *table, int num, const char *const *names,
742 const char *name, int to);
744extern void 743extern void
745ip_vs_tcpudp_debug_packet(struct ip_vs_protocol *pp, const struct sk_buff *skb, 744ip_vs_tcpudp_debug_packet(struct ip_vs_protocol *pp, const struct sk_buff *skb,
746 int offset, const char *msg); 745 int offset, const char *msg);
diff --git a/include/net/ipv6.h b/include/net/ipv6.h
index f27fd83d67d8..ad9a51130254 100644
--- a/include/net/ipv6.h
+++ b/include/net/ipv6.h
@@ -441,6 +441,18 @@ static inline int ipv6_addr_diff(const struct in6_addr *a1, const struct in6_add
441 return __ipv6_addr_diff(a1, a2, sizeof(struct in6_addr)); 441 return __ipv6_addr_diff(a1, a2, sizeof(struct in6_addr));
442} 442}
443 443
444static __inline__ void ipv6_select_ident(struct frag_hdr *fhdr)
445{
446 static u32 ipv6_fragmentation_id = 1;
447 static DEFINE_SPINLOCK(ip6_id_lock);
448
449 spin_lock_bh(&ip6_id_lock);
450 fhdr->identification = htonl(ipv6_fragmentation_id);
451 if (++ipv6_fragmentation_id == 0)
452 ipv6_fragmentation_id = 1;
453 spin_unlock_bh(&ip6_id_lock);
454}
455
444/* 456/*
445 * Prototypes exported by ipv6 457 * Prototypes exported by ipv6
446 */ 458 */
diff --git a/include/net/irda/ircomm_event.h b/include/net/irda/ircomm_event.h
index c290447872d1..bc0c6f31f1c6 100644
--- a/include/net/irda/ircomm_event.h
+++ b/include/net/irda/ircomm_event.h
@@ -74,7 +74,7 @@ struct ircomm_info {
74 struct qos_info *qos; 74 struct qos_info *qos;
75}; 75};
76 76
77extern char *ircomm_state[]; 77extern const char *const ircomm_state[];
78 78
79struct ircomm_cb; /* Forward decl. */ 79struct ircomm_cb; /* Forward decl. */
80 80
diff --git a/include/net/irda/ircomm_tty_attach.h b/include/net/irda/ircomm_tty_attach.h
index f91a5695aa44..0a63bbb972d7 100644
--- a/include/net/irda/ircomm_tty_attach.h
+++ b/include/net/irda/ircomm_tty_attach.h
@@ -66,8 +66,8 @@ struct ircomm_tty_info {
66 __u8 dlsap_sel; 66 __u8 dlsap_sel;
67}; 67};
68 68
69extern char *ircomm_state[]; 69extern const char *const ircomm_state[];
70extern char *ircomm_tty_state[]; 70extern const char *const ircomm_tty_state[];
71 71
72int ircomm_tty_do_event(struct ircomm_tty_cb *self, IRCOMM_TTY_EVENT event, 72int ircomm_tty_do_event(struct ircomm_tty_cb *self, IRCOMM_TTY_EVENT event,
73 struct sk_buff *skb, struct ircomm_tty_info *info); 73 struct sk_buff *skb, struct ircomm_tty_info *info);
diff --git a/include/net/irda/irlap_event.h b/include/net/irda/irlap_event.h
index 2ae2e119ef4b..4c90824c50fb 100644
--- a/include/net/irda/irlap_event.h
+++ b/include/net/irda/irlap_event.h
@@ -120,7 +120,7 @@ typedef enum { /* FIXME check the two first reason codes */
120 LAP_PRIMARY_CONFLICT, 120 LAP_PRIMARY_CONFLICT,
121} LAP_REASON; 121} LAP_REASON;
122 122
123extern const char *irlap_state[]; 123extern const char *const irlap_state[];
124 124
125void irlap_do_event(struct irlap_cb *self, IRLAP_EVENT event, 125void irlap_do_event(struct irlap_cb *self, IRLAP_EVENT event,
126 struct sk_buff *skb, struct irlap_info *info); 126 struct sk_buff *skb, struct irlap_info *info);
diff --git a/include/net/irda/irlmp_event.h b/include/net/irda/irlmp_event.h
index e03ae4ae3963..9e4ec17a7449 100644
--- a/include/net/irda/irlmp_event.h
+++ b/include/net/irda/irlmp_event.h
@@ -79,8 +79,8 @@ typedef enum {
79 LM_LAP_IDLE_TIMEOUT, 79 LM_LAP_IDLE_TIMEOUT,
80} IRLMP_EVENT; 80} IRLMP_EVENT;
81 81
82extern const char *irlmp_state[]; 82extern const char *const irlmp_state[];
83extern const char *irlsap_state[]; 83extern const char *const irlsap_state[];
84 84
85void irlmp_watchdog_timer_expired(void *data); 85void irlmp_watchdog_timer_expired(void *data);
86void irlmp_discovery_timer_expired(void *data); 86void irlmp_discovery_timer_expired(void *data);
diff --git a/include/net/iw_handler.h b/include/net/iw_handler.h
index 51b9a37de991..2b3fbbb8669e 100644
--- a/include/net/iw_handler.h
+++ b/include/net/iw_handler.h
@@ -443,7 +443,7 @@ extern int dev_get_wireless_info(char * buffer, char **start, off_t offset,
443extern void wireless_send_event(struct net_device * dev, 443extern void wireless_send_event(struct net_device * dev,
444 unsigned int cmd, 444 unsigned int cmd,
445 union iwreq_data * wrqu, 445 union iwreq_data * wrqu,
446 char * extra); 446 const char * extra);
447 447
448/* We may need a function to send a stream of events to user space. 448/* We may need a function to send a stream of events to user space.
449 * More on that later... */ 449 * More on that later... */
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index c06104476973..e2fb5767e1fa 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -73,6 +73,21 @@
73 */ 73 */
74 74
75/** 75/**
76 * DOC: mac80211 workqueue
77 *
78 * mac80211 provides its own workqueue for drivers and internal mac80211 use.
79 * The workqueue is a single threaded workqueue and can only be accessed by
80 * helpers for sanity checking. Drivers must ensure all work added onto the
81 * mac80211 workqueue should be cancelled on the driver stop() callback.
82 *
83 * mac80211 will flushed the workqueue upon interface removal and during
84 * suspend.
85 *
86 * All work performed on the mac80211 workqueue must not acquire the RTNL lock.
87 *
88 */
89
90/**
76 * enum ieee80211_max_queues - maximum number of queues 91 * enum ieee80211_max_queues - maximum number of queues
77 * 92 *
78 * @IEEE80211_MAX_QUEUES: Maximum number of regular device queues. 93 * @IEEE80211_MAX_QUEUES: Maximum number of regular device queues.
@@ -241,6 +256,11 @@ struct ieee80211_bss_conf {
241 * it can be sent out. 256 * it can be sent out.
242 * @IEEE80211_TX_INTFL_RETRIED: completely internal to mac80211, 257 * @IEEE80211_TX_INTFL_RETRIED: completely internal to mac80211,
243 * used to indicate that a frame was already retried due to PS 258 * used to indicate that a frame was already retried due to PS
259 * @IEEE80211_TX_INTFL_DONT_ENCRYPT: completely internal to mac80211,
260 * used to indicate frame should not be encrypted
261 * @IEEE80211_TX_CTL_PSPOLL_RESPONSE: (internal?)
262 * This frame is a response to a PS-poll frame and should be sent
263 * although the station is in powersave mode.
244 */ 264 */
245enum mac80211_tx_control_flags { 265enum mac80211_tx_control_flags {
246 IEEE80211_TX_CTL_REQ_TX_STATUS = BIT(0), 266 IEEE80211_TX_CTL_REQ_TX_STATUS = BIT(0),
@@ -259,6 +279,8 @@ enum mac80211_tx_control_flags {
259 IEEE80211_TX_INTFL_RCALGO = BIT(13), 279 IEEE80211_TX_INTFL_RCALGO = BIT(13),
260 IEEE80211_TX_INTFL_NEED_TXPROCESSING = BIT(14), 280 IEEE80211_TX_INTFL_NEED_TXPROCESSING = BIT(14),
261 IEEE80211_TX_INTFL_RETRIED = BIT(15), 281 IEEE80211_TX_INTFL_RETRIED = BIT(15),
282 IEEE80211_TX_INTFL_DONT_ENCRYPT = BIT(16),
283 IEEE80211_TX_CTL_PSPOLL_RESPONSE = BIT(17),
262}; 284};
263 285
264/** 286/**
@@ -397,6 +419,11 @@ static inline struct ieee80211_tx_info *IEEE80211_SKB_CB(struct sk_buff *skb)
397 return (struct ieee80211_tx_info *)skb->cb; 419 return (struct ieee80211_tx_info *)skb->cb;
398} 420}
399 421
422static inline struct ieee80211_rx_status *IEEE80211_SKB_RXCB(struct sk_buff *skb)
423{
424 return (struct ieee80211_rx_status *)skb->cb;
425}
426
400/** 427/**
401 * ieee80211_tx_info_clear_status - clear TX status 428 * ieee80211_tx_info_clear_status - clear TX status
402 * 429 *
@@ -478,7 +505,7 @@ enum mac80211_rx_flags {
478 * 505 *
479 * The low-level driver should provide this information (the subset 506 * The low-level driver should provide this information (the subset
480 * supported by hardware) to the 802.11 code with each received 507 * supported by hardware) to the 802.11 code with each received
481 * frame. 508 * frame, in the skb's control buffer (cb).
482 * 509 *
483 * @mactime: value in microseconds of the 64-bit Time Synchronization Function 510 * @mactime: value in microseconds of the 64-bit Time Synchronization Function
484 * (TSF) timer when the first data symbol (MPDU) arrived at the hardware. 511 * (TSF) timer when the first data symbol (MPDU) arrived at the hardware.
@@ -901,12 +928,6 @@ enum ieee80211_hw_flags {
901 * 928 *
902 * @conf: &struct ieee80211_conf, device configuration, don't use. 929 * @conf: &struct ieee80211_conf, device configuration, don't use.
903 * 930 *
904 * @workqueue: single threaded workqueue available for driver use,
905 * allocated by mac80211 on registration and flushed when an
906 * interface is removed.
907 * NOTICE: All work performed on this workqueue must not
908 * acquire the RTNL lock.
909 *
910 * @priv: pointer to private area that was allocated for driver use 931 * @priv: pointer to private area that was allocated for driver use
911 * along with this structure. 932 * along with this structure.
912 * 933 *
@@ -942,7 +963,6 @@ enum ieee80211_hw_flags {
942struct ieee80211_hw { 963struct ieee80211_hw {
943 struct ieee80211_conf conf; 964 struct ieee80211_conf conf;
944 struct wiphy *wiphy; 965 struct wiphy *wiphy;
945 struct workqueue_struct *workqueue;
946 const char *rate_control_algorithm; 966 const char *rate_control_algorithm;
947 void *priv; 967 void *priv;
948 u32 flags; 968 u32 flags;
@@ -1224,10 +1244,13 @@ ieee80211_get_alt_retry_rate(const struct ieee80211_hw *hw,
1224 * mac80211 needs to do and the amount of CPU wakeups, so you should 1244 * mac80211 needs to do and the amount of CPU wakeups, so you should
1225 * honour this flag if possible. 1245 * honour this flag if possible.
1226 * 1246 *
1227 * @FIF_CONTROL: pass control frames, if PROMISC_IN_BSS is not set then 1247 * @FIF_CONTROL: pass control frames (except for PS Poll), if PROMISC_IN_BSS
1228 * only those addressed to this station 1248 * is not set then only those addressed to this station.
1229 * 1249 *
1230 * @FIF_OTHER_BSS: pass frames destined to other BSSes 1250 * @FIF_OTHER_BSS: pass frames destined to other BSSes
1251 *
1252 * @FIF_PSPOLL: pass PS Poll frames, if PROMISC_IN_BSS is not set then only
1253 * those addressed to this station.
1231 */ 1254 */
1232enum ieee80211_filter_flags { 1255enum ieee80211_filter_flags {
1233 FIF_PROMISC_IN_BSS = 1<<0, 1256 FIF_PROMISC_IN_BSS = 1<<0,
@@ -1237,6 +1260,7 @@ enum ieee80211_filter_flags {
1237 FIF_BCN_PRBRESP_PROMISC = 1<<4, 1260 FIF_BCN_PRBRESP_PROMISC = 1<<4,
1238 FIF_CONTROL = 1<<5, 1261 FIF_CONTROL = 1<<5,
1239 FIF_OTHER_BSS = 1<<6, 1262 FIF_OTHER_BSS = 1<<6,
1263 FIF_PSPOLL = 1<<7,
1240}; 1264};
1241 1265
1242/** 1266/**
@@ -1289,7 +1313,8 @@ enum ieee80211_ampdu_mlme_action {
1289 * is disabled. This should turn off the hardware (at least 1313 * is disabled. This should turn off the hardware (at least
1290 * it must turn off frame reception.) 1314 * it must turn off frame reception.)
1291 * May be called right after add_interface if that rejects 1315 * May be called right after add_interface if that rejects
1292 * an interface. 1316 * an interface. If you added any work onto the mac80211 workqueue
1317 * you should ensure to cancel it on this callback.
1293 * Must be implemented. 1318 * Must be implemented.
1294 * 1319 *
1295 * @add_interface: Called when a netdevice attached to the hardware is 1320 * @add_interface: Called when a netdevice attached to the hardware is
@@ -1411,6 +1436,8 @@ enum ieee80211_ampdu_mlme_action {
1411 * @rfkill_poll: Poll rfkill hardware state. If you need this, you also 1436 * @rfkill_poll: Poll rfkill hardware state. If you need this, you also
1412 * need to set wiphy->rfkill_poll to %true before registration, 1437 * need to set wiphy->rfkill_poll to %true before registration,
1413 * and need to call wiphy_rfkill_set_hw_state() in the callback. 1438 * and need to call wiphy_rfkill_set_hw_state() in the callback.
1439 *
1440 * @testmode_cmd: Implement a cfg80211 test mode command.
1414 */ 1441 */
1415struct ieee80211_ops { 1442struct ieee80211_ops {
1416 int (*tx)(struct ieee80211_hw *hw, struct sk_buff *skb); 1443 int (*tx)(struct ieee80211_hw *hw, struct sk_buff *skb);
@@ -1461,6 +1488,9 @@ struct ieee80211_ops {
1461 struct ieee80211_sta *sta, u16 tid, u16 *ssn); 1488 struct ieee80211_sta *sta, u16 tid, u16 *ssn);
1462 1489
1463 void (*rfkill_poll)(struct ieee80211_hw *hw); 1490 void (*rfkill_poll)(struct ieee80211_hw *hw);
1491#ifdef CONFIG_NL80211_TESTMODE
1492 int (*testmode_cmd)(struct ieee80211_hw *hw, void *data, int len);
1493#endif
1464}; 1494};
1465 1495
1466/** 1496/**
@@ -1606,9 +1636,11 @@ void ieee80211_free_hw(struct ieee80211_hw *hw);
1606 */ 1636 */
1607void ieee80211_restart_hw(struct ieee80211_hw *hw); 1637void ieee80211_restart_hw(struct ieee80211_hw *hw);
1608 1638
1609/* trick to avoid symbol clashes with the ieee80211 subsystem */ 1639/*
1610void __ieee80211_rx(struct ieee80211_hw *hw, struct sk_buff *skb, 1640 * trick to avoid symbol clashes with the ieee80211 subsystem,
1611 struct ieee80211_rx_status *status); 1641 * use the inline below instead
1642 */
1643void __ieee80211_rx(struct ieee80211_hw *hw, struct sk_buff *skb);
1612 1644
1613/** 1645/**
1614 * ieee80211_rx - receive frame 1646 * ieee80211_rx - receive frame
@@ -1624,13 +1656,10 @@ void __ieee80211_rx(struct ieee80211_hw *hw, struct sk_buff *skb,
1624 * 1656 *
1625 * @hw: the hardware this frame came in on 1657 * @hw: the hardware this frame came in on
1626 * @skb: the buffer to receive, owned by mac80211 after this call 1658 * @skb: the buffer to receive, owned by mac80211 after this call
1627 * @status: status of this frame; the status pointer need not be valid
1628 * after this function returns
1629 */ 1659 */
1630static inline void ieee80211_rx(struct ieee80211_hw *hw, struct sk_buff *skb, 1660static inline void ieee80211_rx(struct ieee80211_hw *hw, struct sk_buff *skb)
1631 struct ieee80211_rx_status *status)
1632{ 1661{
1633 __ieee80211_rx(hw, skb, status); 1662 __ieee80211_rx(hw, skb);
1634} 1663}
1635 1664
1636/** 1665/**
@@ -1644,13 +1673,8 @@ static inline void ieee80211_rx(struct ieee80211_hw *hw, struct sk_buff *skb,
1644 * 1673 *
1645 * @hw: the hardware this frame came in on 1674 * @hw: the hardware this frame came in on
1646 * @skb: the buffer to receive, owned by mac80211 after this call 1675 * @skb: the buffer to receive, owned by mac80211 after this call
1647 * @status: status of this frame; the status pointer need not be valid
1648 * after this function returns and is not freed by mac80211,
1649 * it is recommended that it points to a stack area
1650 */ 1676 */
1651void ieee80211_rx_irqsafe(struct ieee80211_hw *hw, 1677void ieee80211_rx_irqsafe(struct ieee80211_hw *hw, struct sk_buff *skb);
1652 struct sk_buff *skb,
1653 struct ieee80211_rx_status *status);
1654 1678
1655/** 1679/**
1656 * ieee80211_tx_status - transmit status callback 1680 * ieee80211_tx_status - transmit status callback
@@ -1917,6 +1941,31 @@ void ieee80211_iterate_active_interfaces_atomic(struct ieee80211_hw *hw,
1917 void *data); 1941 void *data);
1918 1942
1919/** 1943/**
1944 * ieee80211_queue_work - add work onto the mac80211 workqueue
1945 *
1946 * Drivers and mac80211 use this to add work onto the mac80211 workqueue.
1947 * This helper ensures drivers are not queueing work when they should not be.
1948 *
1949 * @hw: the hardware struct for the interface we are adding work for
1950 * @work: the work we want to add onto the mac80211 workqueue
1951 */
1952void ieee80211_queue_work(struct ieee80211_hw *hw, struct work_struct *work);
1953
1954/**
1955 * ieee80211_queue_delayed_work - add work onto the mac80211 workqueue
1956 *
1957 * Drivers and mac80211 use this to queue delayed work onto the mac80211
1958 * workqueue.
1959 *
1960 * @hw: the hardware struct for the interface we are adding work for
1961 * @dwork: delayable work to queue onto the mac80211 workqueue
1962 * @delay: number of jiffies to wait before queueing
1963 */
1964void ieee80211_queue_delayed_work(struct ieee80211_hw *hw,
1965 struct delayed_work *dwork,
1966 unsigned long delay);
1967
1968/**
1920 * ieee80211_start_tx_ba_session - Start a tx Block Ack session. 1969 * ieee80211_start_tx_ba_session - Start a tx Block Ack session.
1921 * @hw: pointer as obtained from ieee80211_alloc_hw(). 1970 * @hw: pointer as obtained from ieee80211_alloc_hw().
1922 * @ra: receiver address of the BA session recipient 1971 * @ra: receiver address of the BA session recipient
@@ -2090,6 +2139,29 @@ static inline int rate_supported(struct ieee80211_sta *sta,
2090 return (sta == NULL || sta->supp_rates[band] & BIT(index)); 2139 return (sta == NULL || sta->supp_rates[band] & BIT(index));
2091} 2140}
2092 2141
2142/**
2143 * rate_control_send_low - helper for drivers for management/no-ack frames
2144 *
2145 * Rate control algorithms that agree to use the lowest rate to
2146 * send management frames and NO_ACK data with the respective hw
2147 * retries should use this in the beginning of their mac80211 get_rate
2148 * callback. If true is returned the rate control can simply return.
2149 * If false is returned we guarantee that sta and sta and priv_sta is
2150 * not null.
2151 *
2152 * Rate control algorithms wishing to do more intelligent selection of
2153 * rate for multicast/broadcast frames may choose to not use this.
2154 *
2155 * @sta: &struct ieee80211_sta pointer to the target destination. Note
2156 * that this may be null.
2157 * @priv_sta: private rate control structure. This may be null.
2158 * @txrc: rate control information we sholud populate for mac80211.
2159 */
2160bool rate_control_send_low(struct ieee80211_sta *sta,
2161 void *priv_sta,
2162 struct ieee80211_tx_rate_control *txrc);
2163
2164
2093static inline s8 2165static inline s8
2094rate_lowest_index(struct ieee80211_supported_band *sband, 2166rate_lowest_index(struct ieee80211_supported_band *sband,
2095 struct ieee80211_sta *sta) 2167 struct ieee80211_sta *sta)
@@ -2106,6 +2178,17 @@ rate_lowest_index(struct ieee80211_supported_band *sband,
2106 return 0; 2178 return 0;
2107} 2179}
2108 2180
2181static inline
2182bool rate_usable_index_exists(struct ieee80211_supported_band *sband,
2183 struct ieee80211_sta *sta)
2184{
2185 unsigned int i;
2186
2187 for (i = 0; i < sband->n_bitrates; i++)
2188 if (rate_supported(sta, sband->band, i))
2189 return true;
2190 return false;
2191}
2109 2192
2110int ieee80211_rate_control_register(struct rate_control_ops *ops); 2193int ieee80211_rate_control_register(struct rate_control_ops *ops);
2111void ieee80211_rate_control_unregister(struct rate_control_ops *ops); 2194void ieee80211_rate_control_unregister(struct rate_control_ops *ops);
diff --git a/include/net/neighbour.h b/include/net/neighbour.h
index d8d790e56d3d..18b69b6cecaf 100644
--- a/include/net/neighbour.h
+++ b/include/net/neighbour.h
@@ -24,6 +24,7 @@
24 24
25#include <linux/err.h> 25#include <linux/err.h>
26#include <linux/sysctl.h> 26#include <linux/sysctl.h>
27#include <linux/workqueue.h>
27#include <net/rtnetlink.h> 28#include <net/rtnetlink.h>
28 29
29/* 30/*
@@ -167,7 +168,7 @@ struct neigh_table
167 int gc_thresh2; 168 int gc_thresh2;
168 int gc_thresh3; 169 int gc_thresh3;
169 unsigned long last_flush; 170 unsigned long last_flush;
170 struct timer_list gc_timer; 171 struct delayed_work gc_work;
171 struct timer_list proxy_timer; 172 struct timer_list proxy_timer;
172 struct sk_buff_head proxy_queue; 173 struct sk_buff_head proxy_queue;
173 atomic_t entries; 174 atomic_t entries;
@@ -178,7 +179,6 @@ struct neigh_table
178 struct neighbour **hash_buckets; 179 struct neighbour **hash_buckets;
179 unsigned int hash_mask; 180 unsigned int hash_mask;
180 __u32 hash_rnd; 181 __u32 hash_rnd;
181 unsigned int hash_chain_gc;
182 struct pneigh_entry **phash_buckets; 182 struct pneigh_entry **phash_buckets;
183}; 183};
184 184
diff --git a/include/net/net_namespace.h b/include/net/net_namespace.h
index ded434b032a4..a1202841aadd 100644
--- a/include/net/net_namespace.h
+++ b/include/net/net_namespace.h
@@ -26,6 +26,7 @@ struct net_device;
26struct sock; 26struct sock;
27struct ctl_table_header; 27struct ctl_table_header;
28struct net_generic; 28struct net_generic;
29struct sock;
29 30
30struct net { 31struct net {
31 atomic_t count; /* To decided when the network 32 atomic_t count; /* To decided when the network
@@ -57,6 +58,7 @@ struct net {
57 spinlock_t rules_mod_lock; 58 spinlock_t rules_mod_lock;
58 59
59 struct sock *rtnl; /* rtnetlink socket */ 60 struct sock *rtnl; /* rtnetlink socket */
61 struct sock *genl_sock;
60 62
61 struct netns_core core; 63 struct netns_core core;
62 struct netns_mib mib; 64 struct netns_mib mib;
@@ -78,6 +80,9 @@ struct net {
78#ifdef CONFIG_XFRM 80#ifdef CONFIG_XFRM
79 struct netns_xfrm xfrm; 81 struct netns_xfrm xfrm;
80#endif 82#endif
83#ifdef CONFIG_WIRELESS_EXT
84 struct sk_buff_head wext_nlevents;
85#endif
81 struct net_generic *gen; 86 struct net_generic *gen;
82}; 87};
83 88
@@ -106,6 +111,8 @@ static inline struct net *copy_net_ns(unsigned long flags, struct net *net_ns)
106 111
107extern struct list_head net_namespace_list; 112extern struct list_head net_namespace_list;
108 113
114extern struct net *get_net_ns_by_pid(pid_t pid);
115
109#ifdef CONFIG_NET_NS 116#ifdef CONFIG_NET_NS
110extern void __put_net(struct net *net); 117extern void __put_net(struct net *net);
111 118
@@ -208,6 +215,9 @@ static inline struct net *read_pnet(struct net * const *pnet)
208#define for_each_net(VAR) \ 215#define for_each_net(VAR) \
209 list_for_each_entry(VAR, &net_namespace_list, list) 216 list_for_each_entry(VAR, &net_namespace_list, list)
210 217
218#define for_each_net_rcu(VAR) \
219 list_for_each_entry_rcu(VAR, &net_namespace_list, list)
220
211#ifdef CONFIG_NET_NS 221#ifdef CONFIG_NET_NS
212#define __net_init 222#define __net_init
213#define __net_exit 223#define __net_exit
@@ -229,13 +239,15 @@ struct pernet_operations {
229 * needs per network namespace operations use device pernet operations, 239 * needs per network namespace operations use device pernet operations,
230 * otherwise use pernet subsys operations. 240 * otherwise use pernet subsys operations.
231 * 241 *
232 * This is critically important. Most of the network code cleanup 242 * Network interfaces need to be removed from a dying netns _before_
233 * runs with the assumption that dev_remove_pack has been called so no 243 * subsys notifiers can be called, as most of the network code cleanup
234 * new packets will arrive during and after the cleanup functions have 244 * (which is done from subsys notifiers) runs with the assumption that
235 * been called. dev_remove_pack is not per namespace so instead the 245 * dev_remove_pack has been called so no new packets will arrive during
236 * guarantee of no more packets arriving in a network namespace is 246 * and after the cleanup functions have been called. dev_remove_pack
237 * provided by ensuring that all network devices and all sockets have 247 * is not per namespace so instead the guarantee of no more packets
238 * left the network namespace before the cleanup methods are called. 248 * arriving in a network namespace is provided by ensuring that all
249 * network devices and all sockets have left the network namespace
250 * before the cleanup methods are called.
239 * 251 *
240 * For the longest time the ipv4 icmp code was registered as a pernet 252 * For the longest time the ipv4 icmp code was registered as a pernet
241 * device which caused kernel oops, and panics during network 253 * device which caused kernel oops, and panics during network
diff --git a/include/net/netns/x_tables.h b/include/net/netns/x_tables.h
index 9554a644a8f8..591db7d657a3 100644
--- a/include/net/netns/x_tables.h
+++ b/include/net/netns/x_tables.h
@@ -8,8 +8,11 @@ struct ebt_table;
8 8
9struct netns_xt { 9struct netns_xt {
10 struct list_head tables[NFPROTO_NUMPROTO]; 10 struct list_head tables[NFPROTO_NUMPROTO];
11#if defined(CONFIG_BRIDGE_NF_EBTABLES) || \
12 defined(CONFIG_BRIDGE_NF_EBTABLES_MODULE)
11 struct ebt_table *broute_table; 13 struct ebt_table *broute_table;
12 struct ebt_table *frame_filter; 14 struct ebt_table *frame_filter;
13 struct ebt_table *frame_nat; 15 struct ebt_table *frame_nat;
16#endif
14}; 17};
15#endif 18#endif
diff --git a/include/net/nl802154.h b/include/net/nl802154.h
new file mode 100644
index 000000000000..6096096f6d7d
--- /dev/null
+++ b/include/net/nl802154.h
@@ -0,0 +1,117 @@
1/*
2 * nl802154.h
3 *
4 * Copyright (C) 2007, 2008, 2009 Siemens AG
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2
8 * as published by the Free Software Foundation.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License along
16 * with this program; if not, write to the Free Software Foundation, Inc.,
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 */
20
21#ifndef IEEE802154_NL_H
22#define IEEE802154_NL_H
23
24struct net_device;
25struct ieee802154_addr;
26
27/**
28 * ieee802154_nl_assoc_indic - Notify userland of an association request.
29 * @dev: The network device on which this association request was
30 * received.
31 * @addr: The address of the device requesting association.
32 * @cap: The capability information field from the device.
33 *
34 * This informs a userland coordinator of a device requesting to
35 * associate with the PAN controlled by the coordinator.
36 *
37 * Note: This is in section 7.3.1 of the IEEE 802.15.4-2006 document.
38 */
39int ieee802154_nl_assoc_indic(struct net_device *dev,
40 struct ieee802154_addr *addr, u8 cap);
41
42/**
43 * ieee802154_nl_assoc_confirm - Notify userland of association.
44 * @dev: The device which has completed association.
45 * @short_addr: The short address assigned to the device.
46 * @status: The status of the association.
47 *
48 * Inform userland of the result of an association request. If the
49 * association request included asking the coordinator to allocate
50 * a short address then it is returned in @short_addr.
51 *
52 * Note: This is in section 7.3.2 of the IEEE 802.15.4 document.
53 */
54int ieee802154_nl_assoc_confirm(struct net_device *dev,
55 u16 short_addr, u8 status);
56
57/**
58 * ieee802154_nl_disassoc_indic - Notify userland of disassociation.
59 * @dev: The device on which disassociation was indicated.
60 * @addr: The device which is disassociating.
61 * @reason: The reason for the disassociation.
62 *
63 * Inform userland that a device has disassociated from the network.
64 *
65 * Note: This is in section 7.3.3 of the IEEE 802.15.4 document.
66 */
67int ieee802154_nl_disassoc_indic(struct net_device *dev,
68 struct ieee802154_addr *addr, u8 reason);
69
70/**
71 * ieee802154_nl_disassoc_confirm - Notify userland of disassociation
72 * completion.
73 * @dev: The device on which disassociation was ordered.
74 * @status: The result of the disassociation.
75 *
76 * Inform userland of the result of requesting that a device
77 * disassociate, or the result of requesting that we disassociate from
78 * a PAN managed by another coordinator.
79 *
80 * Note: This is in section 7.1.4.3 of the IEEE 802.15.4 document.
81 */
82int ieee802154_nl_disassoc_confirm(struct net_device *dev,
83 u8 status);
84
85/**
86 * ieee802154_nl_scan_confirm - Notify userland of completion of scan.
87 * @dev: The device which was instructed to scan.
88 * @status: The status of the scan operation.
89 * @scan_type: What type of scan was performed.
90 * @unscanned: Any channels that the device was unable to scan.
91 * @edl: The energy levels (if a passive scan).
92 *
93 *
94 * Note: This is in section 7.1.11 of the IEEE 802.15.4 document.
95 * Note: This API does not permit the return of an active scan result.
96 */
97int ieee802154_nl_scan_confirm(struct net_device *dev,
98 u8 status, u8 scan_type, u32 unscanned,
99 u8 *edl/*, struct list_head *pan_desc_list */);
100
101/**
102 * ieee802154_nl_beacon_indic - Notify userland of a received beacon.
103 * @dev: The device on which a beacon was received.
104 * @panid: The PAN of the coordinator.
105 * @coord_addr: The short address of the coordinator on that PAN.
106 *
107 * Note: This is in section 7.1.5 of the IEEE 802.15.4 document.
108 * Note: This API does not provide extended information such as what
109 * channel the PAN is on or what the LQI of the beacon frame was on
110 * receipt.
111 * Note: This API cannot indicate a beacon frame for a coordinator
112 * operating in long addressing mode.
113 */
114int ieee802154_nl_beacon_indic(struct net_device *dev, u16 panid,
115 u16 coord_addr);
116
117#endif
diff --git a/include/net/phonet/pn_dev.h b/include/net/phonet/pn_dev.h
index 29d126736611..44c923c9e21d 100644
--- a/include/net/phonet/pn_dev.h
+++ b/include/net/phonet/pn_dev.h
@@ -49,4 +49,6 @@ void phonet_address_notify(int event, struct net_device *dev, u8 addr);
49 49
50#define PN_NO_ADDR 0xff 50#define PN_NO_ADDR 0xff
51 51
52extern const struct file_operations pn_sock_seq_fops;
53
52#endif 54#endif
diff --git a/include/net/pkt_sched.h b/include/net/pkt_sched.h
index 82a3191375f5..f911ec7598ef 100644
--- a/include/net/pkt_sched.h
+++ b/include/net/pkt_sched.h
@@ -87,6 +87,9 @@ extern struct qdisc_rate_table *qdisc_get_rtab(struct tc_ratespec *r,
87extern void qdisc_put_rtab(struct qdisc_rate_table *tab); 87extern void qdisc_put_rtab(struct qdisc_rate_table *tab);
88extern void qdisc_put_stab(struct qdisc_size_table *tab); 88extern void qdisc_put_stab(struct qdisc_size_table *tab);
89extern void qdisc_warn_nonwc(char *txt, struct Qdisc *qdisc); 89extern void qdisc_warn_nonwc(char *txt, struct Qdisc *qdisc);
90extern int sch_direct_xmit(struct sk_buff *skb, struct Qdisc *q,
91 struct net_device *dev, struct netdev_queue *txq,
92 spinlock_t *root_lock);
90 93
91extern void __qdisc_run(struct Qdisc *q); 94extern void __qdisc_run(struct Qdisc *q);
92 95
diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h
index 964ffa0d8815..84b3fc2aef0f 100644
--- a/include/net/sch_generic.h
+++ b/include/net/sch_generic.h
@@ -45,6 +45,7 @@ struct Qdisc
45#define TCQ_F_BUILTIN 1 45#define TCQ_F_BUILTIN 1
46#define TCQ_F_THROTTLED 2 46#define TCQ_F_THROTTLED 2
47#define TCQ_F_INGRESS 4 47#define TCQ_F_INGRESS 4
48#define TCQ_F_CAN_BYPASS 8
48#define TCQ_F_WARN_NONWC (1 << 16) 49#define TCQ_F_WARN_NONWC (1 << 16)
49 int padded; 50 int padded;
50 struct Qdisc_ops *ops; 51 struct Qdisc_ops *ops;
@@ -182,6 +183,11 @@ struct qdisc_skb_cb {
182 char data[]; 183 char data[];
183}; 184};
184 185
186static inline int qdisc_qlen(struct Qdisc *q)
187{
188 return q->q.qlen;
189}
190
185static inline struct qdisc_skb_cb *qdisc_skb_cb(struct sk_buff *skb) 191static inline struct qdisc_skb_cb *qdisc_skb_cb(struct sk_buff *skb)
186{ 192{
187 return (struct qdisc_skb_cb *)skb->cb; 193 return (struct qdisc_skb_cb *)skb->cb;
@@ -387,13 +393,18 @@ static inline int qdisc_enqueue_root(struct sk_buff *skb, struct Qdisc *sch)
387 return qdisc_enqueue(skb, sch) & NET_XMIT_MASK; 393 return qdisc_enqueue(skb, sch) & NET_XMIT_MASK;
388} 394}
389 395
396static inline void __qdisc_update_bstats(struct Qdisc *sch, unsigned int len)
397{
398 sch->bstats.bytes += len;
399 sch->bstats.packets++;
400}
401
390static inline int __qdisc_enqueue_tail(struct sk_buff *skb, struct Qdisc *sch, 402static inline int __qdisc_enqueue_tail(struct sk_buff *skb, struct Qdisc *sch,
391 struct sk_buff_head *list) 403 struct sk_buff_head *list)
392{ 404{
393 __skb_queue_tail(list, skb); 405 __skb_queue_tail(list, skb);
394 sch->qstats.backlog += qdisc_pkt_len(skb); 406 sch->qstats.backlog += qdisc_pkt_len(skb);
395 sch->bstats.bytes += qdisc_pkt_len(skb); 407 __qdisc_update_bstats(sch, qdisc_pkt_len(skb));
396 sch->bstats.packets++;
397 408
398 return NET_XMIT_SUCCESS; 409 return NET_XMIT_SUCCESS;
399} 410}
diff --git a/include/net/scm.h b/include/net/scm.h
index f45bb6eca7d4..cf48c800e926 100644
--- a/include/net/scm.h
+++ b/include/net/scm.h
@@ -26,7 +26,6 @@ struct scm_cookie
26#ifdef CONFIG_SECURITY_NETWORK 26#ifdef CONFIG_SECURITY_NETWORK
27 u32 secid; /* Passed security ID */ 27 u32 secid; /* Passed security ID */
28#endif 28#endif
29 unsigned long seq; /* Connection seqno */
30}; 29};
31 30
32extern void scm_detach_fds(struct msghdr *msg, struct scm_cookie *scm); 31extern void scm_detach_fds(struct msghdr *msg, struct scm_cookie *scm);
@@ -59,7 +58,6 @@ static __inline__ int scm_send(struct socket *sock, struct msghdr *msg,
59 scm->creds.gid = current_gid(); 58 scm->creds.gid = current_gid();
60 scm->creds.pid = task_tgid_vnr(p); 59 scm->creds.pid = task_tgid_vnr(p);
61 scm->fp = NULL; 60 scm->fp = NULL;
62 scm->seq = 0;
63 unix_get_peersec_dgram(sock, scm); 61 unix_get_peersec_dgram(sock, scm);
64 if (msg->msg_controllen <= 0) 62 if (msg->msg_controllen <= 0)
65 return 0; 63 return 0;
diff --git a/include/net/sctp/constants.h b/include/net/sctp/constants.h
index b05b0557211f..8bc25f7b04ce 100644
--- a/include/net/sctp/constants.h
+++ b/include/net/sctp/constants.h
@@ -241,7 +241,9 @@ const char *sctp_tname(const sctp_subtype_t); /* timeouts */
241const char *sctp_pname(const sctp_subtype_t); /* primitives */ 241const char *sctp_pname(const sctp_subtype_t); /* primitives */
242 242
243/* This is a table of printable names of sctp_state_t's. */ 243/* This is a table of printable names of sctp_state_t's. */
244extern const char *sctp_state_tbl[], *sctp_evttype_tbl[], *sctp_status_tbl[]; 244extern const char *const sctp_state_tbl[];
245extern const char *const sctp_evttype_tbl[];
246extern const char *const sctp_status_tbl[];
245 247
246/* Maximum chunk length considering padding requirements. */ 248/* Maximum chunk length considering padding requirements. */
247enum { SCTP_MAX_CHUNK_LEN = ((1<<16) - sizeof(__u32)) }; 249enum { SCTP_MAX_CHUNK_LEN = ((1<<16) - sizeof(__u32)) };
diff --git a/include/net/udp.h b/include/net/udp.h
index 90e6ce56be65..5fb029f817a3 100644
--- a/include/net/udp.h
+++ b/include/net/udp.h
@@ -207,4 +207,7 @@ extern void udp4_proc_exit(void);
207#endif 207#endif
208 208
209extern void udp_init(void); 209extern void udp_init(void);
210
211extern int udp4_ufo_send_check(struct sk_buff *skb);
212extern struct sk_buff *udp4_ufo_fragment(struct sk_buff *skb, int features);
210#endif /* _UDP_H */ 213#endif /* _UDP_H */
diff --git a/include/net/xfrm.h b/include/net/xfrm.h
index 9e3a3f4c1f60..223e90a44824 100644
--- a/include/net/xfrm.h
+++ b/include/net/xfrm.h
@@ -1280,7 +1280,7 @@ struct xfrm6_tunnel {
1280}; 1280};
1281 1281
1282extern void xfrm_init(void); 1282extern void xfrm_init(void);
1283extern void xfrm4_init(void); 1283extern void xfrm4_init(int rt_hash_size);
1284extern int xfrm_state_init(struct net *net); 1284extern int xfrm_state_init(struct net *net);
1285extern void xfrm_state_fini(struct net *net); 1285extern void xfrm_state_fini(struct net *net);
1286extern void xfrm4_state_init(void); 1286extern void xfrm4_state_init(void);