aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/linux/dcbnl.h12
-rw-r--r--include/linux/ethtool.h29
-rw-r--r--include/linux/filter.h7
-rw-r--r--include/linux/hyperv.h27
-rw-r--r--include/linux/if_link.h2
-rw-r--r--include/linux/if_team.h52
-rw-r--r--include/linux/mlx4/cmd.h4
-rw-r--r--include/linux/mlx4/device.h3
-rw-r--r--include/linux/mlx4/qp.h3
-rw-r--r--include/linux/netfilter/ipset/ip_set.h46
-rw-r--r--include/linux/netfilter/ipset/ip_set_ahash.h21
-rw-r--r--include/linux/phy.h3
-rw-r--r--include/linux/platform_data/wiznet.h24
-rw-r--r--include/linux/ptp_clock_kernel.h8
-rw-r--r--include/linux/stmmac.h55
-rw-r--r--include/net/dcbnl.h2
-rw-r--r--include/net/icmp.h1
-rw-r--r--include/net/ndisc.h1
-rw-r--r--include/net/netlink.h169
-rw-r--r--include/net/xfrm.h5
20 files changed, 356 insertions, 118 deletions
diff --git a/include/linux/dcbnl.h b/include/linux/dcbnl.h
index 65a2562f66b4..6bb43382f3f3 100644
--- a/include/linux/dcbnl.h
+++ b/include/linux/dcbnl.h
@@ -67,6 +67,17 @@ struct ieee_ets {
67 __u8 reco_prio_tc[IEEE_8021QAZ_MAX_TCS]; 67 __u8 reco_prio_tc[IEEE_8021QAZ_MAX_TCS];
68}; 68};
69 69
70/* This structure contains rate limit extension to the IEEE 802.1Qaz ETS
71 * managed object.
72 * Values are 64 bits long and specified in Kbps to enable usage over both
73 * slow and very fast networks.
74 *
75 * @tc_maxrate: maximal tc tx bandwidth indexed by traffic class
76 */
77struct ieee_maxrate {
78 __u64 tc_maxrate[IEEE_8021QAZ_MAX_TCS];
79};
80
70/* This structure contains the IEEE 802.1Qaz PFC managed object 81/* This structure contains the IEEE 802.1Qaz PFC managed object
71 * 82 *
72 * @pfc_cap: Indicates the number of traffic classes on the local device 83 * @pfc_cap: Indicates the number of traffic classes on the local device
@@ -321,6 +332,7 @@ enum ieee_attrs {
321 DCB_ATTR_IEEE_PEER_ETS, 332 DCB_ATTR_IEEE_PEER_ETS,
322 DCB_ATTR_IEEE_PEER_PFC, 333 DCB_ATTR_IEEE_PEER_PFC,
323 DCB_ATTR_IEEE_PEER_APP, 334 DCB_ATTR_IEEE_PEER_APP,
335 DCB_ATTR_IEEE_MAXRATE,
324 __DCB_ATTR_IEEE_MAX 336 __DCB_ATTR_IEEE_MAX
325}; 337};
326#define DCB_ATTR_IEEE_MAX (__DCB_ATTR_IEEE_MAX - 1) 338#define DCB_ATTR_IEEE_MAX (__DCB_ATTR_IEEE_MAX - 1)
diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h
index f5647b59a90e..89d68d837b6e 100644
--- a/include/linux/ethtool.h
+++ b/include/linux/ethtool.h
@@ -726,6 +726,29 @@ struct ethtool_sfeatures {
726 struct ethtool_set_features_block features[0]; 726 struct ethtool_set_features_block features[0];
727}; 727};
728 728
729/**
730 * struct ethtool_ts_info - holds a device's timestamping and PHC association
731 * @cmd: command number = %ETHTOOL_GET_TS_INFO
732 * @so_timestamping: bit mask of the sum of the supported SO_TIMESTAMPING flags
733 * @phc_index: device index of the associated PHC, or -1 if there is none
734 * @tx_types: bit mask of the supported hwtstamp_tx_types enumeration values
735 * @rx_filters: bit mask of the supported hwtstamp_rx_filters enumeration values
736 *
737 * The bits in the 'tx_types' and 'rx_filters' fields correspond to
738 * the 'hwtstamp_tx_types' and 'hwtstamp_rx_filters' enumeration values,
739 * respectively. For example, if the device supports HWTSTAMP_TX_ON,
740 * then (1 << HWTSTAMP_TX_ON) in 'tx_types' will be set.
741 */
742struct ethtool_ts_info {
743 __u32 cmd;
744 __u32 so_timestamping;
745 __s32 phc_index;
746 __u32 tx_types;
747 __u32 tx_reserved[3];
748 __u32 rx_filters;
749 __u32 rx_reserved[3];
750};
751
729/* 752/*
730 * %ETHTOOL_SFEATURES changes features present in features[].valid to the 753 * %ETHTOOL_SFEATURES changes features present in features[].valid to the
731 * values of corresponding bits in features[].requested. Bits in .requested 754 * values of corresponding bits in features[].requested. Bits in .requested
@@ -788,6 +811,7 @@ struct net_device;
788 811
789/* Some generic methods drivers may use in their ethtool_ops */ 812/* Some generic methods drivers may use in their ethtool_ops */
790u32 ethtool_op_get_link(struct net_device *dev); 813u32 ethtool_op_get_link(struct net_device *dev);
814int ethtool_op_get_ts_info(struct net_device *dev, struct ethtool_ts_info *eti);
791 815
792/** 816/**
793 * ethtool_rxfh_indir_default - get default value for RX flow hash indirection 817 * ethtool_rxfh_indir_default - get default value for RX flow hash indirection
@@ -893,6 +917,9 @@ static inline u32 ethtool_rxfh_indir_default(u32 index, u32 n_rx_rings)
893 * and flag of the device. 917 * and flag of the device.
894 * @get_dump_data: Get dump data. 918 * @get_dump_data: Get dump data.
895 * @set_dump: Set dump specific flags to the device. 919 * @set_dump: Set dump specific flags to the device.
920 * @get_ts_info: Get the time stamping and PTP hardware clock capabilities.
921 * Drivers supporting transmit time stamps in software should set this to
922 * ethtool_op_get_ts_info().
896 * 923 *
897 * All operations are optional (i.e. the function pointer may be set 924 * All operations are optional (i.e. the function pointer may be set
898 * to %NULL) and callers must take this into account. Callers must 925 * to %NULL) and callers must take this into account. Callers must
@@ -954,6 +981,7 @@ struct ethtool_ops {
954 int (*get_dump_data)(struct net_device *, 981 int (*get_dump_data)(struct net_device *,
955 struct ethtool_dump *, void *); 982 struct ethtool_dump *, void *);
956 int (*set_dump)(struct net_device *, struct ethtool_dump *); 983 int (*set_dump)(struct net_device *, struct ethtool_dump *);
984 int (*get_ts_info)(struct net_device *, struct ethtool_ts_info *);
957 985
958}; 986};
959#endif /* __KERNEL__ */ 987#endif /* __KERNEL__ */
@@ -1028,6 +1056,7 @@ struct ethtool_ops {
1028#define ETHTOOL_SET_DUMP 0x0000003e /* Set dump settings */ 1056#define ETHTOOL_SET_DUMP 0x0000003e /* Set dump settings */
1029#define ETHTOOL_GET_DUMP_FLAG 0x0000003f /* Get dump settings */ 1057#define ETHTOOL_GET_DUMP_FLAG 0x0000003f /* Get dump settings */
1030#define ETHTOOL_GET_DUMP_DATA 0x00000040 /* Get dump data */ 1058#define ETHTOOL_GET_DUMP_DATA 0x00000040 /* Get dump data */
1059#define ETHTOOL_GET_TS_INFO 0x00000041 /* Get time stamping and PHC info */
1031 1060
1032/* compatibility with older code */ 1061/* compatibility with older code */
1033#define SPARC_ETH_GSET ETHTOOL_GSET 1062#define SPARC_ETH_GSET ETHTOOL_GSET
diff --git a/include/linux/filter.h b/include/linux/filter.h
index 8eeb205f298b..72090994d789 100644
--- a/include/linux/filter.h
+++ b/include/linux/filter.h
@@ -126,7 +126,8 @@ struct sock_fprog { /* Required for SO_ATTACH_FILTER. */
126#define SKF_AD_HATYPE 28 126#define SKF_AD_HATYPE 28
127#define SKF_AD_RXHASH 32 127#define SKF_AD_RXHASH 32
128#define SKF_AD_CPU 36 128#define SKF_AD_CPU 36
129#define SKF_AD_MAX 40 129#define SKF_AD_ALU_XOR_X 40
130#define SKF_AD_MAX 44
130#define SKF_NET_OFF (-0x100000) 131#define SKF_NET_OFF (-0x100000)
131#define SKF_LL_OFF (-0x200000) 132#define SKF_LL_OFF (-0x200000)
132 133
@@ -153,6 +154,9 @@ static inline unsigned int sk_filter_len(const struct sk_filter *fp)
153extern int sk_filter(struct sock *sk, struct sk_buff *skb); 154extern int sk_filter(struct sock *sk, struct sk_buff *skb);
154extern unsigned int sk_run_filter(const struct sk_buff *skb, 155extern unsigned int sk_run_filter(const struct sk_buff *skb,
155 const struct sock_filter *filter); 156 const struct sock_filter *filter);
157extern int sk_unattached_filter_create(struct sk_filter **pfp,
158 struct sock_fprog *fprog);
159extern void sk_unattached_filter_destroy(struct sk_filter *fp);
156extern int sk_attach_filter(struct sock_fprog *fprog, struct sock *sk); 160extern int sk_attach_filter(struct sock_fprog *fprog, struct sock *sk);
157extern int sk_detach_filter(struct sock *sk); 161extern int sk_detach_filter(struct sock *sk);
158extern int sk_chk_filter(struct sock_filter *filter, unsigned int flen); 162extern int sk_chk_filter(struct sock_filter *filter, unsigned int flen);
@@ -228,6 +232,7 @@ enum {
228 BPF_S_ANC_HATYPE, 232 BPF_S_ANC_HATYPE,
229 BPF_S_ANC_RXHASH, 233 BPF_S_ANC_RXHASH,
230 BPF_S_ANC_CPU, 234 BPF_S_ANC_CPU,
235 BPF_S_ANC_ALU_XOR_X,
231}; 236};
232 237
233#endif /* __KERNEL__ */ 238#endif /* __KERNEL__ */
diff --git a/include/linux/hyperv.h b/include/linux/hyperv.h
index 5852545e6bba..6af8738ae7e9 100644
--- a/include/linux/hyperv.h
+++ b/include/linux/hyperv.h
@@ -274,6 +274,33 @@ struct hv_ring_buffer_debug_info {
274 u32 bytes_avail_towrite; 274 u32 bytes_avail_towrite;
275}; 275};
276 276
277
278/*
279 *
280 * hv_get_ringbuffer_availbytes()
281 *
282 * Get number of bytes available to read and to write to
283 * for the specified ring buffer
284 */
285static inline void
286hv_get_ringbuffer_availbytes(struct hv_ring_buffer_info *rbi,
287 u32 *read, u32 *write)
288{
289 u32 read_loc, write_loc, dsize;
290
291 smp_read_barrier_depends();
292
293 /* Capture the read/write indices before they changed */
294 read_loc = rbi->ring_buffer->read_index;
295 write_loc = rbi->ring_buffer->write_index;
296 dsize = rbi->ring_datasize;
297
298 *write = write_loc >= read_loc ? dsize - (write_loc - read_loc) :
299 read_loc - write_loc;
300 *read = dsize - *write;
301}
302
303
277/* 304/*
278 * We use the same version numbering for all Hyper-V modules. 305 * We use the same version numbering for all Hyper-V modules.
279 * 306 *
diff --git a/include/linux/if_link.h b/include/linux/if_link.h
index 4b24ff453aee..2f4fa93454c7 100644
--- a/include/linux/if_link.h
+++ b/include/linux/if_link.h
@@ -138,6 +138,8 @@ enum {
138 IFLA_GROUP, /* Group the device belongs to */ 138 IFLA_GROUP, /* Group the device belongs to */
139 IFLA_NET_NS_FD, 139 IFLA_NET_NS_FD,
140 IFLA_EXT_MASK, /* Extended info mask, VFs, etc */ 140 IFLA_EXT_MASK, /* Extended info mask, VFs, etc */
141 IFLA_PROMISCUITY, /* Promiscuity count: > 0 means acts PROMISC */
142#define IFLA_PROMISCUITY IFLA_PROMISCUITY
141 __IFLA_MAX 143 __IFLA_MAX
142}; 144};
143 145
diff --git a/include/linux/if_team.h b/include/linux/if_team.h
index 58404b0c5010..5fd5ab171165 100644
--- a/include/linux/if_team.h
+++ b/include/linux/if_team.h
@@ -33,6 +33,24 @@ struct team_port {
33 struct team *team; 33 struct team *team;
34 int index; 34 int index;
35 35
36 bool linkup; /* either state.linkup or user.linkup */
37
38 struct {
39 bool linkup;
40 u32 speed;
41 u8 duplex;
42 } state;
43
44 /* Values set by userspace */
45 struct {
46 bool linkup;
47 bool linkup_enabled;
48 } user;
49
50 /* Custom gennetlink interface related flags */
51 bool changed;
52 bool removed;
53
36 /* 54 /*
37 * A place for storing original values of the device before it 55 * A place for storing original values of the device before it
38 * become a port. 56 * become a port.
@@ -42,14 +60,6 @@ struct team_port {
42 unsigned int mtu; 60 unsigned int mtu;
43 } orig; 61 } orig;
44 62
45 bool linkup;
46 u32 speed;
47 u8 duplex;
48
49 /* Custom gennetlink interface related flags */
50 bool changed;
51 bool removed;
52
53 struct rcu_head rcu; 63 struct rcu_head rcu;
54}; 64};
55 65
@@ -68,18 +78,30 @@ struct team_mode_ops {
68enum team_option_type { 78enum team_option_type {
69 TEAM_OPTION_TYPE_U32, 79 TEAM_OPTION_TYPE_U32,
70 TEAM_OPTION_TYPE_STRING, 80 TEAM_OPTION_TYPE_STRING,
81 TEAM_OPTION_TYPE_BINARY,
82 TEAM_OPTION_TYPE_BOOL,
83};
84
85struct team_gsetter_ctx {
86 union {
87 u32 u32_val;
88 const char *str_val;
89 struct {
90 const void *ptr;
91 u32 len;
92 } bin_val;
93 bool bool_val;
94 } data;
95 struct team_port *port;
71}; 96};
72 97
73struct team_option { 98struct team_option {
74 struct list_head list; 99 struct list_head list;
75 const char *name; 100 const char *name;
101 bool per_port;
76 enum team_option_type type; 102 enum team_option_type type;
77 int (*getter)(struct team *team, void *arg); 103 int (*getter)(struct team *team, struct team_gsetter_ctx *ctx);
78 int (*setter)(struct team *team, void *arg); 104 int (*setter)(struct team *team, struct team_gsetter_ctx *ctx);
79
80 /* Custom gennetlink interface related flags */
81 bool changed;
82 bool removed;
83}; 105};
84 106
85struct team_mode { 107struct team_mode {
@@ -110,6 +132,7 @@ struct team {
110 struct list_head port_list; 132 struct list_head port_list;
111 133
112 struct list_head option_list; 134 struct list_head option_list;
135 struct list_head option_inst_list; /* list of option instances */
113 136
114 const struct team_mode *mode; 137 const struct team_mode *mode;
115 struct team_mode_ops ops; 138 struct team_mode_ops ops;
@@ -216,6 +239,7 @@ enum {
216 TEAM_ATTR_OPTION_TYPE, /* u8 */ 239 TEAM_ATTR_OPTION_TYPE, /* u8 */
217 TEAM_ATTR_OPTION_DATA, /* dynamic */ 240 TEAM_ATTR_OPTION_DATA, /* dynamic */
218 TEAM_ATTR_OPTION_REMOVED, /* flag */ 241 TEAM_ATTR_OPTION_REMOVED, /* flag */
242 TEAM_ATTR_OPTION_PORT_IFINDEX, /* u32 */ /* for per-port options */
219 243
220 __TEAM_ATTR_OPTION_MAX, 244 __TEAM_ATTR_OPTION_MAX,
221 TEAM_ATTR_OPTION_MAX = __TEAM_ATTR_OPTION_MAX - 1, 245 TEAM_ATTR_OPTION_MAX = __TEAM_ATTR_OPTION_MAX - 1,
diff --git a/include/linux/mlx4/cmd.h b/include/linux/mlx4/cmd.h
index 9958ff2cad3c..1f3860a8a109 100644
--- a/include/linux/mlx4/cmd.h
+++ b/include/linux/mlx4/cmd.h
@@ -150,6 +150,10 @@ enum {
150 /* statistics commands */ 150 /* statistics commands */
151 MLX4_CMD_QUERY_IF_STAT = 0X54, 151 MLX4_CMD_QUERY_IF_STAT = 0X54,
152 MLX4_CMD_SET_IF_STAT = 0X55, 152 MLX4_CMD_SET_IF_STAT = 0X55,
153
154 /* set port opcode modifiers */
155 MLX4_SET_PORT_PRIO2TC = 0x8,
156 MLX4_SET_PORT_SCHEDULER = 0x9,
153}; 157};
154 158
155enum { 159enum {
diff --git a/include/linux/mlx4/device.h b/include/linux/mlx4/device.h
index 834c96c5d879..6d028247f79d 100644
--- a/include/linux/mlx4/device.h
+++ b/include/linux/mlx4/device.h
@@ -628,6 +628,9 @@ int mlx4_SET_PORT_general(struct mlx4_dev *dev, u8 port, int mtu,
628 u8 pptx, u8 pfctx, u8 pprx, u8 pfcrx); 628 u8 pptx, u8 pfctx, u8 pprx, u8 pfcrx);
629int mlx4_SET_PORT_qpn_calc(struct mlx4_dev *dev, u8 port, u32 base_qpn, 629int mlx4_SET_PORT_qpn_calc(struct mlx4_dev *dev, u8 port, u32 base_qpn,
630 u8 promisc); 630 u8 promisc);
631int mlx4_SET_PORT_PRIO2TC(struct mlx4_dev *dev, u8 port, u8 *prio2tc);
632int mlx4_SET_PORT_SCHEDULER(struct mlx4_dev *dev, u8 port, u8 *tc_tx_bw,
633 u8 *pg, u16 *ratelimit);
631int mlx4_find_cached_vlan(struct mlx4_dev *dev, u8 port, u16 vid, int *idx); 634int mlx4_find_cached_vlan(struct mlx4_dev *dev, u8 port, u16 vid, int *idx);
632int mlx4_register_vlan(struct mlx4_dev *dev, u8 port, u16 vlan, int *index); 635int mlx4_register_vlan(struct mlx4_dev *dev, u8 port, u16 vlan, int *index);
633void mlx4_unregister_vlan(struct mlx4_dev *dev, u8 port, int index); 636void mlx4_unregister_vlan(struct mlx4_dev *dev, u8 port, int index);
diff --git a/include/linux/mlx4/qp.h b/include/linux/mlx4/qp.h
index 091f9e7dc8b9..96005d75893c 100644
--- a/include/linux/mlx4/qp.h
+++ b/include/linux/mlx4/qp.h
@@ -139,7 +139,8 @@ struct mlx4_qp_path {
139 u8 rgid[16]; 139 u8 rgid[16];
140 u8 sched_queue; 140 u8 sched_queue;
141 u8 vlan_index; 141 u8 vlan_index;
142 u8 reserved3[2]; 142 u8 feup;
143 u8 reserved3;
143 u8 reserved4[2]; 144 u8 reserved4[2];
144 u8 dmac[6]; 145 u8 dmac[6];
145}; 146};
diff --git a/include/linux/netfilter/ipset/ip_set.h b/include/linux/netfilter/ipset/ip_set.h
index 2f8e18a23227..d6d549cf1f23 100644
--- a/include/linux/netfilter/ipset/ip_set.h
+++ b/include/linux/netfilter/ipset/ip_set.h
@@ -411,26 +411,32 @@ ip_set_get_h16(const struct nlattr *attr)
411#define ipset_nest_start(skb, attr) nla_nest_start(skb, attr | NLA_F_NESTED) 411#define ipset_nest_start(skb, attr) nla_nest_start(skb, attr | NLA_F_NESTED)
412#define ipset_nest_end(skb, start) nla_nest_end(skb, start) 412#define ipset_nest_end(skb, start) nla_nest_end(skb, start)
413 413
414#define NLA_PUT_IPADDR4(skb, type, ipaddr) \ 414static inline int nla_put_ipaddr4(struct sk_buff *skb, int type, __be32 ipaddr)
415do { \ 415{
416 struct nlattr *__nested = ipset_nest_start(skb, type); \ 416 struct nlattr *__nested = ipset_nest_start(skb, type);
417 \ 417 int ret;
418 if (!__nested) \ 418
419 goto nla_put_failure; \ 419 if (!__nested)
420 NLA_PUT_NET32(skb, IPSET_ATTR_IPADDR_IPV4, ipaddr); \ 420 return -EMSGSIZE;
421 ipset_nest_end(skb, __nested); \ 421 ret = nla_put_net32(skb, IPSET_ATTR_IPADDR_IPV4, ipaddr);
422} while (0) 422 if (!ret)
423 423 ipset_nest_end(skb, __nested);
424#define NLA_PUT_IPADDR6(skb, type, ipaddrptr) \ 424 return ret;
425do { \ 425}
426 struct nlattr *__nested = ipset_nest_start(skb, type); \ 426
427 \ 427static inline int nla_put_ipaddr6(struct sk_buff *skb, int type, const struct in6_addr *ipaddrptr)
428 if (!__nested) \ 428{
429 goto nla_put_failure; \ 429 struct nlattr *__nested = ipset_nest_start(skb, type);
430 NLA_PUT(skb, IPSET_ATTR_IPADDR_IPV6, \ 430 int ret;
431 sizeof(struct in6_addr), ipaddrptr); \ 431
432 ipset_nest_end(skb, __nested); \ 432 if (!__nested)
433} while (0) 433 return -EMSGSIZE;
434 ret = nla_put(skb, IPSET_ATTR_IPADDR_IPV6,
435 sizeof(struct in6_addr), ipaddrptr);
436 if (!ret)
437 ipset_nest_end(skb, __nested);
438 return ret;
439}
434 440
435/* Get address from skbuff */ 441/* Get address from skbuff */
436static inline __be32 442static inline __be32
diff --git a/include/linux/netfilter/ipset/ip_set_ahash.h b/include/linux/netfilter/ipset/ip_set_ahash.h
index 05a5d72680be..289b62d9dd1f 100644
--- a/include/linux/netfilter/ipset/ip_set_ahash.h
+++ b/include/linux/netfilter/ipset/ip_set_ahash.h
@@ -594,17 +594,20 @@ type_pf_head(struct ip_set *set, struct sk_buff *skb)
594 nested = ipset_nest_start(skb, IPSET_ATTR_DATA); 594 nested = ipset_nest_start(skb, IPSET_ATTR_DATA);
595 if (!nested) 595 if (!nested)
596 goto nla_put_failure; 596 goto nla_put_failure;
597 NLA_PUT_NET32(skb, IPSET_ATTR_HASHSIZE, 597 if (nla_put_net32(skb, IPSET_ATTR_HASHSIZE,
598 htonl(jhash_size(h->table->htable_bits))); 598 htonl(jhash_size(h->table->htable_bits))) ||
599 NLA_PUT_NET32(skb, IPSET_ATTR_MAXELEM, htonl(h->maxelem)); 599 nla_put_net32(skb, IPSET_ATTR_MAXELEM, htonl(h->maxelem)))
600 goto nla_put_failure;
600#ifdef IP_SET_HASH_WITH_NETMASK 601#ifdef IP_SET_HASH_WITH_NETMASK
601 if (h->netmask != HOST_MASK) 602 if (h->netmask != HOST_MASK &&
602 NLA_PUT_U8(skb, IPSET_ATTR_NETMASK, h->netmask); 603 nla_put_u8(skb, IPSET_ATTR_NETMASK, h->netmask))
604 goto nla_put_failure;
603#endif 605#endif
604 NLA_PUT_NET32(skb, IPSET_ATTR_REFERENCES, htonl(set->ref - 1)); 606 if (nla_put_net32(skb, IPSET_ATTR_REFERENCES, htonl(set->ref - 1)) ||
605 NLA_PUT_NET32(skb, IPSET_ATTR_MEMSIZE, htonl(memsize)); 607 nla_put_net32(skb, IPSET_ATTR_MEMSIZE, htonl(memsize)) ||
606 if (with_timeout(h->timeout)) 608 (with_timeout(h->timeout) &&
607 NLA_PUT_NET32(skb, IPSET_ATTR_TIMEOUT, htonl(h->timeout)); 609 nla_put_net32(skb, IPSET_ATTR_TIMEOUT, htonl(h->timeout))))
610 goto nla_put_failure;
608 ipset_nest_end(skb, nested); 611 ipset_nest_end(skb, nested);
609 612
610 return 0; 613 return 0;
diff --git a/include/linux/phy.h b/include/linux/phy.h
index 6fe0a37d4abf..f092032f1c98 100644
--- a/include/linux/phy.h
+++ b/include/linux/phy.h
@@ -412,6 +412,9 @@ struct phy_driver {
412 /* Clears up any memory if needed */ 412 /* Clears up any memory if needed */
413 void (*remove)(struct phy_device *phydev); 413 void (*remove)(struct phy_device *phydev);
414 414
415 /* Handles ethtool queries for hardware time stamping. */
416 int (*ts_info)(struct phy_device *phydev, struct ethtool_ts_info *ti);
417
415 /* Handles SIOCSHWTSTAMP ioctl for hardware time stamping. */ 418 /* Handles SIOCSHWTSTAMP ioctl for hardware time stamping. */
416 int (*hwtstamp)(struct phy_device *phydev, struct ifreq *ifr); 419 int (*hwtstamp)(struct phy_device *phydev, struct ifreq *ifr);
417 420
diff --git a/include/linux/platform_data/wiznet.h b/include/linux/platform_data/wiznet.h
new file mode 100644
index 000000000000..b5d8c192d84d
--- /dev/null
+++ b/include/linux/platform_data/wiznet.h
@@ -0,0 +1,24 @@
1/*
2 * Ethernet driver for the WIZnet W5x00 chip.
3 *
4 * Licensed under the GPL-2 or later.
5 */
6
7#ifndef PLATFORM_DATA_WIZNET_H
8#define PLATFORM_DATA_WIZNET_H
9
10#include <linux/if_ether.h>
11
12struct wiznet_platform_data {
13 int link_gpio;
14 u8 mac_addr[ETH_ALEN];
15};
16
17#ifndef CONFIG_WIZNET_BUS_SHIFT
18#define CONFIG_WIZNET_BUS_SHIFT 0
19#endif
20
21#define W5100_BUS_DIRECT_SIZE (0x8000 << CONFIG_WIZNET_BUS_SHIFT)
22#define W5300_BUS_DIRECT_SIZE (0x0400 << CONFIG_WIZNET_BUS_SHIFT)
23
24#endif /* PLATFORM_DATA_WIZNET_H */
diff --git a/include/linux/ptp_clock_kernel.h b/include/linux/ptp_clock_kernel.h
index dd2e44fba63e..945704c2ed65 100644
--- a/include/linux/ptp_clock_kernel.h
+++ b/include/linux/ptp_clock_kernel.h
@@ -136,4 +136,12 @@ struct ptp_clock_event {
136extern void ptp_clock_event(struct ptp_clock *ptp, 136extern void ptp_clock_event(struct ptp_clock *ptp,
137 struct ptp_clock_event *event); 137 struct ptp_clock_event *event);
138 138
139/**
140 * ptp_clock_index() - obtain the device index of a PTP clock
141 *
142 * @ptp: The clock obtained from ptp_clock_register().
143 */
144
145extern int ptp_clock_index(struct ptp_clock *ptp);
146
139#endif 147#endif
diff --git a/include/linux/stmmac.h b/include/linux/stmmac.h
index 0dddc9e42b6b..cf6403186359 100644
--- a/include/linux/stmmac.h
+++ b/include/linux/stmmac.h
@@ -28,6 +28,51 @@
28 28
29#include <linux/platform_device.h> 29#include <linux/platform_device.h>
30 30
31#define STMMAC_RX_COE_NONE 0
32#define STMMAC_RX_COE_TYPE1 1
33#define STMMAC_RX_COE_TYPE2 2
34
35/* Define the macros for CSR clock range parameters to be passed by
36 * platform code.
37 * This could also be configured at run time using CPU freq framework. */
38
39/* MDC Clock Selection define*/
40#define STMMAC_CSR_60_100M 0x0 /* MDC = clk_scr_i/42 */
41#define STMMAC_CSR_100_150M 0x1 /* MDC = clk_scr_i/62 */
42#define STMMAC_CSR_20_35M 0x2 /* MDC = clk_scr_i/16 */
43#define STMMAC_CSR_35_60M 0x3 /* MDC = clk_scr_i/26 */
44#define STMMAC_CSR_150_250M 0x4 /* MDC = clk_scr_i/102 */
45#define STMMAC_CSR_250_300M 0x5 /* MDC = clk_scr_i/122 */
46
47/* The MDC clock could be set higher than the IEEE 802.3
48 * specified frequency limit 0f 2.5 MHz, by programming a clock divider
49 * of value different than the above defined values. The resultant MDIO
50 * clock frequency of 12.5 MHz is applicable for the interfacing chips
51 * supporting higher MDC clocks.
52 * The MDC clock selection macros need to be defined for MDC clock rate
53 * of 12.5 MHz, corresponding to the following selection.
54 */
55#define STMMAC_CSR_I_4 0x8 /* clk_csr_i/4 */
56#define STMMAC_CSR_I_6 0x9 /* clk_csr_i/6 */
57#define STMMAC_CSR_I_8 0xA /* clk_csr_i/8 */
58#define STMMAC_CSR_I_10 0xB /* clk_csr_i/10 */
59#define STMMAC_CSR_I_12 0xC /* clk_csr_i/12 */
60#define STMMAC_CSR_I_14 0xD /* clk_csr_i/14 */
61#define STMMAC_CSR_I_16 0xE /* clk_csr_i/16 */
62#define STMMAC_CSR_I_18 0xF /* clk_csr_i/18 */
63
64/* AXI DMA Burst length suported */
65#define DMA_AXI_BLEN_4 (1 << 1)
66#define DMA_AXI_BLEN_8 (1 << 2)
67#define DMA_AXI_BLEN_16 (1 << 3)
68#define DMA_AXI_BLEN_32 (1 << 4)
69#define DMA_AXI_BLEN_64 (1 << 5)
70#define DMA_AXI_BLEN_128 (1 << 6)
71#define DMA_AXI_BLEN_256 (1 << 7)
72#define DMA_AXI_BLEN_ALL (DMA_AXI_BLEN_4 | DMA_AXI_BLEN_8 | DMA_AXI_BLEN_16 \
73 | DMA_AXI_BLEN_32 | DMA_AXI_BLEN_64 \
74 | DMA_AXI_BLEN_128 | DMA_AXI_BLEN_256)
75
31/* Platfrom data for platform device structure's platform_data field */ 76/* Platfrom data for platform device structure's platform_data field */
32 77
33struct stmmac_mdio_bus_data { 78struct stmmac_mdio_bus_data {
@@ -38,16 +83,24 @@ struct stmmac_mdio_bus_data {
38 int probed_phy_irq; 83 int probed_phy_irq;
39}; 84};
40 85
86struct stmmac_dma_cfg {
87 int pbl;
88 int fixed_burst;
89 int burst_len;
90};
91
41struct plat_stmmacenet_data { 92struct plat_stmmacenet_data {
93 char *phy_bus_name;
42 int bus_id; 94 int bus_id;
43 int phy_addr; 95 int phy_addr;
44 int interface; 96 int interface;
45 struct stmmac_mdio_bus_data *mdio_bus_data; 97 struct stmmac_mdio_bus_data *mdio_bus_data;
46 int pbl; 98 struct stmmac_dma_cfg *dma_cfg;
47 int clk_csr; 99 int clk_csr;
48 int has_gmac; 100 int has_gmac;
49 int enh_desc; 101 int enh_desc;
50 int tx_coe; 102 int tx_coe;
103 int rx_coe;
51 int bugged_jumbo; 104 int bugged_jumbo;
52 int pmt; 105 int pmt;
53 int force_sf_dma_mode; 106 int force_sf_dma_mode;
diff --git a/include/net/dcbnl.h b/include/net/dcbnl.h
index f55c980d8e23..fc5d5dcebb00 100644
--- a/include/net/dcbnl.h
+++ b/include/net/dcbnl.h
@@ -48,6 +48,8 @@ struct dcbnl_rtnl_ops {
48 /* IEEE 802.1Qaz std */ 48 /* IEEE 802.1Qaz std */
49 int (*ieee_getets) (struct net_device *, struct ieee_ets *); 49 int (*ieee_getets) (struct net_device *, struct ieee_ets *);
50 int (*ieee_setets) (struct net_device *, struct ieee_ets *); 50 int (*ieee_setets) (struct net_device *, struct ieee_ets *);
51 int (*ieee_getmaxrate) (struct net_device *, struct ieee_maxrate *);
52 int (*ieee_setmaxrate) (struct net_device *, struct ieee_maxrate *);
51 int (*ieee_getpfc) (struct net_device *, struct ieee_pfc *); 53 int (*ieee_getpfc) (struct net_device *, struct ieee_pfc *);
52 int (*ieee_setpfc) (struct net_device *, struct ieee_pfc *); 54 int (*ieee_setpfc) (struct net_device *, struct ieee_pfc *);
53 int (*ieee_getapp) (struct net_device *, struct dcb_app *); 55 int (*ieee_getapp) (struct net_device *, struct dcb_app *);
diff --git a/include/net/icmp.h b/include/net/icmp.h
index 75d615649071..ce70a581d95c 100644
--- a/include/net/icmp.h
+++ b/include/net/icmp.h
@@ -41,7 +41,6 @@ struct net;
41 41
42extern void icmp_send(struct sk_buff *skb_in, int type, int code, __be32 info); 42extern void icmp_send(struct sk_buff *skb_in, int type, int code, __be32 info);
43extern int icmp_rcv(struct sk_buff *skb); 43extern int icmp_rcv(struct sk_buff *skb);
44extern int icmp_ioctl(struct sock *sk, int cmd, unsigned long arg);
45extern int icmp_init(void); 44extern int icmp_init(void);
46extern void icmp_out_count(struct net *net, unsigned char type); 45extern void icmp_out_count(struct net *net, unsigned char type);
47 46
diff --git a/include/net/ndisc.h b/include/net/ndisc.h
index 6f9c25a76cd1..c02b6ad3f6c5 100644
--- a/include/net/ndisc.h
+++ b/include/net/ndisc.h
@@ -34,6 +34,7 @@ enum {
34 __ND_OPT_ARRAY_MAX, 34 __ND_OPT_ARRAY_MAX,
35 ND_OPT_ROUTE_INFO = 24, /* RFC4191 */ 35 ND_OPT_ROUTE_INFO = 24, /* RFC4191 */
36 ND_OPT_RDNSS = 25, /* RFC5006 */ 36 ND_OPT_RDNSS = 25, /* RFC5006 */
37 ND_OPT_DNSSL = 31, /* RFC6106 */
37 __ND_OPT_MAX 38 __ND_OPT_MAX
38}; 39};
39 40
diff --git a/include/net/netlink.h b/include/net/netlink.h
index f394fe5d7641..785f37a3b44e 100644
--- a/include/net/netlink.h
+++ b/include/net/netlink.h
@@ -102,20 +102,6 @@
102 * nla_put_flag(skb, type) add flag attribute to skb 102 * nla_put_flag(skb, type) add flag attribute to skb
103 * nla_put_msecs(skb, type, jiffies) add msecs attribute to skb 103 * nla_put_msecs(skb, type, jiffies) add msecs attribute to skb
104 * 104 *
105 * Exceptions Based Attribute Construction:
106 * NLA_PUT(skb, type, len, data) add attribute to skb
107 * NLA_PUT_U8(skb, type, value) add u8 attribute to skb
108 * NLA_PUT_U16(skb, type, value) add u16 attribute to skb
109 * NLA_PUT_U32(skb, type, value) add u32 attribute to skb
110 * NLA_PUT_U64(skb, type, value) add u64 attribute to skb
111 * NLA_PUT_STRING(skb, type, str) add string attribute to skb
112 * NLA_PUT_FLAG(skb, type) add flag attribute to skb
113 * NLA_PUT_MSECS(skb, type, jiffies) add msecs attribute to skb
114 *
115 * The meaning of these functions is equal to their lower case
116 * variants but they jump to the label nla_put_failure in case
117 * of a failure.
118 *
119 * Nested Attributes Construction: 105 * Nested Attributes Construction:
120 * nla_nest_start(skb, type) start a nested attribute 106 * nla_nest_start(skb, type) start a nested attribute
121 * nla_nest_end(skb, nla) finalize a nested attribute 107 * nla_nest_end(skb, nla) finalize a nested attribute
@@ -772,6 +758,39 @@ static inline int nla_put_u16(struct sk_buff *skb, int attrtype, u16 value)
772} 758}
773 759
774/** 760/**
761 * nla_put_be16 - Add a __be16 netlink attribute to a socket buffer
762 * @skb: socket buffer to add attribute to
763 * @attrtype: attribute type
764 * @value: numeric value
765 */
766static inline int nla_put_be16(struct sk_buff *skb, int attrtype, __be16 value)
767{
768 return nla_put(skb, attrtype, sizeof(__be16), &value);
769}
770
771/**
772 * nla_put_net16 - Add 16-bit network byte order netlink attribute to a socket buffer
773 * @skb: socket buffer to add attribute to
774 * @attrtype: attribute type
775 * @value: numeric value
776 */
777static inline int nla_put_net16(struct sk_buff *skb, int attrtype, __be16 value)
778{
779 return nla_put_be16(skb, attrtype | NLA_F_NET_BYTEORDER, value);
780}
781
782/**
783 * nla_put_le16 - Add a __le16 netlink attribute to a socket buffer
784 * @skb: socket buffer to add attribute to
785 * @attrtype: attribute type
786 * @value: numeric value
787 */
788static inline int nla_put_le16(struct sk_buff *skb, int attrtype, __le16 value)
789{
790 return nla_put(skb, attrtype, sizeof(__le16), &value);
791}
792
793/**
775 * nla_put_u32 - Add a u32 netlink attribute to a socket buffer 794 * nla_put_u32 - Add a u32 netlink attribute to a socket buffer
776 * @skb: socket buffer to add attribute to 795 * @skb: socket buffer to add attribute to
777 * @attrtype: attribute type 796 * @attrtype: attribute type
@@ -783,7 +802,40 @@ static inline int nla_put_u32(struct sk_buff *skb, int attrtype, u32 value)
783} 802}
784 803
785/** 804/**
786 * nla_put_64 - Add a u64 netlink attribute to a socket buffer 805 * nla_put_be32 - Add a __be32 netlink attribute to a socket buffer
806 * @skb: socket buffer to add attribute to
807 * @attrtype: attribute type
808 * @value: numeric value
809 */
810static inline int nla_put_be32(struct sk_buff *skb, int attrtype, __be32 value)
811{
812 return nla_put(skb, attrtype, sizeof(__be32), &value);
813}
814
815/**
816 * nla_put_net32 - Add 32-bit network byte order netlink attribute to a socket buffer
817 * @skb: socket buffer to add attribute to
818 * @attrtype: attribute type
819 * @value: numeric value
820 */
821static inline int nla_put_net32(struct sk_buff *skb, int attrtype, __be32 value)
822{
823 return nla_put_be32(skb, attrtype | NLA_F_NET_BYTEORDER, value);
824}
825
826/**
827 * nla_put_le32 - Add a __le32 netlink attribute to a socket buffer
828 * @skb: socket buffer to add attribute to
829 * @attrtype: attribute type
830 * @value: numeric value
831 */
832static inline int nla_put_le32(struct sk_buff *skb, int attrtype, __le32 value)
833{
834 return nla_put(skb, attrtype, sizeof(__le32), &value);
835}
836
837/**
838 * nla_put_u64 - Add a u64 netlink attribute to a socket buffer
787 * @skb: socket buffer to add attribute to 839 * @skb: socket buffer to add attribute to
788 * @attrtype: attribute type 840 * @attrtype: attribute type
789 * @value: numeric value 841 * @value: numeric value
@@ -794,6 +846,39 @@ static inline int nla_put_u64(struct sk_buff *skb, int attrtype, u64 value)
794} 846}
795 847
796/** 848/**
849 * nla_put_be64 - Add a __be64 netlink attribute to a socket buffer
850 * @skb: socket buffer to add attribute to
851 * @attrtype: attribute type
852 * @value: numeric value
853 */
854static inline int nla_put_be64(struct sk_buff *skb, int attrtype, __be64 value)
855{
856 return nla_put(skb, attrtype, sizeof(__be64), &value);
857}
858
859/**
860 * nla_put_net64 - Add 64-bit network byte order netlink attribute to a socket buffer
861 * @skb: socket buffer to add attribute to
862 * @attrtype: attribute type
863 * @value: numeric value
864 */
865static inline int nla_put_net64(struct sk_buff *skb, int attrtype, __be64 value)
866{
867 return nla_put_be64(skb, attrtype | NLA_F_NET_BYTEORDER, value);
868}
869
870/**
871 * nla_put_le64 - Add a __le64 netlink attribute to a socket buffer
872 * @skb: socket buffer to add attribute to
873 * @attrtype: attribute type
874 * @value: numeric value
875 */
876static inline int nla_put_le64(struct sk_buff *skb, int attrtype, __le64 value)
877{
878 return nla_put(skb, attrtype, sizeof(__le64), &value);
879}
880
881/**
797 * nla_put_string - Add a string netlink attribute to a socket buffer 882 * nla_put_string - Add a string netlink attribute to a socket buffer
798 * @skb: socket buffer to add attribute to 883 * @skb: socket buffer to add attribute to
799 * @attrtype: attribute type 884 * @attrtype: attribute type
@@ -828,60 +913,6 @@ static inline int nla_put_msecs(struct sk_buff *skb, int attrtype,
828 return nla_put(skb, attrtype, sizeof(u64), &tmp); 913 return nla_put(skb, attrtype, sizeof(u64), &tmp);
829} 914}
830 915
831#define NLA_PUT(skb, attrtype, attrlen, data) \
832 do { \
833 if (unlikely(nla_put(skb, attrtype, attrlen, data) < 0)) \
834 goto nla_put_failure; \
835 } while(0)
836
837#define NLA_PUT_TYPE(skb, type, attrtype, value) \
838 do { \
839 type __tmp = value; \
840 NLA_PUT(skb, attrtype, sizeof(type), &__tmp); \
841 } while(0)
842
843#define NLA_PUT_U8(skb, attrtype, value) \
844 NLA_PUT_TYPE(skb, u8, attrtype, value)
845
846#define NLA_PUT_U16(skb, attrtype, value) \
847 NLA_PUT_TYPE(skb, u16, attrtype, value)
848
849#define NLA_PUT_LE16(skb, attrtype, value) \
850 NLA_PUT_TYPE(skb, __le16, attrtype, value)
851
852#define NLA_PUT_BE16(skb, attrtype, value) \
853 NLA_PUT_TYPE(skb, __be16, attrtype, value)
854
855#define NLA_PUT_NET16(skb, attrtype, value) \
856 NLA_PUT_BE16(skb, attrtype | NLA_F_NET_BYTEORDER, value)
857
858#define NLA_PUT_U32(skb, attrtype, value) \
859 NLA_PUT_TYPE(skb, u32, attrtype, value)
860
861#define NLA_PUT_BE32(skb, attrtype, value) \
862 NLA_PUT_TYPE(skb, __be32, attrtype, value)
863
864#define NLA_PUT_NET32(skb, attrtype, value) \
865 NLA_PUT_BE32(skb, attrtype | NLA_F_NET_BYTEORDER, value)
866
867#define NLA_PUT_U64(skb, attrtype, value) \
868 NLA_PUT_TYPE(skb, u64, attrtype, value)
869
870#define NLA_PUT_BE64(skb, attrtype, value) \
871 NLA_PUT_TYPE(skb, __be64, attrtype, value)
872
873#define NLA_PUT_NET64(skb, attrtype, value) \
874 NLA_PUT_BE64(skb, attrtype | NLA_F_NET_BYTEORDER, value)
875
876#define NLA_PUT_STRING(skb, attrtype, value) \
877 NLA_PUT(skb, attrtype, strlen(value) + 1, value)
878
879#define NLA_PUT_FLAG(skb, attrtype) \
880 NLA_PUT(skb, attrtype, 0, NULL)
881
882#define NLA_PUT_MSECS(skb, attrtype, jiffies) \
883 NLA_PUT_U64(skb, attrtype, jiffies_to_msecs(jiffies))
884
885/** 916/**
886 * nla_get_u32 - return payload of u32 attribute 917 * nla_get_u32 - return payload of u32 attribute
887 * @nla: u32 netlink attribute 918 * @nla: u32 netlink attribute
diff --git a/include/net/xfrm.h b/include/net/xfrm.h
index 96239e78e621..1cb32bf107de 100644
--- a/include/net/xfrm.h
+++ b/include/net/xfrm.h
@@ -1682,8 +1682,9 @@ static inline int xfrm_mark_get(struct nlattr **attrs, struct xfrm_mark *m)
1682 1682
1683static inline int xfrm_mark_put(struct sk_buff *skb, const struct xfrm_mark *m) 1683static inline int xfrm_mark_put(struct sk_buff *skb, const struct xfrm_mark *m)
1684{ 1684{
1685 if (m->m | m->v) 1685 if ((m->m | m->v) &&
1686 NLA_PUT(skb, XFRMA_MARK, sizeof(struct xfrm_mark), m); 1686 nla_put(skb, XFRMA_MARK, sizeof(struct xfrm_mark), m))
1687 goto nla_put_failure;
1687 return 0; 1688 return 0;
1688 1689
1689nla_put_failure: 1690nla_put_failure: