vserver 1.9.5.x5
[linux-2.6.git] / drivers / net / wireless / atmel_cs.c
index 06b09a0..1288d57 100644 (file)
@@ -65,7 +65,7 @@
 */
 #ifdef PCMCIA_DEBUG
 static int pc_debug = PCMCIA_DEBUG;
-MODULE_PARM(pc_debug, "i");
+module_param(pc_debug, int, 0);
 static char *version = "$Revision: 1.2 $";
 #define DEBUG(n, args...) if (pc_debug>(n)) printk(KERN_DEBUG args);
 #else
@@ -74,20 +74,10 @@ static char *version = "$Revision: 1.2 $";
 
 /*====================================================================*/
 
-/* Parameters that can be set with 'insmod' */
-
-/* The old way: bit map of interrupts to choose from */
-/* This means pick from 15, 14, 12, 11, 10, 9, 7, 5, 4, and 3 */
-static u_int irq_mask = 0xdeb8;
-/* Newer, simpler way of listing specific interrupts */
-static int irq_list[4] = { -1 };
-
 MODULE_AUTHOR("Simon Kelley");
 MODULE_DESCRIPTION("Support for Atmel at76c50x 802.11 wireless ethernet cards.");
 MODULE_LICENSE("GPL");
 MODULE_SUPPORTED_DEVICE("Atmel at76c50x PCMCIA cards");
-MODULE_PARM(irq_mask, "i");
-MODULE_PARM(irq_list, "1-4i");
 
 /*====================================================================*/
 
@@ -190,7 +180,7 @@ static dev_link_t *atmel_attach(void)
        client_reg_t client_reg;
        dev_link_t *link;
        local_info_t *local;
-       int ret, i;
+       int ret;
        
        DEBUG(0, "atmel_attach()\n");
 
@@ -204,12 +194,7 @@ static dev_link_t *atmel_attach(void)
        
        /* Interrupt setup */
        link->irq.Attributes = IRQ_TYPE_EXCLUSIVE;
-       link->irq.IRQInfo1 = IRQ_INFO2_VALID|IRQ_LEVEL_ID;
-       if (irq_list[0] == -1)
-               link->irq.IRQInfo2 = irq_mask;
-       else
-               for (i = 0; i < 4; i++)
-                       link->irq.IRQInfo2 |= 1 << irq_list[i];
+       link->irq.IRQInfo1 = IRQ_LEVEL_ID;
        link->irq.Handler = NULL;
        
        /*
@@ -237,7 +222,6 @@ static dev_link_t *atmel_attach(void)
        link->next = dev_list;
        dev_list = link;
        client_reg.dev_info = &dev_info;
-       client_reg.Attributes = INFO_IO_CLIENT | INFO_CARD_SHARE;
        client_reg.EventMask =
                CS_EVENT_CARD_INSERTION | CS_EVENT_CARD_REMOVAL |
                CS_EVENT_RESET_PHYSICAL | CS_EVENT_CARD_RESET |
@@ -347,11 +331,6 @@ static struct {
        { 0, 0, "11WAVE/11WP611AL-E", "atmel_at76c502e%s.bin", "11WAVE WaveBuddy" } 
 };
 
-/* This is strictly temporary, until PCMCIA devices get integrated into the device model. */
-static struct device atmel_device = {
-        .bus_id    = "pcmcia",
-};
-
 static void atmel_config(dev_link_t *link)
 {
        client_handle_t handle;
@@ -537,12 +516,12 @@ static void atmel_config(dev_link_t *link)
                       "atmel: cannot assign IRQ: check that CONFIG_ISA is set in kernel config.");
                goto cs_failed;
        }
-       
+       
        ((local_info_t*)link->priv)->eth_dev = 
                init_atmel_card(link->irq.AssignedIRQ,
                                link->io.BasePort1,
                                card_index == -1 ? NULL :  card_table[card_index].firmware,
-                               &atmel_device,
+                               &handle_to_dev(handle),
                                card_present, 
                                link);
        if (!((local_info_t*)link->priv)->eth_dev) 
@@ -602,7 +581,7 @@ static void atmel_release(dev_link_t *link)
        
        if (dev) 
                stop_atmel_card(dev, 0);
-       ((local_info_t*)link->priv)->eth_dev = 0
+       ((local_info_t*)link->priv)->eth_dev = NULL
        
        /* Don't bother checking to see if these succeed or not */
        pcmcia_release_configuration(link->handle);
@@ -686,13 +665,7 @@ static int atmel_cs_init(void)
 static void atmel_cs_cleanup(void)
 {
         pcmcia_unregister_driver(&atmel_driver);
-
-        /* XXX: this really needs to move into generic code.. */
-        while (dev_list != NULL) {
-                if (dev_list->state & DEV_CONFIG)
-                        atmel_release(dev_list);
-                atmel_detach(dev_list);
-        }
+       BUG_ON(dev_list != NULL);
 }
 
 /*