patch-2.3.39 linux/drivers/pnp/isapnp.c

Next file: linux/drivers/pnp/isapnp_proc.c
Previous file: linux/drivers/pnp/Makefile
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.38/linux/drivers/pnp/isapnp.c linux/drivers/pnp/isapnp.c
@@ -30,31 +30,17 @@
 #include <linux/ioport.h>
 #include <linux/string.h>
 #include <linux/malloc.h>
-#include <linux/proc_fs.h>
 #include <linux/delay.h>
 #include <asm/io.h>
 #include <asm/dma.h>
 #include <asm/irq.h>
 #include <linux/pci.h>
-#include <linux/vmalloc.h>
-#include <linux/poll.h>
 #include <linux/init.h>
-#include <asm/uaccess.h>
 #include <linux/isapnp.h>
 
 LIST_HEAD(isapnp_cards);
 LIST_HEAD(isapnp_devices);
 
-#define isapnp_for_each_card(card) \
-	for(card = pci_bus_b(isapnp_cards.next); card != pci_bus_b(&isapnp_cards); card = pci_bus_b(card->node.next))
-#define isapnp_for_each_dev(dev) \
-	for(dev = pci_dev_g(isapnp_devices.next); dev != pci_dev_g(&isapnp_devices); dev = pci_dev_g(dev->global_list.next))
-
-
-#ifdef CONFIG_PROC_FS
-#include "isapnp_proc.c"
-#endif
-
 #if 0
 #define ISAPNP_REGION_OK
 #endif
@@ -286,6 +272,12 @@
 			return 0;
 		}
 		rdp += RDP_STEP;
+		/*
+		 *	We cannot use NE2000 probe spaces for ISAPnP or we
+		 *	will lock up machines.
+		 */
+		if(rdp >= 0x280 && rdp <= 0x380)
+			continue;
 	}
 	return -1;
 }
@@ -298,12 +290,8 @@
 }
 
 /*
- *	This code is badly broken. We cannot simply pick ports as the 
- *	ISAPnP specification implies. We should try 4 or 5 safe ports
- *	then bale by default.
- *
- *	This code touches NE2K cards or other devices and your box is
- *	history.
+ *	Perform an isolation. The port selection code now tries to avoid
+ *	"dangerous to read" ports.
  */
 
 static int __init isapnp_isolate_rdp_select(void)
@@ -996,6 +984,7 @@
 		card->device = (header[3] << 8) | header[2];
 		card->serial = (header[7] << 24) | (header[6] << 16) | (header[5] << 8) | header[4];
 		isapnp_checksum_value = 0x00;
+		INIT_LIST_HEAD(&card->devices);
 		isapnp_parse_resource_map(card);
 		if (isapnp_checksum_value != 0x00)
 			printk("isapnp: checksum for device %i is not valid (0x%x)\n", csn, isapnp_checksum_value);
@@ -1633,7 +1622,10 @@
 	int i;
 	struct pci_dev *dev;
 
-	if (dma < 0 || dma == 4 || dma > 7)
+	/* Some machines allow DMA 0, but others don't. In fact on some 
+	   boxes DMA 0 is the memory refresh. Play safe */
+	   
+	if (dma < 1 || dma == 4 || dma > 7)
 		return 1;
 	for (i = 0; i < 8; i++) {
 		if (isapnp_reserve_dma[i] == dma)

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)