patch-2.4.0-prerelease linux/drivers/net/fc/iph5526.c

Next file: linux/drivers/net/fc/tach_structs.h
Previous file: linux/drivers/net/fc/Makefile
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.0-test12/linux/drivers/net/fc/iph5526.c linux/drivers/net/fc/iph5526.c
@@ -1,7 +1,7 @@
 /**********************************************************************
  * iph5526.c: IP/SCSI driver for the Interphase 5526 PCI Fibre Channel
  *			  Card.
- * Copyright (C) 1999 Vineet M Abraham <vma@iol.unh.edu>
+ * Copyright (C) 1999 Vineet M Abraham <vmabraham@hotmail.com>
  *
  * This program is free software; you can redistribute it and/or 
  * modify it under the terms of the GNU General Public License as 
@@ -33,10 +33,9 @@
 */	
 
 static const char *version =
-    "iph5526.c:v1.0 07.08.99 Vineet Abraham (vma@iol.unh.edu)\n";
+    "iph5526.c:v1.0 07.08.99 Vineet Abraham (vmabraham@hotmail.com)\n";
 
 #include <linux/module.h>
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
 #include <linux/errno.h>
@@ -112,9 +111,16 @@
 #define ALIGNED_ADDR(addr, len) ((((unsigned long)(addr) + (len - 1)) & ~(len - 1)) - (unsigned long)(addr))
 
 
+static struct pci_device_id iph5526_pci_tbl[] __initdata = {
+	{ PCI_VENDOR_ID_INTERPHASE, PCI_DEVICE_ID_INTERPHASE_5526, PCI_ANY_ID, PCI_ANY_ID, },
+	{ PCI_VENDOR_ID_INTERPHASE, PCI_DEVICE_ID_INTERPHASE_55x6, PCI_ANY_ID, PCI_ANY_ID, },
+	{ }			/* Terminating entry */
+};
+MODULE_DEVICE_TABLE(pci, iph5526_pci_tbl);
+
 #define MAX_FC_CARDS 2
 static struct fc_info *fc[MAX_FC_CARDS+1];
-static unsigned int pci_irq_line = 0;
+static unsigned int pci_irq_line;
 static struct {
 	unsigned short vendor_id;
 	unsigned short device_id;
@@ -220,32 +226,23 @@
 
 static void iph5526_timeout(struct net_device *dev);
 
-#ifdef CONFIG_PCI
 static int iph5526_probe_pci(struct net_device *dev);
-#endif
-
 
 int __init iph5526_probe(struct net_device *dev)
 {
-#ifdef CONFIG_PCI
 	if (pci_present() && (iph5526_probe_pci(dev) == 0))
 		return 0;
-#endif
     return -ENODEV;
 }
 
-#ifdef CONFIG_PCI
 static int __init iph5526_probe_pci(struct net_device *dev)
 {
-#ifndef MODULE
-struct fc_info *fi;
-static int count = 0;
-#endif
 #ifdef MODULE
-struct fc_info *fi = (struct fc_info *)dev->priv;
-#endif
-
-#ifndef MODULE
+	struct fc_info *fi = (struct fc_info *)dev->priv;
+#else
+	struct fc_info *fi;
+	static int count = 0;
+ 
 	if(fc[count] != NULL) {
 		if (dev == NULL) {
 			dev = init_fcdev(NULL, 0);
@@ -277,7 +274,6 @@
 	display_cache(fi);
 	return 0;
 }
-#endif  /* CONFIG_PCI */
 
 static int __init fcdev_init(struct net_device *dev)
 {
@@ -2247,7 +2243,7 @@
 	/* (i)chip reset */
 	writel(ICHIP_HCR_RESET, fi->i_r.ptr_ichip_hw_control_reg);
 	/*wait for chip to get reset */
-	udelay(10000);
+	mdelay(10);
 	/*de-assert reset */
 	writel(ICHIP_HCR_DERESET, fi->i_r.ptr_ichip_hw_control_reg);
 	
@@ -3882,7 +3878,7 @@
 	/* This is to make sure that the ACC to the PRLI comes in 
 	 * for the last ALPA. 
 	 */
-	udelay(1000000); /* Ugly! Let the Gods forgive me */
+	mdelay(1000); /* Ugly! Let the Gods forgive me */
 
 	DPRINTK1("leaving iph5526_detect\n");
 	return no_of_hosts;

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