Merge branch 'fixes' of git://git.linux-nfs.org/pub/linux/nfs-2.6
[pandora-kernel.git] / drivers / net / via-velocity.c
index 7e3b2a3..aa9cd92 100644 (file)
@@ -695,14 +695,14 @@ static int __devinit velocity_found1(struct pci_dev *pdev, const struct pci_devi
         * can support more than MAX_UNITS.
         */
        if (velocity_nics >= MAX_UNITS) {
-               dev_printk(KERN_NOTICE, &pdev->dev, "already found %d NICs.\n", 
+               dev_notice(&pdev->dev, "already found %d NICs.\n", 
                           velocity_nics);
                return -ENODEV;
        }
 
        dev = alloc_etherdev(sizeof(struct velocity_info));
        if (!dev) {
-               dev_printk(KERN_ERR, &pdev->dev, "allocate net device failed.\n");
+               dev_err(&pdev->dev, "allocate net device failed.\n");
                goto out;
        }
        
@@ -739,7 +739,7 @@ static int __devinit velocity_found1(struct pci_dev *pdev, const struct pci_devi
 
        ret = pci_request_regions(pdev, VELOCITY_NAME);
        if (ret < 0) {
-               dev_printk(KERN_ERR, &pdev->dev, "No PCI resources.\n");
+               dev_err(&pdev->dev, "No PCI resources.\n");
                goto err_disable;
        }
 
@@ -895,19 +895,19 @@ static int __devinit velocity_get_pci_info(struct velocity_info *vptr, struct pc
        vptr->memaddr = pci_resource_start(pdev, 1);
        
        if (!(pci_resource_flags(pdev, 0) & IORESOURCE_IO)) {
-               dev_printk(KERN_ERR, &pdev->dev,
+               dev_err(&pdev->dev,
                           "region #0 is not an I/O resource, aborting.\n");
                return -EINVAL;
        }
 
        if ((pci_resource_flags(pdev, 1) & IORESOURCE_IO)) {
-               dev_printk(KERN_ERR, &pdev->dev,
+               dev_err(&pdev->dev,
                           "region #1 is an I/O resource, aborting.\n");
                return -EINVAL;
        }
 
        if (pci_resource_len(pdev, 1) < VELOCITY_IO_SIZE) {
-               dev_printk(KERN_ERR, &pdev->dev, "region #1 is too small.\n");
+               dev_err(&pdev->dev, "region #1 is too small.\n");
                return -EINVAL;
        }
        vptr->pdev = pdev;
@@ -2742,7 +2742,7 @@ static u32 check_connection_type(struct mac_regs __iomem * regs)
 
        if (PHYSR0 & PHYSR0_SPDG)
                status |= VELOCITY_SPEED_1000;
-       if (PHYSR0 & PHYSR0_SPD10)
+       else if (PHYSR0 & PHYSR0_SPD10)
                status |= VELOCITY_SPEED_10;
        else
                status |= VELOCITY_SPEED_100;
@@ -2851,8 +2851,17 @@ static int velocity_get_settings(struct net_device *dev, struct ethtool_cmd *cmd
        u32 status;
        status = check_connection_type(vptr->mac_regs);
 
-       cmd->supported = SUPPORTED_TP | SUPPORTED_Autoneg | SUPPORTED_10baseT_Half | SUPPORTED_10baseT_Full | SUPPORTED_100baseT_Half | SUPPORTED_100baseT_Full | SUPPORTED_1000baseT_Half | SUPPORTED_1000baseT_Full;
-       if (status & VELOCITY_SPEED_100)
+       cmd->supported = SUPPORTED_TP |
+                       SUPPORTED_Autoneg |
+                       SUPPORTED_10baseT_Half |
+                       SUPPORTED_10baseT_Full |
+                       SUPPORTED_100baseT_Half |
+                       SUPPORTED_100baseT_Full |
+                       SUPPORTED_1000baseT_Half |
+                       SUPPORTED_1000baseT_Full;
+       if (status & VELOCITY_SPEED_1000)
+               cmd->speed = SPEED_1000;
+       else if (status & VELOCITY_SPEED_100)
                cmd->speed = SPEED_100;
        else
                cmd->speed = SPEED_10;
@@ -2896,7 +2905,7 @@ static u32 velocity_get_link(struct net_device *dev)
 {
        struct velocity_info *vptr = netdev_priv(dev);
        struct mac_regs __iomem * regs = vptr->mac_regs;
-       return BYTE_REG_BITS_IS_ON(PHYSR0_LINKGD, &regs->PHYSR0)  ? 0 : 1;
+       return BYTE_REG_BITS_IS_ON(PHYSR0_LINKGD, &regs->PHYSR0) ? 1 : 0;
 }
 
 static void velocity_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info)