From: Andy P. <at...@us...> - 2002-04-11 16:43:57
|
Update of /cvsroot/linux-vax/kernel-2.4/drivers/net/wan/lmc In directory usw-pr-cvs1:/tmp/cvs-serv30336/net/wan/lmc Modified Files: lmc_ioctl.h lmc_main.c lmc_media.c lmc_proto.c lmc_var.h Log Message: synch 2.4.15 commit 50 Index: lmc_ioctl.h =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/net/wan/lmc/lmc_ioctl.h,v retrieving revision 1.1.1.2 retrieving revision 1.2 diff -u -r1.1.1.2 -r1.2 Index: lmc_main.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/net/wan/lmc/lmc_main.c,v retrieving revision 1.1.1.2 retrieving revision 1.2 diff -u -r1.1.1.2 -r1.2 --- lmc_main.c 25 Feb 2001 23:15:00 -0000 1.1.1.2 +++ lmc_main.c 11 Apr 2002 12:37:52 -0000 1.2 @@ -67,7 +67,7 @@ #include <linux/netdevice.h> #include <linux/etherdevice.h> #include <linux/skbuff.h> -#include "../syncppp.h" +#include <net/syncppp.h> #include <linux/inet.h> #if LINUX_VERSION_CODE >= 0x20200 @@ -77,15 +77,7 @@ #define ARPHRD_HDLC 513 #endif -#ifdef MODULE -#ifdef MODVERSIONS -#include <linux/modversions.h> -#endif #include <linux/module.h> -#else -#define MOD_INC_USE_COUNT -#define MOD_DEC_USE_COUNT -#endif #define DRIVER_MAJOR_VERSION 1 #define DRIVER_MINOR_VERSION 34 @@ -116,6 +108,8 @@ }; MODULE_DEVICE_TABLE(pci, lmc_pci_tbl); + +MODULE_LICENSE("GPL"); #endif @@ -166,7 +160,7 @@ /* * Most functions mess with the structure - * Disable interupts while we do the polling + * Disable interrupts while we do the polling */ spin_lock_irqsave(&sc->lmc_lock, flags); @@ -515,7 +509,12 @@ break; } - LMC_COPY_FROM_USER(data, xc.data, xc.len); + if(copy_from_user(data, xc.data, xc.len)) + { + kfree(data); + ret = -ENOMEM; + break; + } printk("%s: Starting load of data Len: %d at 0x%p == 0x%p\n", dev->name, xc.len, xc.data, data); @@ -546,7 +545,7 @@ udelay(50); /* - * Clear reset and activate programing lines + * Clear reset and activate programming lines * Reset: Input * DP: Input * Clock: Output @@ -584,7 +583,7 @@ sc->lmc_gpio |= LMC_GEP_DATA; /* Data is 1 */ break; default: - printk(KERN_WARNING "%s Bad data in xilinx programing data at %d, got %d wanted 0 or 1\n", dev->name, pos, data[pos]); + printk(KERN_WARNING "%s Bad data in xilinx programming data at %d, got %d wanted 0 or 1\n", dev->name, pos, data[pos]); sc->lmc_gpio |= LMC_GEP_DATA; /* Assume it's 1 */ } sc->lmc_gpio &= ~LMC_GEP_CLK; /* Clock to zero */ @@ -598,13 +597,13 @@ udelay(1); } if((LMC_CSR_READ(sc, csr_gp) & LMC_GEP_INIT) == 0){ - printk(KERN_WARNING "%s: Reprograming FAILED. Needs to be reprogramed. (corrupted data)\n", dev->name); + printk(KERN_WARNING "%s: Reprogramming FAILED. Needs to be reprogrammed. (corrupted data)\n", dev->name); } else if((LMC_CSR_READ(sc, csr_gp) & LMC_GEP_DP) == 0){ - printk(KERN_WARNING "%s: Reprograming FAILED. Needs to be reprogramed. (done)\n", dev->name); + printk(KERN_WARNING "%s: Reprogramming FAILED. Needs to be reprogrammed. (done)\n", dev->name); } else { - printk(KERN_DEBUG "%s: Done reprograming Xilinx, %d bits, good luck!\n", dev->name, pos); + printk(KERN_DEBUG "%s: Done reprogramming Xilinx, %d bits, good luck!\n", dev->name, pos); } lmc_gpio_mkinput(sc, 0xff); @@ -662,12 +661,13 @@ if(sc->check != 0xBEAFCAFE){ printk("LMC: Corrupt net_device stuct, breaking out\n"); + spin_unlock_irqrestore(&sc->lmc_lock, flags); return; } /* Make sure the tx jabber and rx watchdog are off, - * and the transmit and recieve processes are running. + * and the transmit and receive processes are running. */ LMC_CSR_WRITE (sc, csr_15, 0x00000011); @@ -793,7 +793,7 @@ if(sc->failed_recv_alloc == 1){ /* * We failed to alloc mem in the - * interupt halder, go through the rings + * interrupt handler, go through the rings * and rebuild them */ sc->failed_recv_alloc = 0; @@ -1356,7 +1356,7 @@ /* Stop Tx and Rx on the chip */ csr6 = LMC_CSR_READ (sc, csr_command); csr6 &= ~LMC_DEC_ST; /* Turn off the Transmission bit */ - csr6 &= ~LMC_DEC_SR; /* Turn off the Recieve bit */ + csr6 &= ~LMC_DEC_SR; /* Turn off the Receive bit */ LMC_CSR_WRITE (sc, csr_command, csr6); dev->flags &= ~IFF_RUNNING; @@ -1425,7 +1425,7 @@ spin_lock(&sc->lmc_lock); /* - * Read the csr to find what interupts we have (if any) + * Read the csr to find what interrupts we have (if any) */ csr = LMC_CSR_READ (sc, csr_status); @@ -1441,7 +1441,7 @@ /* always go through this loop at least once */ while (csr & sc->lmc_intrmask) { /* - * Clear interupt bits, we handle all case below + * Clear interrupt bits, we handle all case below */ LMC_CSR_WRITE (sc, csr_status, csr); @@ -1464,7 +1464,7 @@ } if (csr & TULIP_STS_RXINTR){ - lmc_trace(dev, "rx interupt"); + lmc_trace(dev, "rx interrupt"); lmc_rx (dev); } @@ -1588,7 +1588,7 @@ /* * Get current csr status to make sure - * we've cleared all interupts + * we've cleared all interrupts */ csr = LMC_CSR_READ (sc, csr_status); } /* end interrupt loop */ @@ -1599,8 +1599,6 @@ spin_unlock(&sc->lmc_lock); lmc_trace(dev, "lmc_interrupt out"); - - return; } static int lmc_start_xmit (struct sk_buff *skb, struct net_device *dev) /*fold00*/ @@ -1843,6 +1841,7 @@ dev->last_rx = jiffies; sc->stats.rx_packets++; + sc->stats.rx_bytes += len; LMC_CONSOLE_LOG("recv", skb->data, len); @@ -1879,12 +1878,12 @@ sc->lmc_rxq[i] = nsb; nsb->dev = dev; sc->lmc_rxring[i].buffer1 = virt_to_bus (nsb->tail); - /* Transfered to 21140 below */ + /* Transferred to 21140 below */ } else { /* * We've run out of memory, stop trying to allocate - * memory and exit the interupt handler + * memory and exit the interrupt handler * * The chip may run out of receivers and stop * in which care we'll try to allocate the buffer @@ -2129,7 +2128,7 @@ lmc_trace(sc->lmc_device, "lmc_softreset in"); - /* Initialize the recieve rings and buffers. */ + /* Initialize the receive rings and buffers. */ sc->lmc_txfull = 0; sc->lmc_next_rx = 0; sc->lmc_next_tx = 0; @@ -2138,7 +2137,7 @@ /* * Setup each one of the receiver buffers - * allocate an skbuff for each one, setup the the descriptor table + * allocate an skbuff for each one, setup the descriptor table * and point each buffer at the next one */ Index: lmc_media.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/net/wan/lmc/lmc_media.c,v retrieving revision 1.1.1.2 retrieving revision 1.2 diff -u -r1.1.1.2 -r1.2 --- lmc_media.c 25 Feb 2001 23:15:00 -0000 1.1.1.2 +++ lmc_media.c 11 Apr 2002 12:37:52 -0000 1.2 @@ -29,7 +29,7 @@ #include <linux/netdevice.h> #include <linux/etherdevice.h> #include <linux/skbuff.h> -#include "../syncppp.h" +#include <net/syncppp.h> #include <linux/inet.h> #if LINUX_VERSION_CODE >= 0x20200 Index: lmc_proto.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/net/wan/lmc/lmc_proto.c,v retrieving revision 1.1.1.2 retrieving revision 1.2 diff -u -r1.1.1.2 -r1.2 --- lmc_proto.c 25 Feb 2001 23:15:00 -0000 1.1.1.2 +++ lmc_proto.c 11 Apr 2002 12:37:52 -0000 1.2 @@ -43,7 +43,7 @@ #include <linux/netdevice.h> #include <linux/etherdevice.h> #include <linux/skbuff.h> -#include "../syncppp.h" +#include <net/syncppp.h> #include <linux/inet.h> #include <linux/tqueue.h> #include <linux/proc_fs.h> @@ -61,7 +61,6 @@ * compiled without referencing any of the sync ppp routines. */ #ifdef SPPPSTUB -#define SYNC_PPP_init() (void)0 #define SPPP_detach(d) (void)0 #define SPPP_open(d) 0 #define SPPP_reopen(d) (void)0 @@ -70,7 +69,6 @@ #define SPPP_do_ioctl(d,i,c) -EOPNOTSUPP #else #if LINUX_VERSION_CODE < 0x20363 -#define SYNC_PPP_init sync_ppp_init #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) @@ -78,7 +76,6 @@ #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 SYNC_PPP_init sync_ppp_init #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) @@ -88,21 +85,19 @@ #endif #endif -static int lmc_first_ppp_load = 0; - // init void lmc_proto_init(lmc_softc_t *sc) /*FOLD00*/ { lmc_trace(sc->lmc_device, "lmc_proto_init in"); switch(sc->if_type){ case LMC_PPP: - if(lmc_first_ppp_load == 0) -#ifndef MODULE - SYNC_PPP_init(); -#endif #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; Index: lmc_var.h =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/net/wan/lmc/lmc_var.h,v retrieving revision 1.1.1.2 retrieving revision 1.2 diff -u -r1.1.1.2 -r1.2 --- lmc_var.h 25 Feb 2001 23:15:00 -0000 1.1.1.2 +++ lmc_var.h 11 Apr 2002 12:37:52 -0000 1.2 @@ -482,10 +482,10 @@ #define TULIP_STS_NORMALINTR 0x00010000L /* (RW) Normal Interrupt */ #define TULIP_STS_ABNRMLINTR 0x00008000L /* (RW) Abnormal Interrupt */ -#define TULIP_STS_ERI 0x00004000L /* (RW) Early Receive Interupt */ +#define TULIP_STS_ERI 0x00004000L /* (RW) Early Receive Interrupt */ #define TULIP_STS_SYSERROR 0x00002000L /* (RW) System Error */ #define TULIP_STS_GTE 0x00000800L /* (RW) General Pupose Timer Exp */ -#define TULIP_STS_ETI 0x00000400L /* (RW) Early Transmit Interupt */ +#define TULIP_STS_ETI 0x00000400L /* (RW) Early Transmit Interrupt */ #define TULIP_STS_RXWT 0x00000200L /* (RW) Receiver Watchdog Timeout */ #define TULIP_STS_RXSTOPPED 0x00000100L /* (RW) Receiver Process Stopped */ #define TULIP_STS_RXNOBUF 0x00000080L /* (RW) Receive Buf Unavail */ |