netdev: remove HAVE_ leftovers
[safe/jmp/linux-2.6] / drivers / net / tsi108_eth.c
index bb43e7f..a69c4a4 100644 (file)
@@ -802,13 +802,11 @@ static int tsi108_refill_rx(struct net_device *dev, int budget)
                int rx = data->rxhead;
                struct sk_buff *skb;
 
-               data->rxskbs[rx] = skb = netdev_alloc_skb(dev,
-                                                         TSI108_RXBUF_SIZE + 2);
+               skb = netdev_alloc_skb_ip_align(dev, TSI108_RXBUF_SIZE);
+               data->rxskbs[rx] = skb;
                if (!skb)
                        break;
 
-               skb_reserve(skb, 2); /* Align the data on a 4-byte boundary. */
-
                data->rxring[rx].buf0 = dma_map_single(NULL, skb->data,
                                                        TSI108_RX_SKB_SIZE,
                                                        DMA_FROM_DEVICE);
@@ -1132,7 +1130,9 @@ static int tsi108_get_mac(struct net_device *dev)
        }
 
        if (!is_valid_ether_addr(dev->dev_addr)) {
-               printk("KERN_ERR: word1: %08x, word2: %08x\n", word1, word2);
+               printk(KERN_ERR
+                      "%s: Invalid MAC address. word1: %08x, word2: %08x\n",
+                      dev->name, word1, word2);
                return -EINVAL;
        }
 
@@ -1201,8 +1201,8 @@ static void tsi108_set_rx_mode(struct net_device *dev)
                                __set_bit(hash, &data->mc_hash[0]);
                        } else {
                                printk(KERN_ERR
-                                      "%s: got multicast address of length %d "
-                                      "instead of 6.\n", dev->name,
+               "%s: got multicast address of length %d instead of 6.\n",
+                                      dev->name,
                                       mc->dmi_addrlen);
                        }
 
@@ -1354,7 +1354,7 @@ static int tsi108_open(struct net_device *dev)
        for (i = 0; i < TSI108_RXRING_LEN; i++) {
                struct sk_buff *skb;
 
-               skb = netdev_alloc_skb(dev, TSI108_RXBUF_SIZE + NET_IP_ALIGN);
+               skb = netdev_alloc_skb_ip_align(dev, TSI108_RXBUF_SIZE);
                if (!skb) {
                        /* Bah.  No memory for now, but maybe we'll get
                         * some more later.
@@ -1368,8 +1368,6 @@ static int tsi108_open(struct net_device *dev)
                }
 
                data->rxskbs[i] = skb;
-               /* Align the payload on a 4-byte boundary */
-               skb_reserve(skb, 2);
                data->rxskbs[i] = skb;
                data->rxring[i].buf0 = virt_to_phys(data->rxskbs[i]->data);
                data->rxring[i].misc = TSI108_RX_OWN | TSI108_RX_INT;
@@ -1561,6 +1559,18 @@ static const struct ethtool_ops tsi108_ethtool_ops = {
        .set_settings   = tsi108_set_settings,
 };
 
+static const struct net_device_ops tsi108_netdev_ops = {
+       .ndo_open               = tsi108_open,
+       .ndo_stop               = tsi108_close,
+       .ndo_start_xmit         = tsi108_send_packet,
+       .ndo_set_multicast_list = tsi108_set_rx_mode,
+       .ndo_get_stats          = tsi108_get_stats,
+       .ndo_do_ioctl           = tsi108_do_ioctl,
+       .ndo_set_mac_address    = tsi108_set_mac,
+       .ndo_validate_addr      = eth_validate_addr,
+       .ndo_change_mtu         = eth_change_mtu,
+};
+
 static int
 tsi108_init_one(struct platform_device *pdev)
 {
@@ -1616,14 +1626,8 @@ tsi108_init_one(struct platform_device *pdev)
        data->phy_type = einfo->phy_type;
        data->irq_num = einfo->irq_num;
        data->id = pdev->id;
-       dev->open = tsi108_open;
-       dev->stop = tsi108_close;
-       dev->hard_start_xmit = tsi108_send_packet;
-       dev->set_mac_address = tsi108_set_mac;
-       dev->set_multicast_list = tsi108_set_rx_mode;
-       dev->get_stats = tsi108_get_stats;
        netif_napi_add(dev, &data->napi, tsi108_poll, 64);
-       dev->do_ioctl = tsi108_do_ioctl;
+       dev->netdev_ops = &tsi108_netdev_ops;
        dev->ethtool_ops = &tsi108_ethtool_ops;
 
        /* Apparently, the Linux networking code won't use scatter-gather