SUNRPC: rpc_pipefs cleanup
[safe/jmp/linux-2.6] / drivers / net / sunbmac.c
index 7009a5e..5017d7f 100644 (file)
@@ -878,7 +878,6 @@ static void bigmac_rx(struct bigmac *bp)
                /* No checksums done by the BigMAC ;-( */
                skb->protocol = eth_type_trans(skb, bp->dev);
                netif_rx(skb);
-               bp->dev->last_rx = jiffies;
                bp->enet_stats.rx_packets++;
                bp->enet_stats.rx_bytes += len;
        next:
@@ -917,7 +916,7 @@ static irqreturn_t bigmac_interrupt(int irq, void *dev_id)
 
 static int bigmac_open(struct net_device *dev)
 {
-       struct bigmac *bp = (struct bigmac *) dev->priv;
+       struct bigmac *bp = netdev_priv(dev);
        int ret;
 
        ret = request_irq(dev->irq, &bigmac_interrupt, IRQF_SHARED, dev->name, bp);
@@ -934,7 +933,7 @@ static int bigmac_open(struct net_device *dev)
 
 static int bigmac_close(struct net_device *dev)
 {
-       struct bigmac *bp = (struct bigmac *) dev->priv;
+       struct bigmac *bp = netdev_priv(dev);
 
        del_timer(&bp->bigmac_timer);
        bp->timer_state = asleep;
@@ -948,7 +947,7 @@ static int bigmac_close(struct net_device *dev)
 
 static void bigmac_tx_timeout(struct net_device *dev)
 {
-       struct bigmac *bp = (struct bigmac *) dev->priv;
+       struct bigmac *bp = netdev_priv(dev);
 
        bigmac_init_hw(bp, 0);
        netif_wake_queue(dev);
@@ -957,7 +956,7 @@ static void bigmac_tx_timeout(struct net_device *dev)
 /* Put a packet on the wire. */
 static int bigmac_start_xmit(struct sk_buff *skb, struct net_device *dev)
 {
-       struct bigmac *bp = (struct bigmac *) dev->priv;
+       struct bigmac *bp = netdev_priv(dev);
        int len, entry;
        u32 mapping;
 
@@ -990,7 +989,7 @@ static int bigmac_start_xmit(struct sk_buff *skb, struct net_device *dev)
 
 static struct net_device_stats *bigmac_get_stats(struct net_device *dev)
 {
-       struct bigmac *bp = (struct bigmac *) dev->priv;
+       struct bigmac *bp = netdev_priv(dev);
 
        bigmac_get_counters(bp, bp->bregs);
        return &bp->enet_stats;
@@ -998,7 +997,7 @@ static struct net_device_stats *bigmac_get_stats(struct net_device *dev)
 
 static void bigmac_set_multicast(struct net_device *dev)
 {
-       struct bigmac *bp = (struct bigmac *) dev->priv;
+       struct bigmac *bp = netdev_priv(dev);
        void __iomem *bregs = bp->bregs;
        struct dev_mc_list *dmi = dev->mc_list;
        char *addrs;
@@ -1061,7 +1060,7 @@ static void bigmac_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *i
 
 static u32 bigmac_get_link(struct net_device *dev)
 {
-       struct bigmac *bp = dev->priv;
+       struct bigmac *bp = netdev_priv(dev);
 
        spin_lock_irq(&bp->lock);
        bp->sw_bmsr = bigmac_tcvr_read(bp, bp->tregs, BIGMAC_BMSR);
@@ -1075,13 +1074,24 @@ static const struct ethtool_ops bigmac_ethtool_ops = {
        .get_link               = bigmac_get_link,
 };
 
+static const struct net_device_ops bigmac_ops = {
+       .ndo_open               = bigmac_open,
+       .ndo_stop               = bigmac_close,
+       .ndo_start_xmit         = bigmac_start_xmit,
+       .ndo_get_stats          = bigmac_get_stats,
+       .ndo_set_multicast_list = bigmac_set_multicast,
+       .ndo_tx_timeout         = bigmac_tx_timeout,
+       .ndo_change_mtu         = eth_change_mtu,
+       .ndo_set_mac_address    = eth_mac_addr,
+       .ndo_validate_addr      = eth_validate_addr,
+};
+
 static int __devinit bigmac_ether_init(struct of_device *op,
                                       struct of_device *qec_op)
 {
        static int version_printed;
        struct net_device *dev;
        u8 bsizes, bsizes_more;
-       DECLARE_MAC_BUF(mac);
        struct bigmac *bp;
        int i;
 
@@ -1189,16 +1199,8 @@ static int __devinit bigmac_ether_init(struct of_device *op,
        bp->dev = dev;
 
        /* Set links to our BigMAC open and close routines. */
-       dev->open = &bigmac_open;
-       dev->stop = &bigmac_close;
-       dev->hard_start_xmit = &bigmac_start_xmit;
        dev->ethtool_ops = &bigmac_ethtool_ops;
-
-       /* Set links to BigMAC statistic and multi-cast loading code. */
-       dev->get_stats = &bigmac_get_stats;
-       dev->set_multicast_list = &bigmac_set_multicast;
-
-       dev->tx_timeout = &bigmac_tx_timeout;
+       dev->netdev_ops = &bigmac_ops;
        dev->watchdog_timeo = 5*HZ;
 
        /* Finish net device registration. */
@@ -1212,8 +1214,8 @@ static int __devinit bigmac_ether_init(struct of_device *op,
 
        dev_set_drvdata(&bp->bigmac_op->dev, bp);
 
-       printk(KERN_INFO "%s: BigMAC 100baseT Ethernet %s\n",
-              dev->name, print_mac(mac, dev->dev_addr));
+       printk(KERN_INFO "%s: BigMAC 100baseT Ethernet %pM\n",
+              dev->name, dev->dev_addr);
 
        return 0;
 
@@ -1235,7 +1237,7 @@ fail_and_cleanup:
                                  bp->bmac_block,
                                  bp->bblock_dvma);
 
-       /* This also frees the co-located 'dev->priv' */
+       /* This also frees the co-located private data */
        free_netdev(dev);
        return -ENODEV;
 }
@@ -1263,7 +1265,7 @@ static int __devexit bigmac_sbus_remove(struct of_device *op)
 
        qec_op = to_of_device(parent);
 
-       unregister_netdevice(net_dev);
+       unregister_netdev(net_dev);
 
        of_iounmap(&qec_op->resource[0], bp->gregs, GLOB_REG_SIZE);
        of_iounmap(&op->resource[0], bp->creg, CREG_REG_SIZE);
@@ -1281,7 +1283,7 @@ static int __devexit bigmac_sbus_remove(struct of_device *op)
        return 0;
 }
 
-static struct of_device_id bigmac_sbus_match[] = {
+static const struct of_device_id bigmac_sbus_match[] = {
        {
                .name = "be",
        },