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 / pci-skeleton.c
index f931248..a7bb54d 100644 (file)
@@ -415,7 +415,7 @@ typedef enum {
 
 
 /* directly indexed by chip_t, above */
-const static struct {
+static const struct {
        const char *name;
        u8 version; /* from RTL8139C docs */
        u32 RxConfigMask; /* should clear the bits supported by this chip */
@@ -481,15 +481,14 @@ struct netdrv_private {
        unsigned int mediasense:1;      /* Media sensing in progress. */
        spinlock_t lock;
        chip_t chipset;
-       u32 pci_state[16];      /* Data saved during suspend */
 };
 
 MODULE_AUTHOR ("Jeff Garzik <jgarzik@pobox.com>");
 MODULE_DESCRIPTION ("Skeleton for a PCI Fast Ethernet driver");
 MODULE_LICENSE("GPL");
-MODULE_PARM (multicast_filter_limit, "i");
-MODULE_PARM (max_interrupt_work, "i");
-MODULE_PARM (media, "1-" __MODULE_STRING(8) "i");
+module_param(multicast_filter_limit, int, 0);
+module_param(max_interrupt_work, int, 0);
+module_param_array(media, int, NULL, 0);
 MODULE_PARM_DESC (multicast_filter_limit, "pci-skeleton maximum number of filtered multicast addresses");
 MODULE_PARM_DESC (max_interrupt_work, "pci-skeleton maximum events handled per interrupt");
 MODULE_PARM_DESC (media, "pci-skeleton: Bits 0-3: media type, bit 17: full duplex");
@@ -796,7 +795,7 @@ static int __devinit netdrv_init_one (struct pci_dev *pdev,
        tp->pci_dev = pdev;
        tp->board = ent->driver_data;
        tp->mmio_addr = ioaddr;
-       tp->lock = SPIN_LOCK_UNLOCKED;
+       spin_lock_init(&tp->lock);
 
        pci_set_drvdata(pdev, dev);
 
@@ -1898,7 +1897,7 @@ static void netdrv_set_rx_mode (struct net_device *dev)
 
 #ifdef CONFIG_PM
 
-static int netdrv_suspend (struct pci_dev *pdev, u32 state)
+static int netdrv_suspend (struct pci_dev *pdev, pm_message_t state)
 {
        struct net_device *dev = pci_get_drvdata (pdev);
        struct netdrv_private *tp = dev->priv;
@@ -1921,8 +1920,8 @@ static int netdrv_suspend (struct pci_dev *pdev, u32 state)
 
        spin_unlock_irqrestore (&tp->lock, flags);
 
-       pci_save_state (pdev, tp->pci_state);
-       pci_set_power_state (pdev, 3);
+       pci_save_state (pdev);
+       pci_set_power_state (pdev, PCI_D3hot);
 
        return 0;
 }
@@ -1935,8 +1934,8 @@ static int netdrv_resume (struct pci_dev *pdev)
 
        if (!netif_running(dev))
                return 0;
-       pci_set_power_state (pdev, 0);
-       pci_restore_state (pdev, tp->pci_state);
+       pci_set_power_state (pdev, PCI_D0);
+       pci_restore_state (pdev);
        netif_device_attach (dev);
        netdrv_hw_start (dev);