Revert to Fedora kernel-2.6.17-1.2187_FC5 patched with vs2.0.2.1; there are too many...
[linux-2.6.git] / drivers / net / wireless / prism54 / islpci_hotplug.c
index 11b315b..bfa0cc3 100644 (file)
  *
  */
 
-#include <linux/version.h>
 #include <linux/module.h>
 #include <linux/pci.h>
 #include <linux/delay.h>
 #include <linux/init.h> /* For __init, __exit */
+#include <linux/dma-mapping.h>
 
 #include "prismcompat.h"
 #include "islpci_dev.h"
@@ -81,7 +81,7 @@ MODULE_DEVICE_TABLE(pci, prism54_id_tbl);
 
 static int prism54_probe(struct pci_dev *, const struct pci_device_id *);
 static void prism54_remove(struct pci_dev *);
-static int prism54_suspend(struct pci_dev *, u32 state);
+static int prism54_suspend(struct pci_dev *, pm_message_t state);
 static int prism54_resume(struct pci_dev *);
 
 static struct pci_driver prism54_driver = {
@@ -107,9 +107,6 @@ prism54_probe(struct pci_dev *pdev, const struct pci_device_id *id)
        islpci_private *priv;
        int rvalue;
 
-       /* TRACE(DRV_NAME); */
-       
-       
        /* Enable the pci device */
        if (pci_enable_device(pdev)) {
                printk(KERN_ERR "%s: pci_enable_device() failed.\n", DRV_NAME);
@@ -128,7 +125,7 @@ prism54_probe(struct pci_dev *pdev, const struct pci_device_id *id)
        }
 
        /* enable PCI DMA */
-       if (pci_set_dma_mask(pdev, 0xffffffff)) {
+       if (pci_set_dma_mask(pdev, DMA_32BIT_MASK)) {
                printk(KERN_ERR "%s: 32-bit PCI DMA not supported", DRV_NAME);
                goto do_pci_disable_device;
         }
@@ -166,7 +163,7 @@ prism54_probe(struct pci_dev *pdev, const struct pci_device_id *id)
        if (rvalue || !mem_addr) {
                printk(KERN_ERR "%s: PCI device memory region not configured; fix your BIOS or CardBus bridge/drivers\n",
                       DRV_NAME);
-               goto do_pci_disable_device;
+               goto do_pci_release_regions;
        }
 
        /* enable PCI bus-mastering */
@@ -264,16 +261,14 @@ prism54_remove(struct pci_dev *pdev)
 }
 
 int
-prism54_suspend(struct pci_dev *pdev, u32 state)
+prism54_suspend(struct pci_dev *pdev, pm_message_t state)
 {
        struct net_device *ndev = pci_get_drvdata(pdev);
        islpci_private *priv = ndev ? netdev_priv(ndev) : NULL;
        BUG_ON(!priv);
 
-       printk(KERN_NOTICE "%s: got suspend request (state %d)\n",
-              ndev->name, state);
 
-       pci_save_state(pdev, priv->pci_state);
+       pci_save_state(pdev);
 
        /* tell the device not to trigger interrupts for now... */
        isl38xx_disable_interrupts(priv->device_base);
@@ -295,9 +290,11 @@ prism54_resume(struct pci_dev *pdev)
        islpci_private *priv = ndev ? netdev_priv(ndev) : NULL;
        BUG_ON(!priv);
 
+       pci_enable_device(pdev);
+
        printk(KERN_NOTICE "%s: got resume request\n", ndev->name);
 
-       pci_restore_state(pdev, priv->pci_state);
+       pci_restore_state(pdev);
 
        /* alright let's go into the PREBOOT state */
        islpci_reset(priv, 1);