packages: kernel-net-eplip/kernel-net-eplip.spec, kernel-net-eplip/kernel-n...

witekfl witekfl at pld-linux.org
Fri Oct 15 14:10:07 CEST 2010


Author: witekfl                      Date: Fri Oct 15 12:10:07 2010 GMT
Module: packages                      Tag: HEAD
---- Log message:
- adjusted to the latest kernels

---- Files affected:
packages/kernel-net-eplip:
   kernel-net-eplip.spec (1.12 -> 1.13) , kernel-net-eplip-2.6.19.patch (NONE -> 1.1)  (NEW), kernel-net-eplip-2.6.20.patch (NONE -> 1.1)  (NEW), kernel-net-eplip-2.6.22.patch (NONE -> 1.1)  (NEW), kernel-net-eplip-2.6.24.patch (NONE -> 1.1)  (NEW), kernel-net-eplip-2.6.32.patch (NONE -> 1.1)  (NEW), kernel-net-eplip-autoconf.patch (NONE -> 1.1)  (NEW)

---- Diffs:

================================================================
Index: packages/kernel-net-eplip/kernel-net-eplip.spec
diff -u packages/kernel-net-eplip/kernel-net-eplip.spec:1.12 packages/kernel-net-eplip/kernel-net-eplip.spec:1.13
--- packages/kernel-net-eplip/kernel-net-eplip.spec:1.12	Tue Feb 13 09:06:37 2007
+++ packages/kernel-net-eplip/kernel-net-eplip.spec	Fri Oct 15 14:10:02 2010
@@ -2,30 +2,35 @@
 #
 # Conditional build:
 %bcond_without	dist_kernel	# without kernel from distribution
-%bcond_without	smp		# without smp version
-#
 
 %define		_orig_name	eplip
+%define		pname		kernel-net-eplip
 %define		_rel	2
 
 Summary:	EPLIP driver for 2.6.x kernels
 Summary(pl.UTF-8):	Sterownik EPLIP dla jąder 2.6.x
-Name:		kernel-net-eplip
+Name:		kernel%{_alt_kernel}-net-eplip
 Version:	0.5.6
 Release:	%{_rel}@%{_kernel_ver_str}
 License:	GPL
 Group:		Base/Kernel
 Source0:	http://e-plip.sourceforge.net/%{_orig_name}-%{version}.tar.gz
 # Source0-md5:	43019250e7227857ae13bdd39a45494d
-Patch0:		%{name}-1.patch
+Patch0:		%{pname}-1.patch
 Patch1:		kernel-eplip-WIRING.patch
-Patch2:		%{name}-2.patch
-Patch3:		%{name}-module_param_array.patch
+Patch2:		%{pname}-2.patch
+Patch3:		%{pname}-module_param_array.patch
+Patch4:		%{pname}-2.6.19.patch
+Patch5:		%{pname}-2.6.20.patch
+Patch6:		%{pname}-2.6.22.patch
+Patch7:		%{pname}-2.6.24.patch
+Patch8:		%{pname}-autoconf.patch
+Patch9:		%{pname}-2.6.32.patch
 URL:		http://e-plip.sourceforge.net/
-%{?with_dist_kernel:BuildRequires:	kernel-module-build}
-BuildRequires:	rpmbuild(macros) >= 1.118
-%{?with_dist_kernel:%requires_releq_kernel_up}
-Requires(post,postun):	modutils
+%{?with_dist_kernel:BuildRequires:	kernel%{_alt_kernel}-module-build}
+BuildRequires:	rpmbuild(macros) >= 1.379
+%{?with_dist_kernel:%requires_releq_kernel}
+Requires(post,postun):	/sbin/depmod
 ExclusiveArch:	%{ix86}
 BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
@@ -35,119 +40,54 @@
 %description -l pl.UTF-8
 Moduł sterownika EPLIP (Enhanced Parallel Line IP) dla jąder 2.6.x.
 
