fedora core 6 1.2949 + vserver 2.2.0
[linux-2.6.git] / drivers / net / wan / sbni.c
index 311ac34..fc5c0c6 100644 (file)
@@ -37,7 +37,6 @@
  *     Known problem: this driver wasn't tested on multiprocessor machine.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/ptrace.h>
@@ -120,7 +119,7 @@ static int  sbni_ioctl( struct net_device *, struct ifreq *, int );
 static struct net_device_stats  *sbni_get_stats( struct net_device * );
 static void  set_multicast_list( struct net_device * );
 
-static irqreturn_t sbni_interrupt( int, void *, struct pt_regs * );
+static irqreturn_t sbni_interrupt( int, void * );
 static void  handle_channel( struct net_device * );
 static int   recv_frame( struct net_device * );
 static void  send_frame( struct net_device * );
@@ -176,7 +175,7 @@ static u32  mac[  SBNI_MAX_NUM_CARDS ] __initdata;
 
 #ifndef MODULE
 typedef u32  iarr[];
-static iarr  *dest[5] = { &io, &irq, &baud, &rxl, &mac };
+static iarr __initdata *dest[5] = { &io, &irq, &baud, &rxl, &mac };
 #endif
 
 /* A zero-terminated list of I/O addresses to be probed on ISA bus */
@@ -294,7 +293,7 @@ sbni_pci_probe( struct net_device  *dev )
 {
        struct pci_dev  *pdev = NULL;
 
-       while( (pdev = pci_find_class( PCI_CLASS_NETWORK_OTHER << 8, pdev ))
+       while( (pdev = pci_get_class( PCI_CLASS_NETWORK_OTHER << 8, pdev ))
               != NULL ) {
                int  pci_irq_line;
                unsigned long  pci_ioaddr;
@@ -331,10 +330,14 @@ sbni_pci_probe( struct net_device  *dev )
                /* avoiding re-enable dual adapters */
                if( (pci_ioaddr & 7) == 0  &&  pci_enable_device( pdev ) ) {
                        release_region( pci_ioaddr, SBNI_IO_EXTENT );
+                       pci_dev_put( pdev );
                        return  -EIO;
                }
                if( sbni_probe1( dev, pci_ioaddr, pci_irq_line ) ) {
                        SET_NETDEV_DEV(dev, &pdev->dev);
+                       /* not the best thing to do, but this is all messed up 
+                          for hotplug systems anyway... */
+                       pci_dev_put( pdev );
                        return  0;
                }
        }
@@ -349,7 +352,7 @@ sbni_probe1( struct net_device  *dev,  unsigned long  ioaddr,  int  irq )
 
        if( sbni_card_probe( ioaddr ) ) {
                release_region( ioaddr, SBNI_IO_EXTENT );
-               return  0;
+               return NULL;
        }
 
        outb( 0, ioaddr + CSR0 );
@@ -368,7 +371,7 @@ sbni_probe1( struct net_device  *dev,  unsigned long  ioaddr,  int  irq )
                        printk( KERN_ERR "%s: can't detect device irq!\n",
                                dev->name );
                        release_region( ioaddr, SBNI_IO_EXTENT );
-                       return  0;
+                       return NULL;
                }
        } else if( irq == 2 )
                irq = 9;
@@ -381,7 +384,7 @@ sbni_probe1( struct net_device  *dev,  unsigned long  ioaddr,  int  irq )
        if( !nl ) {
                printk( KERN_ERR "%s: unable to get memory!\n", dev->name );
                release_region( ioaddr, SBNI_IO_EXTENT );
-               return  0;
+               return NULL;
        }
 
        dev->priv = nl;
@@ -498,7 +501,7 @@ sbni_start_xmit( struct sk_buff  *skb,  struct net_device  *dev )
  */ 
 
 static irqreturn_t
-sbni_interrupt( int  irq,  void  *dev_id,  struct pt_regs  *regs )
+sbni_interrupt( int  irq,  void  *dev_id )
 {
        struct net_device         *dev = (struct net_device *) dev_id;
        struct net_local  *nl  = (struct net_local *) dev->priv;
@@ -1189,7 +1192,7 @@ sbni_open( struct net_device  *dev )
                        }
        }
 
-       if( request_irq(dev->irq, sbni_interrupt, SA_SHIRQ, dev->name, dev) ) {
+       if( request_irq(dev->irq, sbni_interrupt, IRQF_SHARED, dev->name, dev) ) {
                printk( KERN_ERR "%s: unable to get IRQ %d.\n",
                        dev->name, dev->irq );
                return  -EAGAIN;
@@ -1481,20 +1484,17 @@ set_multicast_list( struct net_device  *dev )
 
 
 #ifdef MODULE
-
-MODULE_PARM(   io,     "1-" __MODULE_STRING( SBNI_MAX_NUM_CARDS ) "i" );
-MODULE_PARM(   irq,    "1-" __MODULE_STRING( SBNI_MAX_NUM_CARDS ) "i" );
-MODULE_PARM(   baud,   "1-" __MODULE_STRING( SBNI_MAX_NUM_CARDS ) "i" );
-MODULE_PARM(   rxl,    "1-" __MODULE_STRING( SBNI_MAX_NUM_CARDS ) "i" );
-MODULE_PARM(   mac,    "1-" __MODULE_STRING( SBNI_MAX_NUM_CARDS ) "i" );
-
-MODULE_PARM(   skip_pci_probe, "i" );
+module_param_array(io, int, NULL, 0);
+module_param_array(irq, int, NULL, 0);
+module_param_array(baud, int, NULL, 0);
+module_param_array(rxl, int, NULL, 0);
+module_param_array(mac, int, NULL, 0);
+module_param(skip_pci_probe, bool, 0);
 
 MODULE_LICENSE("GPL");
 
 
-int
-init_module( void )
+int __init init_module( void )
 {
        struct net_device  *dev;
        int err;
@@ -1578,7 +1578,7 @@ calc_crc32( u32  crc,  u8  *p,  u32  len )
        register u32  _crc;
        _crc = crc;
        
-       __asm __volatile (
+       __asm__ __volatile__ (
                "xorl   %%ebx, %%ebx\n"
                "movl   %2, %%esi\n" 
                "movl   %3, %%ecx\n"