drivers/net/others
PATCH 1/1 drivers/net/others
And the next (unfinished) part of net drivers cleaning. Except previously mentioned
- __init fixes
- version fixes
- added MODULE_PARM_DESC
- removed unnecessary zero initializers
it also contains
- mbps -> Mbps (8139too)
- warning fixes (unused variables) (8139too)
- aironet config fixes
- PCI IDs name sync with pci_ids (when different names) (pcnet32, tlan)
- long udelay()s fixed (aironet)
- disabled unused code (arlan-proc)
- comment typos fixed
Andrzej
***********************************************************************
drivers/net/8139too.c +22 -7
@@ -154,6 +154,13 @@#define RTL8139_DRIVER_NAME MODNAME " Fast Ethernet driver " RTL8139_VERSION#define PFX MODNAME ": " +static char version[] +#ifdef MODULE +__initdata +#else +__devinitdata +#endif + = KERN_INFO RTL8139_DRIVER_NAME "\n";/* enable PIO instead of MMIO, if CONFIG_8139TOO_PIO is selected */ #ifdef CONFIG_8139TOO_PIO
@@ -188,8 +195,8 @@/* A few user-configurable values. */ /* media options */ #define MAX_UNITS 8 -static int media[MAX_UNITS ] = {-1 ,-1 ,-1 ,-1 ,-1 ,-1 ,-1 ,-1 }; -static int full_duplex[MAX_UNITS ] = {-1 ,-1 ,-1 ,-1 ,-1 ,-1 ,-1 ,-1 }; +static int media[MAX_UNITS ]__devinitdata = {-1 ,-1 ,-1 ,-1 ,-1 ,-1 ,-1 ,-1 }; +static int full_duplex[MAX_UNITS ]__devinitdata = {-1 ,-1 ,-1 ,-1 ,-1 ,-1 ,-1 ,-1 };/* Maximum events (Rx packets, etc.) to handle at each interrupt. */ static int max_interrupt_work =20 ;
@@ -582,6 +589,10 @@MODULE_PARM (max_interrupt_work,"i" ); MODULE_PARM (media, "1-" __MODULE_STRING(MAX_UNITS) "i"); MODULE_PARM (full_duplex, "1-" __MODULE_STRING(MAX_UNITS) "i"); +MODULE_PARM_DESC (multicast_filter_limit,"8139too maximum number of filtered multicast addresses" ); +MODULE_PARM_DESC (max_interrupt_work,"8139too maximum events handled per interrupt" ); +MODULE_PARM_DESC (media,"8139too: Bits 4+9: force full-duplex, bit 5: 100Mbps" ); +MODULE_PARM_DESC (full_duplex,"8139too: Force full duplex for board(s) (0-1)" );static int read_eeprom (void *ioaddr,int location,int addr_len);static int rtl8139_open (struct net_device *dev);
@@ -910,7 +921,7 @@ {static int printed_version;if (!printed_version++) - printk (KERN_INFO RTL8139_DRIVER_NAME "\n"); +printk ("%s" , version); }#endif
@@ -1018,11 +1029,11 @@ tp->duplex_lock =1 ; }if (tp->default_port) { -printk (KERN_INFO " Forcing %dMbs %s-duplex operation.\n" , +printk (KERN_INFO " Forcing %dMbps %s-duplex operation.\n" , (option &0x20 ?100 :10 ), (option &0x10 ?"full" :"half" ));mdio_write (dev, tp->phys[0 ],0 , - ((option &0x20 ) ?0x2000 :0 ) |/* 100mbps? */ + ((option &0x20 ) ?0x2000 :0 ) |/* 100Mbps? */ ((option &0x10 ) ?0x0100 :0 ));/* Full duplex? */ }
@@ -1172,10 +1183,12 @@static int mdio_read (struct net_device *dev,int phy_id,int location) {struct rtl8139_private *tp = dev->priv; +int retval =0 ; +#ifdef CONFIG_8139TOO_8129 void *mdio_addr = tp->mmio_addr + Config4;int mii_cmd = (0xf6 <<10 ) | (phy_id <<5 ) | location; -int retval =0 ;int i; +#endif /* CONFIG_8139TOO_8129 */ DPRINTK ("ENTER\n" );
@@ -1216,9 +1229,11 @@ int value) {struct rtl8139_private *tp = dev->priv; +#ifdef CONFIG_8139TOO_8129 void *mdio_addr = tp->mmio_addr + Config4;int mii_cmd = (0x5002 <<16 ) | (phy_id <<23 ) | (location <<18 ) | value;int i; +#endif /* CONFIG_8139TOO_8129 */ DPRINTK ("ENTER\n" );
@@ -2384,7 +2399,7 @@* even if no 8139 board is found. */ #ifdef MODULE - printk (KERN_INFO RTL8139_DRIVER_NAME "\n"); +printk ("%s" , version);#endif return pci_module_init (&rtl8139_pci_driver);
drivers/net/82596.c +9 -2
@@ -64,7 +64,7 @@#include <asm/pgalloc.h> static char version[]__initdata = -"82596.c $Revision: 1.4 $\n" ; +KERN_INFO "82596.c $Revision: 1.4 $\n" ;/* DEBUG flags */
@@ -151,6 +151,7 @@MODULE_AUTHOR ("Richard Hirst" );MODULE_DESCRIPTION ("i82596 driver" );MODULE_PARM (i596_debug,"i" ); +MODULE_PARM_DESC (i596_debug,"i82596 debug mask" );/* Copy frames shorter than rx_copybreak, otherwise pass on up in
@@ -1175,7 +1176,9 @@DEB (DEB_PROBE ,printk (" IRQ %d.\n" , dev->irq)); -DEB (DEB_PROBE ,printk (version)); +#ifndef MODULE +printk ("%s" , version); +#endif /* MODULE */ /* The 82596-specific entries in the device structure. */ dev->open = i596_open;
@@ -1493,9 +1496,11 @@static int io =0x300 ;static int irq =10 ;MODULE_PARM (irq,"i" ); +MODULE_PARM_DESC (irq,"Apricot IRQ number" );#endif MODULE_PARM (debug,"i" ); +MODULE_PARM_DESC (debug,"i82596 debug mask" );static int debug =-1 ;int init_module (void )
@@ -1504,6 +1509,8 @@ dev_82596.base_addr = io; dev_82596.irq = irq;#endif + +printk ("%s" , version);if (debug >=0 ) i596_debug = debug;if (register_netdev (&dev_82596) !=0 )
drivers/net/8390.c +4 -4
@@ -45,9 +45,6 @@*/ -static const char version[] = -"8390.c:v1.10cvs 9/23/94 Donald Becker ([email protected])\n" ; -#include <linux/module.h> #include <linux/kernel.h> #include <linux/sched.h>
@@ -70,6 +67,9 @@#include <linux/netdevice.h> #include <linux/etherdevice.h> +static const char version[] = +KERN_INFO "8390.c:v1.10cvs 9/23/94 Donald Becker ([email protected])\n" ; +#define NS8390_CORE #include "8390.h"
@@ -1016,7 +1016,7 @@int ethdev_init (struct net_device *dev) {if (ei_debug >1 ) -printk (version); +printk ("%s" , version);if (dev->priv ==NULL ) {
drivers/net/Config.in +7 -3
@@ -260,10 +260,14 @@ tristate ' Aironet 4500/4800 series adapters' CONFIG_AIRONET4500 dep_tristate ' Aironet 4500/4800 ISA/PCI/PNP/365 support ' CONFIG_AIRONET4500_NONCS $CONFIG_AIRONET4500 if [ "$CONFIG_AIRONET4500" != "n" -a "$CONFIG_AIRONET4500_NONCS" != "n" ]; then - bool ' Aironet 4500/4800 PNP support ' CONFIG_AIRONET4500_PNP + if [ "$CONFIG_AIRONET4500_NONCS" = "m" -a "$CONFIG_ISAPNP" = "m" -o "$CONFIG_ISAPNP" = "y" ]; then + bool ' Aironet 4500/4800 PNP support ' CONFIG_AIRONET4500_PNP + fi dep_bool ' Aironet 4500/4800 PCI support ' CONFIG_AIRONET4500_PCI $CONFIG_PCI - dep_bool ' Aironet 4500/4800 ISA broken support (EXPERIMENTAL)' CONFIG_AIRONET4500_ISA $CONFIG_EXPERIMENTAL - dep_bool ' Aironet 4500/4800 I365 broken support (EXPERIMENTAL)' CONFIG_AIRONET4500_I365 $CONFIG_EXPERIMENTAL + if [ "$CONFIG_AIRONET4500_NONCS" = "m" ]; then + dep_bool ' Aironet 4500/4800 ISA broken support (EXPERIMENTAL)' CONFIG_AIRONET4500_ISA $CONFIG_EXPERIMENTAL + dep_bool ' Aironet 4500/4800 I365 broken support (EXPERIMENTAL)' CONFIG_AIRONET4500_I365 $CONFIG_EXPERIMENTAL + fi fi dep_tristate ' Aironet 4500/4800 PROC interface ' CONFIG_AIRONET4500_PROC $CONFIG_AIRONET4500 m
drivers/net/ac3200.c +14 -5
@@ -62,9 +62,11 @@/* Decoding of the configuration register. */ static unsigned char config2irqmap[8 ]__initdata = {15 ,12 ,11 ,10 ,9 ,7 ,5 ,3 }; -static int addrmap[8 ] = -{0xFF0000 ,0xFE0000 ,0xFD0000 ,0xFFF0000 ,0xFFE0000 ,0xFFC0000 ,0xD0000 ,0 }; -static const char *port_name[4 ] = {"10baseT" ,"invalid" ,"AUI" ,"10base2" }; +static int addrmap[8 ]__initdata = + {0xFF0000 ,0xFE0000 ,0xFD0000 ,0xFFF0000 , +0xFFE0000 ,0xFFC0000 ,0xD0000 ,0 }; +static char *port_name[4 ]__initdata = + {"10baseT" ,"invalid" ,"AUI" ,"10base2" };#define config2irq (configval) config2irqmap[((configval) >> 3) & 7]#define config2mem (configval) addrmap[(configval) & 7]
@@ -119,6 +121,7 @@static int __init ac_probe1 (int ioaddr,struct net_device *dev) {int i, retval; +static int printed_version;if (!request_region (ioaddr,AC_IO_EXTENT , dev->name))return -EBUSY ;
@@ -234,8 +237,10 @@ ei_status.stop_page =AC_STOP_PG ; ei_status.word16 =1 ; -if (ei_debug >0 ) -printk (version); +#ifndef MODULE +if (!printed_version++) +printk ("%s" , version); +#endif /* MODULE */ ei_status.reset_8390 = &ac_reset_8390; ei_status.block_input = &ac_block_input;
@@ -344,12 +349,16 @@ MODULE_PARM(io, "1-" __MODULE_STRING(MAX_AC32_CARDS) "i"); MODULE_PARM(irq, "1-" __MODULE_STRING(MAX_AC32_CARDS) "i"); MODULE_PARM(mem, "1-" __MODULE_STRING(MAX_AC32_CARDS) "i"); +MODULE_PARM_DESC (io,"ac3200 I/O base adress(es)" ); +MODULE_PARM_DESC (irq,"ac3200 IRQ number(s)" ); +MODULE_PARM_DESC (mem,"ac3200 Memory base address(es)" );int init_module (void ) {int this_dev, found =0 ; +printk ("%s" , version);for (this_dev =0 ; this_dev <MAX_AC32_CARDS ; this_dev++) {struct net_device *dev = &dev_ac32[this_dev]; dev->irq = irq[this_dev];
drivers/net/acenic.c +22 -21
110 lines not on this page · raw message
drivers/net/aironet4500_card.c +48 -38
253 lines not on this page · raw message
drivers/net/aironet4500_core.c +12 -6
@@ -2537,8 +2537,8 @@ }; -static const char *aironet4500_core_version = -"aironet4500.c v0.1 1/1/99 Elmer Joandi, [email protected].\n" ; +static char aironet4500_core_version[]__initdata = +KERN_INFO "aironet4500_core.c v0.1 1/1/99 Elmer Joandi, [email protected].\n" ;struct net_device * aironet4500_devices[MAX_AWCS ];
@@ -2566,7 +2566,7 @@MODULE_PARM (awc_debug,"i" );MODULE_PARM (tx_rate,"i" );MODULE_PARM (channel,"i" ); -MODULE_PARM (tx_full_rate,"i" ); +//MODULE_PARM(tx_full_rate,"i"); MODULE_PARM (adhoc,"i" );MODULE_PARM (master,"i" );MODULE_PARM (slave,"i" );
@@ -2575,6 +2575,12 @@MODULE_PARM (large_buff_mem,"i" );MODULE_PARM (small_buff_no,"i" );MODULE_PARM (SSID ,"c33" ); +MODULE_PARM_DESC (awc_debug,"Aironet debug mask" ); +MODULE_PARM_DESC (channel,"Aironet " ); +MODULE_PARM_DESC (adhoc,"Aironet Access Points not available (0-1)" ); +MODULE_PARM_DESC (master,"Aironet is Adhoc master (creates network sync) (0-1)" ); +MODULE_PARM_DESC (slave,"Aironet is Adhoc slave (0-1)" ); +MODULE_PARM_DESC (max_mtu,"Aironet MTU limit (256-2312)" );#endif /*EXPORT_SYMBOL(tx_queue_len);
@@ -3209,18 +3215,18 @@return 0 ; }; -static int aironet_core_init (void ) +static int __init aironet_core_init (void ) {// unsigned long flags; -printk (KERN_INFO "%s" , aironet4500_core_version); +printk ("%s" , aironet4500_core_version);return 0 ; } -static void aironet_core_exit (void ) +static void __exit aironet_core_exit(void) {printk (KERN_INFO "aironet4500 unloading core module \n" );
drivers/net/aironet4500_proc.c +1 -1
@@ -1,5 +1,5 @@/* -* Aironet 4500 Pcmcia driver +* Aironet 4500 /proc interface * * Elmer Joandi, Januar 1999 * Copyright GPL
drivers/net/am79c961a.c +9 -3
@@ -46,7 +46,8 @@static unsigned int net_debug =NET_DEBUG ; -static char *version ="am79c961 ethernet driver (c) 1995 R.M.King v0.02\n" ; +static char version[]__initdata = +KERN_INFO "am79c961 ethernet driver (c) 1995 R.M.King v0.02\n" ;/* --------------------------------------------------------------------------- */
@@ -639,8 +640,8 @@ {static unsigned version_printed; -if (net_debug && version_printed++ ==0 ) -printk (KERN_INFO "%s" , version); +if (version_printed++ ==0 ) +printk ("%s" , version); }static int __init am79c961_init (void )
@@ -649,6 +650,9 @@struct dev_priv *priv;int i, ret; +#ifdef MODULE +am79c961_banner (); +#endif /* MODULE */ dev =init_etherdev (NULL ,sizeof (struct dev_priv )); ret = -ENOMEM ;if (!dev)
@@ -684,7 +688,9 @@if (!request_region (dev->base_addr,0x18 , dev->name)) goto nodev; +#ifndef MODULE am79c961_banner (); +#endif /* MODULE */ printk (KERN_INFO "%s: am79c961 found at %08lx, IRQ%d, ether address " , dev->name, dev->base_addr, dev->irq);
drivers/net/apne.c +8 -5
@@ -117,11 +117,11 @@static const char version[] = -"apne.c:v1.1 7/10/98 Alain Malek ([email protected])\n" ; +KERN_INFO "apne.c:v1.1 7/10/98 Alain Malek ([email protected])\n" ;static int apne_owned;/* signal if card already owned */ -int __init apne_probe (struct net_device *dev) +int apne_probe (struct net_device *dev) {#ifndef MANUAL_CONFIG char tuple[8 ];
@@ -163,7 +163,7 @@ } -static int __init apne_probe1 (struct net_device *dev,int ioaddr) +static int apne_probe1 (struct net_device *dev,int ioaddr) {int i;unsigned char SA_prom[32 ];
@@ -180,8 +180,10 @@8 ,9 +GAYLE_ODD ,0xa ,0xb +GAYLE_ODD , 0xc, 0xd+GAYLE_ODD, 0xe, 0xf+GAYLE_ODD }; -if (ei_debug && version_printed++ ==0 ) -printk (version); +#ifndef MODULE +if (version_printed++ ==0 ) +printk ("%s" , version); +#endif /* MODULE */ printk ("PCMCIA NE*000 ethercard probe" );
@@ -550,6 +552,7 @@ {int err; +printk ("%s" , version); apne_dev.init = apne_probe;if ((err =register_netdev (&apne_dev))) {if (err == -EIO )
drivers/net/arlan-proc.c +2 -0
@@ -249,6 +249,7 @@ } +#if 0 /****************************** TEST MEMORY **************/ static int arlan_hw_test_memory (struct net_device *dev)
@@ -394,6 +395,7 @@return 0 ;/* no errors */ } +#endif /* 0 */ #endif #ifdef ARLAN_PROC_INTERFACE
drivers/net/arlan.c +54 -13
147 lines not on this page · raw message
drivers/net/at1700.c +17 -10
@@ -61,7 +61,7 @@#include <linux/mca.h> static char version[]__initdata = -"at1700.c:v1.15 4/7/98 Donald Becker ([email protected])\n" ; +KERN_INFO "at1700.c:v1.15 4/7/98 Donald Becker ([email protected])\n" ;/* Tunable parameters. */
@@ -70,7 +70,7 @@/* These unusual address orders are used to verify the CONFIG register. */ -static int fmv18x_probe_list[] = { +static int fmv18x_probe_list[]__initdata = {0x220 ,0x240 ,0x260 ,0x280 ,0x2a0 ,0x2c0 ,0x300 ,0x340 ,0 };
@@ -78,7 +78,7 @@* ISA */ -static int at1700_probe_list[] = { +static int at1700_probe_list[]__initdata = {0x260 ,0x280 ,0x2a0 ,0x240 ,0x340 ,0x320 ,0x380 ,0x300 ,0 };
@@ -86,15 +86,15 @@* MCA */ #ifdef CONFIG_MCA -static int at1700_ioaddr_pattern[] = { +static int at1700_ioaddr_pattern[]__initdata = {0x00 ,0x04 ,0x01 ,0x05 ,0x02 ,0x06 ,0x03 ,0x07 }; -static int at1700_mca_probe_list[] = { +static int at1700_mca_probe_list[]__initdata = {0x400 ,0x1400 ,0x2400 ,0x3400 ,0x4400 ,0x5400 ,0x6400 ,0x7400 ,0 }; -static int at1700_irq_pattern[] = { +static int at1700_irq_pattern[]__initdata = {0x00 ,0x00 ,0x00 ,0x30 ,0x70 ,0xb0 ,0x00 ,0x00 ,0x00 ,0xf0 ,0x34 ,0x74 ,0xb4 ,0x00 ,0x00 ,0xf4 ,0x00 };
@@ -226,7 +226,8 @@unsigned int i, irq, is_fmv18x =0 , is_at1700 =0 ;int slot, ret = -ENODEV ;struct net_local *lp; - +static int printed_version; +if (!request_region (ioaddr,AT1700_IO_EXTENT , dev->name))return -EBUSY ;
@@ -410,8 +411,10 @@outb (dev->if_port, ioaddr +MODE13 );outb (0x00 , ioaddr +COL16CNTL ); -if (net_debug) -printk (version); +#ifndef MODULE +if (!printed_version++) +printk ("%s" , version); +#endif /* MODULE */ /* Initialize the device structure. */ dev->priv =kmalloc (sizeof (struct net_local ),GFP_KERNEL );
@@ -470,7 +473,7 @@#define EE_READ_CMD (6 << 6)#define EE_ERASE_CMD (7 << 6) -static int read_eeprom (int ioaddr,int location) +static int __init read_eeprom (int ioaddr,int location) {int i;unsigned short retval =0 ;
@@ -880,9 +883,13 @@MODULE_PARM (io,"i" );MODULE_PARM (irq,"i" );MODULE_PARM (net_debug,"i" ); +MODULE_PARM_DESC (io,"AT1700/FMV18X I/O base address" ); +MODULE_PARM_DESC (irq,"AT1700/FMV18X IRQ number" ); +MODULE_PARM_DESC (net_debug,"AT1700/FMV18X debug level (0-6)" );int init_module (void ) { +printk ("%s" , version);if (io ==0 )printk ("at1700: You should not use auto-probing with insmod!\n" ); dev_at1700.base_addr = io;
drivers/net/atari_bionet.c +6 -2
@@ -126,6 +126,7 @@*/ unsigned int bionet_debug =NET_DEBUG ;MODULE_PARM (bionet_debug,"i" ); +MODULE_PARM_DESC (bionet_debug,"bionet debug level (0-2)" );static unsigned int bionet_min_poll_time =2 ;
@@ -354,8 +355,10 @@SET_MODULE_OWNER (dev); -if (bionet_debug >0 && version_printed++ ==0 ) -printk (version); +#ifndef MODULE +if (version_printed++ ==0 ) +printk ("%s" , version); +#endif /* MODULE */ printk("%s: %s found, eth-addr: %02x-%02x-%02x:%02x-%02x-%02x.\n", dev->name, "BioNet 100",
@@ -650,6 +653,7 @@init_module (void) {int err; +printk ("%s" , version); bio_dev.init = bionet_probe;if ((err =register_netdev (&bio_dev))) {if (err == -EEXIST ) {
drivers/net/atari_pamsnet.c +14 -10
@@ -74,9 +74,6 @@#define MAX_POLL_TIME 10 -static char *version = -"pamsnet.c:v0.2beta 30-mar-96 (c) Torsten Lang.\n" ; -#include <linux/module.h> #include <linux/kernel.h>
@@ -108,6 +105,9 @@#include <linux/etherdevice.h> #include <linux/skbuff.h> +static char version[]__initdata = +KERN_INFO "pamsnet.c:v0.2beta 30-mar-96 (c) Torsten Lang.\n" ; +#undef READ#undef WRITE
@@ -123,6 +123,7 @@*/ unsigned int pamsnet_debug =NET_DEBUG ;MODULE_PARM (pamsnet_debug,"i" ); +MODULE_PARM_DESC (pamsnet_debug,"pamsnet debug enable (0-1)" );static unsigned int pamsnet_min_poll_time =2 ;
@@ -233,7 +234,7 @@#define READSECTOR READPKT#define WRITESECTOR WRITEPKT -u_char *inquire8="MV PAM's NET/GK" ; +u_char *inquire8__initdata ="MV PAM's NET/GK" ;#define DMALOW dma_wd.dma_lo#define DMAMID dma_wd.dma_md
@@ -283,7 +284,7 @@unsigned rw;int lance_target =-1 ; -int if_up =0 ; +int if_up;/* The following routines access the ethernet board connected to the * ACSI port via the st_dma chip.
@@ -433,7 +434,7 @@/* inquiry() returns 0 when PAM's DMA found, -1 when timeout, -2 otherwise */ /* Please note: The buffer is for internal use only but must be defined! */ -static int +static int __init inquiry (target, buffer) int target; unsigned char *buffer;
@@ -470,8 +471,7 @@* a pointer to it (virtual address!) or 0 in case of an error */ -static HADDR -*read_hw_addr (target ,buffer ) +static HADDR *__init read_hw_addr (target ,buffer ) int target;unsigned char *buffer; {
@@ -622,8 +622,11 @@if ((dev ==NULL ) || (lance_target <0 ))return -ENODEV ; -if (pamsnet_debug >0 && version_printed++ ==0 ) -printk (version); + +#ifndef MODULE +if (version_printed++ ==0 ) +printk ("%s" , version); +#endif /* MODULE */ printk("%s: %s found on target %01d, eth-addr: %02x:%02x:%02x:%02x:%02x:%02x.\n", dev->name, "PAM's Net/GK", lance_target,
@@ -873,6 +876,7 @@init_module (void) {int err; +printk ("%s" , version); pam_dev.init = pamsnet_probe;if ((err =register_netdev (&pam_dev))) {if (err == -EEXIST ) {
drivers/net/atarilance.c +4 -1
@@ -615,8 +615,10 @@else *RIEBL_IVEC_ADDR =IRQ_SOURCE_TO_VECTOR (dev->irq); +#ifndef MODULE if (did_version++ ==0 ) -DPRINTK (1 , ( version )); +DPRINTK (1 , ("%s" , version )); +#endif /* MODULE */ /* The LANCE-specific entries in the device structure. */ dev->open = &lance_open;
@@ -1161,6 +1163,7 @@ {int err; +DPRINTK (1 , ("%s" , version )); atarilance_dev.init = atarilance_probe;if ((err =register_netdev ( &atarilance_dev ))) {if (err == -EIO ) {
drivers/net/atp.c +15 -10
@@ -30,11 +30,6 @@*/ -static const char versionA[] = -"atp.c:v1.09 8/9/2000 Donald Becker <[email protected]>\n" ; -static const char versionB[] = -" http://www.scyld.com/network/atp.html\n" ; -/* The user-configurable values. These may be modified when a driver module is loaded.*/
@@ -149,6 +144,10 @@#include "atp.h" +static char version[]__initdata = +KERN_INFO "atp.c:v1.09 8/9/2000 Donald Becker <[email protected]>\n" +KERN_INFO " http://www.scyld.com/network/atp.html\n" ; +MODULE_AUTHOR ("Donald Becker <[email protected]>" );MODULE_DESCRIPTION ("RealTek RTL8002/8012 parallel port Ethernet driver" );MODULE_PARM (max_interrupt_work,"i" );
@@ -156,6 +155,10 @@ MODULE_PARM(io, "1-" __MODULE_STRING(NUM_UNITS) "i"); MODULE_PARM(irq, "1-" __MODULE_STRING(NUM_UNITS) "i"); MODULE_PARM(xcvr, "1-" __MODULE_STRING(NUM_UNITS) "i"); +MODULE_PARM_DESC (max_interrupt_work,"ATP maximum events handled per interrupt" ); +MODULE_PARM_DESC (debug,"ATP debug level (0-7)" ); +MODULE_PARM_DESC (io,"ATP I/O base address(es)" ); +MODULE_PARM_DESC (irq,"ATP IRQ number(s)" );#define RUN_AT (x) (jiffies + (x))
@@ -243,6 +246,7 @@ {struct net_local *lp;int saved_ctrl_reg, status, i; +static int printed_version;outb (0xff , ioaddr +PAR_DATA );/* Save the original value of the Control register, in case we guessed
@@ -314,9 +318,9 @@get_node_ID (dev);#ifndef MODULE -if (net_debug) -printk (KERN_INFO "%s" KERN_INFO "%s" , versionA, versionB); -#endif +if (!printed_version++) +printk ("%s" , version); +#endif /* MODULE */ printk(KERN_NOTICE "%s: Pocket adapter found at %#3lx, IRQ %d, SAPROM " "%02X:%02X:%02X:%02X:%02X:%02X.\n", dev->name, dev->base_addr,
@@ -928,8 +932,9 @@ }static int __init atp_init_module (void ) { -if (debug)/* Emit version even if no cards detected. */ -printk (KERN_INFO "%s" KERN_INFO "%s" , versionA, versionB); +#ifdef MODULE +printk ("%s" , version); +#endif /* MODULE */ return atp_init (NULL ); }
drivers/net/bagetlance.c +12 -7
@@ -1,5 +1,5 @@/* $Id$ -* vmelance.c: Ethernet driver for VME Lance cards on Baget/MIPS +* bagetlance.c: Ethernet driver for VME Lance cards on Baget/MIPS * This code stealed and adopted from linux/drivers/net/atarilance.c * See that for author info *
@@ -12,8 +12,6 @@* related with 16BIT-only access to A24 space. */ -static char *version ="bagetlance.c: v1.1 11/10/98\n" ; -#include <linux/module.h> #include <linux/stddef.h>
@@ -36,6 +34,9 @@#include <asm/baget/baget.h> +static char version[]__initdata = +KERN_INFO "bagetlance.c: v1.1 11/10/98\n" ; +#define BAGET_LANCE_IRQ BAGET_IRQ_MASK(0xdf)/*
@@ -59,6 +60,7 @@static int lance_debug =1 ;#endif MODULE_PARM (lance_debug,"i" ); +MODULE_PARM_DESC (lance_debug,"Lance debug level (0-3)" );/* Print debug messages on probing? */ #undef LANCE_DEBUG_PROBE
@@ -182,7 +184,7 @@* prefix for Riebl cards, the 00:00 at the end is arbitrary. */ -static unsigned char OldRieblDefHwaddr[6 ] = { +static unsigned char OldRieblDefHwaddr[6 ]__initdata = {0x00 ,0x00 ,0x36 ,0x04 ,0x00 ,0x00 };
@@ -207,7 +209,7 @@PAM_CARD /* PAM card with EEPROM */ }; -static char *lance_names[] = { +static char *lance_names[]__initdata = {"Riebl-Card (without battery)" ,"Riebl-Card (with battery)" ,"PAM intern card"
@@ -357,7 +359,7 @@Don't confuse with function name -- it stays from original code */ -void *slow_memcpy (void *dst,const void *src,size_t len ) +static void *slow_memcpy (void *dst,const void *src,size_t len ) {unsigned long to = (unsigned long )dst;
@@ -709,8 +711,10 @@else *RIEBL_IVEC_ADDR =IRQ_SOURCE_TO_VECTOR (dev->irq); +#ifndef MODULE if (did_version++ ==0 ) -DPRINTK (1 , ( version )); +DPRINTK (0 , ("%s" , version )); +#endif /* MODULE */ /* The LANCE-specific entries in the device structure. */ dev->open = &lance_open;
@@ -1332,6 +1336,7 @@ {int err; +DPRINTK (0 , ("%s" , version )); bagetlance_dev.init = bagetlance_probe;if ((err =register_netdev ( &bagetlance_dev ))) {if (err == -EIO ) {
drivers/net/bmac.c +7 -7
@@ -564,7 +564,7 @@ }/* Bit-reverse one byte of an ethernet hardware address. */ -static unsigned char +static unsigned char __init bitrev (unsigned char b) {int d =0 , i;
@@ -1107,7 +1107,7 @@#define SROMAddressBits 6#define EnetAddressOffset 20 -static unsigned char +static unsigned char __init bmac_clock_out_bit (struct net_device *dev) {unsigned short data;
@@ -1126,7 +1126,7 @@return val; } -static void +static void __init bmac_clock_in_bit (struct net_device *dev,unsigned int val) {unsigned short data;
@@ -1144,7 +1144,7 @@udelay (DelayValue); } -static void +static void __init reset_and_select_srom (struct net_device *dev) {/* first reset */
@@ -1157,7 +1157,7 @@bmac_clock_in_bit (dev,0 ); } -static unsigned short +static unsigned short __init read_srom (struct net_device *dev,unsigned int addr,unsigned int addr_len) {unsigned short data, val;
@@ -1186,7 +1186,7 @@* checksums. What a pain.. */ -static int +static int __init bmac_verify_checksum (struct net_device *dev) {unsigned short data, storedCS;
@@ -1199,7 +1199,7 @@ } -static void +static void __init bmac_get_station_address (struct net_device *dev,unsigned char *ea) {int i;
drivers/net/cs89x0.c +33 -3
@@ -81,6 +81,14 @@: Make `version[]' __initdata : Uninlined the read/write reg/word functions. +Andrzej Krzysztofowicz +: Kernel 2.4.5-pre5 +: Added MOD_DESC_PARM +: Added KERN_INFO marker to version[] +: Print version: +: - always for module +: - when a device detected for built-in +*/ /* Always include 'config.h' first in case the user wants to turn on
@@ -139,7 +147,7 @@#include "cs89x0.h" static char version[]__initdata = -"cs89x0.c: v2.4.3-pre1 Russell Nelson <[email protected]>, Andrew Morton <[email protected]>\n" ; +KERN_INFO "cs89x0.c: v2.4.5-ac16 Russell Nelson <[email protected]>, Andrew Morton <[email protected]>\n" ;/* First, a few definitions that the brave might change. A zero-terminated list of I/O addresses to be probed. Some special flags..
@@ -436,8 +444,10 @@if (lp->chip_type !=CS8900 && lp->chip_revision >='C' ) lp->send_cmd =TX_NOW ; -if (net_debug && version_printed++ ==0 ) -printk (version); +#ifndef MODULE +if (version_printed++ ==0 ) +printk ("%s" , version); +#endif /* MODULE */ printk(KERN_INFO "%s: cs89%c0%s rev %c found at %#3lx ", dev->name,
@@ -1607,6 +1617,25 @@MODULE_PARM (dma ,"i" );MODULE_PARM (dmasize ,"i" );MODULE_PARM (use_dma ,"i" ); +MODULE_PARM_DESC (io,"cs89x0 I/O base address" ); +MODULE_PARM_DESC (irq,"cs89x0 IRQ number" ); +#if DEBUGGING +MODULE_PARM_DESC (debug,"cs89x0 debug level (0-6)" ); +#else +MODULE_PARM_DESC (debug,"(ignored)" ); +#endif +MODULE_PARM_DESC (media,"Set cs89x0 adapter(s) media type(s) (rj45,bnc,aui)" ); +/* No other value than -1 for duplex seem to be currently interpreted */ +MODULE_PARM_DESC (duplex,"(ignored)" ); +#if ALLOW_DMA +MODULE_PARM_DESC (dma ,"cs89x0 ISA DMA channel; ignored if use_dma=0" ); +MODULE_PARM_DESC (dmasize ,"cs89x0 DMA size in kB (16,64); ignored if use_dma=0" ); +MODULE_PARM_DESC (use_dma ,"cs89x0 using DMA (0-1)" ); +#else +MODULE_PARM_DESC (dma ,"(ignored)" ); +MODULE_PARM_DESC (dmasize ,"(ignored)" ); +MODULE_PARM_DESC (use_dma ,"(ignored)" ); +#endif MODULE_AUTHOR ("Mike Cruse, Russwll Nelson <[email protected]>, Andrew Morton <[email protected]>" );
@@ -1650,6 +1679,7 @@ debug =0 ;#endif +printk ("%s" , version); dev_cs89x0.irq = irq; dev_cs89x0.base_addr = io;
drivers/net/daynaport.c +4 -6
@@ -23,8 +23,8 @@anymore. */ /* Cabletron E6100 card support added by Tony Mantler ([email protected]) April 1999 */ -static const char *version = -"daynaport.c: v0.02 1999-05-17 Alan Cox ([email protected]) and others\n" ; +static char version[]__initdata = +KERN_INFO "daynaport.c: v0.02 1999-05-17 Alan Cox ([email protected]) and others\n" ;static int version_printed;#include <linux/module.h>
@@ -279,10 +279,8 @@return -ENOMEM ;SET_MODULE_OWNER (dev); -if (!version_printed) { -printk (KERN_INFO "%s" , version); - version_printed =1 ; - } +if (!version_printed++) +printk (version);/* * Dayna specific init
drivers/net/de4x5.c +3 -2
@@ -439,8 +439,6 @@========================================================================= */ -static const char *version ="de4x5.c:V0.546 2001/02/22 [email protected]\n" ; -#include <linux/config.h> #include <linux/module.h>
@@ -478,6 +476,9 @@#include <linux/ctype.h> #include "de4x5.h" + +static const char version[]__initdata = +KERN_INFO "de4x5.c:V0.546 2001/02/22 [email protected]\n" ;#define c_char const char#define TWIDDLE (a) (u_short)le16_to_cpu(get_unaligned((u_short *)(a)))
drivers/net/declance.c +2 -2
@@ -38,8 +38,8 @@#undef DEBUG_DRIVER -static char *version = -"declance.c: v0.008 by Linux Mips DECstation task force\n" ; +static char version[]__initdata = +KERN_INFO "declance.c: v0.008 by Linux Mips DECstation task force\n" ;static char *lancestr ="LANCE" ;
drivers/net/dgrs.c +3 -0
@@ -1441,6 +1441,9 @@MODULE_PARM (iptrap,"1-4i" );MODULE_PARM (ipxnet,"i" );MODULE_PARM (nicmode,"i" ); +MODULE_PARM_DESC (debug,"Digi RightSwitch enable debugging (0-1)" ); +MODULE_PARM_DESC (dma,"Digi RightSwitch enable BM DMA (0-1)" ); +MODULE_PARM_DESC (nicmode,"Digi RightSwitch operating mode (1: switch, 2: multi-NIC)" );static int __init dgrs_init_module (void ) {
drivers/net/dgrs_firmware.c +4 -4
@@ -1,6 +1,6 @@ -static int dgrs_firmnum =550 ; -static char dgrs_firmver[] ="$Version$" ; -static char dgrs_firmdate[] ="11/16/96 03:45:15" ; +static int dgrs_firmnum__initdata =550 ; +static char dgrs_firmver[]__initdata ="$Version$" ; +static char dgrs_firmdate[]__initdata ="11/16/96 03:45:15" ;static unsigned char dgrs_code[]__initdata = {213 ,5 ,192 ,8 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,
@@ -9963,4 +9963,4 @@109 ,46 ,99 ,0 ,114 ,99 ,0 ,0 ,48 ,120 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 } ; -static int dgrs_ncode =119520 ; +static int dgrs_ncode__initdata =119520 ;
drivers/net/dmfe.c +17 -12
@@ -261,20 +261,20 @@static char version[]__devinitdata =KERN_INFO "Davicom DM9xxx net driver, version " DMFE_VERSION "\n" ; -static int dmfe_debug =0 ; +static int dmfe_debug;static unsigned char dmfe_media_mode =DMFE_AUTO ; -static u32 dmfe_cr6_user_set =0 ; +static u32 dmfe_cr6_user_set;/* For module input parameter */ -static int debug =0 ; -static u32 cr6set =0 ; +static int debug; +static u32 cr6set;static unsigned char mode =8 ;static u8 chkmode =1 ; -static u8 HPNA_mode =0 ;/* Default: Low Power/High Speed */ -static u8 HPNA_rx_cmd =0 ;/* Default: Disable Rx remote command */ -static u8 HPNA_tx_cmd =0 ;/* Default: Don't issue remote command */ -static u8 HPNA_NoiseFloor =0 ;/* Default: HPNA NoiseFloor */ -static u8 SF_mode =0 ;/* Special Function: 1:VLAN, 2:RX Flow Control +static u8 HPNA_mode;/* Default: Low Power/High Speed */ +static u8 HPNA_rx_cmd;/* Default: Disable Rx remote command */ +static u8 HPNA_tx_cmd;/* Default: Don't issue remote command */ +static u8 HPNA_NoiseFloor;/* Default: HPNA NoiseFloor */ +static u8 SF_mode;/* Special Function: 1:VLAN, 2:RX Flow Control 4: TX pause packet */ unsigned long CrcTable[256 ] = {
@@ -395,7 +395,7 @@u32 dev_rev, pci_pmr;if (!printed_version++) -printk (version); +printk ("%s" , version);DMFE_DBUG (0 ,"dmfe_init_one()" ,0 );
@@ -2014,7 +2014,10 @@MODULE_PARM (HPNA_tx_cmd,"i" );MODULE_PARM (HPNA_NoiseFloor,"i" );MODULE_PARM (SF_mode,"i" ); - +MODULE_PARM_DESC (debug,"Davicom DM9xxx enable debugging (0-1)" ); +MODULE_PARM_DESC (mode,"Davicom DM9xxx: Bit 0: 10/100Mbps, bit 2: duplex, bit 8: HomePNA" ); +MODULE_PARM_DESC (SF_mode,"Davicom DM9xxx special function (bit 0: VLAN, bit 1 Flow Control, bit 2: TX pause packet)" ); +/* Description: * when user used insmod to add module, system invoked init_module() * to initilize and register.
@@ -2024,8 +2027,10 @@ {int rc; -printk (version); +#ifdef MODULE +printk ("s" , version); printed_version =1 ; +#endif /* MODULE */ DMFE_DBUG (0 ,"init_module() " , debug);
drivers/net/eql.c +2 -3
@@ -16,9 +16,6 @@* Phone: 1-703-847-0040 ext 103 */ -static const char *version = -"Equalizer1996: $Revision: 1.2.1 $ $Date: 1996/09/22 13:52:00 $ Simon Janes ([email protected])\n" ; -/* * Sources: * skeleton.c by Donald Becker.
@@ -124,6 +121,8 @@#include <asm/uaccess.h> +static char version[]__initdata = +KERN_INFO "Equalizer1996: $Revision: 1.2.1 $ $Date: 1996/09/22 13:52:00 $ Simon Janes ([email protected])\n" ;#ifndef EQL_DEBUG /* #undef EQL_DEBUG -* print nothing at all, not even a boot-banner */
drivers/net/lne390.c +3 -3
@@ -31,9 +31,6 @@- no need to check if dev == NULL in lne390_probe1 */ -static const char *version = -"lne390.c: Driver revision v0.99.1, 01/09/2000\n" ; -#include <linux/module.h> #include <linux/kernel.h> #include <linux/sched.h>
@@ -48,6 +45,9 @@#include <linux/netdevice.h> #include <linux/etherdevice.h> #include "8390.h" + +static const char version[]__initdata = +"lne390.c: Driver revision v0.99.1, 01/09/2000\n" ;int lne390_probe (struct net_device *dev);static int lne390_probe1 (struct net_device *dev,int ioaddr);
drivers/net/mac89x0.c +3 -3
@@ -55,9 +55,6 @@use save_flags/restore_flags in net_get_stat, not just cli/sti */ -static char *version = -"cs89x0.c:v1.02 11/26/96 Russell Nelson <[email protected]>\n" ; -/* ======================= configure the driver here ======================= */ /* use 0 for production, 1 for verification, >2 for debug */
@@ -106,6 +103,9 @@#include <linux/etherdevice.h> #include <linux/skbuff.h> #include "cs89x0.h" + +static char version[] __initrdata = +KERN_INFO "cs89x0.c:v1.02 11/26/96 Russell Nelson <[email protected]>\n" ;static unsigned int net_debug =NET_DEBUG ;
drivers/net/ne.c +1 -1
@@ -263,7 +263,7 @@ } } -if (ei_debug && version_printed++ ==0 ) +if (version_printed++ ==0 )printk (version);printk (KERN_INFO "NE*000 ethercard probe at %#3x:" , ioaddr);
drivers/net/pcmcia/aironet4500_cs.c +3 -8
@@ -10,10 +10,6 @@* */ -static const char *awc_version = -"aironet4500_cs.c v0.1 1/1/99 Elmer Joandi, [email protected].\n" ; - -#include <linux/module.h> #include <linux/init.h> #include <linux/kernel.h>
@@ -50,6 +46,8 @@#include "../aironet4500.h" +static const char awc_version[] = +KERN_INFO "aironet4500_cs.c v0.1 1/1/99 Elmer Joandi, [email protected].\n" ;static u_int irq_mask =0x5eF8 ;static int awc_ports[] = {0x140 ,0x100 ,0xc0 ,0x80 };
@@ -65,8 +63,6 @@static int pc_debug =PCMCIA_DEBUG ;MODULE_PARM (pc_debug,"i" ); #define PC_DEBUG(n, args...) if (pc_debug>(n)) printk(KERN_DEBUG args) -static char *version = -"aironet4500_cs.c v0.1 1/1/99 Elmer Joandi, [email protected].\n" ;#else #define PC_DEBUG(n, args...)#endif
@@ -615,8 +611,7 @@servinfo_t serv;/* Always emit the version, before any failure. */ -printk (KERN_INFO "%s" , awc_version); -PC_DEBUG (0 ,"%s\n" , version); +printk (awc_version);CardServices (GetCardServicesInfo, &serv);if (serv.Revision !=CS_RELEASE_CODE ) { printk(KERN_NOTICE "awc_cs: Card Services release "
drivers/net/pcnet32.c +19 -24
86 lines not on this page · raw message
drivers/net/sb1000.c +6 -4
@@ -32,8 +32,6 @@Merged with 2.2 - Alan Cox */ -static char version[] ="sb1000.c:v1.1.2 6/01/98 ([email protected])\n" ; -#include <linux/module.h> #include <linux/version.h>
@@ -50,6 +48,7 @@#include <linux/if_arp.h> #include <linux/skbuff.h> #include <linux/delay.h> /* for udelay() */ +#include <linux/init.h> #include <asm/processor.h> #include <asm/bitops.h>
@@ -62,6 +61,9 @@#include <linux/if_cablemodem.h> +static char version[]__initdata = +KERN_INFO "sb1000.c:v1.1.2 6/01/98 ([email protected])\n" ; +#ifdef SB1000_DEBUG int sb1000_debug =SB1000_DEBUG ;#else
@@ -146,7 +148,7 @@MODULE_DEVICE_TABLE (isapnp, id_table);/* probe for SB1000 using Plug-n-Play mechanism */ -int +int __init sb1000_probe (struct net_device *dev) {
@@ -228,7 +230,7 @@memset (dev->priv,0 ,sizeof (struct sb1000_private ));if (sb1000_debug >0 ) -printk (KERN_NOTICE "%s" , version); +printk (version);/* The SB1000-specific entries in the device structure. */ dev->open = sb1000_open;
drivers/net/smc-ultra.c +10 -10
@@ -79,9 +79,9 @@int ultra_probe (struct net_device *dev);static int ultra_probe1 (struct net_device *dev,int ioaddr); -#if definedCONFIG_ISAPNP || definedCONFIG_ISAPNP_MODULE +#if defined(CONFIG_ISAPNP ) || (defined(CONFIG_ISAPNP_MODULE ) && defined(MODULE ))static int ultra_probe_isapnp (struct net_device *dev); -#endif +#endif /* CONFIG_ISAPNP || CONFIG_ISAPNP_MODULE */ static int ultra_open (struct net_device *dev);static void ultra_reset_8390 (struct net_device *dev);
@@ -99,7 +99,7 @@ const unsigned char *buf, const int start_page);static int ultra_close_card (struct net_device *dev); -#if defined CONFIG_ISAPNP || defined CONFIG_ISAPNP_MODULE +#if defined(CONFIG_ISAPNP) || (defined(CONFIG_ISAPNP_MODULE) && defined(MODULE)) static struct isapnp_device_id ultra_device_ids[] __initdata = { { ISAPNP_VENDOR('S','M','C'), ISAPNP_FUNCTION(0x8416), ISAPNP_VENDOR('S','M','C'), ISAPNP_FUNCTION(0x8416),
@@ -108,7 +108,7 @@ };MODULE_DEVICE_TABLE (isapnp, ultra_device_ids); -#endif +#endif /* CONFIG_ISAPNP || CONFIG_ISAPNP_MODULE */ #define START_PG 0x00/* First page of TX buffer */
@@ -139,13 +139,13 @@else if (base_addr !=0 )/* Don't probe at all. */ return -ENXIO ; -#if definedCONFIG_ISAPNP || definedCONFIG_ISAPNP_MODULE +#if defined(CONFIG_ISAPNP ) || (defined(CONFIG_ISAPNP_MODULE ) && defined(MODULE ))/* Look for any installed ISAPnP cards */ if (isapnp_present () && (ultra_probe_isapnp (dev) ==0 ))return 0 ;printk (KERN_NOTICE "smc-ultra.c: No ISAPnP cards found, trying standard ones...\n" ); -#endif +#endif /* CONFIG_ISAPNP || CONFIG_ISAPNP_MODULE */ for (i =0 ; ultra_portlist[i]; i++)if (ultra_probe1 (dev, ultra_portlist[i]) ==0 )
@@ -278,7 +278,7 @@return retval; } -#if definedCONFIG_ISAPNP || definedCONFIG_ISAPNP_MODULE +#if defined(CONFIG_ISAPNP ) || (defined(CONFIG_ISAPNP_MODULE ) && defined(MODULE ))static int __init ultra_probe_isapnp (struct net_device *dev) {int i;
@@ -318,7 +318,7 @@ return -ENODEV; } -#endif +#endif /* CONFIG_ISAPNP || CONFIG_ISAPNP_MODULE */ static int ultra_open (struct net_device *dev)
@@ -541,11 +541,11 @@/* NB: ultra_close_card() does free_irq */ int ioaddr = dev->base_addr -ULTRA_NIC_OFFSET ; -#if definedCONFIG_ISAPNP || definedCONFIG_ISAPNP_MODULE +#if defined(CONFIG_ISAPNP ) || defined(CONFIG_ISAPNP_MODULE )struct pci_dev *idev = (struct pci_dev *)ei_status.priv;if (idev) idev->deactivate (idev); -#endif +#endif /* CONFIG_ISAPNP || CONFIG_ISAPNP_MODULE */ unregister_netdev (dev);release_region (ioaddr,ULTRA_IO_EXTENT );
drivers/net/smc-ultra32.c +7 -1
@@ -106,6 +106,10 @@ {int ioaddr; +#ifdef MODULE +printk (version); +#endif /* MODULE */ +if (!EISA_bus)return -ENODEV ;SET_MODULE_OWNER (dev);
@@ -163,8 +167,10 @@ goto out; } -if (ei_debug && version_printed++ ==0 ) +#ifndef MODULE +if (version_printed++ ==0 )printk (version); +#endif /* MODULE */ model_name ="SMC Ultra32" ;
drivers/net/tlan.c +8 -8
@@ -241,21 +241,21 @@ };static struct pci_device_id tlan_pci_tbl[]__devinitdata = { - {PCI_VENDOR_ID_COMPAQ ,PCI_DEVICE_ID_NETELLIGENT_10 , + {PCI_VENDOR_ID_COMPAQ ,PCI_DEVICE_ID_COMPAQ_NETEL10 ,PCI_ANY_ID ,PCI_ANY_ID ,0 ,0 ,0 }, - {PCI_VENDOR_ID_COMPAQ ,PCI_DEVICE_ID_NETELLIGENT_10_100 , + {PCI_VENDOR_ID_COMPAQ ,PCI_DEVICE_ID_COMPAQ_NETEL100 ,PCI_ANY_ID ,PCI_ANY_ID ,0 ,0 ,1 }, - {PCI_VENDOR_ID_COMPAQ ,PCI_DEVICE_ID_NETFLEX_3P_INTEGRATED , + {PCI_VENDOR_ID_COMPAQ ,PCI_DEVICE_ID_COMPAQ_NETFLEX3I ,PCI_ANY_ID ,PCI_ANY_ID ,0 ,0 ,2 }, - {PCI_VENDOR_ID_COMPAQ ,PCI_DEVICE_ID_NETFLEX_3P , + {PCI_VENDOR_ID_COMPAQ ,PCI_DEVICE_ID_COMPAQ_THUNDER ,PCI_ANY_ID ,PCI_ANY_ID ,0 ,0 ,3 }, - {PCI_VENDOR_ID_COMPAQ ,PCI_DEVICE_ID_NETFLEX_3P_BNC , + {PCI_VENDOR_ID_COMPAQ ,PCI_DEVICE_ID_COMPAQ_NETFLEX3B ,PCI_ANY_ID ,PCI_ANY_ID ,0 ,0 ,4 }, - {PCI_VENDOR_ID_COMPAQ ,PCI_DEVICE_ID_NETELLIGENT_10_100_PROLIANT , + {PCI_VENDOR_ID_COMPAQ ,PCI_DEVICE_ID_COMPAQ_NETEL100PI ,PCI_ANY_ID ,PCI_ANY_ID ,0 ,0 ,5 }, - {PCI_VENDOR_ID_COMPAQ ,PCI_DEVICE_ID_NETELLIGENT_10_100_DUAL , + {PCI_VENDOR_ID_COMPAQ ,PCI_DEVICE_ID_COMPAQ_NETEL100D ,PCI_ANY_ID ,PCI_ANY_ID ,0 ,0 ,6 }, - {PCI_VENDOR_ID_COMPAQ ,PCI_DEVICE_ID_DESKPRO_4000_5233MMX , + {PCI_VENDOR_ID_COMPAQ ,PCI_DEVICE_ID_COMPAQ_NETEL100I ,PCI_ANY_ID ,PCI_ANY_ID ,0 ,0 ,7 }, {PCI_VENDOR_ID_OLICOM ,PCI_DEVICE_ID_OLICOM_OC2183 ,PCI_ANY_ID ,PCI_ANY_ID ,0 ,0 ,8 },
drivers/net/tlan.h +0 -17
@@ -61,25 +61,8 @@* ****************************************************************/ -#define PCI_DEVICE_ID_NETELLIGENT_10 0xAE34 -#define PCI_DEVICE_ID_NETELLIGENT_10_100 0xAE32 -#define PCI_DEVICE_ID_NETFLEX_3P_INTEGRATED 0xAE35 -#define PCI_DEVICE_ID_NETFLEX_3P 0xF130 -#define PCI_DEVICE_ID_NETFLEX_3P_BNC 0xF150 -#define PCI_DEVICE_ID_NETELLIGENT_10_100_PROLIANT 0xAE43 -#define PCI_DEVICE_ID_NETELLIGENT_10_100_DUAL 0xAE40 -#define PCI_DEVICE_ID_DESKPRO_4000_5233MMX 0xB011#define PCI_DEVICE_ID_NETELLIGENT_10_T2 0xB012#define PCI_DEVICE_ID_NETELLIGENT_10_100_WS_5100 0xB030 -#ifndef PCI_DEVICE_ID_OLICOM_OC2183 -#define PCI_DEVICE_ID_OLICOM_OC2183 0x0013 -#endif -#ifndef PCI_DEVICE_ID_OLICOM_OC2325 -#define PCI_DEVICE_ID_OLICOM_OC2325 0x0012 -#endif -#ifndef PCI_DEVICE_ID_OLICOM_OC2326 -#define PCI_DEVICE_ID_OLICOM_OC2326 0x0014 -#endif typedef struct tlan_adapter_entry { u16 vendorId;
Signature · 4 lines
======================================================================= Andrzej M. Krzysztofowicz [email protected] phone (48)(58) 347 14 61 Faculty of Applied Phys. & Math., Technical University of Gdansk
These two patches look generally ok. However, I'm going to hold them in my mailbox for a little while, until two 8139 bug fixes and a tulip bug fix are sent to Linus/Alan.
Signature · 3 lines
Jeff Garzik | "Are you the police?" Building 1024 | "No, ma'am. We're musicians." MandrakeSoft |
Andrzej,
Thanks for your impressive clean-up patch. I have a couple of comments regarding your clean-up of the dmfe.c driver.
drivers/net/dmfe.c line 401
Quoted 9 lines · Andrzej Krzysztofowicz
drivers/net/dmfe.c +1
-1@@ -395,7 +395,7 @@u32 dev_rev, pci_pmr;if (!printed_version++) -printk (version); +printk ("%s" , version);DMFE_DBUG (0 ,"dmfe_init_one()" ,0 );
Could you please explain the purpose of this change? To me it looks less efficient in both performance and memory usage.
drivers/net/dmfe.c line 2036
Quoted 12 lines
drivers/net/dmfe.c +3
-1@@ -2024,8 +2027,10 @@ {int rc; -printk (version); +#ifdef MODULE +printk ("s" , version); printed_version =1 ; +#endif /* MODULE */ DMFE_DBUG (0 ,"init_module() " , debug);
Whoups... And why did you add the ifdef, btw?
/Tobias
Quoted 2 lines
Thanks for your impressive clean-up patch. I have a couple of comments regarding your clean-up of the
dmfe.cdriver.
Thanks for your response.
Quoted 9 lines · Andrzej Krzysztofowicz
Quoted 8 lines
drivers/net/dmfe.c +1
-1@@ -395,7 +395,7 @@u32 dev_rev, pci_pmr;if (!printed_version++) -printk (version); +printk ("%s" , version);
Quoted 5 lines
drivers/net/dmfe.c line 401
Quoted 2 lines
drivers/net/dmfe.c +0
-0DMFE_DBUG (0 ,"dmfe_init_one()" ,0 );Could you please explain the purpose of this change? To me it looks less efficient in both performance and memory usage.
Basically I also preferred to avoid the extra string here. But Alan suggests it may cause problems while somebody wants to add a literal % to the version string. Moreover, IMHO it is better to have a standard here, i.e. either all drivers contain the format or none does.
If you still complain, I'll drop this change.
Quoted 10 lines
Quoted 10 lines
drivers/net/dmfe.c +3
-1@@ -2024,8 +2027,10 @@ {int rc; -printk (version); +#ifdef MODULE +printk ("s" , version); printed_version =1 ; +#endif /* MODULE */
Quoted 4 lines
drivers/net/dmfe.c line 2036
Quoted 2 lines
drivers/net/dmfe.c +0
-0DMFE_DBUG (0 ,"init_module() " , debug);Whoups... And why did you add the ifdef, btw?
AFAIK module_init becomes __initcall while compiled into kernel. So it is called (IMO) always and the previous "version" printing (around line 400) would never be executed (printed_version == 1).
And we do not want to print version for built-in drivers which do not detect hardware, do we ?
Andrzej
Signature · 4 lines
======================================================================= Andrzej M. Krzysztofowicz [email protected] tel. (0-58) 347 14 61 Wydz.Fizyki Technicznej i Matematyki Stosowanej Politechniki Gdanskiej
Quoted 5 lines
Review
Quoted 3 lines
(quoted diff) +1
-1- printk(version); + printk("%s", version);Could you please explain the purpose of this change? To me it looks less efficient in both performance and memory usage.
its called 'programming in C not taking ugly shortcuts'
Quoted 1 line
Quoted 8 lines · Alan Cox
Quoted 5 lines
Review
Quoted 3 lines
(quoted diff) +1
-1- printk(version); + printk("%s", version);Could you please explain the purpose of this change? To me it looks less efficient in both performance and memory usage.
its called 'programming in C not taking ugly shortcuts'
Quoted 1 line
Fine. But:
drivers/net/dmfe.c line 2033
Quoted 5 lines · Andrzej Krzysztofowicz
drivers/net/dmfe.c +3
-1-printk (version); +#ifdef MODULE +printk ("s" , version); printed_version =1 ; +#endif /* MODULE */
...is playing it just a little too safe, wouldn't you say?
I assume that MODULE ifdef is related to version being initdata otherwise?
Signature · 1 line
/Jonathan Lundell.
On Thu, May 24, 2001 at 09:00:20AM -0700, Jonathan Lundell wrote:
[...]
Quoted 11 lines
Fine. But:
drivers/net/dmfe.c line 2033
Quoted 5 lines · Andrzej Krzysztofowicz
drivers/net/dmfe.c +3
-1-printk (version); +#ifdef MODULE +printk ("s" , version); printed_version =1 ; +#endif /* MODULE */ ...is playing it just a little too safe, wouldn't you say?
With the above snippet of code being remailed a couple of times somebody surely noticed before me that the printk should have "%s" as format string, not "s". But then again somebody might not so there you are.
Signature · 4 lines
Rasmus([email protected]) "A statesman... is a dead politician. Lord knows, we need more statesmen." -- Bloom County
Quoted 9 lines · Tobias Ringstrom
drivers/net/dmfe.c line 400
Quoted 6 lines
drivers/net/dmfe.c +1
-1if (!printed_version++) -printk (version); +printk ("%s" , version);DMFE_DBUG (0 ,"dmfe_init_one()" ,0 );Could you please explain the purpose of this change? To me it looks less efficient in both performance and memory usage.
Potentially, version might include stuff which is interpreted by printk if not quoted - the above fixes this. Paranoia always helps ;-)
Sincerely,
Lars Marowsky-Brée <[email protected]>
Signature · 1 line
Perfection is our goal, excellence will be tolerated. -- J. Yahl
Hi Andrzej,
Some hopefully useful/constructive feedback:
drivers/net/8139too.c line 163
Quoted 8 lines · Andrzej Krzysztofowicz
drivers/net/8139too.c +7
-0+static char version[] +#ifdef MODULE +__initdata +#else +__devinitdata +#endif + = KERN_INFO RTL8139_DRIVER_NAME "\n";
This doesn't look right. If defined(MODULE) then __initdata is a no-op (see linux/init.h). You probably just want:
static char version[] __devinitdata = KERN_INFO ...... ;
assuming the drivers you are hacking are CONFIG_HOTPLUG capable.
Generally we should aim to reduce the number of #ifdef MODULE, rather than add more. If the driver load paths look the same regardless of whether built in or modular then driver maintenance is easier. (Ok, removing existing #ifdef MODULE is a 2.5 thing, but we should avoid adding more in 2.4.x)
We can probably do something better with cases like these too:
drivers/net/am79c961a.c line 655
Quoted 3 lines
drivers/net/am79c961a.c +3
-0+#ifdef MODULE +am79c961_banner (); +#endif /* MODULE */
I think the days of kitchen sink kernels with 20 drivers all compiled in are over, and so we should just do the version printk/banner unconditionally. This way, if you have unused drivers built into your image, at least you will have a way of knowing it. (People who don't use modules are clearly building their own kernels and don't want any unused drivers accidentally glued into their image).
Other options for dealing with printing driver version info include:
(1) to replace the printk(...) with e.g. module_banner(...) and have the conditional stuff hidden in how module_banner() is defined in module.h
(2) have sys_create_module or sys_init_module print out the MODULE_DESCRIPTION and (optionally?) MODULE_AUTHOR for all modules thus removing code replication from each module. (This assumes that the modinfo section is, and will remain with modules in the future).
I personally like the sounds of (2) a lot. Of course we would have to make sure all modules had a useful MODULE_DESCRIPTION.
I'd avoid making patches like this:
Review
Quoted 2 lines
(quoted diff) +1
-1-#endif +#endif /* CONFIG_ISAPNP || CONFIG_ISAPNP_MODULE */
...they fall into the category of "patching for the sake of patching" (which is not good in 2.4.x) and you end up inflicting your style on the original author(s) who may not like it (especially if the corresponding #ifdef is only one line up...). One could argue that the printk(version) vs. printk("%s\n", version) changes fall into the same category...
Also might want to avoid changes like this:
drivers/net/ne.c line 267
Quoted 3 lines
drivers/net/ne.c +1
-1-if (ei_debug && version_printed++ ==0 ) +if (version_printed++ ==0 )printk (version);
that are actually changing the original author's intention. In this case (ne.c) the compiled output remains unchanged, and I'm okay with the change in intention since we now have the "quiet" boot argument anyway.
Also, if you are changing version strings like this:
static char version[] __initdata =
- "at1700.c:v1.15 4/7/98 Donald\ Becker([email protected])\n";
+ KERN_INFO "at1700.c:v1.15 4/7/98 Donald Becker ([email protected])\n";
to add KERN_xxx tags, then you could also:
s/[email protected]/[email protected]/
and I'm sure Donald would thank you for it.
Finally, breaking your patch into logical chunks / separate e-mails would also ensure that your work has a better chance of getting used - e.g.
[PATCH] add KERN_INFO to version tags of net drivers [PATCH] missing __[dev]initdata in net drivers [PATCH] add MODULE_PARM_DESC to various net drivers
...and so on. If somebody doesn't like one part, then at least the rest doesn't get tossed out as well.
Ok, I'll shut up now. Hope you find this useful,
Paul.
"Paul Gortmaker wrote:"
Quoted 4 lines
Some hopefully useful/constructive feedback:
Quoted 1 line · Andrzej Krzysztofowicz
Quoted 10 lines
drivers/net/8139too.c line 163
Quoted 7 lines
drivers/net/8139too.c +7
-0+static char version[] +#ifdef MODULE +__initdata +#else +__devinitdata +#endif + = KERN_INFO RTL8139_DRIVER_NAME "\n";This doesn't look right. If defined(MODULE) then
__initdatais a no-op (seelinux/init.h). You probably just want:
Currently it is no-op.
Hopefully it would change some day. I've seen a patch pointer somewhere.
Maybe you are right that potential only remove of one string from loaded module code is not worth the change.
Quoted 5 lines
Generally we should aim to reduce the number of #ifdef MODULE, rather than add more. If the driver load paths look the same regardless of whether built in or modular then driver maintenance is easier. (Ok, removing existing #ifdef MODULE is a 2.5 thing, but we should avoid adding more in 2.4.x)
IMO there's no difference whoether there's 3 or 4 of them. There's no point in adding an new #ifdef only if there's none currently (IMHO).
Quoted 8 lines
We can probably do something better with cases like these too:
drivers/net/am79c961a.c line 655
Quoted 3 lines
drivers/net/am79c961a.c +3
-0+#ifdef MODULE +am79c961_banner (); +#endif /* MODULE */ I think the days of kitchen sink kernels with 20 drivers all compiled in are over, and so we should just do the version printk/banner unconditionally.
Jeff, your opinion here ?
Quoted 15 lines
This way, if you have unused drivers built into your image, at least you will have a way of knowing it. (People who don't use modules are clearly building their own kernels and don't want any unused drivers accidentally glued into their image).
Other options for dealing with printing driver version info include:
(1) to replace the printk(...) with e.g.
module_banner(...)and have the conditional stuff hidden in howmodule_banner()is defined inmodule.h(2) have
sys_create_moduleorsys_init_moduleprint out theMODULE_DESCRIPTIONand (optionally?)MODULE_AUTHORfor all modules thus removing code replication from each module. (This assumes that the modinfo section is, and will remain with modules in the future).
Quoted 7 lines
I personally like the sounds of (2) a lot. Of course we would have to make sure all modules had a useful
MODULE_DESCRIPTION.I'd avoid making patches like this:
Review
Quoted 2 lines
(quoted diff) +1
-1-#endif +#endif /* CONFIG_ISAPNP || CONFIG_ISAPNP_MODULE */
OK.
Quoted 11 lines
...they fall into the category of "patching for the sake of patching" (which is not good in 2.4.x) and you end up inflicting your style on the original author(s) who may not like it (especially if the corresponding #ifdef is only one line up...). One could argue that the printk(version) vs.
printk("%s\n", version)changes fall into the same category...Also might want to avoid changes like this:
Quoted 3 lines
drivers/net/ne.c +1
-1-if (ei_debug && version_printed++ ==0 ) +if (version_printed++ ==0 )printk (version);
It was intentional. I follor Jeff's suggestion of printing the version banner rules, i.e.
- print version unconditionally for modules
- print version only if hardware has been detected for built-in.
Having different behaviour of different modules here is very bad IMO.
Quoted 2 lines
that are actually changing the original author's intention. In this case (
ne.c) the compiled output remains unchanged, and I'm okay with the
Unfinished.
Quoted 10 lines
change in intention since we now have the "quiet" boot argument anyway.
Also, if you are changing version strings like this:
static char version[]
__initdata=(quoted diff) +1
-1- "at1700.c:v1.15 4/7/98 Donald\ Becker([email protected])\n"; + KERN_INFO "at1700.c:v1.15 4/7/98 Donald Becker ([email protected])\n";to add
KERN_xxxtags, then you could also:
s/[email protected]/[email protected]/
OK. Thanks for the suggestion.
Quoted 4 lines
and I'm sure Donald would thank you for it.
Finally, breaking your patch into logical chunks / separate e-mails would also ensure that your work has a better chance of getting used - e.g.
Final version will be splitted out with Cc: to the appropriate maintainers.
Quoted 3 lines
[PATCH] add
KERN_INFOto version tags of net drivers [PATCH] missing __[dev]initdata in net drivers [PATCH] addMODULE_PARM_DESCto various net drivers
IMO, no chance. They are too close to be separated in many places. I would rather find out which of the changes are bad/unacceptable.
Thanks for your comments.
Andrzej
Signature · 4 lines
======================================================================= Andrzej M. Krzysztofowicz [email protected] phone (48)(58) 347 14 61 Faculty of Applied Phys. & Math., Technical University of Gdansk