-%package -n kernel-smp-net-eplip
-Summary:	EPLIP driver for 2.6.x SMP kernels
-Summary(pl.UTF-8):	Sterownik EPLIP dla jąder 2.6.x SMP
-Release:	%{_rel}@%{_kernel_ver_str}
-Group:		Base/Kernel
-%{?with_dist_kernel:%requires_releq_kernel_smp}
-Requires(post,postun):	modutils
-
-%description -n kernel-smp-net-eplip
-EPLIP (Enhanced Parallel Line IP) driver module for 2.6.x SMP kernels.
-
-%description -n kernel-smp-net-eplip -l pl.UTF-8
-Moduł sterownika EPLIP (Enhanced Parallel Line IP) dla jąder 2.6.x
-SMP.
-
 %prep
 %setup -q -n %{_orig_name}-%{version}
 %patch0 -p1
 %patch1 -p1
 %patch2 -p1
 %patch3 -p1
+%patch4 -p1
+%patch5 -p1
+%patch6 -p1
+%patch7 -p1
+%patch8 -p1
+%patch9 -p1
 
-%build
-install -d build-done/{UP,SMP}
-rm -rf include
-install -d o/include/{linux,config}
-ln -sf %{_kernelsrcdir}/config-up o/.config
-ln -sf %{_kernelsrcdir}/include/linux/autoconf-up.h o/include/linux/autoconf.h
-ln -sf %{_kernelsrcdir}/include/asm-%{_arch} o/include/asm
-ln -sf %{_kernelsrcdir}/Module.symvers-up o/Module.symvers
-#touch include/config/MARKER
 cat <<EOF > Makefile
-CONFIG_X86=1
-CONFIG_ISA=1
 obj-m += eplip.o
 eplip-objs := eplip-drv.o
 EOF
-%{__make} -j1 -C %{_kernelsrcdir} O=$PWD/o prepare scripts
-%{__make} -C %{_kernelsrcdir} modules \
-	SYSRC=%{_kernelsrcdir} \
-	SYSOUT=$PWD/o \
-	M=$PWD \
-	O=$PWD/o \
-	V=1
-mv *.ko build-done/UP
-
-%if %{with smp}
-ln -sf %{_kernelsrcdir}/config-smp .config
-rm -rf include
-install -d include/{linux,config}
-ln -sf %{_kernelsrcdir}/include/linux/autoconf-smp.h include/linux/autoconf.h
-ln -sf %{_kernelsrcdir}/include/asm-%{_arch} include/asm
-ln -sf %{_kernelsrcdir}/Module.symvers-smp Module.symvers
-#touch include/config/MARKER
-%{__make} -C %{_kernelsrcdir} O=$PWD prepare scripts
-%{__make} -C %{_kernelsrcdir} clean \
-	RCS_FIND_IGNORE="-name '*.ko' -o" \
-	SYSSRC=%{_kernelsrcdir} \
-	SYSOUT=$PWD/o \
-	M=$PWD O=$PWD/o \
-	V=1
-%{__make} -C %{_kernelsrcdir} modules \
-	SYSRC=%{_kernelsrcdir} \
-	SYSOUT=$PWD \
-	M=$PWD \
-	O=$PWD \
-	V=1
 
-mv *.ko build-done/SMP
-%endif
+%build
+%build_kernel_modules -m eplip
 
 %install
 rm -rf $RPM_BUILD_ROOT
