[patch] NE2000

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi 

There are three drivers for n2k cards. One is MCA only, one is PCI only,
and the then the third one (ne.c) is both ISA and PCI. I think the ISA
driver should be ISA only, as is described in Documentation and in config 
help. So I removed PCI code from ne.c to have ISA only driver. It
gets a bit smaller, although I am not sure whether more code can be
removed.

Pavel Rabel

*** ne.c.old	Sat Oct 28 16:39:18 2000
--- ne.c.new	Sat Oct 28 19:21:38 2000
***************
*** 16,21 ****
--- 16,24 ----
      boards.  Currently it supports the NE1000, NE2000, many clones,
      and some Cabletron products.
  
+     This driver supports ISA cards only. PCI cards have their own 
+     driver, ne2k-pci.c. MCA cards have their own driver, ne2.c.
+ 
      Changelog:
  
      Paul Gortmaker	: use ENISR_RDC to monitor Tx PIO uploads, made
***************
*** 29,35 ****
      occur after memory is allocated for dev->priv. Deallocated memory
      last in cleanup_modue()
      Richard Guenther    : Added support for ISAPnP cards
!     
  */
  
  /* Routines for the NatSemi-based designs (NE[12]000). */
--- 32,38 ----
      occur after memory is allocated for dev->priv. Deallocated memory
      last in cleanup_modue()
      Richard Guenther    : Added support for ISAPnP cards
!     Pavel Rabel         : Deleted PCI support.
  */
  
  /* Routines for the NatSemi-based designs (NE[12]000). */
***************
*** 75,97 ****
  };
  #endif
  
- #ifdef CONFIG_PCI
- /* Ack! People are making PCI ne2000 clones! Oh the horror, the horror... */
- static struct { unsigned short vendor, dev_id; char *name; }
- pci_clone_list[] __initdata = {
- 	{PCI_VENDOR_ID_REALTEK,		PCI_DEVICE_ID_REALTEK_8029,		"Realtek 8029" },
- 	{PCI_VENDOR_ID_WINBOND2,	PCI_DEVICE_ID_WINBOND2_89C940,		"Winbond 89C940" },
- 	{PCI_VENDOR_ID_COMPEX,		PCI_DEVICE_ID_COMPEX_RL2000,		"Compex ReadyLink 2000" },
- 	{PCI_VENDOR_ID_KTI,		PCI_DEVICE_ID_KTI_ET32P2,		"KTI ET32P2" },
- 	{PCI_VENDOR_ID_NETVIN,		PCI_DEVICE_ID_NETVIN_NV5000SC,		"NetVin NV5000" },
- 	{PCI_VENDOR_ID_VIA,		PCI_DEVICE_ID_VIA_82C926,		"VIA 82C926 Amazon" },
- 	{PCI_VENDOR_ID_SURECOM,		PCI_DEVICE_ID_SURECOM_NE34,		"SureCom NE34"},
- 	{0,}
- };
- 
- static int probe_pci = 1;
- #endif
- 
  static struct { unsigned short vendor, function; char *name; }
  isapnp_clone_list[] __initdata = {
  	{ISAPNP_VENDOR('E','D','I'), ISAPNP_FUNCTION(0x0216),		"NN NE2000" },
--- 78,83 ----
***************
*** 138,146 ****
  int ne_probe(struct net_device *dev);
  static int ne_probe1(struct net_device *dev, int ioaddr);
  static int ne_probe_isapnp(struct net_device *dev);
- #ifdef CONFIG_PCI
- static int ne_probe_pci(struct net_device *dev);
- #endif
  
  static int ne_open(struct net_device *dev);
  static int ne_close(struct net_device *dev);
--- 124,129 ----
***************
*** 181,190 ****
  #else
  
  /*
!  * Note that at boot, this probe only picks up one card at a time, even for
!  * multiple PCI ne2k cards. Use "ether=0,0,eth1" if you have a second PCI
!  * ne2k card.  This keeps things consistent regardless of the bus type of
!  * the card.
   */
  
  int __init ne_probe(struct net_device *dev)
--- 164,171 ----
  #else
  
  /*
!  * Note that at boot, this probe only picks up one card at a time.
!  * Use "ether=0,0,eth1" if you have a second card.
   */
  
  int __init ne_probe(struct net_device *dev)
***************
*** 197,208 ****
  	else if (base_addr != 0)	/* Don't probe at all. */
  		return -ENXIO;
  
- #ifdef CONFIG_PCI
- 	/* Then look for any installed PCI clones */
- 	if (probe_pci && pci_present() && (ne_probe_pci(dev) == 0))
- 		return 0;
- #endif
- 
  	/* Then look for any installed ISAPnP clones */
  	if (isapnp_present() && (ne_probe_isapnp(dev) == 0))
  		return 0;
--- 178,183 ----
***************
*** 222,264 ****
  }
  #endif
  
