Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit abad5446 authored by Simon Wunderlich's avatar Simon Wunderlich Committed by Greg Kroah-Hartman
Browse files

Staging: batman-adv: Remove compat.h



Since we are now part of mainline, we don't need compat.h to allow
building of the module with old versions of the kernel.

Signed-off-by: default avatarAndrew Lunn <andrew@lunn.ch>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent b9b27e4e
Loading
Loading
Loading
Loading
+0 −3
Original line number Original line Diff line number Diff line
@@ -17,9 +17,6 @@
-> transtable_global (read-only) [outputs the global translation table]
-> transtable_global (read-only) [outputs the global translation table]
-> transtable_local (read-only) [outputs the local translation table]
-> transtable_local (read-only) [outputs the local translation table]


=> strip out all backward compatibility support to older kernels
   (only found in compat.h)

=> fix checkpatch.pl errors
=> fix checkpatch.pl errors


Please send all patches to:
Please send all patches to:
+0 −121
Original line number Original line Diff line number Diff line
/*
 * Copyright (C) 2007-2009 B.A.T.M.A.N. contributors:
 *
 * Marek Lindner, Simon Wunderlich
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of version 2 of the GNU General Public
 * License as published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
 * 02110-1301, USA
 *
 *
 * This file contains macros for maintaining compatibility with older versions
 * of the Linux kernel.
 */

#include <linux/version.h>	/* LINUX_VERSION_CODE */

#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 22)

#define skb_set_network_header(_skb, _offset) \
	do { (_skb)->nh.raw = (_skb)->data + (_offset); } while (0)

#define skb_reset_mac_header(_skb) \
	do { (_skb)->mac.raw = (_skb)->data; } while (0)

#define list_first_entry(ptr, type, member) \
	list_entry((ptr)->next, type, member)

#define skb_mac_header(_skb) \
    ((_skb)->mac.raw)

#define skb_network_header(_skb) \
    ((_skb)->nh.raw)

#define skb_mac_header(_skb) \
    ((_skb)->mac.raw)

#endif /* < KERNEL_VERSION(2,6,22) */

#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 23)

static inline int skb_clone_writable(struct sk_buff *skb, unsigned int len)
{
	/* skb->hdr_len not available, just "not writable" to enforce a copy */
	return 0;
}

#define cancel_delayed_work_sync(wq) cancel_rearming_delayed_work(wq)

#endif /* < KERNEL_VERSION(2, 6, 23) */

#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 25)

#define strict_strtoul(cp, base, res) \
	({ \
	int ret = 0; \
	char *endp; \
	*res = simple_strtoul(cp, &endp, base); \
	if (cp == endp) \
		ret = -EINVAL; \
	ret; \
})

#endif /* < KERNEL_VERSION(2, 6, 25) */

#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 26)

static const char hex_asc[] = "0123456789abcdef";
#define hex_asc_lo(x)   hex_asc[((x) & 0x0f)]
#define hex_asc_hi(x)   hex_asc[((x) & 0xf0) >> 4]
static inline char *pack_hex_byte(char *buf, u8 byte)
{
    *buf++ = hex_asc_hi(byte);
    *buf++ = hex_asc_lo(byte);
    return buf;
}

#define device_create(_cls, _parent, _devt, _device, _fmt) \
	class_device_create(_cls, _parent, _devt, _device, _fmt)

#define device_destroy(_cls, _device) \
	class_device_destroy(_cls, _device)

#endif /* < KERNEL_VERSION(2, 6, 26) */

#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 27)

#ifndef dereference_function_descriptor
#define dereference_function_descriptor(p) (p)
#endif

#ifndef device_create
#define device_create(_cls, _parent, _devt, _device, _fmt) \
	device_create_drvdata(_cls, _parent, _devt, _device, _fmt)
#endif

#endif /* < KERNEL_VERSION(2, 6, 27) */

#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 29)

asmlinkage int bat_printk(const char *fmt, ...);
#define printk bat_printk

static inline struct net_device_stats *dev_get_stats(struct net_device *dev)
{
	if (dev->get_stats)
		return dev->get_stats(dev);
	else
		return NULL;
}

#endif /* < KERNEL_VERSION(2, 6, 29) */
+0 −2
Original line number Original line Diff line number Diff line
@@ -26,8 +26,6 @@
#include "types.h"
#include "types.h"
#include "hash.h"
#include "hash.h"


#include "compat.h"

static struct class *batman_class;
static struct class *batman_class;


static int Major;	/* Major number assigned to our device driver */
static int Major;	/* Major number assigned to our device driver */
+0 −1
Original line number Original line Diff line number Diff line
@@ -26,7 +26,6 @@
#include "translation-table.h"
#include "translation-table.h"
#include "routing.h"
#include "routing.h"
#include "hash.h"
#include "hash.h"
#include "compat.h"


#define MIN(x, y) ((x) < (y) ? (x) : (y))
#define MIN(x, y) ((x) < (y) ? (x) : (y))


+0 −1
Original line number Original line Diff line number Diff line
@@ -31,7 +31,6 @@
#include "types.h"
#include "types.h"
#include "vis.h"
#include "vis.h"
#include "hash.h"
#include "hash.h"
#include "compat.h"


struct list_head if_list;
struct list_head if_list;
struct hlist_head forw_bat_list;
struct hlist_head forw_bat_list;
Loading