-install -d $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}{,smp}/kernel/drivers/net
-cp build-done/UP/* $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}/kernel/drivers/net
-
-%if %{with smp}
-cp build-done/SMP/* $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}smp/kernel/drivers/net
-%endif
+%install_kernel_modules -m eplip -d kernel/drivers/net
 
 %clean
 rm -rf $RPM_BUILD_ROOT
 
-%post	-n kernel-net-eplip
+%post
 %depmod %{_kernel_ver}
 
-%postun	-n kernel-net-eplip
+%postun
 %depmod %{_kernel_ver}
 
-%post	-n kernel-smp-net-eplip
-%depmod %{_kernel_ver}
-
-%postun	-n kernel-smp-net-eplip
-%depmod %{_kernel_ver}
-
-%files -n kernel-net-eplip
+%files
 %defattr(644,root,root,755)
 %doc ChangeLog LAME-TESTS README TODO TODO-done WIRING
 /lib/modules/%{_kernel_ver}/kernel/drivers/net/*
 
-%if %{with smp}
-%files -n kernel-smp-net-eplip
-%defattr(644,root,root,755)
-%doc ChangeLog LAME-TESTS README TODO TODO-done WIRING
-/lib/modules/%{_kernel_ver}smp/kernel/drivers/net/*
-%endif
-
 %define date	%(echo `LC_ALL="C" date +"%a %b %d %Y"`)
 %changelog
 * %{date} PLD Team <feedback at pld-linux.org>
 All persons listed below can be reached at <cvs_login>@pld-linux.org
 
 $Log$
+Revision 1.13  2010/10/15 12:10:02  witekfl
+- adjusted to the latest kernels
+
 Revision 1.12  2007/02/13 08:06:37  glen
 - tabs in preamble
 

================================================================
Index: packages/kernel-net-eplip/kernel-net-eplip-2.6.19.patch
diff -u /dev/null packages/kernel-net-eplip/kernel-net-eplip-2.6.19.patch:1.1
--- /dev/null	Fri Oct 15 14:10:07 2010
+++ packages/kernel-net-eplip/kernel-net-eplip-2.6.19.patch	Fri Oct 15 14:10:02 2010
@@ -0,0 +1,20 @@
+--- eplip-0.5.6/eplip-drv.c.old	2010-10-12 15:59:19.000000000 +0200
++++ eplip-0.5.6/eplip-drv.c	2010-10-12 16:00:10.000000000 +0200
+@@ -401,7 +401,7 @@
+                                   struct hh_cache *hh);
+ #endif
+ static int	eplip_open(struct net_device *dev);
+-static int	eplip_interrupt(int irq, void *dev_id, struct pt_regs *regs);
++static int	eplip_interrupt(int irq, void *dev_id); /*, struct pt_regs *regs);*/
+ static int	eplip_close(struct net_device *dev);
+ static struct	net_device_stats *eplip_get_stats(struct net_device *dev);
+ static int      eplip_change_mtu(struct net_device *dev, int new_mtu);
+@@ -2193,7 +2193,7 @@
+  * Handle the network interface interrupts.
+  */
+ static int
+-eplip_interrupt(int irq, void *dev_id, struct pt_regs * regs)
++eplip_interrupt(int irq, void *dev_id) /* , struct pt_regs * regs) */
+ {
+         struct net_device *dev = dev_id;
+ 	struct net_local *nl;

================================================================
Index: packages/kernel-net-eplip/kernel-net-eplip-2.6.20.patch
diff -u /dev/null packages/kernel-net-eplip/kernel-net-eplip-2.6.20.patch:1.1
--- /dev/null	Fri Oct 15 14:10:07 2010
+++ packages/kernel-net-eplip/kernel-net-eplip-2.6.20.patch	Fri Oct 15 14:10:02 2010
@@ -0,0 +1,102 @@
+--- eplip-0.5.6.old/eplip-drv.c	2010-10-12 18:34:40.000000000 +0200
++++ eplip-0.5.6/eplip-drv.c	2010-10-12 18:53:02.000000000 +0200
+@@ -60,6 +60,10 @@
+ #define NET_DEBUG 0
+ #endif
+ 
++#ifndef EPLIP_DEBUG
++#define EPLIP_DEBUG 0
++#endif
++
+ #define EPLIP_MTU    (16360+2)
+ #define PKT_BUF_SZ (EPLIP_MTU+ETH_HLEN)
+ 
+@@ -336,9 +340,10 @@
+ struct net_local {
+ 
+ 	struct net_device_stats enet_stats;
++	struct net_device *ndev;
+ 
+         struct work_struct immediate;                     /** for immediate Bottom Half handler           */
+-        struct work_struct deferred;                      /** for deffered  Bottom Half handler           */
++        struct delayed_work deferred;                      /** for deferred  Bottom Half handler           */
+ 
+         struct eplip_local snd_data;
+ 	struct eplip_local rcv_data;
+@@ -388,8 +393,8 @@
+ /* Index to functions, as function prototypes. */
+ 
+ /* Bottom halves */
+-static void eplip_kick_bh(struct net_device *dev);
+-static void eplip_bh(struct net_device *dev);
++static void eplip_kick_bh(struct work_struct *work);
++static void eplip_bh(struct work_struct *work);
+ 
+ /* Functions for DEV methods */
+ static int eplip_tx_packet(struct sk_buff *skb, struct net_device *dev);
+@@ -458,7 +463,7 @@
+ 
+ static void dma_timeout_routine( unsigned long timer_data );
+ 
+-int __init
++int
+ eplip_init_dev(struct net_device *dev, ecp_dev *ecpdev,unsigned long hwaddr)
+ {
+ 	struct  net_local *nl;
+@@ -510,6 +515,7 @@
+ 	nl = (struct net_local *) dev->priv;
+ 
+         nl->mru = EPLIP_MRU ;
++	nl->ndev = dev;
+ 
+         i=3;
+         while( (dev->dma > 0 )) {
+@@ -573,8 +579,8 @@
+ 
+ 	/* Initialize task queue structures */
+ #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
+-        INIT_WORK(&nl->immediate, (void (*)(void *))eplip_bh, dev);
+-        INIT_WORK(&nl->deferred, (void (*)(void *))eplip_kick_bh, dev);
++        INIT_WORK(&nl->immediate, eplip_bh);
++        INIT_DELAYED_WORK(&nl->deferred, eplip_kick_bh);
+ 
+ #else
+         nl->immediate.next = NULL;
+@@ -613,10 +619,10 @@
+    Request `eplip_bh' to be invoked. */
+ 
+ static void
+-eplip_kick_bh(struct net_device *dev)
++eplip_kick_bh(struct work_struct *work)
+ 
+ {
+-	struct net_local *nl = (struct net_local *)dev->priv;
++	struct net_local *nl = container_of(work, struct net_local, deferred.work);
+ 
+         spin_lock_irq( &nl->lock );
+ 	if ( nl->is_deferred ) {
+@@ -642,10 +648,10 @@
+ 
+ /* Bottom half handler of EPLIP. */
+ static void
+-eplip_bh
+-(struct net_device *dev)
++eplip_bh(struct work_struct *work)
+ {
+-	struct net_local *nl = (struct net_local *)dev->priv;
++	struct net_local *nl = container_of(work, struct net_local, immediate);
++
+ 	struct eplip_local *snd = &nl->snd_data;
+ 	struct eplip_local *rcv = &nl->rcv_data;
+ 	eplip_func f;
+@@ -653,8 +659,8 @@
+ 
+                 nl->is_deferred = 0;
+                 f = connection_state_table[nl->connection];
+-                if ((r = (*f)(dev, nl, snd, rcv)) != OK
+-                && (r = eplip_bh_timeout_error(dev, nl, snd, rcv, r)) != OK) {
++                if ((r = (*f)(nl->ndev, nl, snd, rcv)) != OK
++                && (r = eplip_bh_timeout_error(nl->ndev, nl, snd, rcv, r)) != OK) {
+ 	                nl->is_deferred = 1;
+ 	                schedule_delayed_work(&nl->deferred, 1);
+                 }

================================================================
Index: packages/kernel-net-eplip/kernel-net-eplip-2.6.22.patch
diff -u /dev/null packages/kernel-net-eplip/kernel-net-eplip-2.6.22.patch:1.1
--- /dev/null	Fri Oct 15 14:10:07 2010
+++ packages/kernel-net-eplip/kernel-net-eplip-2.6.22.patch	Fri Oct 15 14:10:02 2010
@@ -0,0 +1,23 @@
+--- eplip-0.5.6.old/eplip-drv.c	2010-10-13 08:27:05.000000000 +0200
++++ eplip-0.5.6/eplip-drv.c	2010-10-13 08:30:31.000000000 +0200
+@@ -700,9 +700,9 @@
+ 	struct ethhdr *eth;
+ 	unsigned char *rawp;
+ 
+-	skb->mac.raw=skb->data;
++	skb->mac_header = skb->data;
+ 	skb_pull(skb,dev->hard_header_len);
+-	eth= (struct ethhdr *)skb->mac.raw;
++	eth= (struct ethhdr *)skb->mac_header;
+ 
+ 	if(*eth->h_dest&1)
+ 	{
+@@ -2016,7 +2016,7 @@
+ 
+         struct net_local *nl = (struct net_local *)dev->priv;
+ 	struct in_device *in_dev;
+-        unsigned long   intrflags = ( nl->dev->flags & ECPDEV_IRQ_TRIGGER )?SA_SHIRQ:0;
++        unsigned long   intrflags = ( nl->dev->flags & ECPDEV_IRQ_TRIGGER ) ? IRQF_SHARED : 0;
+ 
+         nl->connection=EPLIP_CN_NONE;
+ 

================================================================
Index: packages/kernel-net-eplip/kernel-net-eplip-2.6.24.patch
diff -u /dev/null packages/kernel-net-eplip/kernel-net-eplip-2.6.24.patch:1.1
--- /dev/null	Fri Oct 15 14:10:07 2010
+++ packages/kernel-net-eplip/kernel-net-eplip-2.6.24.patch	Fri Oct 15 14:10:02 2010
@@ -0,0 +1,253 @@
+--- eplip-0.5.6.old/eplip-drv.c	2010-10-13 13:04:55.000000000 +0200
++++ eplip-0.5.6/eplip-drv.c	2010-10-13 14:02:56.000000000 +0200
+@@ -488,7 +488,6 @@
+ 	dev->get_stats 		 = eplip_get_stats;
+         dev->change_mtu          = eplip_change_mtu;
+        	//dev->do_ioctl		 = eplip_ioctl;
+-	dev->header_cache_update = NULL;
+ 
+ 	dev->tx_queue_len 	 = 10;
+ 	//dev->flags	        |= IFF_POINTOPOINT|IFF_NOARP;
+@@ -505,14 +504,15 @@
+       //  }
+ 	/* Set the private structure */
+ 
++/*
+ 	dev->priv = kmalloc(sizeof (struct net_local), GFP_KERNEL);
+ 	if (!dev->priv) {
+ 		printk(KERN_ERR "%s: out of memory\n", dev->name);
+ 		return -ENOMEM;
+ 	}
+ 	memset(dev->priv, 0, sizeof(struct net_local));
+-
+-	nl = (struct net_local *) dev->priv;
++*/
++	nl = (struct net_local *)netdev_priv(dev);
+ 
+         nl->mru = EPLIP_MRU ;
+ 	nl->ndev = dev;
+@@ -757,7 +757,7 @@
+                  unsigned short type, void *daddr,
+ 	         void *saddr, unsigned len)
+ {
+-	struct net_local *nl = (struct net_local *)dev->priv;
++	struct net_local *nl = netdev_priv(dev);
+ 	int ret;
+ 
+ 	if ((ret = nl->orig_hard_header(skb, dev, type, daddr, saddr, len)) >= 0)
+@@ -770,7 +770,7 @@
+ eplip_hard_header_cache(struct neighbour *neigh,
+                            struct hh_cache *hh)
+ {
+-	struct net_local *nl = (struct net_local *)neigh->dev->priv;
++	struct net_local *nl = netdev_priv(neigh->dev);
+ 	int ret;
+ 
+ 	if ((ret = nl->orig_hard_header_cache(neigh, hh)) == 0)
+@@ -891,7 +891,7 @@
+ static int
+ eplip_tx_packet(struct sk_buff *skb, struct net_device *dev)
+ {
+-	struct net_local *nl = (struct net_local *)dev->priv;
++	struct net_local *nl = netdev_priv(dev);
+ 	struct eplip_local *snd = &nl->snd_data;
+ 
+ 	if (netif_queue_stopped(dev))
+@@ -989,7 +989,7 @@
+ static int
+ eplip_dma_close( struct net_device* dev )
+ {
+-        struct net_local *nl = (struct net_local*)dev->priv ;
++        struct net_local *nl = netdev_priv(dev);
+         unsigned long flags;
+         int bytes_left;
+ #ifdef PARANOID
+@@ -1024,7 +1024,7 @@
+ static int
+ eplip_dma_send_data( struct net_device* dev )
+ {
+-        struct net_local        *nl  = (struct net_local*)dev->priv;
++        struct net_local        *nl  = netdev_priv(dev);
+         struct eplip_local      *snd = &nl->snd_data;
+         unsigned long           flags;
+         u32                     phys_addr;
+@@ -1074,7 +1074,7 @@
+ static int
+ eplip_dma_receive_data( struct net_device* dev)
+ {
+-        struct net_local        *nl  = (struct net_local*)dev->priv;
++        struct net_local        *nl  = netdev_priv(dev);
+         struct eplip_local      *rcv = &nl->rcv_data;
+         unsigned long           flags;
+ 
+@@ -2014,7 +2014,7 @@
+ eplip_open(struct net_device *dev)
+ {
+ 
+-        struct net_local *nl = (struct net_local *)dev->priv;
++        struct net_local *nl = netdev_priv(dev);
+ 	struct in_device *in_dev;
+         unsigned long   intrflags = ( nl->dev->flags & ECPDEV_IRQ_TRIGGER ) ? IRQF_SHARED : 0;
+ 
+@@ -2088,7 +2088,7 @@
+ static int
+ eplip_close(struct net_device *dev)
+ {
+-	struct net_local *nl = (struct net_local *)dev->priv;
++	struct net_local *nl = netdev_priv(dev);
+         struct eplip_local *snd = &nl->snd_data;
+ 	struct eplip_local *rcv = &nl->rcv_data;
+ 
+@@ -2141,7 +2141,7 @@
+ static struct net_device_stats *
+ eplip_get_stats(struct net_device *dev)
+ {
+-	struct net_local *nl = (struct net_local *)dev->priv;
++	struct net_local *nl = netdev_priv(dev);
+ 	struct net_device_stats *r = &nl->enet_stats;
+ 
+ 	return r;
+@@ -2149,7 +2149,7 @@
+ 
+ static int eplip_change_mtu(struct net_device *dev, int new_mtu)
+ {
+-        struct net_local *nl = (struct net_local *)dev->priv;
++        struct net_local *nl = netdev_priv(dev);
+ 
+ 	if ((new_mtu < 68) || (new_mtu > EPLIP_MRU))
+ 		return -EINVAL;
+@@ -2174,7 +2174,7 @@
+ static int
+ eplip_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
+ {
+-	struct net_local *nl = (struct net_local *) dev->priv;
++	struct net_local *nl = netdev_priv(dev);
+ 	struct plipconf *pc = (struct plipconf *) &rq->ifr_data;
+ 
+ 	switch(pc->pcmd) {
+@@ -2211,7 +2211,7 @@
+ 		return;
+ 	}
+ #endif
+-	nl = (struct net_local *)dev->priv;
++	nl = netdev_priv(dev);
+ 	rcv = &nl->rcv_data;
+ 
+ 	spin_lock_irq (&nl->lock);
+@@ -2348,16 +2348,17 @@
+ }
+ 
+ static void
+-cleanup( struct net_device eplip_net_dev[] )
++cleanup(struct net_device *eplip_net_dev[])
+ {
+         int i  = EPLIP_MAX ;
+         while( i-- ) {
++		if (eplip_net_dev[i]) {
+ 
+-                if( eplip_net_dev[i].priv ) {
++                        struct net_local *nl = netdev_priv(eplip_net_dev[i]);
+ 
+-                        struct net_local *nl = (struct net_local*)eplip_net_dev[i].priv ;
++			if (!nl) continue;
+ 
+-                        unregister_netdev( &(eplip_net_dev[i]) );
++                        unregister_netdev(eplip_net_dev[i]);
+ 
+                         if( nl->bounce_buff ) {
+                                 kfree( nl->bounce_buff );
+@@ -2366,11 +2367,12 @@
+                         cleanup_ecp_dev( nl->dev );
+                         kfree( nl->dev);
+ 
+-                        kfree( eplip_net_dev[i].priv );
+-                        eplip_net_dev[i].priv = NULL;
++                        /*kfree( eplip_net_dev[i].priv );
++                        eplip_net_dev[i].priv = NULL;*/
+ 
+                 }
+ 
++#if 0
+ #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
+ #else
+                 if( eplip_net_dev[i].name ) {
+@@ -2378,6 +2380,7 @@
+                         eplip_net_dev[i].name=NULL;
+                 }
+ #endif
++#endif
+         }
+ 
+ }
+@@ -2471,7 +2474,7 @@
+         return OK ;
+ }
+ 
+-static struct net_device dev_eplip[EPLIP_MAX] ;
++static struct net_device *dev_eplip[EPLIP_MAX] ;
+ 
+ /* Initialize the module */
+ static int
+@@ -2480,15 +2483,23 @@
+ 	int i = -1 ;
+         int ndevs = 0 ;
+         int error = 0 ;
++	char name[IFNAMSIZ];
+ 
+ 
+ 	printk(KERN_INFO "%s-%s(%s) by %s(%s)\n",driver,version,date,author,email);
+ 
+-        memset( dev_eplip , 0 , (sizeof( struct net_device ) )* EPLIP_MAX ) ;
++        memset( dev_eplip , 0 , (sizeof( struct net_device *) )* EPLIP_MAX ) ;
+ 
+         while(  ( (++i) < EPLIP_MAX )  && ( io[i] > 0 ) ) {
+ 
+         	ecp_dev* dev = 0L ;
++		sprintf(name, "eplip%d", i);
++		dev_eplip[i] = alloc_etherdev(sizeof(struct net_local));
++		if (!dev_eplip[i]) {
++			printk(KERN_ERR "eplip: memory squeeze\n");
++			return -ENOMEM;
++		}
++		strcpy(dev_eplip[i]->name, name);
+ 
+         	dev = kmalloc(sizeof ( ecp_dev ) , GFP_KERNEL ) ;
+         	if( !dev ) {
+@@ -2529,6 +2540,7 @@
+ 
+ #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
+ #else
++/*
+ 		        dev_eplip[i].name = kmalloc(strlen("eplipXXX"), GFP_KERNEL);
+ 		        if (!dev_eplip[i].name) {
+ 			        printk(KERN_ERR "%s: memory squeeze.\n",driver);
+@@ -2537,10 +2549,11 @@
+ 			        cleanup( dev_eplip );
+ 			        return -ENOMEM ;
+ 		        }
++*/
+ #endif
+-		        sprintf(dev_eplip[i].name,"eplip%d", i );
++/*		        sprintf(dev_eplip[i].name,"eplip%d", i ); */
+ 
+-                        if ( ( error = eplip_init_dev(&(dev_eplip[i]),dev,hwaddr[i]/*,crc[i]*/ ) ) ) {
++                        if ( ( error = eplip_init_dev(dev_eplip[i], dev, hwaddr[i]/*,crc[i]*/ ) ) ) {
+ 
+                                 cleanup_ecp_dev(dev);
+                                 kfree(dev);
+@@ -2549,12 +2562,12 @@
+ 		        }
+                         //((struct net_local*)dev_eplip[i].priv)->uses_adler32crc = crc[i];
+ 
+-                        if( ( dev->mode == EPLIP_MODE_ECP_DMA ) && !(dev_eplip[i].dma) )
<<Diff was trimmed, longer than 597 lines>>

---- CVS-web:
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/kernel-net-eplip/kernel-net-eplip.spec?r1=1.12&r2=1.13&f=u



More information about the pld-cvs-commit mailing list