fec: Add FEC support for MX25 processor
[safe/jmp/linux-2.6] / drivers / net / ni5010.c
index 1dc74a7..462d20f 100644 (file)
@@ -189,6 +189,17 @@ static void __init trigger_irq(int ioaddr)
                outb(MM_EN_XMT|MM_MUX, IE_MMODE); /* Start transmission */
 }
 
+static const struct net_device_ops ni5010_netdev_ops = {
+       .ndo_open               = ni5010_open,
+       .ndo_stop               = ni5010_close,
+       .ndo_start_xmit         = ni5010_send_packet,
+       .ndo_set_multicast_list = ni5010_set_multicast_list,
+       .ndo_tx_timeout         = ni5010_timeout,
+       .ndo_validate_addr      = eth_validate_addr,
+       .ndo_set_mac_address    = eth_mac_addr,
+       .ndo_change_mtu         = eth_change_mtu,
+};
+
 /*
  *      This is the real probe routine.  Linux has a history of friendly device
  *      probes on the ISA bus.  A good device probes avoids doing writes, and
@@ -268,8 +279,9 @@ static int __init ni5010_probe1(struct net_device *dev, int ioaddr)
 
        for (i=0; i<6; i++) {
                outw(i, IE_GP);
-               printk("%2.2x ", dev->dev_addr[i] = inb(IE_SAPROM));
+               dev->dev_addr[i] = inb(IE_SAPROM);
        }
+       printk("%pM ", dev->dev_addr);
 
        PRINTK2((KERN_DEBUG "%s: I/O #4 passed!\n", dev->name));
 
@@ -327,13 +339,8 @@ static int __init ni5010_probe1(struct net_device *dev, int ioaddr)
                outb(0, IE_RBUF);       /* set buffer byte 0 to 0 again */
        }
         printk("-> bufsize rcv/xmt=%d/%d\n", bufsize_rcv, NI5010_BUFSIZE);
-       memset(dev->priv, 0, sizeof(struct ni5010_local));
 
-       dev->open               = ni5010_open;
-       dev->stop               = ni5010_close;
-       dev->hard_start_xmit    = ni5010_send_packet;
-       dev->set_multicast_list = ni5010_set_multicast_list;
-       dev->tx_timeout         = ni5010_timeout;
+       dev->netdev_ops         = &ni5010_netdev_ops;
        dev->watchdog_timeo     = HZ/20;
 
        dev->flags &= ~IFF_MULTICAST;   /* Multicast doesn't work */
@@ -456,7 +463,7 @@ static int ni5010_send_packet(struct sk_buff *skb, struct net_device *dev)
        hardware_send_packet(dev, (unsigned char *)skb->data, skb->len, length-skb->len);
        dev->trans_start = jiffies;
        dev_kfree_skb (skb);
-       return 0;
+       return NETDEV_TX_OK;
 }
 
 /*
@@ -516,7 +523,6 @@ static void dump_packet(void *buf, int len)
 /* We have a good packet, get it out of the buffer. */
 static void ni5010_rx(struct net_device *dev)
 {
-       struct ni5010_local *lp = netdev_priv(dev);
        int ioaddr = dev->base_addr;
        unsigned char rcv_stat;
        struct sk_buff *skb;
@@ -569,13 +575,11 @@ static void ni5010_rx(struct net_device *dev)
 
        skb->protocol = eth_type_trans(skb,dev);
        netif_rx(skb);
-       dev->last_rx = jiffies;
        dev->stats.rx_packets++;
        dev->stats.rx_bytes += i_pkt_size;
 
        PRINTK2((KERN_DEBUG "%s: Received packet, size=%#4.4x\n",
                dev->name, i_pkt_size));
-
 }
 
 static int process_xmt_interrupt(struct net_device *dev)
@@ -648,7 +652,6 @@ static void ni5010_set_multicast_list(struct net_device *dev)
        PRINTK2((KERN_DEBUG "%s: entering set_multicast_list\n", dev->name));
 
        if (dev->flags&IFF_PROMISC || dev->flags&IFF_ALLMULTI || dev->mc_list) {
-               dev->flags |= IFF_PROMISC;
                outb(RMD_PROMISC, EDLC_RMODE); /* Enable promiscuous mode */
                PRINTK((KERN_DEBUG "%s: Entering promiscuous mode\n", dev->name));
        } else {
@@ -769,12 +772,3 @@ module_init(ni5010_init_module);
 module_exit(ni5010_cleanup_module);
 #endif /* MODULE */
 MODULE_LICENSE("GPL");
-
-/*
- * Local variables:
- *  compile-command: "gcc -D__KERNEL__ -I/usr/src/linux/net/inet -Wall -Wstrict-prototypes -O6 -m486 -c ni5010.c"
- *  version-control: t
- *  kept-new-versions: 5
- *  tab-width: 4
- * End:
- */