[NET]: Introduce and use print_mac() and DECLARE_MAC_BUF()
[deliverable/linux.git] / drivers / net / pasemi_mac.c
index 0bfdd79de6cf0a1f18cd005c3f16694a06bc6afc..4d87cd65626f8c2954450f0f8b46c97fbd94b4c8 100644 (file)
@@ -530,8 +530,8 @@ static int pasemi_mac_clean_rx(struct pasemi_mac *mac, int limit)
                } else
                        skb->ip_summed = CHECKSUM_NONE;
 
-               mac->stats.rx_bytes += len;
-               mac->stats.rx_packets++;
+               mac->netdev->stats.rx_bytes += len;
+               mac->netdev->stats.rx_packets++;
 
                skb->protocol = eth_type_trans(skb, mac->netdev);
                netif_receive_skb(skb);
@@ -1032,8 +1032,8 @@ static int pasemi_mac_start_tx(struct sk_buff *skb, struct net_device *dev)
        info->skb = skb;
 
        txring->next_to_fill++;
-       mac->stats.tx_packets++;
-       mac->stats.tx_bytes += skb->len;
+       dev->stats.tx_packets++;
+       dev->stats.tx_bytes += skb->len;
 
        spin_unlock_irqrestore(&txring->lock, flags);
 
@@ -1047,14 +1047,6 @@ out_err:
        return NETDEV_TX_BUSY;
 }
 
-static struct net_device_stats *pasemi_mac_get_stats(struct net_device *dev)
-{
-       struct pasemi_mac *mac = netdev_priv(dev);
-
-       return &mac->stats;
-}
-
-
 static void pasemi_mac_set_rx_mode(struct net_device *dev)
 {
        struct pasemi_mac *mac = netdev_priv(dev);
@@ -1078,6 +1070,7 @@ static int pasemi_mac_poll(struct napi_struct *napi, int budget)
        struct net_device *dev = mac->netdev;
        int pkts;
 
+       pasemi_mac_clean_tx(mac);
        pkts = pasemi_mac_clean_rx(mac, budget);
        if (pkts < budget) {
                /* all done, no more packets present */
@@ -1162,6 +1155,7 @@ pasemi_mac_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
        struct net_device *dev;
        struct pasemi_mac *mac;
        int err;
+       DECLARE_MAC_BUF(mac_buf);
 
        err = pci_enable_device(pdev);
        if (err)
@@ -1175,7 +1169,6 @@ pasemi_mac_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
                goto out_disable_device;
        }
 
-       SET_MODULE_OWNER(dev);
        pci_set_drvdata(pdev, dev);
        SET_NETDEV_DEV(dev, &pdev->dev);
 
@@ -1186,7 +1179,7 @@ pasemi_mac_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 
        netif_napi_add(dev, &mac->napi, pasemi_mac_poll, 64);
 
-       dev->features = NETIF_F_HW_CSUM;
+       dev->features = NETIF_F_HW_CSUM | NETIF_F_LLTX;
 
        /* These should come out of the device tree eventually */
        mac->dma_txch = index;
@@ -1223,7 +1216,6 @@ pasemi_mac_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
        dev->open = pasemi_mac_open;
        dev->stop = pasemi_mac_close;
        dev->hard_start_xmit = pasemi_mac_start_tx;
-       dev->get_stats = pasemi_mac_get_stats;
        dev->set_multicast_list = pasemi_mac_set_rx_mode;
 
        err = pasemi_mac_map_regs(mac);
@@ -1246,11 +1238,10 @@ pasemi_mac_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
                goto out;
        } else
                printk(KERN_INFO "%s: PA Semi %s: intf %d, txch %d, rxch %d, "
-                      "hw addr %02x:%02x:%02x:%02x:%02x:%02x\n",
+                      "hw addr %s\n",
                       dev->name, mac->type == MAC_TYPE_GMAC ? "GMAC" : "XAUI",
                       mac->dma_if, mac->dma_txch, mac->dma_rxch,
-                      dev->dev_addr[0], dev->dev_addr[1], dev->dev_addr[2],
-                      dev->dev_addr[3], dev->dev_addr[4], dev->dev_addr[5]);
+                      print_mac(mac_buf, dev->dev_addr));
 
        return err;
 
This page took 0.027522 seconds and 5 git commands to generate.