--- 3c59x.c 2002-12-30 23:51:46.000000000 -0600 +++ 3c59x-hacked.c 2002-12-30 23:51:24.000000000 -0600 @@ -103,7 +103,6 @@ #include #include #else -#include #include #endif @@ -646,7 +645,6 @@ static struct net_device *root_vortex_dev = NULL; -#ifdef MODULE #ifdef CARDBUS #include @@ -737,34 +735,12 @@ return 0; #if defined(NO_PCI) return 0; -#endif -#endif +#endif /* MO_PCI */ +#endif /* ! USE_MEM_OPS */ return pci_drv_register(&vortex_drv_id, NULL); -#endif -} - -#else -int tc59x_probe(struct net_device *dev) -{ - int retval = -ENODEV; - - /* Allow an EISA-only driver. */ -#if ! defined(NO_PCI) - if (pci_drv_register(&vortex_drv_id, dev) >= 0) { - retval = 0; - dev = 0; - } -#endif -#ifndef USE_MEM_OPS - if (eisa_scan(dev) >= 0) - retval = 0; -#endif - if (retval >= 0) - printk(KERN_INFO "%s" KERN_INFO "%s", versionA, versionB); - return retval; +#endif /* CARDBUS */ } -#endif /* not MODULE */ #if ! defined(CARDBUS) && ! defined(USE_MEM_OPS) static int eisa_scan(struct net_device *dev) @@ -842,7 +818,7 @@ pci_write_config_byte(pdev, PCI_LATENCY_TIMER, new_latency); } } -#endif +#endif /* ! NO_PCI */ printk(KERN_INFO "%s: 3Com %s at 0x%lx, ", dev->name, pci_tbl[chip_idx].name, ioaddr); @@ -950,7 +926,7 @@ printk(KERN_INFO "%s: CardBus functions mapped %8.8x->%p.\n", dev->name, fn_st_addr, vp->cb_fn_base); } -#endif +#endif /* ! NO_PCI */ /* Extract our information from the EEPROM data. */ vp->info1 = eeprom[13]; @@ -1539,7 +1515,7 @@ le32_to_cpu(vp->tx_ring[i].status)); } } -#endif +#endif /* VERSION_CODE stuff */ outw(TxReset, ioaddr + EL3_CMD); for (j = 200; j >= 0 ; j--) if ( ! (inw(ioaddr + EL3_STATUS) & CmdInProgress)) @@ -2524,7 +2500,7 @@ /* Change the power state to D3; RxEnable doesn't take effect. */ pci_write_config_word(vp->pci_dev, 0xe0, 0x8103); } -#endif +#endif /* ! NO_PCI */ static int pwr_event(void *dev_instance, int event) { @@ -2593,7 +2569,6 @@ } -#ifdef MODULE void cleanup_module(void) { struct net_device *next_dev; @@ -2625,8 +2600,11 @@ } } -#endif /* MODULE */ - +/* These are needed to get the driver to load into the kernel + * when it's NOT compiled as a module */ +module_init(init_module); +module_exit(cleanup_module); + /* * Local variables: * compile-command: "make KERNVER=`uname -r` 3c59x.o"