- #ifdef CONFIG_PCI
- static int __init ne_probe_pci(struct net_device *dev)
- {
- 	int i;
- 
- 	for (i = 0; pci_clone_list[i].vendor != 0; i++) {
- 		struct pci_dev *pdev = NULL;
- 		unsigned int pci_ioaddr = 0;
- 
- 		while ((pdev = pci_find_device(pci_clone_list[i].vendor, pci_clone_list[i].dev_id, pdev))) {
- 			if (pci_enable_device(pdev))
- 				continue;
- 			pci_ioaddr = pci_resource_start (pdev, 0);
- 			/* Avoid already found cards from previous calls */
- 			if (check_region(pci_ioaddr, NE_IO_EXTENT))
- 				continue;
- 			pci_irq_line = pdev->irq;
- 			if (pci_irq_line) break;	/* Found it */
- 		}
- 		if (!pdev)
- 			continue;
- 		printk(KERN_INFO "ne.c: PCI BIOS reports %s at i/o %#x, irq %d.\n",
- 				pci_clone_list[i].name,
- 				pci_ioaddr, pci_irq_line);
- 		printk("*\n* Use of the PCI-NE2000 driver with this card is recommended!\n*\n");
- 		if (ne_probe1(dev, pci_ioaddr) != 0) {	/* Shouldn't happen. */
- 			printk(KERN_ERR "ne.c: Probe of PCI card at %#x failed.\n", pci_ioaddr);
- 			pci_irq_line = 0;
- 			return -ENXIO;
- 		}
- 		pci_irq_line = 0;
- 		return 0;
- 	}
- 	return -ENODEV;
- }
- #endif  /* CONFIG_PCI */
- 
  static int __init ne_probe_isapnp(struct net_device *dev)
  {
  	int i;
--- 197,202 ----
***************
*** 408,413 ****
--- 346,353 ----
  	   request in program_seq above, and hence don't have doubled up values.
  	   These broken cards would otherwise be detected as an ne1000.  */
  
+ 	/* FIXME * PCI version is broken, but do we need this stuff here ? */
+ 
  	if (wordlength == 2)
  		for (i = 0; i < 16; i++)
  			SA_prom[i] = SA_prom[i+i];
***************
*** 823,832 ****
  MODULE_PARM(irq, "1-" __MODULE_STRING(MAX_NE_CARDS) "i");
  MODULE_PARM(bad, "1-" __MODULE_STRING(MAX_NE_CARDS) "i");
  
- #ifdef CONFIG_PCI
- MODULE_PARM(probe_pci, "i");
- #endif
- 
  /* This is set up so that no ISA autoprobe takes place. We can't guarantee
  that the ne2k probe is the last 8390 based probe to take place (as it
  is at boot) and so the probe will get confused by any other 8390 cards.
--- 763,768 ----
***************
*** 852,861 ****
  		if (found != 0) { 	/* Got at least one. */
  			return 0;
  		}
! 		if (io[this_dev] != 0)
! 			printk(KERN_WARNING "ne.c: No NE*000 card found at i/o = %#x\n", io[this_dev]);
! 		else
! 			printk(KERN_NOTICE "ne.c: No PCI cards found. Use \"io=0xNNN\" value(s) for ISA cards.\n");
  		unload_8390_module();
  		return -ENXIO;
  	}
--- 788,794 ----
  		if (found != 0) { 	/* Got at least one. */
  			return 0;
  		}
! 		printk(KERN_WARNING "ne.c: No NE*000 card found at i/o = %#x\n", io[this_dev]);
  		unload_8390_module();
  		return -ENXIO;
  	}



-
: send the line "unsubscribe linux-net" in
the body of a message to majordomo@vger.kernel.org


[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux 802.1Q VLAN]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Git]     [Bugtraq]     [Yosemite News and Information]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux PCI]     [Linux Admin]     [Samba]

  Powered by Linux