From patchwork Mon Jul 21 13:42:05 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Wunderlich X-Patchwork-Id: 4125 Return-Path: Received-SPF: None (no SPF record) identity=mailfrom; client-ip=79.140.42.25; helo=mail.mail.packetmixer.de; envelope-from=sw@simonwunderlich.de; receiver=b.a.t.m.a.n@lists.open-mesh.org Received: from mail.mail.packetmixer.de (packetmixer.de [79.140.42.25]) by open-mesh.org (Postfix) with ESMTPS id D0CD5600289 for ; Mon, 21 Jul 2014 15:42:12 +0200 (CEST) Received: from kero.packetmixer.de (unknown [IPv6:2a02:3100:260a:f800:221:ccff:fe73:b665]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by mail.mail.packetmixer.de (Postfix) with ESMTPSA id BAB94174001; Mon, 21 Jul 2014 15:43:04 +0200 (CEST) From: Simon Wunderlich To: b.a.t.m.a.n@lists.open-mesh.org Date: Mon, 21 Jul 2014 15:42:05 +0200 Message-Id: <1405950125-13983-1-git-send-email-sw@simonwunderlich.de> X-Mailer: git-send-email 1.9.1 Cc: Tom Gundersen , "David S. Miller" Subject: [B.A.T.M.A.N.] [PATCH] net: set name_assign_type in alloc_netdev() X-BeenThere: b.a.t.m.a.n@lists.open-mesh.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: The list for a Better Approach To Mobile Ad-hoc Networking List-Id: The list for a Better Approach To Mobile Ad-hoc Networking List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jul 2014 13:42:13 -0000 From: Tom Gundersen Extend alloc_netdev{,_mq{,s}}() to take name_assign_type as argument, and convert all users to pass NET_NAME_UNKNOWN. Coccinelle patch: @@ expression sizeof_priv, name, setup, txqs, rxqs, count; @@ ( -alloc_netdev_mqs(sizeof_priv, name, setup, txqs, rxqs) +alloc_netdev_mqs(sizeof_priv, name, NET_NAME_UNKNOWN, setup, txqs, rxqs) | -alloc_netdev_mq(sizeof_priv, name, setup, count) +alloc_netdev_mq(sizeof_priv, name, NET_NAME_UNKNOWN, setup, count) | -alloc_netdev(sizeof_priv, name, setup) +alloc_netdev(sizeof_priv, name, NET_NAME_UNKNOWN, setup) ) v9: move comments here from the wrong commit Signed-off-by: Tom Gundersen Reviewed-by: David Herrmann Signed-off-by: David S. Miller [sw: added compat code] Signed-off-by: Simon Wunderlich --- compat.h | 14 ++++++++++++++ soft-interface.c | 2 +- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/compat.h b/compat.h index ed5b815..d218426 100644 --- a/compat.h +++ b/compat.h @@ -446,4 +446,18 @@ static int __batadv_interface_kill_vid(struct net_device *dev, __be16 proto,\ #endif /* < KERNEL_VERSION(3, 16, 0) */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 17, 0) + +/* alloc_netdev() was defined differently before 2.6.38 */ +#undef alloc_netdev +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 38) +#define alloc_netdev(sizeof_priv, name, name_assign_type, setup) \ + alloc_netdev_mq(sizeof_priv, name, setup, 1) +#else +#define alloc_netdev(sizeof_priv, name, name_assign_type, setup) \ + alloc_netdev_mqs(sizeof_priv, name, setup, 1, 1) +#endif /* nested < KERNEL_VERSION(2, 6, 38) */ + +#endif /* < KERNEL_VERSION(3, 17, 0) */ + #endif /* _NET_BATMAN_ADV_COMPAT_H_ */ diff --git a/soft-interface.c b/soft-interface.c index 9bf382d..cfc2cd2 100644 --- a/soft-interface.c +++ b/soft-interface.c @@ -933,7 +933,7 @@ struct net_device *batadv_softif_create(const char *name) int ret; soft_iface = alloc_netdev(sizeof(struct batadv_priv), name, - batadv_softif_init_early); + NET_NAME_UNKNOWN, batadv_softif_init_early); if (!soft_iface) return NULL;