[PATCH] backport: add support for kernel 3.17

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



backport upstream's

commit c835a677331495cf137a7f8a023463afd9f032f8
Author: Tom Gundersen <teg@xxxxxxx>
Date:   Mon Jul 14 16:37:24 2014 +0200

    net: set name_assign_type in alloc_netdev()

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@xxxxxxxxx>
---
 backport/backport-include/linux/netdevice.h | 32 +++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)

diff --git a/backport/backport-include/linux/netdevice.h b/backport/backport-include/linux/netdevice.h
index 6979758..1935f78 100644
--- a/backport/backport-include/linux/netdevice.h
+++ b/backport/backport-include/linux/netdevice.h
@@ -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 */
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe backports" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux