[PATCH] NI5010 netcard cleanup

- updated MAINTAINERS entry to new format
- updated Jan-Pascal's (ACKed) and my email address
- driver cleanup/modernization (runtime-, not hardware-tested)

[bunk@stusta.de: build fix]
Signed-off-by: Andreas Mohr <andi@lisas.de>
Cc: Jeff Garzik <jeff@garzik.org>
Cc: Jan-Pascal van Best <jvbest@qv3pluto.leidenuniv.nl>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>

authored by Andreas Mohr and committed by Jeff Garzik 5b552b16 3a10cceb

+28 -31
+4 -3
MAINTAINERS
··· 2039 2039 S: Maintained 2040 2040 2041 2041 NI5010 NETWORK DRIVER 2042 - P: Jan-Pascal van Best and Andreas Mohr 2043 - M: Jan-Pascal van Best <jvbest@qv3pluto.leidenuniv.nl> 2044 - M: Andreas Mohr <100.30936@germany.net> 2042 + P: Jan-Pascal van Best 2043 + M: janpascal@vanbest.org 2044 + P: Andreas Mohr 2045 + M: andi@lisas.de 2045 2046 L: netdev@vger.kernel.org 2046 2047 S: Maintained 2047 2048
+24 -28
drivers/net/ni5010.c
··· 1 1 /* ni5010.c: A network driver for the MiCom-Interlan NI5010 ethercard. 2 2 * 3 - * Copyright 1996,1997 Jan-Pascal van Best and Andreas Mohr. 3 + * Copyright 1996,1997,2006 Jan-Pascal van Best and Andreas Mohr. 4 4 * 5 5 * This software may be used and distributed according to the terms 6 6 * of the GNU General Public License, incorporated herein by reference. 7 7 * 8 8 * The authors may be reached as: 9 - * jvbest@wi.leidenuniv.nl a.mohr@mailto.de 10 - * or by snail mail as 11 - * Jan-Pascal van Best Andreas Mohr 12 - * Klikspaanweg 58-4 Stauferstr. 6 13 - * 2324 LZ Leiden D-71272 Renningen 14 - * The Netherlands Germany 9 + * janpascal@vanbest.org andi@lisas.de 15 10 * 16 11 * Sources: 17 12 * Donald Becker's "skeleton.c" ··· 22 27 * 970503 v0.93: Fixed auto-irq failure on warm reboot (JB) 23 28 * 970623 v1.00: First kernel version (AM) 24 29 * 970814 v1.01: Added detection of onboard receive buffer size (AM) 30 + * 060611 v1.02: slight cleanup: email addresses, driver modernization. 25 31 * Bugs: 26 - * - None known... 32 + * - not SMP-safe (no locking of I/O accesses) 27 33 * - Note that you have to patch ifconfig for the new /proc/net/dev 28 34 * format. It gives incorrect stats otherwise. 29 35 * ··· 35 39 * Complete merge with Andreas' driver 36 40 * Implement ring buffers (Is this useful? You can't squeeze 37 41 * too many packet in a 2k buffer!) 38 - * Implement DMA (Again, is this useful? Some docs says DMA is 42 + * Implement DMA (Again, is this useful? Some docs say DMA is 39 43 * slower than programmed I/O) 40 44 * 41 45 * Compile with: ··· 43 47 * -DMODULE -c ni5010.c 44 48 * 45 49 * Insert with e.g.: 46 - * insmod ni5010.o io=0x300 irq=5 50 + * insmod ni5010.ko io=0x300 irq=5 47 51 */ 48 52 49 53 #include <linux/module.h> ··· 65 69 66 70 #include "ni5010.h" 67 71 68 - static const char *boardname = "NI5010"; 69 - static char *version = 70 - "ni5010.c: v1.00 06/23/97 Jan-Pascal van Best and Andreas Mohr\n"; 72 + static const char boardname[] = "NI5010"; 73 + static char version[] __initdata = 74 + "ni5010.c: v1.02 20060611 Jan-Pascal van Best and Andreas Mohr\n"; 71 75 72 76 /* bufsize_rcv == 0 means autoprobing */ 73 77 static unsigned int bufsize_rcv; 74 78 75 - #define jumpered_interrupts /* IRQ line jumpered on board */ 76 - #undef jumpered_dma /* No DMA used */ 79 + #define JUMPERED_INTERRUPTS /* IRQ line jumpered on board */ 80 + #undef JUMPERED_DMA /* No DMA used */ 77 81 #undef FULL_IODETECT /* Only detect in portlist */ 78 82 79 83 #ifndef FULL_IODETECT ··· 277 281 278 282 PRINTK2((KERN_DEBUG "%s: I/O #4 passed!\n", dev->name)); 279 283 280 - #ifdef jumpered_interrupts 284 + #ifdef JUMPERED_INTERRUPTS 281 285 if (dev->irq == 0xff) 282 286 ; 283 287 else if (dev->irq < 2) { ··· 301 305 } else if (dev->irq == 2) { 302 306 dev->irq = 9; 303 307 } 304 - #endif /* jumpered_irq */ 308 + #endif /* JUMPERED_INTERRUPTS */ 305 309 PRINTK2((KERN_DEBUG "%s: I/O #9 passed!\n", dev->name)); 306 310 307 311 /* DMA is not supported (yet?), so no use detecting it */ ··· 330 334 outw(0, IE_GP); /* Point GP at start of packet */ 331 335 outb(0, IE_RBUF); /* set buffer byte 0 to 0 again */ 332 336 } 333 - printk("// bufsize rcv/xmt=%d/%d\n", bufsize_rcv, NI5010_BUFSIZE); 337 + printk("-> bufsize rcv/xmt=%d/%d\n", bufsize_rcv, NI5010_BUFSIZE); 334 338 memset(dev->priv, 0, sizeof(struct ni5010_local)); 335 339 336 340 dev->open = ni5010_open; ··· 350 354 outb(0xff, EDLC_XCLR); /* Kill all pending xmt interrupts */ 351 355 352 356 printk(KERN_INFO "%s: NI5010 found at 0x%x, using IRQ %d", dev->name, ioaddr, dev->irq); 353 - if (dev->dma) printk(" & DMA %d", dev->dma); 357 + if (dev->dma) 358 + printk(" & DMA %d", dev->dma); 354 359 printk(".\n"); 355 - 356 - printk(KERN_INFO "Join the NI5010 driver development team!\n"); 357 - printk(KERN_INFO "Mail to a.mohr@mailto.de or jvbest@wi.leidenuniv.nl\n"); 358 360 return 0; 359 361 out: 360 362 release_region(dev->base_addr, NI5010_IO_EXTENT); ··· 365 371 * 366 372 * This routine should set everything up anew at each open, even 367 373 * registers that "should" only need to be set once at boot, so that 368 - * there is non-reboot way to recover if something goes wrong. 374 + * there is a non-reboot way to recover if something goes wrong. 369 375 */ 370 376 371 377 static int ni5010_open(struct net_device *dev) ··· 384 390 * Always allocate the DMA channel after the IRQ, 385 391 * and clean up on failure. 386 392 */ 387 - #ifdef jumpered_dma 393 + #ifdef JUMPERED_DMA 388 394 if (request_dma(dev->dma, cardname)) { 389 395 printk(KERN_WARNING "%s: Cannot get dma %#2x\n", dev->name, dev->dma); 390 396 free_irq(dev->irq, NULL); 391 397 return -EAGAIN; 392 398 } 393 - #endif /* jumpered_dma */ 399 + #endif /* JUMPERED_DMA */ 394 400 395 401 PRINTK3((KERN_DEBUG "%s: passed open() #2\n", dev->name)); 396 402 /* Reset the hardware here. Don't forget to set the station address. */ ··· 627 633 int ioaddr = dev->base_addr; 628 634 629 635 PRINTK2((KERN_DEBUG "%s: entering ni5010_close\n", dev->name)); 630 - #ifdef jumpered_interrupts 636 + #ifdef JUMPERED_INTERRUPTS 631 637 free_irq(dev->irq, NULL); 632 638 #endif 633 639 /* Put card in held-RESET state */ ··· 765 771 MODULE_PARM_DESC(io, "ni5010 I/O base address"); 766 772 MODULE_PARM_DESC(irq, "ni5010 IRQ number"); 767 773 768 - int init_module(void) 774 + static int __init ni5010_init_module(void) 769 775 { 770 776 PRINTK2((KERN_DEBUG "%s: entering init_module\n", boardname)); 771 777 /* ··· 786 792 return 0; 787 793 } 788 794 789 - void cleanup_module(void) 795 + static void __exit ni5010_cleanup_module(void) 790 796 { 791 797 PRINTK2((KERN_DEBUG "%s: entering cleanup_module\n", boardname)); 792 798 unregister_netdev(dev_ni5010); 793 799 release_region(dev_ni5010->base_addr, NI5010_IO_EXTENT); 794 800 free_netdev(dev_ni5010); 795 801 } 802 + module_init(ni5010_init_module); 803 + module_exit(ni5010_cleanup_module); 796 804 #endif /* MODULE */ 797 805 MODULE_LICENSE("GPL"); 798 806