vsprintf: use TOLOWER whenever possible
[safe/jmp/linux-2.6] / drivers / net / sungem.c
index d2dfe0a..b571a1b 100644 (file)
@@ -38,6 +38,7 @@
 #include <linux/interrupt.h>
 #include <linux/ioport.h>
 #include <linux/in.h>
+#include <linux/sched.h>
 #include <linux/slab.h>
 #include <linux/string.h>
 #include <linux/delay.h>
@@ -1015,7 +1016,8 @@ static __inline__ int gem_intme(int entry)
        return 0;
 }
 
-static int gem_start_xmit(struct sk_buff *skb, struct net_device *dev)
+static netdev_tx_t gem_start_xmit(struct sk_buff *skb,
+                                 struct net_device *dev)
 {
        struct gem *gp = netdev_priv(dev);
        int entry;
@@ -1032,10 +1034,8 @@ static int gem_start_xmit(struct sk_buff *skb, struct net_device *dev)
                        (csum_stuff_off << 21));
        }
 
-       local_irq_save(flags);
-       if (!spin_trylock(&gp->tx_lock)) {
+       if (!spin_trylock_irqsave(&gp->tx_lock, flags)) {
                /* Tell upper layer to requeue */
-               local_irq_restore(flags);
                return NETDEV_TX_LOCKED;
        }
        /* We raced with gem_do_stop() */
@@ -2061,7 +2061,15 @@ static int gem_check_invariants(struct gem *gp)
                mif_cfg &= ~MIF_CFG_PSELECT;
                writel(mif_cfg, gp->regs + MIF_CFG);
        } else {
-               gp->phy_type = phy_serialink;
+#ifdef CONFIG_SPARC
+               const char *p;
+
+               p = of_get_property(gp->of_node, "shared-pins", NULL);
+               if (p && !strcmp(p, "serdes"))
+                       gp->phy_type = phy_serdes;
+               else
+#endif
+                       gp->phy_type = phy_serialink;
        }
        if (gp->phy_type == phy_mii_mdio1 ||
            gp->phy_type == phy_mii_mdio0) {
@@ -2851,9 +2859,7 @@ static int gem_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
                break;
 
        case SIOCSMIIREG:               /* Write MII PHY register. */
-               if (!capable(CAP_NET_ADMIN))
-                       rc = -EPERM;
-               else if (!gp->running)
+               if (!gp->running)
                        rc = -EAGAIN;
                else {
                        __phy_write(gp, data->phy_id & 0x1f, data->reg_num & 0x1f,