Skip to contentSkip to conversation

backport: add support for kernel 3.17

PATCH New Emmanuel Grumbach 1 participant 1 message Sep 2, 2014

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 backport: add support for kernel 3.17

backport upstream's

commit c835a677331495cf137a7f8a023463afd9f032f8

Author: Tom Gundersen <[email protected]>
Date:   Mon Jul 14 16:37:24 2014 +0200

net: set name_assign_type in alloc_netdev()

---
 backport/backport-include/linux/netdevice.h | 32 +++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)
backport/backport-include/linux/netdevice.h +32 -0
index 6979758..1935f78 100644
@@ -157,4 +157,36 @@ static inline void netdev_reset_queue(struct net_device *dev_queue)
 #define IFF_UNICAST_FLT	0x20000		/* Supports unicast filtering	*/
 #endif
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,17,0)
+
+/* interface name assignment types (sysfs name_assign_type attribute) */
+#define NET_NAME_UNKNOWN	0	/* unknown origin (not exposed to userspace) */
+#define NET_NAME_ENUM		1	/* enumerated by kernel */
+#define NET_NAME_PREDICTABLE	2	/* predictably named by the kernel */
+#define NET_NAME_USER		3	/* provided by user-space */
+#define NET_NAME_RENAMED	4	/* renamed by user-space */
+
+static inline struct net_device *
+backport_alloc_netdev_mqs(int sizeof_priv, const char *name,
+			  unsigned char name_assign_type,
+			  void (*setup)(struct net_device *),
+			  unsigned int txqs, unsigned int rxqs)
+{
+	return alloc_netdev_mqs(sizeof_priv, name, setup, txqs, rxqs);
+}
+
+#define alloc_netdev_mqs LINUX_BACKPORT(alloc_netdev_mqs)
+
+#undef alloc_netdev
+static inline struct net_device *
+backport_alloc_netdev(int sizeof_priv, const char *name,
+		      unsigned char name_assign_type,
+		      void (*setup)(struct net_device *))
+{
+	return backport_alloc_netdev_mqs(sizeof_priv, name, name_assign_type,
+					 setup, 1, 1);
+}
+#define alloc_netdev LINUX_BACKPORT(alloc_netdev)
+#endif
+
 #endif /* __BACKPORT_NETDEVICE_H */
Signature · 1 line
1.9.1