sc92031: more useful banner in kernel log
[linux-2.6.git] / drivers / net / sc92031.c
index f64a860..12ce341 100644 (file)
@@ -816,7 +816,6 @@ static void _sc92031_rx_tasklet(struct net_device *dev)
                }
 
                skb->protocol = eth_type_trans(skb, dev);
-               dev->last_rx = jiffies;
                netif_rx(skb);
 
                dev->stats.rx_bytes += pkt_size;
@@ -953,9 +952,6 @@ static int sc92031_start_xmit(struct sk_buff *skb, struct net_device *dev)
        unsigned entry;
        u32 tx_status;
 
-       if (skb_padto(skb, ETH_ZLEN))
-               return NETDEV_TX_OK;
-
        if (unlikely(skb->len > TX_BUF_SIZE)) {
                dev->stats.tx_dropped++;
                goto out;
@@ -975,6 +971,11 @@ static int sc92031_start_xmit(struct sk_buff *skb, struct net_device *dev)
        skb_copy_and_csum_dev(skb, priv->tx_bufs + entry * TX_BUF_SIZE);
 
        len = skb->len;
+       if (len < ETH_ZLEN) {
+               memset(priv->tx_bufs + entry * TX_BUF_SIZE + len,
+                               0, ETH_ZLEN - len);
+               len = ETH_ZLEN;
+       }
 
        wmb();
 
@@ -1385,7 +1386,7 @@ static void sc92031_ethtool_get_ethtool_stats(struct net_device *dev,
        spin_unlock_bh(&priv->lock);
 }
 
-static struct ethtool_ops sc92031_ethtool_ops = {
+static const struct ethtool_ops sc92031_ethtool_ops = {
        .get_settings           = sc92031_ethtool_get_settings,
        .set_settings           = sc92031_ethtool_set_settings,
        .get_drvinfo            = sc92031_ethtool_get_drvinfo,
@@ -1398,6 +1399,22 @@ static struct ethtool_ops sc92031_ethtool_ops = {
        .get_ethtool_stats      = sc92031_ethtool_get_ethtool_stats,
 };
 
+
+static const struct net_device_ops sc92031_netdev_ops = {
+       .ndo_get_stats          = sc92031_get_stats,
+       .ndo_start_xmit         = sc92031_start_xmit,
+       .ndo_open               = sc92031_open,
+       .ndo_stop               = sc92031_stop,
+       .ndo_set_multicast_list = sc92031_set_multicast_list,
+       .ndo_change_mtu         = eth_change_mtu,
+       .ndo_validate_addr      = eth_validate_addr,
+       .ndo_set_mac_address    = eth_mac_addr,
+       .ndo_tx_timeout         = sc92031_tx_timeout,
+#ifdef CONFIG_NET_POLL_CONTROLLER
+       .ndo_poll_controller    = sc92031_poll_controller,
+#endif
+};
+
 static int __devinit sc92031_probe(struct pci_dev *pdev,
                const struct pci_device_id *id)
 {
@@ -1406,6 +1423,7 @@ static int __devinit sc92031_probe(struct pci_dev *pdev,
        struct net_device *dev;
        struct sc92031_priv *priv;
        u32 mac0, mac1;
+       unsigned long base_addr;
 
        err = pci_enable_device(pdev);
        if (unlikely(err < 0))
@@ -1451,17 +1469,9 @@ static int __devinit sc92031_probe(struct pci_dev *pdev,
        /* faked with skb_copy_and_csum_dev */
        dev->features = NETIF_F_SG | NETIF_F_HW_CSUM | NETIF_F_HIGHDMA;
 
-       dev->get_stats          = sc92031_get_stats;
-       dev->ethtool_ops        = &sc92031_ethtool_ops;
-       dev->hard_start_xmit    = sc92031_start_xmit;
+       dev->netdev_ops         = &sc92031_netdev_ops;
        dev->watchdog_timeo     = TX_TIMEOUT;
-       dev->open               = sc92031_open;
-       dev->stop               = sc92031_stop;
-       dev->set_multicast_list = sc92031_set_multicast_list;
-       dev->tx_timeout         = sc92031_tx_timeout;
-#ifdef CONFIG_NET_POLL_CONTROLLER
-       dev->poll_controller    = sc92031_poll_controller;
-#endif
+       dev->ethtool_ops        = &sc92031_ethtool_ops;
 
        priv = netdev_priv(dev);
        spin_lock_init(&priv->lock);
@@ -1488,6 +1498,14 @@ static int __devinit sc92031_probe(struct pci_dev *pdev,
        if (err < 0)
                goto out_register_netdev;
 
+#if SC92031_USE_BAR == 0
+       base_addr = dev->mem_start;
+#elif SC92031_USE_BAR == 1
+       base_addr = dev->base_addr;
+#endif
+       printk(KERN_INFO "%s: SC92031 at 0x%lx, %pM, IRQ %d\n", dev->name,
+                       base_addr, dev->dev_addr, dev->irq);
+
        return 0;
 
 out_register_netdev:
@@ -1594,7 +1612,6 @@ static struct pci_driver sc92031_pci_driver = {
 
 static int __init sc92031_init(void)
 {
-       printk(KERN_INFO SC92031_DESCRIPTION " " SC92031_VERSION "\n");
        return pci_register_driver(&sc92031_pci_driver);
 }