From patchwork Fri Jun 26 23:11:10 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sven Eckelmann X-Patchwork-Id: 5106 Return-Path: Received: from mail.gmx.net (mail.gmx.net [213.165.64.20]) by open-mesh.net (Postfix) with SMTP id DE0B515438F for ; Fri, 26 Jun 2009 23:32:19 +0000 (UTC) Received: (qmail invoked by alias); 26 Jun 2009 23:11:06 -0000 Received: from unknown (EHLO localhost) [89.246.221.190] by mail.gmx.net (mp014) with SMTP; 27 Jun 2009 01:11:06 +0200 X-Authenticated: #15668376 X-Provags-ID: V01U2FsdGVkX188VRQlcfo82cf0zd/89rYmpIomYGHdG46GKYniLt 4qjqqBXJ1hf9y4 From: Sven Eckelmann To: b.a.t.m.a.n@lists.open-mesh.net Date: Sat, 27 Jun 2009 01:11:10 +0200 Message-Id: <1246057870-1880-2-git-send-email-sven.eckelmann@gmx.de> X-Mailer: git-send-email 1.6.3.1 In-Reply-To: <1246057870-1880-1-git-send-email-sven.eckelmann@gmx.de> References: <1246057870-1880-1-git-send-email-sven.eckelmann@gmx.de> X-Y-GMX-Trusted: 0 X-FuHaFi: 0.48 Subject: [B.A.T.M.A.N.] [PATCH] [batman] 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:20 -0000 The current version of batman-gateway 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/linux/modules/gateway.c | 19 ++++++++++++++++--- batman/linux/modules/gateway.h | 1 + 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/batman/linux/modules/gateway.c b/batman/linux/modules/gateway.c index bbe48e0..aa58688 100644 --- a/batman/linux/modules/gateway.c +++ b/batman/linux/modules/gateway.c @@ -503,15 +503,31 @@ static int packet_recv_thread(void *data) } /* bat_netdev part */ +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 29) +static const struct net_device_ops bat_netdev_ops = { + .ndo_open = bat_netdev_open, + .ndo_stop = bat_netdev_close, + .ndo_start_xmit = bat_netdev_xmit, + .ndo_set_mac_address = eth_mac_addr, + .ndo_change_mtu = eth_change_mtu +}; +#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 29) */ static void bat_netdev_setup( struct net_device *dev ) { struct gate_priv *priv; ether_setup(dev); +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 29) dev->open = bat_netdev_open; dev->stop = bat_netdev_close; dev->hard_start_xmit = bat_netdev_xmit; +#ifdef HAVE_VALIDATE_ADDR + dev->validate_addr = NULL; +#endif +#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; @@ -520,9 +536,6 @@ static void bat_netdev_setup( struct net_device *dev ) #endif dev->mtu = 1471; dev->flags = IFF_POINTOPOINT | IFF_NOARP | IFF_MULTICAST; -#ifdef HAVE_VALIDATE_ADDR - dev->validate_addr = NULL; -#endif priv = netdev_priv( dev ); memset( priv, 0, sizeof( struct gate_priv ) ); diff --git a/batman/linux/modules/gateway.h b/batman/linux/modules/gateway.h index de2fecd..238b518 100644 --- a/batman/linux/modules/gateway.h +++ b/batman/linux/modules/gateway.h @@ -36,6 +36,7 @@ #include /* sock */ #include /* class_create, class_destroy, class_device_create */ #include /* list handling */ +#include /* ethernet device standard functions */ //#include /* init_net */ #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)