-From c37953457a7ebeb0d97ae8574b3d41274fcd9119 Mon Sep 17 00:00:00 2001
+From 67a2eceebe9dcd92a1a5f3e912340c8975c84434 Mon Sep 17 00:00:00 2001
From: Yangbo Lu <yangbo.lu@nxp.com>
-Date: Wed, 1 Nov 2017 16:22:33 +0800
-Subject: [PATCH] core-linux: support layerscape
+Date: Wed, 17 Jan 2018 14:50:41 +0800
+Subject: [PATCH 02/30] core-linux: support layerscape
-This is a integrated patch for layerscape core-linux support.
+This is an integrated patch for layerscape core-linux support.
Signed-off-by: Madalin Bucur <madalin.bucur@freescale.com>
Signed-off-by: Zhao Qiang <qiang.zhao@nxp.com>
Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
---
drivers/base/devres.c | 66 ++++++++++++++++++++++++++++
- drivers/base/soc.c | 66 ++++++++++++++++++++++++++++
+ drivers/base/soc.c | 70 +++++++++++++++++++++++++++++
include/linux/device.h | 19 ++++++++
include/linux/fsl/svr.h | 97 +++++++++++++++++++++++++++++++++++++++++
include/linux/fsl_devices.h | 3 ++
net/core/dev.c | 13 +++++-
net/core/skbuff.c | 29 +++++++++++-
net/sched/sch_generic.c | 7 +++
- 13 files changed, 309 insertions(+), 3 deletions(-)
+ 13 files changed, 313 insertions(+), 3 deletions(-)
create mode 100644 include/linux/fsl/svr.h
--- a/drivers/base/devres.c
static DEFINE_IDA(soc_ida);
-@@ -159,3 +160,68 @@ static int __init soc_bus_register(void)
+@@ -159,3 +160,72 @@ static int __init soc_bus_register(void)
return bus_register(&soc_bus_type);
}
core_initcall(soc_bus_register);
+ const struct soc_device_attribute *match = arg;
+
+ if (match->machine &&
-+ !glob_match(match->machine, soc_dev->attr->machine))
++ (!soc_dev->attr->machine ||
++ !glob_match(match->machine, soc_dev->attr->machine)))
+ return 0;
+
+ if (match->family &&
-+ !glob_match(match->family, soc_dev->attr->family))
++ (!soc_dev->attr->family ||
++ !glob_match(match->family, soc_dev->attr->family)))
+ return 0;
+
+ if (match->revision &&
-+ !glob_match(match->revision, soc_dev->attr->revision))
++ (!soc_dev->attr->revision ||
++ !glob_match(match->revision, soc_dev->attr->revision)))
+ return 0;
+
+ if (match->soc_id &&
-+ !glob_match(match->soc_id, soc_dev->attr->soc_id))
++ (!soc_dev->attr->soc_id ||
++ !glob_match(match->soc_id, soc_dev->attr->soc_id)))
+ return 0;
+
+ return 1;
void __kfree_skb(struct sk_buff *skb);
extern struct kmem_cache *skbuff_head_cache;
-@@ -3057,6 +3058,7 @@ static inline void skb_free_datagram_loc
+@@ -3059,6 +3060,7 @@ static inline void skb_free_datagram_loc
}
int skb_kill_datagram(struct sock *sk, struct sk_buff *skb, unsigned int flags);
int skb_copy_bits(const struct sk_buff *skb, int offset, void *to, int len);
#endif /* __SOC_BUS_H */
--- a/include/uapi/linux/if_ether.h
+++ b/include/uapi/linux/if_ether.h
-@@ -35,6 +35,7 @@
+@@ -36,6 +36,7 @@
#define ETH_DATA_LEN 1500 /* Max. octets in payload */
#define ETH_FRAME_LEN 1514 /* Max. octets in frame sans FCS */
#define ETH_FCS_LEN 4 /* Octets in the FCS */
* These are the defined Ethernet Protocol ID's.
--- a/net/core/dev.c
+++ b/net/core/dev.c
-@@ -6603,9 +6603,18 @@ int dev_set_mtu(struct net_device *dev,
+@@ -6630,9 +6630,18 @@ int dev_set_mtu(struct net_device *dev,
if (new_mtu == dev->mtu)
return 0;
/* Make sure a field is enclosed inside headers_start/headers_end section */
#define CHECK_SKB_FIELD(field) \
BUILD_BUG_ON(offsetof(struct sk_buff, field) < \
-@@ -1073,7 +1099,7 @@ static void skb_headers_offset_update(st
+@@ -1075,7 +1101,7 @@ static void skb_headers_offset_update(st
skb->inner_mac_header += off;
}
{
__copy_skb_header(new, old);
-@@ -1081,6 +1107,7 @@ static void copy_skb_header(struct sk_bu
+@@ -1083,6 +1109,7 @@ static void copy_skb_header(struct sk_bu
skb_shinfo(new)->gso_segs = skb_shinfo(old)->gso_segs;
skb_shinfo(new)->gso_type = skb_shinfo(old)->gso_type;
}