aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/cpmac.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/cpmac.c')
-rw-r--r--drivers/net/cpmac.c33
1 files changed, 19 insertions, 14 deletions
diff --git a/drivers/net/cpmac.c b/drivers/net/cpmac.c
index 3f476c7c0736..58afafbd3b9c 100644
--- a/drivers/net/cpmac.c
+++ b/drivers/net/cpmac.c
@@ -202,7 +202,7 @@ struct cpmac_priv {
202 void __iomem *regs; 202 void __iomem *regs;
203 struct mii_bus *mii_bus; 203 struct mii_bus *mii_bus;
204 struct phy_device *phy; 204 struct phy_device *phy;
205 char phy_name[BUS_ID_SIZE]; 205 char phy_name[MII_BUS_ID_SIZE + 3];
206 int oldlink, oldspeed, oldduplex; 206 int oldlink, oldspeed, oldduplex;
207 u32 msg_enable; 207 u32 msg_enable;
208 struct net_device *dev; 208 struct net_device *dev;
@@ -615,13 +615,13 @@ static void cpmac_end_xmit(struct net_device *dev, int queue)
615 615
616 dev_kfree_skb_irq(desc->skb); 616 dev_kfree_skb_irq(desc->skb);
617 desc->skb = NULL; 617 desc->skb = NULL;
618 if (netif_subqueue_stopped(dev, queue)) 618 if (__netif_subqueue_stopped(dev, queue))
619 netif_wake_subqueue(dev, queue); 619 netif_wake_subqueue(dev, queue);
620 } else { 620 } else {
621 if (netif_msg_tx_err(priv) && net_ratelimit()) 621 if (netif_msg_tx_err(priv) && net_ratelimit())
622 printk(KERN_WARNING 622 printk(KERN_WARNING
623 "%s: end_xmit: spurious interrupt\n", dev->name); 623 "%s: end_xmit: spurious interrupt\n", dev->name);
624 if (netif_subqueue_stopped(dev, queue)) 624 if (__netif_subqueue_stopped(dev, queue))
625 netif_wake_subqueue(dev, queue); 625 netif_wake_subqueue(dev, queue);
626 } 626 }
627} 627}
@@ -731,7 +731,6 @@ static void cpmac_clear_tx(struct net_device *dev)
731 731
732static void cpmac_hw_error(struct work_struct *work) 732static void cpmac_hw_error(struct work_struct *work)
733{ 733{
734 int i;
735 struct cpmac_priv *priv = 734 struct cpmac_priv *priv =
736 container_of(work, struct cpmac_priv, reset_work); 735 container_of(work, struct cpmac_priv, reset_work);
737 736
@@ -818,7 +817,6 @@ static irqreturn_t cpmac_irq(int irq, void *dev_id)
818 817
819static void cpmac_tx_timeout(struct net_device *dev) 818static void cpmac_tx_timeout(struct net_device *dev)
820{ 819{
821 int i;
822 struct cpmac_priv *priv = netdev_priv(dev); 820 struct cpmac_priv *priv = netdev_priv(dev);
823 821
824 spin_lock(&priv->lock); 822 spin_lock(&priv->lock);
@@ -1093,11 +1091,24 @@ static int cpmac_stop(struct net_device *dev)
1093 return 0; 1091 return 0;
1094} 1092}
1095 1093
1094static const struct net_device_ops cpmac_netdev_ops = {
1095 .ndo_open = cpmac_open,
1096 .ndo_stop = cpmac_stop,
1097 .ndo_start_xmit = cpmac_start_xmit,
1098 .ndo_tx_timeout = cpmac_tx_timeout,
1099 .ndo_set_multicast_list = cpmac_set_multicast_list,
1100 .ndo_so_ioctl = cpmac_ioctl,
1101 .ndo_set_config = cpmac_config,
1102 .ndo_change_mtu = eth_change_mtu,
1103 .ndo_validate_addr = eth_validate_addr,
1104 .ndo_set_mac_address = eth_mac_addr,
1105};
1106
1096static int external_switch; 1107static int external_switch;
1097 1108
1098static int __devinit cpmac_probe(struct platform_device *pdev) 1109static int __devinit cpmac_probe(struct platform_device *pdev)
1099{ 1110{
1100 int rc, phy_id, i; 1111 int rc, phy_id;
1101 char *mdio_bus_id = "0"; 1112 char *mdio_bus_id = "0";
1102 struct resource *mem; 1113 struct resource *mem;
1103 struct cpmac_priv *priv; 1114 struct cpmac_priv *priv;
@@ -1143,14 +1154,8 @@ static int __devinit cpmac_probe(struct platform_device *pdev)
1143 1154
1144 dev->irq = platform_get_irq_byname(pdev, "irq"); 1155 dev->irq = platform_get_irq_byname(pdev, "irq");
1145 1156
1146 dev->open = cpmac_open; 1157 dev->netdev_ops = &cpmac_netdev_ops;
1147 dev->stop = cpmac_stop; 1158 dev->ethtool_ops = &cpmac_ethtool_ops;
1148 dev->set_config = cpmac_config;
1149 dev->hard_start_xmit = cpmac_start_xmit;
1150 dev->do_ioctl = cpmac_ioctl;
1151 dev->set_multicast_list = cpmac_set_multicast_list;
1152 dev->tx_timeout = cpmac_tx_timeout;
1153 dev->ethtool_ops = &cpmac_ethtool_ops;
1154 1159
1155 netif_napi_add(dev, &priv->napi, cpmac_poll, 64); 1160 netif_napi_add(dev, &priv->napi, cpmac_poll, 64);
1156 1161