remove kernel 2.0 and 2.2 code from drivers/net/wan/lmc/*
PATCH 1/1 remove kernel 2.0 and 2.2 code from drivers/net/wan/lmc/*
The patch below removes obsolete #if'd code for kernel 2.0 and 2.2 from drivers/net/wan/lmc/* (this includes the expansion of some #define's that were definded differently for different kernel versions).
cu
Adrian
drivers/net/wan/lmc/lmc_ver.h deleted +0 -123
@@ -1,123 +0,0 @@ -#ifndef _IF_LMC_LINUXVER_ -#define _IF_LMC_LINUXVER_ - -/* -* Copyright (c) 1997-2000 LAN Media Corporation (LMC) -* All rights reserved. www.lanmedia.com -* -* This code is written by: -* Andrew Stanley-Jones ([email protected]) -* Rob Braun ([email protected]), -* Michael Graff ([email protected]) and -* Matt Thomas ([email protected]). -* -* This software may be used and distributed according to the terms -* of the GNU General Public License version 2, incorporated herein by reference. -*/ - -/* -* This file defines and controls all linux version -* differences. -* -* This is being done to keep 1 central location where all linux -* version differences can be kept and maintained. as this code was -* found version issues where pepered throughout the source code and -* made the souce code not only hard to read but version problems hard -* to track down. If I'm overiding a function/etc with something in -* this file it will be prefixed by "LMC_" which will mean look -* here for the version dependant change that's been done. -* -*/ - -#if LINUX_VERSION_CODE <0x20363 -#define net_device device -#endif - -#if LINUX_VERSION_CODE <0x20363 -#define LMC_XMITTER_BUSY (x) (x)->tbusy = 1 -#define LMC_XMITTER_FREE (x) (x)->tbusy = 0 -#define LMC_XMITTER_INIT (x) (x)->tbusy = 0 -#else -#define LMC_XMITTER_BUSY (x) netif_stop_queue(x) -#define LMC_XMITTER_FREE (x) netif_wake_queue(x) -#define LMC_XMITTER_INIT (x) netif_start_queue(x) - -#endif - - -#if LINUX_VERSION_CODE <0x20100 -//typedef unsigned int u_int32_t; - -#define LMC_SETUP_20_DEV {\ - int indx; \ - for (indx = 0; indx < DEV_NUMBUFFS; indx++) \ - skb_queue_head_init (&dev->buffs[indx]); \ - } \ - dev->family = AF_INET; \ - dev->pa_addr = 0; \ - dev->pa_brdaddr = 0; \ - dev->pa_mask = 0xFCFFFFFF; \ - dev->pa_alen = 4;/* IP addr. sizeof(u32) */ - -#else - -#define LMC_SETUP_20_DEV - -#endif - - -#if LINUX_VERSION_CODE <0x20155 /* basically 2.2 plus */ - -#define LMC_DEV_KFREE_SKB (skb) dev_kfree_skb((skb), FREE_WRITE) -#define LMC_PCI_PRESENT () pcibios_present() - -#else /* Mostly 2.0 kernels */ - -#define LMC_DEV_KFREE_SKB (skb) dev_kfree_skb(skb) -#define LMC_PCI_PRESENT () pci_present() - -#endif - -#if LINUX_VERSION_CODE <0x20200 -#else - -#endif - -#if LINUX_VERSION_CODE <0x20100 -#define LMC_SKB_FREE (skb, val) (skb->free = val) -#else -#define LMC_SKB_FREE (skb, val) -#endif - - -#if (LINUX_VERSION_CODE >=0x20200 ) - -#define LMC_SPIN_FLAGS unsigned long flags; -#define LMC_SPIN_LOCK_INIT (x) spin_lock_init(&(x)->lmc_lock); -#define LMC_SPIN_UNLOCK (x) ((x)->lmc_lock = SPIN_LOCK_UNLOCKED) -#define LMC_SPIN_LOCK_IRQSAVE (x) spin_lock_irqsave (&(x)->lmc_lock, flags); -#define LMC_SPIN_UNLOCK_IRQRESTORE (x) spin_unlock_irqrestore (&(x)->lmc_lock, flags); -#else -#define LMC_SPIN_FLAGS -#define LMC_SPIN_LOCK_INIT (x) -#define LMC_SPIN_UNLOCK (x) -#define LMC_SPIN_LOCK_IRQSAVE (x) -#define LMC_SPIN_UNLOCK_IRQRESTORE (x) -#endif - - -#if LINUX_VERSION_CODE >=0x20100 -#define LMC_COPY_FROM_USER (x, y, z) if(copy_from_user ((x), (y), (z))) return -EFAULT -#define LMC_COPY_TO_USER (x, y, z) if(copy_to_user ((x), (y), (z))) return -EFAULT -#else -#define LMC_COPY_FROM_USER (x, y, z) if(verify_area(VERIFY_READ, (y), (z))) \ - return -EFAULT; \ - memcpy_fromfs ((x), (y), (z)) - -#define LMC_COPY_TO_USER (x, y, z) if(verify_area(VERIFY_WRITE, (x), (z))) \ - return -EFAULT; \ - memcpy_tofs ((x), (y), (z)) -#endif - - -#endif
drivers/net/wan/lmc/lmc_var.h renamed from drivers/net/wan/lmc/lmc_var.h.old +0 -9
@@ -48,9 +48,6 @@#define u_int16_t u16#define u_int8_t u8#define tulip_uint32_t u32 -#if LINUX_VERSION_CODE <0x20155 -#define u_int32_t u32 -#endif #define LMC_REG_RANGE 0x80
@@ -410,9 +407,7 @@u32 last_int;u32 num_int; -#if LINUX_VERSION_CODE >=0x20200 spinlock_t lmc_lock; -#endif u_int16_t if_type;/* PPP or NET */ struct ppp_device *pd;
@@ -550,10 +545,6 @@#define LMC_CRC_LEN_16 2/* 16-bit CRC */ #define LMC_CRC_LEN_32 4 -#if LINUX_VERSION_CODE <0x20100 -#define test_and_set_bit (val, addr) set_bit(val, addr) -#endif -#ifdef LMC_HDLC /* definition of an hdlc header. */ struct hdlc_hdr
drivers/net/wan/lmc/lmc_media.c renamed from drivers/net/wan/lmc/lmc_media.c.old +0 -7
@@ -1,6 +1,5 @@/* $Id: lmc_media.c,v 1.13 2000/04/11 05:25:26 asj Exp $ */ -#include <linux/version.h> #include <linux/config.h> #include <linux/kernel.h> #include <linux/string.h>
@@ -11,9 +10,6 @@#include <linux/slab.h> #include <linux/interrupt.h> #include <linux/pci.h> -#if LINUX_VERSION_CODE <0x20155 -#include <linux/bios32.h> -#endif #include <linux/in.h> #include <linux/if_arp.h> #include <linux/netdevice.h>
@@ -28,11 +24,8 @@#include <asm/io.h> #include <asm/dma.h> -#if LINUX_VERSION_CODE >=0x20200 #include <asm/uaccess.h> -#endif -#include "lmc_ver.h" #include "lmc.h" #include "lmc_var.h" #include "lmc_ioctl.h"
drivers/net/wan/lmc/lmc_debug.c renamed from drivers/net/wan/lmc/lmc_debug.c.old +0 -2
@@ -2,9 +2,7 @@#include <linux/types.h> #include <linux/netdevice.h> #include <linux/interrupt.h> -#include <linux/version.h> -#include "lmc_ver.h" #include "lmc_debug.h" /*
drivers/net/wan/lmc/lmc_proto.c renamed from drivers/net/wan/lmc/lmc_proto.c.old +0 -14
@@ -19,7 +19,6 @@* Driver for the LanMedia LMC5200, LMC5245, LMC1000, LMC1200 cards. */ -#include <linux/version.h> #include <linux/kernel.h> #include <linux/string.h> #include <linux/timer.h>
@@ -46,7 +45,6 @@#include <asm/dma.h> #include <asm/smp.h> -#include "lmc_ver.h" #include "lmc.h" #include "lmc_var.h" #include "lmc_debug.h"
@@ -66,14 +64,6 @@#define SPPP_attach (d) (void)0#define SPPP_do_ioctl (d,i,c) -EOPNOTSUPP#else -#if LINUX_VERSION_CODE <0x20363 -#define SPPP_attach (x) sppp_attach((struct ppp_device *)(x)->lmc_device) -#define SPPP_detach (x) sppp_detach((x)->lmc_device) -#define SPPP_open (x) sppp_open((x)->lmc_device) -#define SPPP_reopen (x) sppp_reopen((x)->lmc_device) -#define SPPP_close (x) sppp_close((x)->lmc_device) -#define SPPP_do_ioctl (x, y, z) sppp_do_ioctl((x)->lmc_device, (y), (z)) -#else #define SPPP_attach (x) sppp_attach((x)->pd)#define SPPP_detach (x) sppp_detach((x)->pd->dev)#define SPPP_open (x) sppp_open((x)->pd->dev)
@@ -81,7 +71,6 @@#define SPPP_close (x) sppp_close((x)->pd->dev)#define SPPP_do_ioctl (x, y, z) sppp_do_ioctl((x)->pd->dev, (y), (z))#endif -#endif // init void lmc_proto_init (lmc_softc_t *sc)/*FOLD00*/
@@ -89,15 +78,12 @@lmc_trace (sc->lmc_device,"lmc_proto_init in" );switch (sc->if_type){case LMC_PPP : - -#if LINUX_VERSION_CODE >=0x20363 sc->pd =kmalloc (sizeof (struct ppp_device ),GFP_KERNEL );if (!sc->pd) {printk ("lmc_proto_init(): kmalloc failure!\n" );return ; } sc->pd->dev = sc->lmc_device; -#endif sc->if_ptr = sc->pd;break ;case LMC_RAW :
drivers/net/wan/lmc/lmc_main.c renamed from drivers/net/wan/lmc/lmc_main.c.old +41 -133
450 lines not on this page · raw message