- patches.fixes/patch-2.6.11-rc1: 2.6.11-rc1.
[linux-flexiantxendom0-3.2.10.git] / drivers / net / via-velocity.c
index 1886fe6..7964bc3 100644 (file)
@@ -100,8 +100,8 @@ MODULE_LICENSE("GPL");
 MODULE_DESCRIPTION("VIA Networking Velocity Family Gigabit Ethernet Adapter Driver");
 
 #define VELOCITY_PARAM(N,D) \
-        static const int N[MAX_UNITS]=OPTION_DEFAULT;\
-        MODULE_PARM(N, "1-" __MODULE_STRING(MAX_UNITS) "i");\
+        static int N[MAX_UNITS]=OPTION_DEFAULT;\
+       module_param_array(N, int, NULL, 0); \
         MODULE_PARM_DESC(N, D);
 
 #define RX_DESC_MIN     64
@@ -229,7 +229,7 @@ VELOCITY_PARAM(wol_opts, "Wake On Lan options");
 VELOCITY_PARAM(int_works, "Number of packets per interrupt services");
 
 static int rx_copybreak = 200;
-MODULE_PARM(rx_copybreak, "i");
+module_param(rx_copybreak, int, 0644);
 MODULE_PARM_DESC(rx_copybreak, "Copy breakpoint for copy-only-tiny-frames");
 
 static void velocity_init_info(struct pci_dev *pdev, struct velocity_info *vptr, struct velocity_info_tbl *info);
@@ -804,7 +804,7 @@ static int __devinit velocity_found1(struct pci_dev *pdev, const struct pci_devi
        
        /* and leave the chip powered down */
        
-       pci_set_power_state(pdev, 3);
+       pci_set_power_state(pdev, PCI_D3hot);
 #ifdef CONFIG_PM
        {
                unsigned long flags;
@@ -1742,7 +1742,7 @@ static int velocity_open(struct net_device *dev)
                goto err_free_rd_ring;
        
        /* Ensure chip is running */    
-       pci_set_power_state(vptr->pdev, 0);
+       pci_set_power_state(vptr->pdev, PCI_D0);
        
        velocity_init_registers(vptr, VELOCITY_INIT_COLD);
 
@@ -1750,7 +1750,7 @@ static int velocity_open(struct net_device *dev)
                          dev->name, dev);
        if (ret < 0) {
                /* Power down the chip */
-               pci_set_power_state(vptr->pdev, 3);
+               pci_set_power_state(vptr->pdev, PCI_D3hot);
                goto err_free_td_ring;
        }
 
@@ -1868,7 +1868,7 @@ static int velocity_close(struct net_device *dev)
                free_irq(dev->irq, dev);
                
        /* Power down the chip */
-       pci_set_power_state(vptr->pdev, 3);
+       pci_set_power_state(vptr->pdev, PCI_D3hot);
        
        /* Free the resources */
        velocity_free_td_ring(vptr);
@@ -2194,8 +2194,8 @@ static int velocity_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
        /* If we are asked for information and the device is power
           saving then we need to bring the device back up to talk to it */
                
-       if(!netif_running(dev))
-               pci_set_power_state(vptr->pdev, 0);
+       if (!netif_running(dev))
+               pci_set_power_state(vptr->pdev, PCI_D0);
                
        switch (cmd) {
        case SIOCGMIIPHY:       /* Get address of MII PHY in use. */
@@ -2207,8 +2207,8 @@ static int velocity_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
        default:
                ret = -EOPNOTSUPP;
        }
-       if(!netif_running(dev))
-               pci_set_power_state(vptr->pdev, 3);
+       if (!netif_running(dev))
+               pci_set_power_state(vptr->pdev, PCI_D3hot);
                
                
        return ret;
@@ -2818,8 +2818,8 @@ static void enable_flow_control_ability(struct velocity_info *vptr)
 static int velocity_ethtool_up(struct net_device *dev)
 {
        struct velocity_info *vptr = dev->priv;
-       if(!netif_running(dev))
-               pci_set_power_state(vptr->pdev, 0);
+       if (!netif_running(dev))
+               pci_set_power_state(vptr->pdev, PCI_D0);
        return 0;
 }      
 
@@ -2834,8 +2834,8 @@ static int velocity_ethtool_up(struct net_device *dev)
 static void velocity_ethtool_down(struct net_device *dev)
 {
        struct velocity_info *vptr = dev->priv;
-       if(!netif_running(dev))
-               pci_set_power_state(vptr->pdev, 3);
+       if (!netif_running(dev))
+               pci_set_power_state(vptr->pdev, PCI_D3hot);
 }
 
 static int velocity_get_settings(struct net_device *dev, struct ethtool_cmd *cmd)
@@ -3229,15 +3229,15 @@ static int velocity_suspend(struct pci_dev *pdev, u32 state)
                velocity_shutdown(vptr);
                velocity_set_wol(vptr);
                pci_enable_wake(pdev, 3, 1);
-               pci_set_power_state(pdev, 3);
+               pci_set_power_state(pdev, PCI_D3hot);
        } else {
                velocity_save_context(vptr, &vptr->context);
                velocity_shutdown(vptr);
                pci_disable_device(pdev);
-               pci_set_power_state(pdev, state);
+               pci_set_power_state(pdev, pci_choose_state(pdev, state));
        }
 #else
-       pci_set_power_state(pdev, state);
+       pci_set_power_state(pdev, pci_choose_state(pdev, state));
 #endif
        spin_unlock_irqrestore(&vptr->lock, flags);
        return 0;
@@ -3252,7 +3252,7 @@ static int velocity_resume(struct pci_dev *pdev)
        if(!netif_running(vptr->dev))
                return 0;
 
-       pci_set_power_state(pdev, 0);
+       pci_set_power_state(pdev, PCI_D0);
        pci_enable_wake(pdev, 0, 0);
        pci_restore_state(pdev);