From patchwork Fri Jun 26 23:11:09 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sven Eckelmann X-Patchwork-Id: 5123 Return-Path: Received: from mail.gmx.net (mail.gmx.net [213.165.64.20]) by open-mesh.net (Postfix) with SMTP id 8A58015438B for ; Fri, 26 Jun 2009 23:32:15 +0000 (UTC) Received: (qmail invoked by alias); 26 Jun 2009 23:11:01 -0000 Received: from unknown (EHLO localhost) [89.246.221.190] by mail.gmx.net (mp015) with SMTP; 27 Jun 2009 01:11:01 +0200 X-Authenticated: #15668376 X-Provags-ID: V01U2FsdGVkX1/Ioi8X6ErIVtZG6okN3ZxnJ0OjLPm9p9Sm7rcUcV oNtI6aG3S9YuKT From: Sven Eckelmann To: b.a.t.m.a.n@lists.open-mesh.net Date: Sat, 27 Jun 2009 01:11:09 +0200 Message-Id: <1246057870-1880-1-git-send-email-sven.eckelmann@gmx.de> X-Mailer: git-send-email 1.6.3.1 X-Y-GMX-Trusted: 0 X-FuHaFi: 0.51 Subject: [B.A.T.M.A.N.] [PATCH] [batman-adv] Convert to new net_device_ops X-BeenThere: b.a.t.m.a.n@lists.open-mesh.net X-Mailman-Version: 2.1.11 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: Fri, 26 Jun 2009 23:32:15 -0000 The current version of batman-adv-kernelland uses the netdevice structure instead of netdevice ops introduced by v2.6.28-rc5-510-gd314774. The compatibility version was removed in v2.6.30-rc6-851-ge3804cb. We need to change now change to this new structure to be able to compile it against linux-2.6.31. Signed-off-by: Sven Eckelmann --- batman-adv-kernelland/soft-interface.c | 17 +++++++++++++++++ 1 files changed, 17 insertions(+), 0 deletions(-) diff --git a/batman-adv-kernelland/soft-interface.c b/batman-adv-kernelland/soft-interface.c index bb95501..4600017 100644 --- a/batman-adv-kernelland/soft-interface.c +++ b/batman-adv-kernelland/soft-interface.c @@ -31,6 +31,7 @@ #include "hash.h" #include #include +#include "compat.h" @@ -98,6 +99,18 @@ int my_skb_push(struct sk_buff *skb, unsigned int len) return 0; } +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 29) +static const struct net_device_ops bat_netdev_ops = { + .ndo_open = interface_open, + .ndo_stop = interface_release, + .ndo_get_stats = interface_stats, + .ndo_set_mac_address = interface_set_mac_addr, + .ndo_change_mtu = interface_change_mtu, + .ndo_start_xmit = interface_tx, + .ndo_validate_addr = eth_validate_addr +}; +#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 29) */ + void interface_setup(struct net_device *dev) { struct bat_priv *priv = netdev_priv(dev); @@ -105,12 +118,16 @@ void interface_setup(struct net_device *dev) ether_setup(dev); +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 29) dev->open = interface_open; dev->stop = interface_release; dev->get_stats = interface_stats; dev->set_mac_address = interface_set_mac_addr; dev->change_mtu = interface_change_mtu; dev->hard_start_xmit = interface_tx; +#else + dev->netdev_ops = &bat_netdev_ops; +#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 29) */ dev->destructor = free_netdev; dev->features |= NETIF_F_NO_CSUM;