Commit 68300d2b authored by Alan Cox's avatar Alan Cox Committed by Linus Torvalds

[PATCH] remove 2.0/2.2 stuff from wanrouter

parent 3a6167a6
......@@ -39,59 +39,7 @@
#ifndef _WANPIPE_H
#define _WANPIPE_H
#include <linux/version.h>
#ifndef KERNEL_VERSION
#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))
#endif
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,3,0)
#define LINUX_2_4
#define netdevice_t struct net_device
#define FREE_READ 1
#define FREE_WRITE 0
#define stop_net_queue(a) netif_stop_queue(a)
#define start_net_queue(a) netif_start_queue(a)
#define is_queue_stopped(a) netif_queue_stopped(a)
#define wake_net_dev(a) netif_wake_queue(a)
#define is_dev_running(a) netif_running(a)
#define wan_dev_kfree_skb(a,b) dev_kfree_skb_any(a)
#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,0)
#define LINUX_2_1
#define netdevice_t struct device
#define FREE_READ 1
#define FREE_WRITE 0
#define stop_net_queue(a) (set_bit(0, &##a->tbusy))
#define start_net_queue(a) (clear_bit(0,&##a->tbusy))
#define is_queue_stopped(a) (##a->tbusy)
#define wake_net_dev(a) {clear_bit(0,&##a->tbusy);mark_bh(NET_BH);}
#define is_dev_running(a) (test_bit(0,&##a->start))
#define wan_dev_kfree_skb(a,b) dev_kfree_skb(a)
#else
#define LINUX_2_0
#define netdevice_t struct device
#define test_and_set_bit set_bit
#define net_ratelimit() 1
#define stop_net_queue(a) (set_bit(0, &##a->tbusy))
#define start_net_queue(a) (clear_bit(0,&##a->tbusy))
#define is_queue_stopped(a) (##a->tbusy)
#define wake_net_dev(a) {clear_bit(0,&##a->tbusy);mark_bh(NET_BH);}
#define is_dev_running(a) (test_bit(0,(void*)&##a->start))
#define wan_dev_kfree_skb(a,b) dev_kfree_skb(a,b)
#define spin_lock_init(a)
#define spin_lock(a)
#define spin_unlock(a)
#endif
#define netdevice_t struct net_device
#include <linux/wanrouter.h>
......@@ -121,21 +69,11 @@
#define MAX_LCN_NUM 4095 /* Maximum lcn number */
#define MAX_FT1_RETRY 100
#ifdef LINUX_2_4
#ifndef AF_WANPIPE
#ifndef AF_WANPIPE
#define AF_WANPIPE 25
#ifndef PF_WANPIPE
#define PF_WANPIPE AF_WANPIPE
#endif
#endif
#else
#ifndef AF_WANPIPE
#define AF_WANPIPE 24
#ifndef PF_WANPIPE
#define PF_WANPIPE AF_WANPIPE
#endif
#endif
#endif
......@@ -321,12 +259,10 @@ typedef struct {
#include <linux/sdladrv.h> /* SDLA support module API definitions */
#include <linux/sdlasfm.h> /* SDLA firmware module definitions */
#include <linux/workqueue.h>
#ifdef LINUX_2_4
#include <linux/serial.h>
#include <linux/serialP.h>
#include <linux/serial_reg.h>
#include <asm/serial.h>
#endif
#include <linux/serial.h>
#include <linux/serialP.h>
#include <linux/serial_reg.h>
#include <asm/serial.h>
#include <linux/tty.h>
#include <linux/tty_driver.h>
#include <linux/tty_flip.h>
......
......@@ -43,27 +43,10 @@
* Jan 16, 1997 Gene Kozin router_devlist made public
* Jan 02, 1997 Gene Kozin Initial version (based on wanpipe.h).
*****************************************************************************/
#include <linux/version.h>
#ifndef KERNEL_VERSION
#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))
#endif
#define netdevice_t struct net_device
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,3,0)
#define LINUX_2_4
#define netdevice_t struct net_device
#include <linux/spinlock.h> /* Support for SMP Locking */
#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,0)
#define LINUX_2_1
#define netdevice_t struct device
#include <asm/spinlock.h> /* Support for SMP Locking */
#else
#define LINUX_2_0
#define netdevice_t struct device
#define spinlock_t int
#endif
#include <linux/spinlock.h> /* Support for SMP Locking */
#ifndef _ROUTER_H
#define _ROUTER_H
......@@ -512,11 +495,7 @@ typedef struct wan_device
/****** status and statistics *******/
char state; /* device state */
char api_status; /* device api status */
#if defined(LINUX_2_1) || defined(LINUX_2_4)
struct net_device_stats stats; /* interface statistics */
#else
struct enet_statistics stats; /* interface statistics */
#endif
unsigned reserved[16]; /* reserved for future use */
unsigned long critical; /* critical section flag */
spinlock_t lock; /* Support for SMP Locking */
......@@ -534,11 +513,7 @@ typedef struct wan_device
struct wan_device* next; /* -> next device */
netdevice_t* dev; /* list of network interfaces */
unsigned ndev; /* number of interfaces */
#ifdef LINUX_2_4
struct proc_dir_entry *dent; /* proc filesystem entry */
#else
struct proc_dir_entry dent; /* proc filesystem entry */
#endif
} wan_device_t;
/* Public functions available for device drivers */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment