aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/macb.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2007-02-19 16:23:26 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-02-19 16:23:26 -0500
commit2370965c5065b24b28b5ba09b60ddfbfb6d7649b (patch)
tree1929618e9d904bdd0f050c95053b8b59145f670e /drivers/net/macb.c
parent59b8175c771040afcd4ad67022b0cc80c216b866 (diff)
parent0b3581e26d4807f36b2294366d6fbd506c30d68a (diff)
Merge branch 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/netdev-2.6
* 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/netdev-2.6: (51 commits) sk98lin: mark deprecated in Kconfig Hostess SV-11 depends on INET Fix link autonegotiation timer. sk98lin: planned removal B44: increase wait loop b44: replace define e1000: allow ethtool to see link status when down e1000: remove obsolete custom pci_save_state code e1000: fix shared interrupt warning message atm: Use ARRAY_SIZE macro when appropriate bugfixes and new hardware support for arcnet driver pcnet32 NAPI no longer experimental MAINTAINER macb: Remove inappropriate spinlocks around mii calls Convert meth to netdev_priv sky2: v1.13 sky2: receive error handling improvements sky2: transmit timeout sky2: flow control negotiation for Yukon-FE sky2: no need to reset pause bits on shutdown ...
Diffstat (limited to 'drivers/net/macb.c')
-rw-r--r--drivers/net/macb.c24
1 files changed, 3 insertions, 21 deletions
diff --git a/drivers/net/macb.c b/drivers/net/macb.c
index a41418b3c518..2e9571bf0736 100644
--- a/drivers/net/macb.c
+++ b/drivers/net/macb.c
@@ -881,27 +881,15 @@ static struct net_device_stats *macb_get_stats(struct net_device *dev)
881static int macb_get_settings(struct net_device *dev, struct ethtool_cmd *cmd) 881static int macb_get_settings(struct net_device *dev, struct ethtool_cmd *cmd)
882{ 882{
883 struct macb *bp = netdev_priv(dev); 883 struct macb *bp = netdev_priv(dev);
884 int ret;
885 unsigned long flags;
886
887 spin_lock_irqsave(&bp->lock, flags);
888 ret = mii_ethtool_gset(&bp->mii, cmd);
889 spin_unlock_irqrestore(&bp->lock, flags);
890 884
891 return ret; 885 return mii_ethtool_gset(&bp->mii, cmd);
892} 886}
893 887
894static int macb_set_settings(struct net_device *dev, struct ethtool_cmd *cmd) 888static int macb_set_settings(struct net_device *dev, struct ethtool_cmd *cmd)
895{ 889{
896 struct macb *bp = netdev_priv(dev); 890 struct macb *bp = netdev_priv(dev);
897 int ret;
898 unsigned long flags;
899
900 spin_lock_irqsave(&bp->lock, flags);
901 ret = mii_ethtool_sset(&bp->mii, cmd);
902 spin_unlock_irqrestore(&bp->lock, flags);
903 891
904 return ret; 892 return mii_ethtool_sset(&bp->mii, cmd);
905} 893}
906 894
907static void macb_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info) 895static void macb_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info)
@@ -930,17 +918,11 @@ static struct ethtool_ops macb_ethtool_ops = {
930static int macb_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) 918static int macb_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
931{ 919{
932 struct macb *bp = netdev_priv(dev); 920 struct macb *bp = netdev_priv(dev);
933 int ret;
934 unsigned long flags;
935 921
936 if (!netif_running(dev)) 922 if (!netif_running(dev))
937 return -EINVAL; 923 return -EINVAL;
938 924
939 spin_lock_irqsave(&bp->lock, flags); 925 return generic_mii_ioctl(&bp->mii, if_mii(rq), cmd, NULL);
940 ret = generic_mii_ioctl(&bp->mii, if_mii(rq), cmd, NULL);
941 spin_unlock_irqrestore(&bp->lock, flags);
942
943 return ret;
944} 926}
945 927
946static ssize_t macb_mii_show(const struct device *_dev, char *buf, 928static ssize_t macb_mii_show(const struct device *_dev, char *buf,