summaryrefslogtreecommitdiff
path: root/include/net
diff options
context:
space:
mode:
Diffstat (limited to 'include/net')
-rw-r--r--include/net/addrconf.h1
-rw-r--r--include/net/arp.h4
-rw-r--r--include/net/caif/caif_hsi.h1
-rw-r--r--include/net/cfg80211.h64
-rw-r--r--include/net/dn.h1
-rw-r--r--include/net/genetlink.h31
-rw-r--r--include/net/inet_sock.h3
-rw-r--r--include/net/iucv/af_iucv.h2
-rw-r--r--include/net/mac80211.h79
-rw-r--r--include/net/ndisc.h1
-rw-r--r--include/net/netlink.h35
-rw-r--r--include/net/nfc/nci.h53
-rw-r--r--include/net/nfc/nci_core.h26
-rw-r--r--include/net/nfc/nfc.h9
-rw-r--r--include/net/sock.h29
-rw-r--r--include/net/tcp.h66
-rw-r--r--include/net/xfrm.h5
17 files changed, 246 insertions, 164 deletions
diff --git a/include/net/addrconf.h b/include/net/addrconf.h
index f68dce2d8d8..757a17638b1 100644
--- a/include/net/addrconf.h
+++ b/include/net/addrconf.h
@@ -160,7 +160,6 @@ extern void addrconf_prefix_rcv(struct net_device *dev,
extern int ipv6_sock_ac_join(struct sock *sk,int ifindex, const struct in6_addr *addr);
extern int ipv6_sock_ac_drop(struct sock *sk,int ifindex, const struct in6_addr *addr);
extern void ipv6_sock_ac_close(struct sock *sk);
-extern int inet6_ac_check(struct sock *sk, const struct in6_addr *addr, int ifindex);
extern int ipv6_dev_ac_inc(struct net_device *dev, const struct in6_addr *addr);
extern int __ipv6_dev_ac_dec(struct inet6_dev *idev, const struct in6_addr *addr);
diff --git a/include/net/arp.h b/include/net/arp.h
index 0013dc87940..4a1f3fb562e 100644
--- a/include/net/arp.h
+++ b/include/net/arp.h
@@ -15,14 +15,14 @@ static inline u32 arp_hashfn(u32 key, const struct net_device *dev, u32 hash_rnd
return val * hash_rnd;
}
-static inline struct neighbour *__ipv4_neigh_lookup(struct neigh_table *tbl, struct net_device *dev, u32 key)
+static inline struct neighbour *__ipv4_neigh_lookup(struct net_device *dev, u32 key)
{
struct neigh_hash_table *nht;
struct neighbour *n;
u32 hash_val;
rcu_read_lock_bh();
- nht = rcu_dereference_bh(tbl->nht);
+ nht = rcu_dereference_bh(arp_tbl.nht);
hash_val = arp_hashfn(key, dev, nht->hash_rnd[0]) >> (32 - nht->hash_shift);
for (n = rcu_dereference_bh(nht->hash_buckets[hash_val]);
n != NULL;
diff --git a/include/net/caif/caif_hsi.h b/include/net/caif/caif_hsi.h
index 8d552519ff6..6db8ecf52aa 100644
--- a/include/net/caif/caif_hsi.h
+++ b/include/net/caif/caif_hsi.h
@@ -138,6 +138,7 @@ struct cfhsi {
u8 *rx_ptr;
u8 *tx_buf;
u8 *rx_buf;
+ u8 *rx_flip_buf;
spinlock_t lock;
int flow_off_sent;
u32 q_low_mark;
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index a067d30ce73..e0c9ff3a197 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -120,6 +120,7 @@ enum ieee80211_channel_flags {
* @band: band this channel belongs to.
* @max_antenna_gain: maximum antenna gain in dBi
* @max_power: maximum transmission power (in dBm)
+ * @max_reg_power: maximum regulatory transmission power (in dBm)
* @beacon_found: helper to regulatory code to indicate when a beacon
* has been found on this channel. Use regulatory_hint_found_beacon()
* to enable this, this is useful only on 5 GHz band.
@@ -133,6 +134,7 @@ struct ieee80211_channel {
u32 flags;
int max_antenna_gain;
int max_power;
+ int max_reg_power;
bool beacon_found;
u32 orig_flags;
int orig_mag, orig_mpwr;
@@ -796,6 +798,7 @@ struct mesh_config {
* mesh gate, but not necessarily using the gate announcement protocol.
* Still keeping the same nomenclature to be in sync with the spec. */
bool dot11MeshGateAnnouncementProtocol;
+ bool dot11MeshForwarding;
};
/**
@@ -1036,10 +1039,6 @@ const u8 *ieee80211_bss_get_ie(struct cfg80211_bss *bss, u8 ie);
* @key_len: length of WEP key for shared key authentication
* @key_idx: index of WEP key for shared key authentication
* @key: WEP key for shared key authentication
- * @local_state_change: This is a request for a local state only, i.e., no
- * Authentication frame is to be transmitted and authentication state is
- * to be changed without having to wait for a response from the peer STA
- * (AP).
*/
struct cfg80211_auth_request {
struct cfg80211_bss *bss;
@@ -1048,7 +1047,6 @@ struct cfg80211_auth_request {
enum nl80211_auth_type auth_type;
const u8 *key;
u8 key_len, key_idx;
- bool local_state_change;
};
/**
@@ -1065,7 +1063,11 @@ enum cfg80211_assoc_req_flags {
*
* This structure provides information needed to complete IEEE 802.11
* (re)association.
- * @bss: The BSS to associate with.
+ * @bss: The BSS to associate with. If the call is successful the driver
+ * is given a reference that it must release, normally via a call to
+ * cfg80211_send_rx_assoc(), or, if association timed out, with a
+ * call to cfg80211_put_bss() (in addition to calling
+ * cfg80211_send_assoc_timeout())
* @ie: Extra IEs to add to (Re)Association Request frame or %NULL
* @ie_len: Length of ie buffer in octets
* @use_mfp: Use management frame protection (IEEE 802.11w) in this association
@@ -1093,19 +1095,16 @@ struct cfg80211_assoc_request {
* This structure provides information needed to complete IEEE 802.11
* deauthentication.
*
- * @bss: the BSS to deauthenticate from
+ * @bssid: the BSSID of the BSS to deauthenticate from
* @ie: Extra IEs to add to Deauthentication frame or %NULL
* @ie_len: Length of ie buffer in octets
* @reason_code: The reason code for the deauthentication
- * @local_state_change: This is a request for a local state only, i.e., no
- * Deauthentication frame is to be transmitted.
*/
struct cfg80211_deauth_request {
- struct cfg80211_bss *bss;
+ const u8 *bssid;
const u8 *ie;
size_t ie_len;
u16 reason_code;
- bool local_state_change;
};
/**
@@ -1148,6 +1147,10 @@ struct cfg80211_disassoc_request {
* @beacon_interval: beacon interval to use
* @privacy: this is a protected network, keys will be configured
* after joining
+ * @control_port: whether user space controls IEEE 802.1X port, i.e.,
+ * sets/clears %NL80211_STA_FLAG_AUTHORIZED. If true, the driver is
+ * required to assume that the port is unauthorized until authorized by
+ * user space. Otherwise, port is marked authorized by default.
* @basic_rates: bitmap of basic rates to use when creating the IBSS
* @mcast_rate: per-band multicast rate index + 1 (0: disabled)
*/
@@ -1162,6 +1165,7 @@ struct cfg80211_ibss_params {
u32 basic_rates;
bool channel_fixed;
bool privacy;
+ bool control_port;
int mcast_rate[IEEE80211_NUM_BANDS];
};
@@ -1229,8 +1233,7 @@ enum wiphy_params_flags {
struct cfg80211_bitrate_mask {
struct {
u32 legacy;
- /* TODO: add support for masking MCS rates; e.g.: */
- /* u8 mcs[IEEE80211_HT_MCS_MASK_LEN]; */
+ u8 mcs[IEEE80211_HT_MCS_MASK_LEN];
} control[IEEE80211_NUM_BANDS];
};
/**
@@ -2204,8 +2207,6 @@ struct cfg80211_conn;
struct cfg80211_internal_bss;
struct cfg80211_cached_keys;
-#define MAX_AUTH_BSSES 4
-
/**
* struct wireless_dev - wireless per-netdev state
*
@@ -2269,8 +2270,6 @@ struct wireless_dev {
struct list_head event_list;
spinlock_t event_lock;
- struct cfg80211_internal_bss *authtry_bsses[MAX_AUTH_BSSES];
- struct cfg80211_internal_bss *auth_bsses[MAX_AUTH_BSSES];
struct cfg80211_internal_bss *current_bss; /* associated / joined */
struct ieee80211_channel *channel;
@@ -2725,6 +2724,20 @@ struct cfg80211_bss *cfg80211_get_mesh(struct wiphy *wiphy,
struct ieee80211_channel *channel,
const u8 *meshid, size_t meshidlen,
const u8 *meshcfg);
+/**
+ * cfg80211_ref_bss - reference BSS struct
+ * @bss: the BSS struct to reference
+ *
+ * Increments the refcount of the given BSS struct.
+ */
+void cfg80211_ref_bss(struct cfg80211_bss *bss);
+
+/**
+ * cfg80211_put_bss - unref BSS struct
+ * @bss: the BSS struct
+ *
+ * Decrements the refcount of the given BSS struct.
+ */
void cfg80211_put_bss(struct cfg80211_bss *bss);
/**
@@ -2762,20 +2775,10 @@ void cfg80211_send_rx_auth(struct net_device *dev, const u8 *buf, size_t len);
void cfg80211_send_auth_timeout(struct net_device *dev, const u8 *addr);
/**
- * __cfg80211_auth_canceled - notify cfg80211 that authentication was canceled
- * @dev: network device
- * @addr: The MAC address of the device with which the authentication timed out
- *
- * When a pending authentication had no action yet, the driver may decide
- * to not send a deauth frame, but in that case must calls this function
- * to tell cfg80211 about this decision. It is only valid to call this
- * function within the deauth() callback.
- */
-void __cfg80211_auth_canceled(struct net_device *dev, const u8 *addr);
-
-/**
* cfg80211_send_rx_assoc - notification of processed association
* @dev: network device
+ * @bss: the BSS struct association was requested for, the struct reference
+ * is owned by cfg80211 after this call
* @buf: (re)association response frame (header + body)
* @len: length of the frame data
*
@@ -2784,7 +2787,8 @@ void __cfg80211_auth_canceled(struct net_device *dev, const u8 *addr);
* function or cfg80211_send_assoc_timeout() to indicate the result of
* cfg80211_ops::assoc() call. This function may sleep.
*/
-void cfg80211_send_rx_assoc(struct net_device *dev, const u8 *buf, size_t len);
+void cfg80211_send_rx_assoc(struct net_device *dev, struct cfg80211_bss *bss,
+ const u8 *buf, size_t len);
/**
* cfg80211_send_assoc_timeout - notification of timed out association
diff --git a/include/net/dn.h b/include/net/dn.h
index 298521e0d8a..814af0b9387 100644
--- a/include/net/dn.h
+++ b/include/net/dn.h
@@ -3,6 +3,7 @@
#include <linux/dn.h>
#include <net/sock.h>
+#include <net/flow.h>
#include <asm/byteorder.h>
#include <asm/unaligned.h>
diff --git a/include/net/genetlink.h b/include/net/genetlink.h
index 7db32995ccd..ccb68880abf 100644
--- a/include/net/genetlink.h
+++ b/include/net/genetlink.h
@@ -131,35 +131,8 @@ extern void genl_unregister_mc_group(struct genl_family *family,
extern void genl_notify(struct sk_buff *skb, struct net *net, u32 pid,
u32 group, struct nlmsghdr *nlh, gfp_t flags);
-/**
- * genlmsg_put - Add generic netlink header to netlink message
- * @skb: socket buffer holding the message
- * @pid: netlink pid the message is addressed to
- * @seq: sequence number (usually the one of the sender)
- * @family: generic netlink family
- * @flags netlink message flags
- * @cmd: generic netlink command
- *
- * Returns pointer to user specific header
- */
-static inline void *genlmsg_put(struct sk_buff *skb, u32 pid, u32 seq,
- struct genl_family *family, int flags, u8 cmd)
-{
- struct nlmsghdr *nlh;
- struct genlmsghdr *hdr;
-
- nlh = nlmsg_put(skb, pid, seq, family->id, GENL_HDRLEN +
- family->hdrsize, flags);
- if (nlh == NULL)
- return NULL;
-
- hdr = nlmsg_data(nlh);
- hdr->cmd = cmd;
- hdr->version = family->version;
- hdr->reserved = 0;
-
- return (char *) hdr + GENL_HDRLEN;
-}
+void *genlmsg_put(struct sk_buff *skb, u32 pid, u32 seq,
+ struct genl_family *family, int flags, u8 cmd);
/**
* genlmsg_nlhdr - Obtain netlink header from user specified header
diff --git a/include/net/inet_sock.h b/include/net/inet_sock.h
index e3e405106af..ae17e1352d7 100644
--- a/include/net/inet_sock.h
+++ b/include/net/inet_sock.h
@@ -132,6 +132,7 @@ struct rtable;
* @tos - TOS
* @mc_ttl - Multicasting TTL
* @is_icsk - is this an inet_connection_sock?
+ * @uc_index - Unicast outgoing device index
* @mc_index - Multicast device index
* @mc_list - Group array
* @cork - info to build ip hdr on each ip frag while socket is corked
@@ -167,6 +168,8 @@ struct inet_sock {
transparent:1,
mc_all:1,
nodefrag:1;
+ __u8 rcv_tos;
+ int uc_index;
int mc_index;
__be32 mc_addr;
struct ip_mc_socklist __rcu *mc_list;
diff --git a/include/net/iucv/af_iucv.h b/include/net/iucv/af_iucv.h
index 0954ec95915..2e1d5ecc2d1 100644
--- a/include/net/iucv/af_iucv.h
+++ b/include/net/iucv/af_iucv.h
@@ -113,6 +113,7 @@ struct iucv_sock {
spinlock_t accept_q_lock;
struct sock *parent;
struct iucv_path *path;
+ struct net_device *hs_dev;
struct sk_buff_head send_skb_q;
struct sk_buff_head backlog_skb_q;
struct sock_msg_q message_q;
@@ -131,6 +132,7 @@ struct iucv_sock {
/* iucv socket options (SOL_IUCV) */
#define SO_IPRMDATA_MSG 0x0080 /* send/recv IPRM_DATA msgs */
#define SO_MSGLIMIT 0x1000 /* get/set IUCV MSGLIMIT */
+#define SO_MSGSIZE 0x0800 /* get maximum msgsize */
/* iucv related control messages (scm) */
#define SCM_IUCV_TRGCLS 0x0001 /* target class control message */
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index d49928ba5d0..cbff4f94a20 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -852,6 +852,21 @@ struct ieee80211_channel_switch {
};
/**
+ * enum ieee80211_vif_flags - virtual interface flags
+ *
+ * @IEEE80211_VIF_BEACON_FILTER: the device performs beacon filtering
+ * on this virtual interface to avoid unnecessary CPU wakeups
+ * @IEEE80211_VIF_SUPPORTS_CQM_RSSI: the device can do connection quality
+ * monitoring on this virtual interface -- i.e. it can monitor
+ * connection quality related parameters, such as the RSSI level and
+ * provide notifications if configured trigger levels are reached.
+ */
+enum ieee80211_vif_flags {
+ IEEE80211_VIF_BEACON_FILTER = BIT(0),
+ IEEE80211_VIF_SUPPORTS_CQM_RSSI = BIT(1),
+};
+
+/**
* struct ieee80211_vif - per-interface data
*
* Data in this structure is continually present for driver
@@ -863,6 +878,10 @@ struct ieee80211_channel_switch {
* @addr: address of this interface
* @p2p: indicates whether this AP or STA interface is a p2p
* interface, i.e. a GO or p2p-sta respectively
+ * @driver_flags: flags/capabilities the driver has for this interface,
+ * these need to be set (or cleared) when the interface is added
+ * or, if supported by the driver, the interface type is changed
+ * at runtime, mac80211 will never touch this field
* @drv_priv: data area for driver use, will always be aligned to
* sizeof(void *).
*/
@@ -871,6 +890,7 @@ struct ieee80211_vif {
struct ieee80211_bss_conf bss_conf;
u8 addr[ETH_ALEN];
bool p2p;
+ u32 driver_flags;
/* must be last */
u8 drv_priv[0] __attribute__((__aligned__(sizeof(void *))));
};
@@ -962,6 +982,25 @@ enum set_key_cmd {
};
/**
+ * enum ieee80211_sta_state - station state
+ *
+ * @IEEE80211_STA_NOTEXIST: station doesn't exist at all,
+ * this is a special state for add/remove transitions
+ * @IEEE80211_STA_NONE: station exists without special state
+ * @IEEE80211_STA_AUTH: station is authenticated
+ * @IEEE80211_STA_ASSOC: station is associated
+ * @IEEE80211_STA_AUTHORIZED: station is authorized (802.1X)
+ */
+enum ieee80211_sta_state {
+ /* NOTE: These need to be ordered correctly! */
+ IEEE80211_STA_NOTEXIST,
+ IEEE80211_STA_NONE,
+ IEEE80211_STA_AUTH,
+ IEEE80211_STA_ASSOC,
+ IEEE80211_STA_AUTHORIZED,
+};
+
+/**
* struct ieee80211_sta - station table entry
*
* A station table entry represents a station we are possibly
@@ -1079,10 +1118,6 @@ enum sta_notify_cmd {
* @IEEE80211_HW_MFP_CAPABLE:
* Hardware supports management frame protection (MFP, IEEE 802.11w).
*
- * @IEEE80211_HW_BEACON_FILTER:
- * Hardware supports dropping of irrelevant beacon frames to
- * avoid waking up cpu.
- *
* @IEEE80211_HW_SUPPORTS_STATIC_SMPS:
* Hardware supports static spatial multiplexing powersave,
* ie. can turn off all but one chain even on HT connections
@@ -1108,11 +1143,6 @@ enum sta_notify_cmd {
* When this flag is set, signaling beacon-loss will cause an immediate
* change to disassociated state.
*
- * @IEEE80211_HW_SUPPORTS_CQM_RSSI:
- * Hardware can do connection quality monitoring - i.e. it can monitor
- * connection quality related parameters, such as the RSSI level and
- * provide notifications if configured trigger levels are reached.
- *
* @IEEE80211_HW_NEED_DTIM_PERIOD:
* This device needs to know the DTIM period for the BSS before
* associating.
@@ -1134,6 +1164,10 @@ enum sta_notify_cmd {
* @IEEE80211_HW_TX_AMPDU_SETUP_IN_HW: The device handles TX A-MPDU session
* setup strictly in HW. mac80211 should not attempt to do this in
* software.
+ *
+ * @IEEE80211_HW_SCAN_WHILE_IDLE: The device can do hw scan while
+ * being idle (i.e. mac80211 doesn't have to go idle-off during the
+ * the scan).
*/
enum ieee80211_hw_flags {
IEEE80211_HW_HAS_RATE_CONTROL = 1<<0,
@@ -1150,16 +1184,17 @@ enum ieee80211_hw_flags {
IEEE80211_HW_PS_NULLFUNC_STACK = 1<<11,
IEEE80211_HW_SUPPORTS_DYNAMIC_PS = 1<<12,
IEEE80211_HW_MFP_CAPABLE = 1<<13,
- IEEE80211_HW_BEACON_FILTER = 1<<14,
+ /* reuse bit 14 */
IEEE80211_HW_SUPPORTS_STATIC_SMPS = 1<<15,
IEEE80211_HW_SUPPORTS_DYNAMIC_SMPS = 1<<16,
IEEE80211_HW_SUPPORTS_UAPSD = 1<<17,
IEEE80211_HW_REPORTS_TX_ACK_STATUS = 1<<18,
IEEE80211_HW_CONNECTION_MONITOR = 1<<19,
- IEEE80211_HW_SUPPORTS_CQM_RSSI = 1<<20,
+ /* reuse bit 20 */
IEEE80211_HW_SUPPORTS_PER_STA_GTK = 1<<21,
IEEE80211_HW_AP_LINK_PS = 1<<22,
IEEE80211_HW_TX_AMPDU_SETUP_IN_HW = 1<<23,
+ IEEE80211_HW_SCAN_WHILE_IDLE = 1<<24,
};
/**
@@ -1446,8 +1481,8 @@ void ieee80211_free_txskb(struct ieee80211_hw *hw, struct sk_buff *skb);
* way the host will only receive beacons where some relevant information
* (for example ERP protection or WMM settings) have changed.
*
- * Beacon filter support is advertised with the %IEEE80211_HW_BEACON_FILTER
- * hardware capability. The driver needs to enable beacon filter support
+ * Beacon filter support is advertised with the %IEEE80211_VIF_BEACON_FILTER
+ * interface capability. The driver needs to enable beacon filter support
* whenever power save is enabled, that is %IEEE80211_CONF_PS is set. When
* power save is enabled, the stack will not check for beacon loss and the
* driver needs to notify about loss of beacons with ieee80211_beacon_loss().
@@ -1963,6 +1998,13 @@ enum ieee80211_frame_release_type {
* in AP mode, this callback will not be called when the flag
* %IEEE80211_HW_AP_LINK_PS is set. Must be atomic.
*
+ * @sta_state: Notifies low level driver about state transition of a
+ * station (which can be the AP, a client, IBSS/WDS/mesh peer etc.)
+ * This callback is mutually exclusive with @sta_add/@sta_remove.
+ * It must not fail for down transitions but may fail for transitions
+ * up the list of states.
+ * The callback can sleep.
+ *
* @conf_tx: Configure TX queue parameters (EDCF (aifs, cw_min, cw_max),
* bursting) for a hardware TX queue.
* Returns a negative error code on failure.
@@ -2182,6 +2224,10 @@ struct ieee80211_ops {
struct ieee80211_sta *sta);
void (*sta_notify)(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
enum sta_notify_cmd, struct ieee80211_sta *sta);
+ int (*sta_state)(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
+ struct ieee80211_sta *sta,
+ enum ieee80211_sta_state old_state,
+ enum ieee80211_sta_state new_state);
int (*conf_tx)(struct ieee80211_hw *hw,
struct ieee80211_vif *vif, u16 queue,
const struct ieee80211_tx_queue_params *params);
@@ -3316,7 +3362,7 @@ struct sk_buff *ieee80211_ap_probereq_get(struct ieee80211_hw *hw,
*
* @vif: &struct ieee80211_vif pointer from the add_interface callback.
*
- * When beacon filtering is enabled with %IEEE80211_HW_BEACON_FILTER and
+ * When beacon filtering is enabled with %IEEE80211_VIF_BEACON_FILTER and
* %IEEE80211_CONF_PS is set, the driver needs to inform whenever the
* hardware is not receiving beacons with this function.
*/
@@ -3327,7 +3373,7 @@ void ieee80211_beacon_loss(struct ieee80211_vif *vif);
*
* @vif: &struct ieee80211_vif pointer from the add_interface callback.
*
- * When beacon filtering is enabled with %IEEE80211_HW_BEACON_FILTER, and
+ * When beacon filtering is enabled with %IEEE80211_VIF_BEACON_FILTER, and
* %IEEE80211_CONF_PS and %IEEE80211_HW_CONNECTION_MONITOR are set, the driver
* needs to inform if the connection to the AP has been lost.
*
@@ -3397,7 +3443,7 @@ void ieee80211_enable_dyn_ps(struct ieee80211_vif *vif);
* @rssi_event: the RSSI trigger event type
* @gfp: context flags
*
- * When the %IEEE80211_HW_SUPPORTS_CQM_RSSI is set, and a connection quality
+ * When the %IEEE80211_VIF_SUPPORTS_CQM_RSSI is set, and a connection quality
* monitoring is configured with an rssi threshold, the driver will inform
* whenever the rssi level reaches the threshold.
*/
@@ -3540,6 +3586,7 @@ struct ieee80211_tx_rate_control {
bool rts, short_preamble;
u8 max_rate_idx;
u32 rate_idx_mask;
+ u8 rate_idx_mcs_mask[IEEE80211_HT_MCS_MASK_LEN];
bool bss;
};
diff --git a/include/net/ndisc.h b/include/net/ndisc.h
index e3133c23980..6f9c25a76cd 100644
--- a/include/net/ndisc.h
+++ b/include/net/ndisc.h
@@ -133,7 +133,6 @@ extern void ndisc_send_rs(struct net_device *dev,
const struct in6_addr *daddr);
extern void ndisc_send_redirect(struct sk_buff *skb,
- struct neighbour *neigh,
const struct in6_addr *target);
extern int ndisc_mc_map(const struct in6_addr *addr, char *buf,
diff --git a/include/net/netlink.h b/include/net/netlink.h
index cb1f3504687..f394fe5d764 100644
--- a/include/net/netlink.h
+++ b/include/net/netlink.h
@@ -441,41 +441,6 @@ static inline int nlmsg_report(const struct nlmsghdr *nlh)
nla_for_each_attr(pos, nlmsg_attrdata(nlh, hdrlen), \
nlmsg_attrlen(nlh, hdrlen), rem)
-#if 0
-/* FIXME: Enable once all users have been converted */
-
-/**
- * __nlmsg_put - Add a new netlink message to an skb
- * @skb: socket buffer to store message in
- * @pid: netlink process id
- * @seq: sequence number of message
- * @type: message type
- * @payload: length of message payload
- * @flags: message flags
- *
- * The caller is responsible to ensure that the skb provides enough
- * tailroom for both the netlink header and payload.
- */
-static inline struct nlmsghdr *__nlmsg_put(struct sk_buff *skb, u32 pid,
- u32 seq, int type, int payload,
- int flags)
-{
- struct nlmsghdr *nlh;
-
- nlh = (struct nlmsghdr *) skb_put(skb, nlmsg_total_size(payload));
- nlh->nlmsg_type = type;
- nlh->nlmsg_len = nlmsg_msg_size(payload);
- nlh->nlmsg_flags = flags;
- nlh->nlmsg_pid = pid;
- nlh->nlmsg_seq = seq;
-
- memset((unsigned char *) nlmsg_data(nlh) + payload, 0,
- nlmsg_padlen(payload));
-
- return nlh;
-}
-#endif
-
/**
* nlmsg_put - Add a new netlink message to an skb
* @skb: socket buffer to store message in
diff --git a/include/net/nfc/nci.h b/include/net/nfc/nci.h
index 2be95e2626c..276094b91d7 100644
--- a/include/net/nfc/nci.h
+++ b/include/net/nfc/nci.h
@@ -116,6 +116,11 @@
#define NCI_DISC_MAP_MODE_POLL 0x01
#define NCI_DISC_MAP_MODE_LISTEN 0x02
+/* NCI Discover Notification Type */
+#define NCI_DISCOVER_NTF_TYPE_LAST 0x00
+#define NCI_DISCOVER_NTF_TYPE_LAST_NFCC 0x01
+#define NCI_DISCOVER_NTF_TYPE_MORE 0x02
+
/* NCI Deactivation Type */
#define NCI_DEACTIVATE_TYPE_IDLE_MODE 0x00
#define NCI_DEACTIVATE_TYPE_SLEEP_MODE 0x01
@@ -207,6 +212,13 @@ struct nci_rf_disc_cmd {
struct disc_config disc_configs[NCI_MAX_NUM_RF_CONFIGS];
} __packed;
+#define NCI_OP_RF_DISCOVER_SELECT_CMD nci_opcode_pack(NCI_GID_RF_MGMT, 0x04)
+struct nci_rf_discover_select_cmd {
+ __u8 rf_discovery_id;
+ __u8 rf_protocol;
+ __u8 rf_interface;
+} __packed;
+
#define NCI_OP_RF_DEACTIVATE_CMD nci_opcode_pack(NCI_GID_RF_MGMT, 0x06)
struct nci_rf_deactivate_cmd {
__u8 type;
@@ -244,6 +256,8 @@ struct nci_core_init_rsp_2 {
#define NCI_OP_RF_DISCOVER_RSP nci_opcode_pack(NCI_GID_RF_MGMT, 0x03)
+#define NCI_OP_RF_DISCOVER_SELECT_RSP nci_opcode_pack(NCI_GID_RF_MGMT, 0x04)
+
#define NCI_OP_RF_DEACTIVATE_RSP nci_opcode_pack(NCI_GID_RF_MGMT, 0x06)
/* --------------------------- */
@@ -260,13 +274,15 @@ struct nci_core_conn_credit_ntf {
struct conn_credit_entry conn_entries[NCI_MAX_NUM_CONN];
} __packed;
+#define NCI_OP_CORE_GENERIC_ERROR_NTF nci_opcode_pack(NCI_GID_CORE, 0x07)
+
#define NCI_OP_CORE_INTF_ERROR_NTF nci_opcode_pack(NCI_GID_CORE, 0x08)
struct nci_core_intf_error_ntf {
__u8 status;
__u8 conn_id;
} __packed;
-#define NCI_OP_RF_INTF_ACTIVATED_NTF nci_opcode_pack(NCI_GID_RF_MGMT, 0x05)
+#define NCI_OP_RF_DISCOVER_NTF nci_opcode_pack(NCI_GID_RF_MGMT, 0x03)
struct rf_tech_specific_params_nfca_poll {
__u16 sens_res;
__u8 nfcid1_len; /* 0, 4, 7, or 10 Bytes */
@@ -275,11 +291,43 @@ struct rf_tech_specific_params_nfca_poll {
__u8 sel_res;
} __packed;
+struct rf_tech_specific_params_nfcb_poll {
+ __u8 sensb_res_len;
+ __u8 sensb_res[12]; /* 11 or 12 Bytes */
+} __packed;
+
+struct rf_tech_specific_params_nfcf_poll {
+ __u8 bit_rate;
+ __u8 sensf_res_len;
+ __u8 sensf_res[18]; /* 16 or 18 Bytes */
+} __packed;
+
+struct nci_rf_discover_ntf {
+ __u8 rf_discovery_id;
+ __u8 rf_protocol;
+ __u8 rf_tech_and_mode;
+ __u8 rf_tech_specific_params_len;
+
+ union {
+ struct rf_tech_specific_params_nfca_poll nfca_poll;
+ struct rf_tech_specific_params_nfcb_poll nfcb_poll;
+ struct rf_tech_specific_params_nfcf_poll nfcf_poll;
+ } rf_tech_specific_params;
+
+ __u8 ntf_type;
+} __packed;
+
+#define NCI_OP_RF_INTF_ACTIVATED_NTF nci_opcode_pack(NCI_GID_RF_MGMT, 0x05)
struct activation_params_nfca_poll_iso_dep {
__u8 rats_res_len;
__u8 rats_res[20];
};
+struct activation_params_nfcb_poll_iso_dep {
+ __u8 attrib_res_len;
+ __u8 attrib_res[50];
+};
+
struct nci_rf_intf_activated_ntf {
__u8 rf_discovery_id;
__u8 rf_interface;
@@ -291,6 +339,8 @@ struct nci_rf_intf_activated_ntf {
union {
struct rf_tech_specific_params_nfca_poll nfca_poll;
+ struct rf_tech_specific_params_nfcb_poll nfcb_poll;
+ struct rf_tech_specific_params_nfcf_poll nfcf_poll;
} rf_tech_specific_params;
__u8 data_exch_rf_tech_and_mode;
@@ -300,6 +350,7 @@ struct nci_rf_intf_activated_ntf {
union {
struct activation_params_nfca_poll_iso_dep nfca_poll_iso_dep;
+ struct activation_params_nfcb_poll_iso_dep nfcb_poll_iso_dep;
} activation_params;
} __packed;
diff --git a/include/net/nfc/nci_core.h b/include/net/nfc/nci_core.h
index bccd89e9d4c..86fee8b5c65 100644
--- a/include/net/nfc/nci_core.h
+++ b/include/net/nfc/nci_core.h
@@ -34,21 +34,31 @@
#include <net/nfc/nfc.h>
#include <net/nfc/nci.h>
-/* NCI device state */
-enum {
+/* NCI device flags */
+enum nci_flag {
NCI_INIT,
NCI_UP,
+ NCI_DATA_EXCHANGE,
+ NCI_DATA_EXCHANGE_TO,
+};
+
+/* NCI device states */
+enum nci_state {
+ NCI_IDLE,
NCI_DISCOVERY,
+ NCI_W4_ALL_DISCOVERIES,
+ NCI_W4_HOST_SELECT,
NCI_POLL_ACTIVE,
- NCI_DATA_EXCHANGE,
};
/* NCI timeouts */
#define NCI_RESET_TIMEOUT 5000
#define NCI_INIT_TIMEOUT 5000
#define NCI_RF_DISC_TIMEOUT 5000
-#define NCI_RF_DEACTIVATE_TIMEOUT 5000
+#define NCI_RF_DISC_SELECT_TIMEOUT 5000
+#define NCI_RF_DEACTIVATE_TIMEOUT 30000
#define NCI_CMD_TIMEOUT 5000
+#define NCI_DATA_TIMEOUT 700
struct nci_dev;
@@ -59,6 +69,7 @@ struct nci_ops {
};
#define NCI_MAX_SUPPORTED_RF_INTERFACES 4
+#define NCI_MAX_DISCOVERED_TARGETS 10
/* NCI Core structures */
struct nci_dev {
@@ -68,12 +79,14 @@ struct nci_dev {
int tx_headroom;
int tx_tailroom;
+ atomic_t state;
unsigned long flags;
atomic_t cmd_cnt;
atomic_t credits_cnt;
struct timer_list cmd_timer;
+ struct timer_list data_timer;
struct workqueue_struct *cmd_wq;
struct work_struct cmd_work;
@@ -96,9 +109,11 @@ struct nci_dev {
void *driver_data;
__u32 poll_prots;
- __u32 target_available_prots;
__u32 target_active_prot;
+ struct nfc_target targets[NCI_MAX_DISCOVERED_TARGETS];
+ int n_targets;
+
/* received during NCI_OP_CORE_RESET_RSP */
__u8 nci_ver;
@@ -169,6 +184,7 @@ int nci_send_cmd(struct nci_dev *ndev, __u16 opcode, __u8 plen, void *payload);
int nci_send_data(struct nci_dev *ndev, __u8 conn_id, struct sk_buff *skb);
void nci_data_exchange_complete(struct nci_dev *ndev, struct sk_buff *skb,
int err);
+void nci_clear_target_list(struct nci_dev *ndev);
/* ----- NCI requests ----- */
#define NCI_REQ_DONE 0
diff --git a/include/net/nfc/nfc.h b/include/net/nfc/nfc.h
index 8696b773a69..d253278e5a9 100644
--- a/include/net/nfc/nfc.h
+++ b/include/net/nfc/nfc.h
@@ -24,6 +24,7 @@
#ifndef __NET_NFC_H
#define __NET_NFC_H
+#include <linux/nfc.h>
#include <linux/device.h>
#include <linux/skbuff.h>
@@ -65,7 +66,6 @@ struct nfc_ops {
#define NFC_TARGET_IDX_ANY -1
#define NFC_MAX_GT_LEN 48
-#define NFC_MAX_NFCID1_LEN 10
struct nfc_target {
u32 idx;
@@ -73,7 +73,11 @@ struct nfc_target {
u16 sens_res;
u8 sel_res;
u8 nfcid1_len;
- u8 nfcid1[NFC_MAX_NFCID1_LEN];
+ u8 nfcid1[NFC_NFCID1_MAXSIZE];
+ u8 sensb_res_len;
+ u8 sensb_res[NFC_SENSB_RES_MAXSIZE];
+ u8 sensf_res_len;
+ u8 sensf_res[NFC_SENSF_RES_MAXSIZE];
};
struct nfc_genl_data {
@@ -83,7 +87,6 @@ struct nfc_genl_data {
struct nfc_dev {
unsigned idx;
- unsigned target_idx;
struct nfc_target *targets;
int n_targets;
int targets_generation;
diff --git a/include/net/sock.h b/include/net/sock.h
index 91c1c8baf02..ba761e7de25 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -357,6 +357,7 @@ struct sock {
struct page *sk_sndmsg_page;
struct sk_buff *sk_send_head;
__u32 sk_sndmsg_off;
+ __s32 sk_peek_off;
int sk_write_pending;
#ifdef CONFIG_SECURITY
void *sk_security;
@@ -373,6 +374,30 @@ struct sock {
void (*sk_destruct)(struct sock *sk);
};
+static inline int sk_peek_offset(struct sock *sk, int flags)
+{
+ if ((flags & MSG_PEEK) && (sk->sk_peek_off >= 0))
+ return sk->sk_peek_off;
+ else
+ return 0;
+}
+
+static inline void sk_peek_offset_bwd(struct sock *sk, int val)
+{
+ if (sk->sk_peek_off >= 0) {
+ if (sk->sk_peek_off >= val)
+ sk->sk_peek_off -= val;
+ else
+ sk->sk_peek_off = 0;
+ }
+}
+
+static inline void sk_peek_offset_fwd(struct sock *sk, int val)
+{
+ if (sk->sk_peek_off >= 0)
+ sk->sk_peek_off += val;
+}
+
/*
* Hashed lists helper routines
*/
@@ -590,6 +615,10 @@ enum sock_flags {
SOCK_RXQ_OVFL,
SOCK_ZEROCOPY, /* buffers from userspace */
SOCK_WIFI_STATUS, /* push wifi status to userspace */
+ SOCK_NOFCS, /* Tell NIC not to do the Ethernet FCS.
+ * Will use last 4 bytes of packet sent from
+ * user-space instead.
+ */
};
static inline void sock_copy_flags(struct sock *nsk, struct sock *osk)
diff --git a/include/net/tcp.h b/include/net/tcp.h
index 42c29bfbcee..6b2acfce4cf 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -1138,35 +1138,27 @@ static inline void tcp_clear_all_retrans_hints(struct tcp_sock *tp)
/* MD5 Signature */
struct crypto_hash;
+union tcp_md5_addr {
+ struct in_addr a4;
+#if IS_ENABLED(CONFIG_IPV6)
+ struct in6_addr a6;
+#endif
+};
+
/* - key database */
struct tcp_md5sig_key {
- u8 *key;
+ struct hlist_node node;
u8 keylen;
-};
-
-struct tcp4_md5sig_key {
- struct tcp_md5sig_key base;
- __be32 addr;
-};
-
-struct tcp6_md5sig_key {
- struct tcp_md5sig_key base;
-#if 0
- u32 scope_id; /* XXX */
-#endif
- struct in6_addr addr;
+ u8 family; /* AF_INET or AF_INET6 */
+ union tcp_md5_addr addr;
+ u8 key[TCP_MD5SIG_MAXKEYLEN];
+ struct rcu_head rcu;
};
/* - sock block */
struct tcp_md5sig_info {
- struct tcp4_md5sig_key *keys4;
-#if IS_ENABLED(CONFIG_IPV6)
- struct tcp6_md5sig_key *keys6;
- u32 entries6;
- u32 alloced6;
-#endif
- u32 entries4;
- u32 alloced4;
+ struct hlist_head head;
+ struct rcu_head rcu;
};
/* - pseudo header */
@@ -1203,19 +1195,25 @@ extern int tcp_v4_md5_hash_skb(char *md5_hash, struct tcp_md5sig_key *key,
const struct sock *sk,
const struct request_sock *req,
const struct sk_buff *skb);
-extern struct tcp_md5sig_key * tcp_v4_md5_lookup(struct sock *sk,
- struct sock *addr_sk);
-extern int tcp_v4_md5_do_add(struct sock *sk, __be32 addr, u8 *newkey,
- u8 newkeylen);
-extern int tcp_v4_md5_do_del(struct sock *sk, __be32 addr);
+extern int tcp_md5_do_add(struct sock *sk, const union tcp_md5_addr *addr,
+ int family, const u8 *newkey,
+ u8 newkeylen, gfp_t gfp);
+extern int tcp_md5_do_del(struct sock *sk, const union tcp_md5_addr *addr,
+ int family);
+extern struct tcp_md5sig_key *tcp_v4_md5_lookup(struct sock *sk,
+ struct sock *addr_sk);
#ifdef CONFIG_TCP_MD5SIG
-#define tcp_twsk_md5_key(twsk) ((twsk)->tw_md5_keylen ? \
- &(struct tcp_md5sig_key) { \
- .key = (twsk)->tw_md5_key, \
- .keylen = (twsk)->tw_md5_keylen, \
- } : NULL)
+extern struct tcp_md5sig_key *tcp_md5_do_lookup(struct sock *sk,
+ const union tcp_md5_addr *addr, int family);
+#define tcp_twsk_md5_key(twsk) ((twsk)->tw_md5_key)
#else
+static inline struct tcp_md5sig_key *tcp_md5_do_lookup(struct sock *sk,
+ const union tcp_md5_addr *addr,
+ int family)
+{
+ return NULL;
+}
#define tcp_twsk_md5_key(twsk) NULL
#endif
@@ -1470,10 +1468,6 @@ struct tcp_sock_af_ops {
const struct sock *sk,
const struct request_sock *req,
const struct sk_buff *skb);
- int (*md5_add) (struct sock *sk,
- struct sock *addr_sk,
- u8 *newkey,
- u8 len);
int (*md5_parse) (struct sock *sk,
char __user *optval,
int optlen);
diff --git a/include/net/xfrm.h b/include/net/xfrm.h
index 89174e29dca..96239e78e62 100644
--- a/include/net/xfrm.h
+++ b/include/net/xfrm.h
@@ -1566,11 +1566,6 @@ extern struct xfrm_algo_desc *xfrm_calg_get_byname(const char *name, int probe);
extern struct xfrm_algo_desc *xfrm_aead_get_byname(const char *name, int icv_len,
int probe);
-struct hash_desc;
-struct scatterlist;
-typedef int (icv_update_fn_t)(struct hash_desc *, struct scatterlist *,
- unsigned int);
-
static inline int xfrm_addr_cmp(const xfrm_address_t *a,
const xfrm_address_t *b,
int family)