aboutsummaryrefslogtreecommitdiffstats
path: root/include/net
diff options
context:
space:
mode:
Diffstat (limited to 'include/net')
-rw-r--r--include/net/caif/caif_shm.h26
-rw-r--r--include/net/cfg80211.h126
-rw-r--r--include/net/dn_fib.h28
-rw-r--r--include/net/firewire.h25
-rw-r--r--include/net/gre.h51
-rw-r--r--include/net/inet_connection_sock.h5
-rw-r--r--include/net/inet_frag.h14
-rw-r--r--include/net/ip6_tunnel.h21
-rw-r--r--include/net/ip_tunnels.h177
-rw-r--r--include/net/ip_vs.h2
-rw-r--r--include/net/ipip.h87
-rw-r--r--include/net/ipv6.h22
-rw-r--r--include/net/mac80211.h29
-rw-r--r--include/net/netfilter/nf_conntrack_core.h1
-rw-r--r--include/net/netns/ipv6.h1
-rw-r--r--include/net/request_sock.h8
-rw-r--r--include/net/rtnetlink.h2
-rw-r--r--include/net/sock.h1
-rw-r--r--include/net/tcp.h145
19 files changed, 456 insertions, 315 deletions
diff --git a/include/net/caif/caif_shm.h b/include/net/caif/caif_shm.h
deleted file mode 100644
index 5bcce55438cf..000000000000
--- a/include/net/caif/caif_shm.h
+++ /dev/null
@@ -1,26 +0,0 @@
1/*
2 * Copyright (C) ST-Ericsson AB 2010
3 * Contact: Sjur Brendeland / sjur.brandeland@stericsson.com
4 * Author: Amarnath Revanna / amarnath.bangalore.revanna@stericsson.com
5 * License terms: GNU General Public License (GPL) version 2
6 */
7
8#ifndef CAIF_SHM_H_
9#define CAIF_SHM_H_
10
11struct shmdev_layer {
12 u32 shm_base_addr;
13 u32 shm_total_sz;
14 u32 shm_id;
15 u32 shm_loopback;
16 void *hmbx;
17 int (*pshmdev_mbxsend) (u32 shm_id, u32 mbx_msg);
18 int (*pshmdev_mbxsetup) (void *pshmdrv_cb,
19 struct shmdev_layer *pshm_dev, void *pshm_drv);
20 struct net_device *pshm_netdev;
21};
22
23extern int caif_shmcore_probe(struct shmdev_layer *pshm_dev);
24extern void caif_shmcore_remove(struct net_device *pshm_netdev);
25
26#endif
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index d581c6de5d64..bdba9b619064 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -611,22 +611,10 @@ struct cfg80211_ap_settings {
611}; 611};
612 612
613/** 613/**
614 * enum plink_action - actions to perform in mesh peers
615 *
616 * @PLINK_ACTION_INVALID: action 0 is reserved
617 * @PLINK_ACTION_OPEN: start mesh peer link establishment
618 * @PLINK_ACTION_BLOCK: block traffic from this mesh peer
619 */
620enum plink_actions {
621 PLINK_ACTION_INVALID,
622 PLINK_ACTION_OPEN,
623 PLINK_ACTION_BLOCK,
624};
625
626/**
627 * enum station_parameters_apply_mask - station parameter values to apply 614 * enum station_parameters_apply_mask - station parameter values to apply
628 * @STATION_PARAM_APPLY_UAPSD: apply new uAPSD parameters (uapsd_queues, max_sp) 615 * @STATION_PARAM_APPLY_UAPSD: apply new uAPSD parameters (uapsd_queues, max_sp)
629 * @STATION_PARAM_APPLY_CAPABILITY: apply new capability 616 * @STATION_PARAM_APPLY_CAPABILITY: apply new capability
617 * @STATION_PARAM_APPLY_PLINK_STATE: apply new plink state
630 * 618 *
631 * Not all station parameters have in-band "no change" signalling, 619 * Not all station parameters have in-band "no change" signalling,
632 * for those that don't these flags will are used. 620 * for those that don't these flags will are used.
@@ -634,6 +622,7 @@ enum plink_actions {
634enum station_parameters_apply_mask { 622enum station_parameters_apply_mask {
635 STATION_PARAM_APPLY_UAPSD = BIT(0), 623 STATION_PARAM_APPLY_UAPSD = BIT(0),
636 STATION_PARAM_APPLY_CAPABILITY = BIT(1), 624 STATION_PARAM_APPLY_CAPABILITY = BIT(1),
625 STATION_PARAM_APPLY_PLINK_STATE = BIT(2),
637}; 626};
638 627
639/** 628/**
@@ -669,7 +658,7 @@ enum station_parameters_apply_mask {
669 * @ext_capab_len: number of extended capabilities 658 * @ext_capab_len: number of extended capabilities
670 */ 659 */
671struct station_parameters { 660struct station_parameters {
672 u8 *supported_rates; 661 const u8 *supported_rates;
673 struct net_device *vlan; 662 struct net_device *vlan;
674 u32 sta_flags_mask, sta_flags_set; 663 u32 sta_flags_mask, sta_flags_set;
675 u32 sta_modify_mask; 664 u32 sta_modify_mask;
@@ -678,17 +667,60 @@ struct station_parameters {
678 u8 supported_rates_len; 667 u8 supported_rates_len;
679 u8 plink_action; 668 u8 plink_action;
680 u8 plink_state; 669 u8 plink_state;
681 struct ieee80211_ht_cap *ht_capa; 670 const struct ieee80211_ht_cap *ht_capa;
682 struct ieee80211_vht_cap *vht_capa; 671 const struct ieee80211_vht_cap *vht_capa;
683 u8 uapsd_queues; 672 u8 uapsd_queues;
684 u8 max_sp; 673 u8 max_sp;
685 enum nl80211_mesh_power_mode local_pm; 674 enum nl80211_mesh_power_mode local_pm;
686 u16 capability; 675 u16 capability;
687 u8 *ext_capab; 676 const u8 *ext_capab;
688 u8 ext_capab_len; 677 u8 ext_capab_len;
689}; 678};
690 679
691/** 680/**
681 * enum cfg80211_station_type - the type of station being modified
682 * @CFG80211_STA_AP_CLIENT: client of an AP interface
683 * @CFG80211_STA_AP_MLME_CLIENT: client of an AP interface that has
684 * the AP MLME in the device
685 * @CFG80211_STA_AP_STA: AP station on managed interface
686 * @CFG80211_STA_IBSS: IBSS station
687 * @CFG80211_STA_TDLS_PEER_SETUP: TDLS peer on managed interface (dummy entry
688 * while TDLS setup is in progress, it moves out of this state when
689 * being marked authorized; use this only if TDLS with external setup is
690 * supported/used)
691 * @CFG80211_STA_TDLS_PEER_ACTIVE: TDLS peer on managed interface (active
692 * entry that is operating, has been marked authorized by userspace)
693 * @CFG80211_STA_MESH_PEER_KERNEL: peer on mesh interface (kernel managed)
694 * @CFG80211_STA_MESH_PEER_USER: peer on mesh interface (user managed)
695 */
696enum cfg80211_station_type {
697 CFG80211_STA_AP_CLIENT,
698 CFG80211_STA_AP_MLME_CLIENT,
699 CFG80211_STA_AP_STA,
700 CFG80211_STA_IBSS,
701 CFG80211_STA_TDLS_PEER_SETUP,
702 CFG80211_STA_TDLS_PEER_ACTIVE,
703 CFG80211_STA_MESH_PEER_KERNEL,
704 CFG80211_STA_MESH_PEER_USER,
705};
706
707/**
708 * cfg80211_check_station_change - validate parameter changes
709 * @wiphy: the wiphy this operates on
710 * @params: the new parameters for a station
711 * @statype: the type of station being modified
712 *
713 * Utility function for the @change_station driver method. Call this function
714 * with the appropriate station type looking up the station (and checking that
715 * it exists). It will verify whether the station change is acceptable, and if
716 * not will return an error code. Note that it may modify the parameters for
717 * backward compatibility reasons, so don't use them before calling this.
718 */
719int cfg80211_check_station_change(struct wiphy *wiphy,
720 struct station_parameters *params,
721 enum cfg80211_station_type statype);
722
723/**
692 * enum station_info_flags - station information flags 724 * enum station_info_flags - station information flags
693 * 725 *
694 * Used by the driver to indicate which info in &struct station_info 726 * Used by the driver to indicate which info in &struct station_info
@@ -1119,6 +1151,7 @@ struct mesh_config {
1119 * @ie_len: length of vendor information elements 1151 * @ie_len: length of vendor information elements
1120 * @is_authenticated: this mesh requires authentication 1152 * @is_authenticated: this mesh requires authentication
1121 * @is_secure: this mesh uses security 1153 * @is_secure: this mesh uses security
1154 * @user_mpm: userspace handles all MPM functions
1122 * @dtim_period: DTIM period to use 1155 * @dtim_period: DTIM period to use
1123 * @beacon_interval: beacon interval to use 1156 * @beacon_interval: beacon interval to use
1124 * @mcast_rate: multicat rate for Mesh Node [6Mbps is the default for 802.11a] 1157 * @mcast_rate: multicat rate for Mesh Node [6Mbps is the default for 802.11a]
@@ -1136,6 +1169,7 @@ struct mesh_setup {
1136 u8 ie_len; 1169 u8 ie_len;
1137 bool is_authenticated; 1170 bool is_authenticated;
1138 bool is_secure; 1171 bool is_secure;
1172 bool user_mpm;
1139 u8 dtim_period; 1173 u8 dtim_period;
1140 u16 beacon_interval; 1174 u16 beacon_interval;
1141 int mcast_rate[IEEE80211_NUM_BANDS]; 1175 int mcast_rate[IEEE80211_NUM_BANDS];
@@ -1398,9 +1432,11 @@ struct cfg80211_auth_request {
1398 * enum cfg80211_assoc_req_flags - Over-ride default behaviour in association. 1432 * enum cfg80211_assoc_req_flags - Over-ride default behaviour in association.
1399 * 1433 *
1400 * @ASSOC_REQ_DISABLE_HT: Disable HT (802.11n) 1434 * @ASSOC_REQ_DISABLE_HT: Disable HT (802.11n)
1435 * @ASSOC_REQ_DISABLE_VHT: Disable VHT
1401 */ 1436 */
1402enum cfg80211_assoc_req_flags { 1437enum cfg80211_assoc_req_flags {
1403 ASSOC_REQ_DISABLE_HT = BIT(0), 1438 ASSOC_REQ_DISABLE_HT = BIT(0),
1439 ASSOC_REQ_DISABLE_VHT = BIT(1),
1404}; 1440};
1405 1441
1406/** 1442/**
@@ -1422,6 +1458,8 @@ enum cfg80211_assoc_req_flags {
1422 * @ht_capa: HT Capabilities over-rides. Values set in ht_capa_mask 1458 * @ht_capa: HT Capabilities over-rides. Values set in ht_capa_mask
1423 * will be used in ht_capa. Un-supported values will be ignored. 1459 * will be used in ht_capa. Un-supported values will be ignored.
1424 * @ht_capa_mask: The bits of ht_capa which are to be used. 1460 * @ht_capa_mask: The bits of ht_capa which are to be used.
1461 * @vht_capa: VHT capability override
1462 * @vht_capa_mask: VHT capability mask indicating which fields to use
1425 */ 1463 */
1426struct cfg80211_assoc_request { 1464struct cfg80211_assoc_request {
1427 struct cfg80211_bss *bss; 1465 struct cfg80211_bss *bss;
@@ -1432,6 +1470,7 @@ struct cfg80211_assoc_request {
1432 u32 flags; 1470 u32 flags;
1433 struct ieee80211_ht_cap ht_capa; 1471 struct ieee80211_ht_cap ht_capa;
1434 struct ieee80211_ht_cap ht_capa_mask; 1472 struct ieee80211_ht_cap ht_capa_mask;
1473 struct ieee80211_vht_cap vht_capa, vht_capa_mask;
1435}; 1474};
1436 1475
1437/** 1476/**
@@ -1542,6 +1581,8 @@ struct cfg80211_ibss_params {
1542 * @ht_capa: HT Capabilities over-rides. Values set in ht_capa_mask 1581 * @ht_capa: HT Capabilities over-rides. Values set in ht_capa_mask
1543 * will be used in ht_capa. Un-supported values will be ignored. 1582 * will be used in ht_capa. Un-supported values will be ignored.
1544 * @ht_capa_mask: The bits of ht_capa which are to be used. 1583 * @ht_capa_mask: The bits of ht_capa which are to be used.
1584 * @vht_capa: VHT Capability overrides
1585 * @vht_capa_mask: The bits of vht_capa which are to be used.
1545 */ 1586 */
1546struct cfg80211_connect_params { 1587struct cfg80211_connect_params {
1547 struct ieee80211_channel *channel; 1588 struct ieee80211_channel *channel;
@@ -1560,6 +1601,8 @@ struct cfg80211_connect_params {
1560 int bg_scan_period; 1601 int bg_scan_period;
1561 struct ieee80211_ht_cap ht_capa; 1602 struct ieee80211_ht_cap ht_capa;
1562 struct ieee80211_ht_cap ht_capa_mask; 1603 struct ieee80211_ht_cap ht_capa_mask;
1604 struct ieee80211_vht_cap vht_capa;
1605 struct ieee80211_vht_cap vht_capa_mask;
1563}; 1606};
1564 1607
1565/** 1608/**
@@ -1722,6 +1765,21 @@ struct cfg80211_gtk_rekey_data {
1722}; 1765};
1723 1766
1724/** 1767/**
1768 * struct cfg80211_update_ft_ies_params - FT IE Information
1769 *
1770 * This structure provides information needed to update the fast transition IE
1771 *
1772 * @md: The Mobility Domain ID, 2 Octet value
1773 * @ie: Fast Transition IEs
1774 * @ie_len: Length of ft_ie in octets
1775 */
1776struct cfg80211_update_ft_ies_params {
1777 u16 md;
1778 const u8 *ie;
1779 size_t ie_len;
1780};
1781
1782/**
1725 * struct cfg80211_ops - backend description for wireless configuration 1783 * struct cfg80211_ops - backend description for wireless configuration
1726 * 1784 *
1727 * This struct is registered by fullmac card drivers and/or wireless stacks 1785 * This struct is registered by fullmac card drivers and/or wireless stacks
@@ -1781,9 +1839,8 @@ struct cfg80211_gtk_rekey_data {
1781 * @change_station: Modify a given station. Note that flags changes are not much 1839 * @change_station: Modify a given station. Note that flags changes are not much
1782 * validated in cfg80211, in particular the auth/assoc/authorized flags 1840 * validated in cfg80211, in particular the auth/assoc/authorized flags
1783 * might come to the driver in invalid combinations -- make sure to check 1841 * might come to the driver in invalid combinations -- make sure to check
1784 * them, also against the existing state! Also, supported_rates changes are 1842 * them, also against the existing state! Drivers must call
1785 * not checked in station mode -- drivers need to reject (or ignore) them 1843 * cfg80211_check_station_change() to validate the information.
1786 * for anything but TDLS peers.
1787 * @get_station: get station information for the station identified by @mac 1844 * @get_station: get station information for the station identified by @mac
1788 * @dump_station: dump station callback -- resume dump at index @idx 1845 * @dump_station: dump station callback -- resume dump at index @idx
1789 * 1846 *
@@ -2168,6 +2225,8 @@ struct cfg80211_ops {
2168 int (*start_radar_detection)(struct wiphy *wiphy, 2225 int (*start_radar_detection)(struct wiphy *wiphy,
2169 struct net_device *dev, 2226 struct net_device *dev,
2170 struct cfg80211_chan_def *chandef); 2227 struct cfg80211_chan_def *chandef);
2228 int (*update_ft_ies)(struct wiphy *wiphy, struct net_device *dev,
2229 struct cfg80211_update_ft_ies_params *ftie);
2171}; 2230};
2172 2231
2173/* 2232/*
@@ -2485,6 +2544,8 @@ struct wiphy_wowlan_support {
2485 * @ap_sme_capa: AP SME capabilities, flags from &enum nl80211_ap_sme_features. 2544 * @ap_sme_capa: AP SME capabilities, flags from &enum nl80211_ap_sme_features.
2486 * @ht_capa_mod_mask: Specify what ht_cap values can be over-ridden. 2545 * @ht_capa_mod_mask: Specify what ht_cap values can be over-ridden.
2487 * If null, then none can be over-ridden. 2546 * If null, then none can be over-ridden.
2547 * @vht_capa_mod_mask: Specify what VHT capabilities can be over-ridden.
2548 * If null, then none can be over-ridden.
2488 * 2549 *
2489 * @max_acl_mac_addrs: Maximum number of MAC addresses that the device 2550 * @max_acl_mac_addrs: Maximum number of MAC addresses that the device
2490 * supports for ACL. 2551 * supports for ACL.
@@ -2593,6 +2654,7 @@ struct wiphy {
2593 struct dentry *debugfsdir; 2654 struct dentry *debugfsdir;
2594 2655
2595 const struct ieee80211_ht_cap *ht_capa_mod_mask; 2656 const struct ieee80211_ht_cap *ht_capa_mod_mask;
2657 const struct ieee80211_vht_cap *vht_capa_mod_mask;
2596 2658
2597#ifdef CONFIG_NET_NS 2659#ifdef CONFIG_NET_NS
2598 /* the network namespace this phy lives in currently */ 2660 /* the network namespace this phy lives in currently */
@@ -4002,6 +4064,30 @@ u32 cfg80211_calculate_bitrate(struct rate_info *rate);
4002void cfg80211_unregister_wdev(struct wireless_dev *wdev); 4064void cfg80211_unregister_wdev(struct wireless_dev *wdev);
4003 4065
4004/** 4066/**
4067 * struct cfg80211_ft_event - FT Information Elements
4068 * @ies: FT IEs
4069 * @ies_len: length of the FT IE in bytes
4070 * @target_ap: target AP's MAC address
4071 * @ric_ies: RIC IE
4072 * @ric_ies_len: length of the RIC IE in bytes
4073 */
4074struct cfg80211_ft_event_params {
4075 const u8 *ies;
4076 size_t ies_len;
4077 const u8 *target_ap;
4078 const u8 *ric_ies;
4079 size_t ric_ies_len;
4080};
4081
4082/**
4083 * cfg80211_ft_event - notify userspace about FT IE and RIC IE
4084 * @netdev: network device
4085 * @ft_event: IE information
4086 */
4087void cfg80211_ft_event(struct net_device *netdev,
4088 struct cfg80211_ft_event_params *ft_event);
4089
4090/**
4005 * cfg80211_get_p2p_attr - find and copy a P2P attribute from IE buffer 4091 * cfg80211_get_p2p_attr - find and copy a P2P attribute from IE buffer
4006 * @ies: the input IE buffer 4092 * @ies: the input IE buffer
4007 * @len: the input length 4093 * @len: the input length
diff --git a/include/net/dn_fib.h b/include/net/dn_fib.h
index 1ee9d4bda30d..74004af31c48 100644
--- a/include/net/dn_fib.h
+++ b/include/net/dn_fib.h
@@ -1,24 +1,9 @@
1#ifndef _NET_DN_FIB_H 1#ifndef _NET_DN_FIB_H
2#define _NET_DN_FIB_H 2#define _NET_DN_FIB_H
3 3
4/* WARNING: The ordering of these elements must match ordering 4#include <linux/netlink.h>
5 * of RTA_* rtnetlink attribute numbers. 5
6 */ 6extern const struct nla_policy rtm_dn_policy[];
7struct dn_kern_rta {
8 void *rta_dst;
9 void *rta_src;
10 int *rta_iif;
11 int *rta_oif;
12 void *rta_gw;
13 u32 *rta_priority;
14 void *rta_prefsrc;
15 struct rtattr *rta_mx;
16 struct rtattr *rta_mp;
17 unsigned char *rta_protoinfo;
18 u32 *rta_flow;
19 struct rta_cacheinfo *rta_ci;
20 struct rta_session *rta_sess;
21};
22 7
23struct dn_fib_res { 8struct dn_fib_res {
24 struct fib_rule *r; 9 struct fib_rule *r;
@@ -93,10 +78,10 @@ struct dn_fib_table {
93 u32 n; 78 u32 n;
94 79
95 int (*insert)(struct dn_fib_table *t, struct rtmsg *r, 80 int (*insert)(struct dn_fib_table *t, struct rtmsg *r,
96 struct dn_kern_rta *rta, struct nlmsghdr *n, 81 struct nlattr *attrs[], struct nlmsghdr *n,
97 struct netlink_skb_parms *req); 82 struct netlink_skb_parms *req);
98 int (*delete)(struct dn_fib_table *t, struct rtmsg *r, 83 int (*delete)(struct dn_fib_table *t, struct rtmsg *r,
99 struct dn_kern_rta *rta, struct nlmsghdr *n, 84 struct nlattr *attrs[], struct nlmsghdr *n,
100 struct netlink_skb_parms *req); 85 struct netlink_skb_parms *req);
101 int (*lookup)(struct dn_fib_table *t, const struct flowidn *fld, 86 int (*lookup)(struct dn_fib_table *t, const struct flowidn *fld,
102 struct dn_fib_res *res); 87 struct dn_fib_res *res);
@@ -116,13 +101,12 @@ extern void dn_fib_cleanup(void);
116extern int dn_fib_ioctl(struct socket *sock, unsigned int cmd, 101extern int dn_fib_ioctl(struct socket *sock, unsigned int cmd,
117 unsigned long arg); 102 unsigned long arg);
118extern struct dn_fib_info *dn_fib_create_info(const struct rtmsg *r, 103extern struct dn_fib_info *dn_fib_create_info(const struct rtmsg *r,
119 struct dn_kern_rta *rta, 104 struct nlattr *attrs[],
120 const struct nlmsghdr *nlh, int *errp); 105 const struct nlmsghdr *nlh, int *errp);
121extern int dn_fib_semantic_match(int type, struct dn_fib_info *fi, 106extern int dn_fib_semantic_match(int type, struct dn_fib_info *fi,
122 const struct flowidn *fld, 107 const struct flowidn *fld,
123 struct dn_fib_res *res); 108 struct dn_fib_res *res);
124extern void dn_fib_release_info(struct dn_fib_info *fi); 109extern void dn_fib_release_info(struct dn_fib_info *fi);
125extern __le16 dn_fib_get_attr16(struct rtattr *attr, int attrlen, int type);
126extern void dn_fib_flush(void); 110extern void dn_fib_flush(void);
127extern void dn_fib_select_multipath(const struct flowidn *fld, 111extern void dn_fib_select_multipath(const struct flowidn *fld,
128 struct dn_fib_res *res); 112 struct dn_fib_res *res);
diff --git a/include/net/firewire.h b/include/net/firewire.h
new file mode 100644
index 000000000000..31bcbfe7a220
--- /dev/null
+++ b/include/net/firewire.h
@@ -0,0 +1,25 @@
1#ifndef _NET_FIREWIRE_H
2#define _NET_FIREWIRE_H
3
4/* Pseudo L2 address */
5#define FWNET_ALEN 16
6union fwnet_hwaddr {
7 u8 u[FWNET_ALEN];
8 /* "Hardware address" defined in RFC2734/RF3146 */
9 struct {
10 __be64 uniq_id; /* EUI-64 */
11 u8 max_rec; /* max packet size */
12 u8 sspd; /* max speed */
13 __be16 fifo_hi; /* hi 16bits of FIFO addr */
14 __be32 fifo_lo; /* lo 32bits of FIFO addr */
15 } __packed uc;
16};
17
18/* Pseudo L2 Header */
19#define FWNET_HLEN 18
20struct fwnet_header {
21 u8 h_dest[FWNET_ALEN]; /* destination address */
22 __be16 h_proto; /* packet type ID field */
23} __packed;
24
25#endif
diff --git a/include/net/gre.h b/include/net/gre.h
index 82665474bcb7..9f03a390c826 100644
--- a/include/net/gre.h
+++ b/include/net/gre.h
@@ -2,6 +2,7 @@
2#define __LINUX_GRE_H 2#define __LINUX_GRE_H
3 3
4#include <linux/skbuff.h> 4#include <linux/skbuff.h>
5#include <net/ip_tunnels.h>
5 6
6#define GREPROTO_CISCO 0 7#define GREPROTO_CISCO 0
7#define GREPROTO_PPTP 1 8#define GREPROTO_PPTP 1
@@ -12,7 +13,57 @@ struct gre_protocol {
12 void (*err_handler)(struct sk_buff *skb, u32 info); 13 void (*err_handler)(struct sk_buff *skb, u32 info);
13}; 14};
14 15
16struct gre_base_hdr {
17 __be16 flags;
18 __be16 protocol;
19};
20#define GRE_HEADER_SECTION 4
21
15int gre_add_protocol(const struct gre_protocol *proto, u8 version); 22int gre_add_protocol(const struct gre_protocol *proto, u8 version);
16int gre_del_protocol(const struct gre_protocol *proto, u8 version); 23int gre_del_protocol(const struct gre_protocol *proto, u8 version);
17 24
25static inline __be16 gre_flags_to_tnl_flags(__be16 flags)
26{
27 __be16 tflags = 0;
28
29 if (flags & GRE_CSUM)
30 tflags |= TUNNEL_CSUM;
31 if (flags & GRE_ROUTING)
32 tflags |= TUNNEL_ROUTING;
33 if (flags & GRE_KEY)
34 tflags |= TUNNEL_KEY;
35 if (flags & GRE_SEQ)
36 tflags |= TUNNEL_SEQ;
37 if (flags & GRE_STRICT)
38 tflags |= TUNNEL_STRICT;
39 if (flags & GRE_REC)
40 tflags |= TUNNEL_REC;
41 if (flags & GRE_VERSION)
42 tflags |= TUNNEL_VERSION;
43
44 return tflags;
45}
46
47static inline __be16 tnl_flags_to_gre_flags(__be16 tflags)
48{
49 __be16 flags = 0;
50
51 if (tflags & TUNNEL_CSUM)
52 flags |= GRE_CSUM;
53 if (tflags & TUNNEL_ROUTING)
54 flags |= GRE_ROUTING;
55 if (tflags & TUNNEL_KEY)
56 flags |= GRE_KEY;
57 if (tflags & TUNNEL_SEQ)
58 flags |= GRE_SEQ;
59 if (tflags & TUNNEL_STRICT)
60 flags |= GRE_STRICT;
61 if (tflags & TUNNEL_REC)
62 flags |= GRE_REC;
63 if (tflags & TUNNEL_VERSION)
64 flags |= GRE_VERSION;
65
66 return flags;
67}
68
18#endif 69#endif
diff --git a/include/net/inet_connection_sock.h b/include/net/inet_connection_sock.h
index 183292722f6e..de2c78529afa 100644
--- a/include/net/inet_connection_sock.h
+++ b/include/net/inet_connection_sock.h
@@ -133,6 +133,8 @@ struct inet_connection_sock {
133#define ICSK_TIME_RETRANS 1 /* Retransmit timer */ 133#define ICSK_TIME_RETRANS 1 /* Retransmit timer */
134#define ICSK_TIME_DACK 2 /* Delayed ack timer */ 134#define ICSK_TIME_DACK 2 /* Delayed ack timer */
135#define ICSK_TIME_PROBE0 3 /* Zero window probe timer */ 135#define ICSK_TIME_PROBE0 3 /* Zero window probe timer */
136#define ICSK_TIME_EARLY_RETRANS 4 /* Early retransmit timer */
137#define ICSK_TIME_LOSS_PROBE 5 /* Tail loss probe timer */
136 138
137static inline struct inet_connection_sock *inet_csk(const struct sock *sk) 139static inline struct inet_connection_sock *inet_csk(const struct sock *sk)
138{ 140{
@@ -222,7 +224,8 @@ static inline void inet_csk_reset_xmit_timer(struct sock *sk, const int what,
222 when = max_when; 224 when = max_when;
223 } 225 }
224 226
225 if (what == ICSK_TIME_RETRANS || what == ICSK_TIME_PROBE0) { 227 if (what == ICSK_TIME_RETRANS || what == ICSK_TIME_PROBE0 ||
228 what == ICSK_TIME_EARLY_RETRANS || what == ICSK_TIME_LOSS_PROBE) {
226 icsk->icsk_pending = what; 229 icsk->icsk_pending = what;
227 icsk->icsk_timeout = jiffies + when; 230 icsk->icsk_timeout = jiffies + when;
228 sk_reset_timer(sk, &icsk->icsk_retransmit_timer, icsk->icsk_timeout); 231 sk_reset_timer(sk, &icsk->icsk_retransmit_timer, icsk->icsk_timeout);
diff --git a/include/net/inet_frag.h b/include/net/inet_frag.h
index 0a1dcc2fa2f5..7cac9c5789b5 100644
--- a/include/net/inet_frag.h
+++ b/include/net/inet_frag.h
@@ -143,6 +143,7 @@ static inline void inet_frag_lru_del(struct inet_frag_queue *q)
143{ 143{
144 spin_lock(&q->net->lru_lock); 144 spin_lock(&q->net->lru_lock);
145 list_del(&q->lru_list); 145 list_del(&q->lru_list);
146 q->net->nqueues--;
146 spin_unlock(&q->net->lru_lock); 147 spin_unlock(&q->net->lru_lock);
147} 148}
148 149
@@ -151,6 +152,19 @@ static inline void inet_frag_lru_add(struct netns_frags *nf,
151{ 152{
152 spin_lock(&nf->lru_lock); 153 spin_lock(&nf->lru_lock);
153 list_add_tail(&q->lru_list, &nf->lru_list); 154 list_add_tail(&q->lru_list, &nf->lru_list);
155 q->net->nqueues++;
154 spin_unlock(&nf->lru_lock); 156 spin_unlock(&nf->lru_lock);
155} 157}
158
159/* RFC 3168 support :
160 * We want to check ECN values of all fragments, do detect invalid combinations.
161 * In ipq->ecn, we store the OR value of each ip4_frag_ecn() fragment value.
162 */
163#define IPFRAG_ECN_NOT_ECT 0x01 /* one frag had ECN_NOT_ECT */
164#define IPFRAG_ECN_ECT_1 0x02 /* one frag had ECN_ECT_1 */
165#define IPFRAG_ECN_ECT_0 0x04 /* one frag had ECN_ECT_0 */
166#define IPFRAG_ECN_CE 0x08 /* one frag had ECN_CE */
167
168extern const u8 ip_frag_ecn_table[16];
169
156#endif 170#endif
diff --git a/include/net/ip6_tunnel.h b/include/net/ip6_tunnel.h
index e03047f7090b..4da5de10d1d4 100644
--- a/include/net/ip6_tunnel.h
+++ b/include/net/ip6_tunnel.h
@@ -3,6 +3,7 @@
3 3
4#include <linux/ipv6.h> 4#include <linux/ipv6.h>
5#include <linux/netdevice.h> 5#include <linux/netdevice.h>
6#include <linux/if_tunnel.h>
6#include <linux/ip6_tunnel.h> 7#include <linux/ip6_tunnel.h>
7 8
8#define IP6TUNNEL_ERR_TIMEO (30*HZ) 9#define IP6TUNNEL_ERR_TIMEO (30*HZ)
@@ -68,4 +69,24 @@ __u16 ip6_tnl_parse_tlv_enc_lim(struct sk_buff *skb, __u8 *raw);
68__u32 ip6_tnl_get_cap(struct ip6_tnl *t, const struct in6_addr *laddr, 69__u32 ip6_tnl_get_cap(struct ip6_tnl *t, const struct in6_addr *laddr,
69 const struct in6_addr *raddr); 70 const struct in6_addr *raddr);
70 71
72static inline void ip6tunnel_xmit(struct sk_buff *skb, struct net_device *dev)
73{
74 struct net_device_stats *stats = &dev->stats;
75 int pkt_len, err;
76
77 nf_reset(skb);
78 pkt_len = skb->len;
79 err = ip6_local_out(skb);
80
81 if (net_xmit_eval(err) == 0) {
82 struct pcpu_tstats *tstats = this_cpu_ptr(dev->tstats);
83 u64_stats_update_begin(&tstats->syncp);
84 tstats->tx_bytes += pkt_len;
85 tstats->tx_packets++;
86 u64_stats_update_end(&tstats->syncp);
87 } else {
88 stats->tx_errors++;
89 stats->tx_aborted_errors++;
90 }
91}
71#endif 92#endif
diff --git a/include/net/ip_tunnels.h b/include/net/ip_tunnels.h
new file mode 100644
index 000000000000..4b6f0b28f41f
--- /dev/null
+++ b/include/net/ip_tunnels.h
@@ -0,0 +1,177 @@
1#ifndef __NET_IP_TUNNELS_H
2#define __NET_IP_TUNNELS_H 1
3
4#include <linux/if_tunnel.h>
5#include <linux/netdevice.h>
6#include <linux/skbuff.h>
7#include <linux/types.h>
8#include <linux/u64_stats_sync.h>
9#include <net/dsfield.h>
10#include <net/gro_cells.h>
11#include <net/inet_ecn.h>
12#include <net/ip.h>
13#include <net/rtnetlink.h>
14
15#if IS_ENABLED(CONFIG_IPV6)
16#include <net/ipv6.h>
17#include <net/ip6_fib.h>
18#include <net/ip6_route.h>
19#endif
20
21/* Keep error state on tunnel for 30 sec */
22#define IPTUNNEL_ERR_TIMEO (30*HZ)
23
24/* 6rd prefix/relay information */
25#ifdef CONFIG_IPV6_SIT_6RD
26struct ip_tunnel_6rd_parm {
27 struct in6_addr prefix;
28 __be32 relay_prefix;
29 u16 prefixlen;
30 u16 relay_prefixlen;
31};
32#endif
33
34struct ip_tunnel_prl_entry {
35 struct ip_tunnel_prl_entry __rcu *next;
36 __be32 addr;
37 u16 flags;
38 struct rcu_head rcu_head;
39};
40
41struct ip_tunnel {
42 struct ip_tunnel __rcu *next;
43 struct hlist_node hash_node;
44 struct net_device *dev;
45
46 int err_count; /* Number of arrived ICMP errors */
47 unsigned long err_time; /* Time when the last ICMP error
48 * arrived */
49
50 /* These four fields used only by GRE */
51 __u32 i_seqno; /* The last seen seqno */
52 __u32 o_seqno; /* The last output seqno */
53 int hlen; /* Precalculated header length */
54 int mlink;
55
56 struct ip_tunnel_parm parms;
57
58 /* for SIT */
59#ifdef CONFIG_IPV6_SIT_6RD
60 struct ip_tunnel_6rd_parm ip6rd;
61#endif
62 struct ip_tunnel_prl_entry __rcu *prl; /* potential router list */
63 unsigned int prl_count; /* # of entries in PRL */
64 int ip_tnl_net_id;
65 struct gro_cells gro_cells;
66};
67
68#define TUNNEL_CSUM __cpu_to_be16(0x01)
69#define TUNNEL_ROUTING __cpu_to_be16(0x02)
70#define TUNNEL_KEY __cpu_to_be16(0x04)
71#define TUNNEL_SEQ __cpu_to_be16(0x08)
72#define TUNNEL_STRICT __cpu_to_be16(0x10)
73#define TUNNEL_REC __cpu_to_be16(0x20)
74#define TUNNEL_VERSION __cpu_to_be16(0x40)
75#define TUNNEL_NO_KEY __cpu_to_be16(0x80)
76
77struct tnl_ptk_info {
78 __be16 flags;
79 __be16 proto;
80 __be32 key;
81 __be32 seq;
82};
83
84#define PACKET_RCVD 0
85#define PACKET_REJECT 1
86
87#define IP_TNL_HASH_BITS 10
88#define IP_TNL_HASH_SIZE (1 << IP_TNL_HASH_BITS)
89
90struct ip_tunnel_net {
91 struct hlist_head *tunnels;
92 struct net_device *fb_tunnel_dev;
93};
94
95int ip_tunnel_init(struct net_device *dev);
96void ip_tunnel_uninit(struct net_device *dev);
97void ip_tunnel_dellink(struct net_device *dev, struct list_head *head);
98int __net_init ip_tunnel_init_net(struct net *net, int ip_tnl_net_id,
99 struct rtnl_link_ops *ops, char *devname);
100
101void __net_exit ip_tunnel_delete_net(struct ip_tunnel_net *itn);
102
103void ip_tunnel_xmit(struct sk_buff *skb, struct net_device *dev,
104 const struct iphdr *tnl_params);
105int ip_tunnel_ioctl(struct net_device *dev, struct ip_tunnel_parm *p, int cmd);
106int ip_tunnel_change_mtu(struct net_device *dev, int new_mtu);
107
108struct rtnl_link_stats64 *ip_tunnel_get_stats64(struct net_device *dev,
109 struct rtnl_link_stats64 *tot);
110struct ip_tunnel *ip_tunnel_lookup(struct ip_tunnel_net *itn,
111 int link, __be16 flags,
112 __be32 remote, __be32 local,
113 __be32 key);
114
115int ip_tunnel_rcv(struct ip_tunnel *tunnel, struct sk_buff *skb,
116 const struct tnl_ptk_info *tpi, bool log_ecn_error);
117int ip_tunnel_changelink(struct net_device *dev, struct nlattr *tb[],
118 struct ip_tunnel_parm *p);
119int ip_tunnel_newlink(struct net_device *dev, struct nlattr *tb[],
120 struct ip_tunnel_parm *p);
121void ip_tunnel_setup(struct net_device *dev, int net_id);
122
123/* Extract dsfield from inner protocol */
124static inline u8 ip_tunnel_get_dsfield(const struct iphdr *iph,
125 const struct sk_buff *skb)
126{
127 if (skb->protocol == htons(ETH_P_IP))
128 return iph->tos;
129 else if (skb->protocol == htons(ETH_P_IPV6))
130 return ipv6_get_dsfield((const struct ipv6hdr *)iph);
131 else
132 return 0;
133}
134
135/* Propogate ECN bits out */
136static inline u8 ip_tunnel_ecn_encap(u8 tos, const struct iphdr *iph,
137 const struct sk_buff *skb)
138{
139 u8 inner = ip_tunnel_get_dsfield(iph, skb);
140
141 return INET_ECN_encapsulate(tos, inner);
142}
143
144static inline void tunnel_ip_select_ident(struct sk_buff *skb,
145 const struct iphdr *old_iph,
146 struct dst_entry *dst)
147{
148 struct iphdr *iph = ip_hdr(skb);
149
150 /* Use inner packet iph-id if possible. */
151 if (skb->protocol == htons(ETH_P_IP) && old_iph->id)
152 iph->id = old_iph->id;
153 else
154 __ip_select_ident(iph, dst,
155 (skb_shinfo(skb)->gso_segs ?: 1) - 1);
156}
157
158static inline void iptunnel_xmit(struct sk_buff *skb, struct net_device *dev)
159{
160 int err;
161 int pkt_len = skb->len - skb_transport_offset(skb);
162 struct pcpu_tstats *tstats = this_cpu_ptr(dev->tstats);
163
164 nf_reset(skb);
165
166 err = ip_local_out(skb);
167 if (likely(net_xmit_eval(err) == 0)) {
168 u64_stats_update_begin(&tstats->syncp);
169 tstats->tx_bytes += pkt_len;
170 tstats->tx_packets++;
171 u64_stats_update_end(&tstats->syncp);
172 } else {
173 dev->stats.tx_errors++;
174 dev->stats.tx_aborted_errors++;
175 }
176}
177#endif /* __NET_IP_TUNNELS_H */
diff --git a/include/net/ip_vs.h b/include/net/ip_vs.h
index fce8e6b66d55..bee87badabef 100644
--- a/include/net/ip_vs.h
+++ b/include/net/ip_vs.h
@@ -459,7 +459,7 @@ struct ip_vs_estimator {
459struct ip_vs_stats { 459struct ip_vs_stats {
460 struct ip_vs_stats_user ustats; /* statistics */ 460 struct ip_vs_stats_user ustats; /* statistics */
461 struct ip_vs_estimator est; /* estimator */ 461 struct ip_vs_estimator est; /* estimator */
462 struct ip_vs_cpu_stats *cpustats; /* per cpu counters */ 462 struct ip_vs_cpu_stats __percpu *cpustats; /* per cpu counters */
463 spinlock_t lock; /* spin lock */ 463 spinlock_t lock; /* spin lock */
464 struct ip_vs_stats_user ustats0; /* reset values */ 464 struct ip_vs_stats_user ustats0; /* reset values */
465}; 465};
diff --git a/include/net/ipip.h b/include/net/ipip.h
deleted file mode 100644
index 982141c15200..000000000000
--- a/include/net/ipip.h
+++ /dev/null
@@ -1,87 +0,0 @@
1#ifndef __NET_IPIP_H
2#define __NET_IPIP_H 1
3
4#include <linux/if_tunnel.h>
5#include <net/gro_cells.h>
6#include <net/ip.h>
7
8/* Keep error state on tunnel for 30 sec */
9#define IPTUNNEL_ERR_TIMEO (30*HZ)
10
11/* 6rd prefix/relay information */
12struct ip_tunnel_6rd_parm {
13 struct in6_addr prefix;
14 __be32 relay_prefix;
15 u16 prefixlen;
16 u16 relay_prefixlen;
17};
18
19struct ip_tunnel {
20 struct ip_tunnel __rcu *next;
21 struct net_device *dev;
22
23 int err_count; /* Number of arrived ICMP errors */
24 unsigned long err_time; /* Time when the last ICMP error arrived */
25
26 /* These four fields used only by GRE */
27 __u32 i_seqno; /* The last seen seqno */
28 __u32 o_seqno; /* The last output seqno */
29 int hlen; /* Precalculated GRE header length */
30 int mlink;
31
32 struct ip_tunnel_parm parms;
33
34 /* for SIT */
35#ifdef CONFIG_IPV6_SIT_6RD
36 struct ip_tunnel_6rd_parm ip6rd;
37#endif
38 struct ip_tunnel_prl_entry __rcu *prl; /* potential router list */
39 unsigned int prl_count; /* # of entries in PRL */
40
41 struct gro_cells gro_cells;
42};
43
44struct ip_tunnel_prl_entry {
45 struct ip_tunnel_prl_entry __rcu *next;
46 __be32 addr;
47 u16 flags;
48 struct rcu_head rcu_head;
49};
50
51static inline void iptunnel_xmit(struct sk_buff *skb, struct net_device *dev)
52{
53 int err;
54 struct iphdr *iph = ip_hdr(skb);
55 int pkt_len = skb->len - skb_transport_offset(skb);
56 struct pcpu_tstats *tstats = this_cpu_ptr(dev->tstats);
57
58 nf_reset(skb);
59 skb->ip_summed = CHECKSUM_NONE;
60 ip_select_ident(iph, skb_dst(skb), NULL);
61
62 err = ip_local_out(skb);
63 if (likely(net_xmit_eval(err) == 0)) {
64 u64_stats_update_begin(&tstats->syncp);
65 tstats->tx_bytes += pkt_len;
66 tstats->tx_packets++;
67 u64_stats_update_end(&tstats->syncp);
68 } else {
69 dev->stats.tx_errors++;
70 dev->stats.tx_aborted_errors++;
71 }
72}
73
74static inline void tunnel_ip_select_ident(struct sk_buff *skb,
75 const struct iphdr *old_iph,
76 struct dst_entry *dst)
77{
78 struct iphdr *iph = ip_hdr(skb);
79
80 /* Use inner packet iph-id if possible. */
81 if (skb->protocol == htons(ETH_P_IP) && old_iph->id)
82 iph->id = old_iph->id;
83 else
84 __ip_select_ident(iph, dst,
85 (skb_shinfo(skb)->gso_segs ?: 1) - 1);
86}
87#endif
diff --git a/include/net/ipv6.h b/include/net/ipv6.h
index 64d12e77719a..0810aa57c780 100644
--- a/include/net/ipv6.h
+++ b/include/net/ipv6.h
@@ -217,7 +217,7 @@ struct ipv6_txoptions {
217}; 217};
218 218
219struct ip6_flowlabel { 219struct ip6_flowlabel {
220 struct ip6_flowlabel *next; 220 struct ip6_flowlabel __rcu *next;
221 __be32 label; 221 __be32 label;
222 atomic_t users; 222 atomic_t users;
223 struct in6_addr dst; 223 struct in6_addr dst;
@@ -238,9 +238,9 @@ struct ip6_flowlabel {
238#define IPV6_FLOWLABEL_MASK cpu_to_be32(0x000FFFFF) 238#define IPV6_FLOWLABEL_MASK cpu_to_be32(0x000FFFFF)
239 239
240struct ipv6_fl_socklist { 240struct ipv6_fl_socklist {
241 struct ipv6_fl_socklist *next; 241 struct ipv6_fl_socklist __rcu *next;
242 struct ip6_flowlabel *fl; 242 struct ip6_flowlabel *fl;
243 struct rcu_head rcu; 243 struct rcu_head rcu;
244}; 244};
245 245
246extern struct ip6_flowlabel *fl6_sock_lookup(struct sock *sk, __be32 label); 246extern struct ip6_flowlabel *fl6_sock_lookup(struct sock *sk, __be32 label);
@@ -320,6 +320,18 @@ static inline int ipv6_addr_src_scope(const struct in6_addr *addr)
320 return __ipv6_addr_src_scope(__ipv6_addr_type(addr)); 320 return __ipv6_addr_src_scope(__ipv6_addr_type(addr));
321} 321}
322 322
323static inline bool __ipv6_addr_needs_scope_id(int type)
324{
325 return type & IPV6_ADDR_LINKLOCAL ||
326 (type & IPV6_ADDR_MULTICAST &&
327 (type & (IPV6_ADDR_LOOPBACK|IPV6_ADDR_LINKLOCAL)));
328}
329
330static inline __u32 ipv6_iface_scope_id(const struct in6_addr *addr, int iface)
331{
332 return __ipv6_addr_needs_scope_id(__ipv6_addr_type(addr)) ? iface : 0;
333}
334
323static inline int ipv6_addr_cmp(const struct in6_addr *a1, const struct in6_addr *a2) 335static inline int ipv6_addr_cmp(const struct in6_addr *a1, const struct in6_addr *a2)
324{ 336{
325 return memcmp(a1, a2, sizeof(struct in6_addr)); 337 return memcmp(a1, a2, sizeof(struct in6_addr));
@@ -466,6 +478,7 @@ struct ip6_create_arg {
466 u32 user; 478 u32 user;
467 const struct in6_addr *src; 479 const struct in6_addr *src;
468 const struct in6_addr *dst; 480 const struct in6_addr *dst;
481 u8 ecn;
469}; 482};
470 483
471void ip6_frag_init(struct inet_frag_queue *q, void *a); 484void ip6_frag_init(struct inet_frag_queue *q, void *a);
@@ -485,6 +498,7 @@ struct frag_queue {
485 int iif; 498 int iif;
486 unsigned int csum; 499 unsigned int csum;
487 __u16 nhoffset; 500 __u16 nhoffset;
501 u8 ecn;
488}; 502};
489 503
490void ip6_expire_frag_queue(struct net *net, struct frag_queue *fq, 504void ip6_expire_frag_queue(struct net *net, struct frag_queue *fq,
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index f7eba1300d82..cdd7cea1fd4c 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -1101,8 +1101,6 @@ static inline bool ieee80211_vif_is_mesh(struct ieee80211_vif *vif)
1101 * These flags are used for communication about keys between the driver 1101 * These flags are used for communication about keys between the driver
1102 * and mac80211, with the @flags parameter of &struct ieee80211_key_conf. 1102 * and mac80211, with the @flags parameter of &struct ieee80211_key_conf.
1103 * 1103 *
1104 * @IEEE80211_KEY_FLAG_WMM_STA: Set by mac80211, this flag indicates
1105 * that the STA this key will be used with could be using QoS.
1106 * @IEEE80211_KEY_FLAG_GENERATE_IV: This flag should be set by the 1104 * @IEEE80211_KEY_FLAG_GENERATE_IV: This flag should be set by the
1107 * driver to indicate that it requires IV generation for this 1105 * driver to indicate that it requires IV generation for this
1108 * particular key. 1106 * particular key.
@@ -1127,7 +1125,6 @@ static inline bool ieee80211_vif_is_mesh(struct ieee80211_vif *vif)
1127 * %IEEE80211_KEY_FLAG_SW_MGMT_TX flag to encrypt such frames in SW. 1125 * %IEEE80211_KEY_FLAG_SW_MGMT_TX flag to encrypt such frames in SW.
1128 */ 1126 */
1129enum ieee80211_key_flags { 1127enum ieee80211_key_flags {
1130 IEEE80211_KEY_FLAG_WMM_STA = 1<<0,
1131 IEEE80211_KEY_FLAG_GENERATE_IV = 1<<1, 1128 IEEE80211_KEY_FLAG_GENERATE_IV = 1<<1,
1132 IEEE80211_KEY_FLAG_GENERATE_MMIC= 1<<2, 1129 IEEE80211_KEY_FLAG_GENERATE_MMIC= 1<<2,
1133 IEEE80211_KEY_FLAG_PAIRWISE = 1<<3, 1130 IEEE80211_KEY_FLAG_PAIRWISE = 1<<3,
@@ -1231,9 +1228,8 @@ enum ieee80211_sta_rx_bandwidth {
1231 * @addr: MAC address 1228 * @addr: MAC address
1232 * @aid: AID we assigned to the station if we're an AP 1229 * @aid: AID we assigned to the station if we're an AP
1233 * @supp_rates: Bitmap of supported rates (per band) 1230 * @supp_rates: Bitmap of supported rates (per band)
1234 * @ht_cap: HT capabilities of this STA; restricted to our own TX capabilities 1231 * @ht_cap: HT capabilities of this STA; restricted to our own capabilities
1235 * @vht_cap: VHT capabilities of this STA; Not restricting any capabilities 1232 * @vht_cap: VHT capabilities of this STA; restricted to our own capabilities
1236 * of remote STA. Taking as is.
1237 * @wme: indicates whether the STA supports WME. Only valid during AP-mode. 1233 * @wme: indicates whether the STA supports WME. Only valid during AP-mode.
1238 * @drv_priv: data area for driver use, will always be aligned to 1234 * @drv_priv: data area for driver use, will always be aligned to
1239 * sizeof(void *), size is determined in hw information. 1235 * sizeof(void *), size is determined in hw information.
@@ -2135,6 +2131,24 @@ enum ieee80211_rate_control_changed {
2135}; 2131};
2136 2132
2137/** 2133/**
2134 * enum ieee80211_roc_type - remain on channel type
2135 *
2136 * With the support for multi channel contexts and multi channel operations,
2137 * remain on channel operations might be limited/deferred/aborted by other
2138 * flows/operations which have higher priority (and vise versa).
2139 * Specifying the ROC type can be used by devices to prioritize the ROC
2140 * operations compared to other operations/flows.
2141 *
2142 * @IEEE80211_ROC_TYPE_NORMAL: There are no special requirements for this ROC.
2143 * @IEEE80211_ROC_TYPE_MGMT_TX: The remain on channel request is required
2144 * for sending managment frames offchannel.
2145 */
2146enum ieee80211_roc_type {
2147 IEEE80211_ROC_TYPE_NORMAL = 0,
2148 IEEE80211_ROC_TYPE_MGMT_TX,
2149};
2150
2151/**
2138 * struct ieee80211_ops - callbacks from mac80211 to the driver 2152 * struct ieee80211_ops - callbacks from mac80211 to the driver
2139 * 2153 *
2140 * This structure contains various callbacks that the driver may 2154 * This structure contains various callbacks that the driver may
@@ -2687,7 +2701,8 @@ struct ieee80211_ops {
2687 int (*remain_on_channel)(struct ieee80211_hw *hw, 2701 int (*remain_on_channel)(struct ieee80211_hw *hw,
2688 struct ieee80211_vif *vif, 2702 struct ieee80211_vif *vif,
2689 struct ieee80211_channel *chan, 2703 struct ieee80211_channel *chan,
2690 int duration); 2704 int duration,
2705 enum ieee80211_roc_type type);
2691 int (*cancel_remain_on_channel)(struct ieee80211_hw *hw); 2706 int (*cancel_remain_on_channel)(struct ieee80211_hw *hw);
2692 int (*set_ringparam)(struct ieee80211_hw *hw, u32 tx, u32 rx); 2707 int (*set_ringparam)(struct ieee80211_hw *hw, u32 tx, u32 rx);
2693 void (*get_ringparam)(struct ieee80211_hw *hw, 2708 void (*get_ringparam)(struct ieee80211_hw *hw,
diff --git a/include/net/netfilter/nf_conntrack_core.h b/include/net/netfilter/nf_conntrack_core.h
index 930275fa2ea6..fb2b6234e937 100644
--- a/include/net/netfilter/nf_conntrack_core.h
+++ b/include/net/netfilter/nf_conntrack_core.h
@@ -27,6 +27,7 @@ extern unsigned int nf_conntrack_in(struct net *net,
27 27
28extern int nf_conntrack_init_net(struct net *net); 28extern int nf_conntrack_init_net(struct net *net);
29extern void nf_conntrack_cleanup_net(struct net *net); 29extern void nf_conntrack_cleanup_net(struct net *net);
30extern void nf_conntrack_cleanup_net_list(struct list_head *net_exit_list);
30 31
31extern int nf_conntrack_proto_pernet_init(struct net *net); 32extern int nf_conntrack_proto_pernet_init(struct net *net);
32extern void nf_conntrack_proto_pernet_fini(struct net *net); 33extern void nf_conntrack_proto_pernet_fini(struct net *net);
diff --git a/include/net/netns/ipv6.h b/include/net/netns/ipv6.h
index 1242f371718b..005e2c2e39a9 100644
--- a/include/net/netns/ipv6.h
+++ b/include/net/netns/ipv6.h
@@ -71,6 +71,7 @@ struct netns_ipv6 {
71 struct fib_rules_ops *mr6_rules_ops; 71 struct fib_rules_ops *mr6_rules_ops;
72#endif 72#endif
73#endif 73#endif
74 atomic_t dev_addr_genid;
74}; 75};
75 76
76#if IS_ENABLED(CONFIG_NF_DEFRAG_IPV6) 77#if IS_ENABLED(CONFIG_NF_DEFRAG_IPV6)
diff --git a/include/net/request_sock.h b/include/net/request_sock.h
index a51dbd17c2de..9069e65c1c56 100644
--- a/include/net/request_sock.h
+++ b/include/net/request_sock.h
@@ -27,19 +27,13 @@ struct sk_buff;
27struct dst_entry; 27struct dst_entry;
28struct proto; 28struct proto;
29 29
30/* empty to "strongly type" an otherwise void parameter.
31 */
32struct request_values {
33};
34
35struct request_sock_ops { 30struct request_sock_ops {
36 int family; 31 int family;
37 int obj_size; 32 int obj_size;
38 struct kmem_cache *slab; 33 struct kmem_cache *slab;
39 char *slab_name; 34 char *slab_name;
40 int (*rtx_syn_ack)(struct sock *sk, 35 int (*rtx_syn_ack)(struct sock *sk,
41 struct request_sock *req, 36 struct request_sock *req);
42 struct request_values *rvp);
43 void (*send_ack)(struct sock *sk, struct sk_buff *skb, 37 void (*send_ack)(struct sock *sk, struct sk_buff *skb,
44 struct request_sock *req); 38 struct request_sock *req);
45 void (*send_reset)(struct sock *sk, 39 void (*send_reset)(struct sock *sk,
diff --git a/include/net/rtnetlink.h b/include/net/rtnetlink.h
index 5a15fabd6a75..702664833a53 100644
--- a/include/net/rtnetlink.h
+++ b/include/net/rtnetlink.h
@@ -4,7 +4,7 @@
4#include <linux/rtnetlink.h> 4#include <linux/rtnetlink.h>
5#include <net/netlink.h> 5#include <net/netlink.h>
6 6
7typedef int (*rtnl_doit_func)(struct sk_buff *, struct nlmsghdr *, void *); 7typedef int (*rtnl_doit_func)(struct sk_buff *, struct nlmsghdr *);
8typedef int (*rtnl_dumpit_func)(struct sk_buff *, struct netlink_callback *); 8typedef int (*rtnl_dumpit_func)(struct sk_buff *, struct netlink_callback *);
9typedef u16 (*rtnl_calcit_func)(struct sk_buff *, struct nlmsghdr *); 9typedef u16 (*rtnl_calcit_func)(struct sk_buff *, struct nlmsghdr *);
10 10
diff --git a/include/net/sock.h b/include/net/sock.h
index 14f6e9d19dc7..08f05f964737 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -667,6 +667,7 @@ enum sock_flags {
667 * user-space instead. 667 * user-space instead.
668 */ 668 */
669 SOCK_FILTER_LOCKED, /* Filter cannot be changed anymore */ 669 SOCK_FILTER_LOCKED, /* Filter cannot be changed anymore */
670 SOCK_SELECT_ERR_QUEUE, /* Wake select on error queue */
670}; 671};
671 672
672static inline void sock_copy_flags(struct sock *nsk, struct sock *osk) 673static inline void sock_copy_flags(struct sock *nsk, struct sock *osk)
diff --git a/include/net/tcp.h b/include/net/tcp.h
index cf0694d4ad60..4475aaf0af57 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -179,7 +179,6 @@ extern void tcp_time_wait(struct sock *sk, int state, int timeo);
179#define TCPOPT_SACK 5 /* SACK Block */ 179#define TCPOPT_SACK 5 /* SACK Block */
180#define TCPOPT_TIMESTAMP 8 /* Better RTT estimations/PAWS */ 180#define TCPOPT_TIMESTAMP 8 /* Better RTT estimations/PAWS */
181#define TCPOPT_MD5SIG 19 /* MD5 Signature (RFC2385) */ 181#define TCPOPT_MD5SIG 19 /* MD5 Signature (RFC2385) */
182#define TCPOPT_COOKIE 253 /* Cookie extension (experimental) */
183#define TCPOPT_EXP 254 /* Experimental */ 182#define TCPOPT_EXP 254 /* Experimental */
184/* Magic number to be after the option value for sharing TCP 183/* Magic number to be after the option value for sharing TCP
185 * experimental options. See draft-ietf-tcpm-experimental-options-00.txt 184 * experimental options. See draft-ietf-tcpm-experimental-options-00.txt
@@ -273,7 +272,6 @@ extern int sysctl_tcp_app_win;
273extern int sysctl_tcp_adv_win_scale; 272extern int sysctl_tcp_adv_win_scale;
274extern int sysctl_tcp_tw_reuse; 273extern int sysctl_tcp_tw_reuse;
275extern int sysctl_tcp_frto; 274extern int sysctl_tcp_frto;
276extern int sysctl_tcp_frto_response;
277extern int sysctl_tcp_low_latency; 275extern int sysctl_tcp_low_latency;
278extern int sysctl_tcp_dma_copybreak; 276extern int sysctl_tcp_dma_copybreak;
279extern int sysctl_tcp_nometrics_save; 277extern int sysctl_tcp_nometrics_save;
@@ -284,7 +282,6 @@ extern int sysctl_tcp_base_mss;
284extern int sysctl_tcp_workaround_signed_windows; 282extern int sysctl_tcp_workaround_signed_windows;
285extern int sysctl_tcp_slow_start_after_idle; 283extern int sysctl_tcp_slow_start_after_idle;
286extern int sysctl_tcp_max_ssthresh; 284extern int sysctl_tcp_max_ssthresh;
287extern int sysctl_tcp_cookie_size;
288extern int sysctl_tcp_thin_linear_timeouts; 285extern int sysctl_tcp_thin_linear_timeouts;
289extern int sysctl_tcp_thin_dupack; 286extern int sysctl_tcp_thin_dupack;
290extern int sysctl_tcp_early_retrans; 287extern int sysctl_tcp_early_retrans;
@@ -425,8 +422,6 @@ extern struct sock * tcp_check_req(struct sock *sk,struct sk_buff *skb,
425 bool fastopen); 422 bool fastopen);
426extern int tcp_child_process(struct sock *parent, struct sock *child, 423extern int tcp_child_process(struct sock *parent, struct sock *child,
427 struct sk_buff *skb); 424 struct sk_buff *skb);
428extern bool tcp_use_frto(struct sock *sk);
429extern void tcp_enter_frto(struct sock *sk);
430extern void tcp_enter_loss(struct sock *sk, int how); 425extern void tcp_enter_loss(struct sock *sk, int how);
431extern void tcp_clear_retrans(struct tcp_sock *tp); 426extern void tcp_clear_retrans(struct tcp_sock *tp);
432extern void tcp_update_metrics(struct sock *sk); 427extern void tcp_update_metrics(struct sock *sk);
@@ -454,7 +449,7 @@ extern void tcp_syn_ack_timeout(struct sock *sk, struct request_sock *req);
454extern int tcp_recvmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, 449extern int tcp_recvmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
455 size_t len, int nonblock, int flags, int *addr_len); 450 size_t len, int nonblock, int flags, int *addr_len);
456extern void tcp_parse_options(const struct sk_buff *skb, 451extern void tcp_parse_options(const struct sk_buff *skb,
457 struct tcp_options_received *opt_rx, const u8 **hvpp, 452 struct tcp_options_received *opt_rx,
458 int estab, struct tcp_fastopen_cookie *foc); 453 int estab, struct tcp_fastopen_cookie *foc);
459extern const u8 *tcp_parse_md5sig_option(const struct tcphdr *th); 454extern const u8 *tcp_parse_md5sig_option(const struct tcphdr *th);
460 455
@@ -476,7 +471,6 @@ extern int tcp_v4_connect(struct sock *sk, struct sockaddr *uaddr,
476extern int tcp_connect(struct sock *sk); 471extern int tcp_connect(struct sock *sk);
477extern struct sk_buff * tcp_make_synack(struct sock *sk, struct dst_entry *dst, 472extern struct sk_buff * tcp_make_synack(struct sock *sk, struct dst_entry *dst,
478 struct request_sock *req, 473 struct request_sock *req,
479 struct request_values *rvp,
480 struct tcp_fastopen_cookie *foc); 474 struct tcp_fastopen_cookie *foc);
481extern int tcp_disconnect(struct sock *sk, int flags); 475extern int tcp_disconnect(struct sock *sk, int flags);
482 476
@@ -543,6 +537,8 @@ extern bool tcp_syn_flood_action(struct sock *sk,
543extern void tcp_push_one(struct sock *, unsigned int mss_now); 537extern void tcp_push_one(struct sock *, unsigned int mss_now);
544extern void tcp_send_ack(struct sock *sk); 538extern void tcp_send_ack(struct sock *sk);
545extern void tcp_send_delayed_ack(struct sock *sk); 539extern void tcp_send_delayed_ack(struct sock *sk);
540extern void tcp_send_loss_probe(struct sock *sk);
541extern bool tcp_schedule_loss_probe(struct sock *sk);
546 542
547/* tcp_input.c */ 543/* tcp_input.c */
548extern void tcp_cwnd_application_limited(struct sock *sk); 544extern void tcp_cwnd_application_limited(struct sock *sk);
@@ -756,7 +752,6 @@ enum tcp_ca_event {
756 CA_EVENT_TX_START, /* first transmit when no packets in flight */ 752 CA_EVENT_TX_START, /* first transmit when no packets in flight */
757 CA_EVENT_CWND_RESTART, /* congestion window restart */ 753 CA_EVENT_CWND_RESTART, /* congestion window restart */
758 CA_EVENT_COMPLETE_CWR, /* end of congestion recovery */ 754 CA_EVENT_COMPLETE_CWR, /* end of congestion recovery */
759 CA_EVENT_FRTO, /* fast recovery timeout */
760 CA_EVENT_LOSS, /* loss timeout */ 755 CA_EVENT_LOSS, /* loss timeout */
761 CA_EVENT_FAST_ACK, /* in sequence ack */ 756 CA_EVENT_FAST_ACK, /* in sequence ack */
762 CA_EVENT_SLOW_ACK, /* other ack */ 757 CA_EVENT_SLOW_ACK, /* other ack */
@@ -873,8 +868,8 @@ static inline void tcp_enable_fack(struct tcp_sock *tp)
873static inline void tcp_enable_early_retrans(struct tcp_sock *tp) 868static inline void tcp_enable_early_retrans(struct tcp_sock *tp)
874{ 869{
875 tp->do_early_retrans = sysctl_tcp_early_retrans && 870 tp->do_early_retrans = sysctl_tcp_early_retrans &&
876 !sysctl_tcp_thin_dupack && sysctl_tcp_reordering == 3; 871 sysctl_tcp_early_retrans < 4 && !sysctl_tcp_thin_dupack &&
877 tp->early_retrans_delayed = 0; 872 sysctl_tcp_reordering == 3;
878} 873}
879 874
880static inline void tcp_disable_early_retrans(struct tcp_sock *tp) 875static inline void tcp_disable_early_retrans(struct tcp_sock *tp)
@@ -1030,50 +1025,7 @@ static inline void tcp_prequeue_init(struct tcp_sock *tp)
1030#endif 1025#endif
1031} 1026}
1032 1027
1033/* Packet is added to VJ-style prequeue for processing in process 1028extern bool tcp_prequeue(struct sock *sk, struct sk_buff *skb);
1034 * context, if a reader task is waiting. Apparently, this exciting
1035 * idea (VJ's mail "Re: query about TCP header on tcp-ip" of 07 Sep 93)
1036 * failed somewhere. Latency? Burstiness? Well, at least now we will
1037 * see, why it failed. 8)8) --ANK
1038 *
1039 * NOTE: is this not too big to inline?
1040 */
1041static inline bool tcp_prequeue(struct sock *sk, struct sk_buff *skb)
1042{
1043 struct tcp_sock *tp = tcp_sk(sk);
1044
1045 if (sysctl_tcp_low_latency || !tp->ucopy.task)
1046 return false;
1047
1048 if (skb->len <= tcp_hdrlen(skb) &&
1049 skb_queue_len(&tp->ucopy.prequeue) == 0)
1050 return false;
1051
1052 __skb_queue_tail(&tp->ucopy.prequeue, skb);
1053 tp->ucopy.memory += skb->truesize;
1054 if (tp->ucopy.memory > sk->sk_rcvbuf) {
1055 struct sk_buff *skb1;
1056
1057 BUG_ON(sock_owned_by_user(sk));
1058
1059 while ((skb1 = __skb_dequeue(&tp->ucopy.prequeue)) != NULL) {
1060 sk_backlog_rcv(sk, skb1);
1061 NET_INC_STATS_BH(sock_net(sk),
1062 LINUX_MIB_TCPPREQUEUEDROPPED);
1063 }
1064
1065 tp->ucopy.memory = 0;
1066 } else if (skb_queue_len(&tp->ucopy.prequeue) == 1) {
1067 wake_up_interruptible_sync_poll(sk_sleep(sk),
1068 POLLIN | POLLRDNORM | POLLRDBAND);
1069 if (!inet_csk_ack_scheduled(sk))
1070 inet_csk_reset_xmit_timer(sk, ICSK_TIME_DACK,
1071 (3 * tcp_rto_min(sk)) / 4,
1072 TCP_RTO_MAX);
1073 }
1074 return true;
1075}
1076
1077 1029
1078#undef STATE_TRACE 1030#undef STATE_TRACE
1079 1031
@@ -1630,91 +1582,6 @@ struct tcp_request_sock_ops {
1630#endif 1582#endif
1631}; 1583};
1632 1584
1633/* Using SHA1 for now, define some constants.
1634 */
1635#define COOKIE_DIGEST_WORDS (SHA_DIGEST_WORDS)
1636#define COOKIE_MESSAGE_WORDS (SHA_MESSAGE_BYTES / 4)
1637#define COOKIE_WORKSPACE_WORDS (COOKIE_DIGEST_WORDS + COOKIE_MESSAGE_WORDS)
1638
1639extern int tcp_cookie_generator(u32 *bakery);
1640
1641/**
1642 * struct tcp_cookie_values - each socket needs extra space for the
1643 * cookies, together with (optional) space for any SYN data.
1644 *
1645 * A tcp_sock contains a pointer to the current value, and this is
1646 * cloned to the tcp_timewait_sock.
1647 *
1648 * @cookie_pair: variable data from the option exchange.
1649 *
1650 * @cookie_desired: user specified tcpct_cookie_desired. Zero
1651 * indicates default (sysctl_tcp_cookie_size).
1652 * After cookie sent, remembers size of cookie.
1653 * Range 0, TCP_COOKIE_MIN to TCP_COOKIE_MAX.
1654 *
1655 * @s_data_desired: user specified tcpct_s_data_desired. When the
1656 * constant payload is specified (@s_data_constant),
1657 * holds its length instead.
1658 * Range 0 to TCP_MSS_DESIRED.
1659 *
1660 * @s_data_payload: constant data that is to be included in the
1661 * payload of SYN or SYNACK segments when the
1662 * cookie option is present.
1663 */
1664struct tcp_cookie_values {
1665 struct kref kref;
1666 u8 cookie_pair[TCP_COOKIE_PAIR_SIZE];
1667 u8 cookie_pair_size;
1668 u8 cookie_desired;
1669 u16 s_data_desired:11,
1670 s_data_constant:1,
1671 s_data_in:1,
1672 s_data_out:1,
1673 s_data_unused:2;
1674 u8 s_data_payload[0];
1675};
1676
1677static inline void tcp_cookie_values_release(struct kref *kref)
1678{
1679 kfree(container_of(kref, struct tcp_cookie_values, kref));
1680}
1681
1682/* The length of constant payload data. Note that s_data_desired is
1683 * overloaded, depending on s_data_constant: either the length of constant
1684 * data (returned here) or the limit on variable data.
1685 */
1686static inline int tcp_s_data_size(const struct tcp_sock *tp)
1687{
1688 return (tp->cookie_values != NULL && tp->cookie_values->s_data_constant)
1689 ? tp->cookie_values->s_data_desired
1690 : 0;
1691}
1692
1693/**
1694 * struct tcp_extend_values - tcp_ipv?.c to tcp_output.c workspace.
1695 *
1696 * As tcp_request_sock has already been extended in other places, the
1697 * only remaining method is to pass stack values along as function
1698 * parameters. These parameters are not needed after sending SYNACK.
1699 *
1700 * @cookie_bakery: cryptographic secret and message workspace.
1701 *
1702 * @cookie_plus: bytes in authenticator/cookie option, copied from
1703 * struct tcp_options_received (above).
1704 */
1705struct tcp_extend_values {
1706 struct request_values rv;
1707 u32 cookie_bakery[COOKIE_WORKSPACE_WORDS];
1708 u8 cookie_plus:6,
1709 cookie_out_never:1,
1710 cookie_in_always:1;
1711};
1712
1713static inline struct tcp_extend_values *tcp_xv(struct request_values *rvp)
1714{
1715 return (struct tcp_extend_values *)rvp;
1716}
1717
1718extern void tcp_v4_init(void); 1585extern void tcp_v4_init(void);
1719extern void tcp_init(void); 1586extern void tcp_init(void);
1720 1587