ath9k: fix misplaced semicolon on rate control
[safe/jmp/linux-2.6] / drivers / net / at1700.c
index 2d4b5c3..544d5af 100644 (file)
@@ -159,7 +159,8 @@ struct net_local {
 static int at1700_probe1(struct net_device *dev, int ioaddr);
 static int read_eeprom(long ioaddr, int location);
 static int net_open(struct net_device *dev);
-static int     net_send_packet(struct sk_buff *skb, struct net_device *dev);
+static netdev_tx_t net_send_packet(struct sk_buff *skb,
+                                  struct net_device *dev);
 static irqreturn_t net_interrupt(int irq, void *dev_id);
 static void net_rx(struct net_device *dev);
 static int net_close(struct net_device *dev);
@@ -249,6 +250,17 @@ out:
        return ERR_PTR(err);
 }
 
+static const struct net_device_ops at1700_netdev_ops = {
+       .ndo_open               = net_open,
+       .ndo_stop               = net_close,
+       .ndo_start_xmit         = net_send_packet,
+       .ndo_set_multicast_list = set_rx_mode,
+       .ndo_tx_timeout         = net_tx_timeout,
+       .ndo_change_mtu         = eth_change_mtu,
+       .ndo_set_mac_address    = eth_mac_addr,
+       .ndo_validate_addr      = eth_validate_addr,
+};
+
 /* The Fujitsu datasheet suggests that the NIC be probed for by checking its
    "signature", the default bit pattern after a reset.  This *doesn't* work --
    there is no way to reset the bus interface without a complete power-cycle!
@@ -307,7 +319,7 @@ static int __init at1700_probe1(struct net_device *dev, int ioaddr)
                                pos3 = mca_read_stored_pos( slot, 3 );
                                pos4 = mca_read_stored_pos( slot, 4 );
 
-                               for (l_i = 0; l_i < 0x09; l_i++)
+                               for (l_i = 0; l_i < 8; l_i++)
                                        if (( pos3 & 0x07) == at1700_ioaddr_pattern[l_i])
                                                break;
                                ioaddr = at1700_mca_probe_list[l_i];
@@ -448,13 +460,7 @@ found:
        if (net_debug)
                printk(version);
 
-       memset(lp, 0, sizeof(struct net_local));
-
-       dev->open               = net_open;
-       dev->stop               = net_close;
-       dev->hard_start_xmit = net_send_packet;
-       dev->set_multicast_list = &set_rx_mode;
-       dev->tx_timeout = net_tx_timeout;
+       dev->netdev_ops = &at1700_netdev_ops;
        dev->watchdog_timeo = TX_TIMEOUT;
 
        spin_lock_init(&lp->lock);
@@ -590,7 +596,8 @@ static void net_tx_timeout (struct net_device *dev)
 }
 
 
-static int net_send_packet (struct sk_buff *skb, struct net_device *dev)
+static netdev_tx_t net_send_packet (struct sk_buff *skb,
+                                   struct net_device *dev)
 {
        struct net_local *lp = netdev_priv(dev);
        int ioaddr = dev->base_addr;
@@ -638,7 +645,7 @@ static int net_send_packet (struct sk_buff *skb, struct net_device *dev)
                netif_start_queue (dev);
        dev_kfree_skb (skb);
 
-       return 0;
+       return NETDEV_TX_OK;
 }
 
 /* The typical workload of the driver:
@@ -828,7 +835,6 @@ set_rx_mode(struct net_device *dev)
        struct net_local *lp = netdev_priv(dev);
        unsigned char mc_filter[8];              /* Multicast hash filter */
        unsigned long flags;
-       int i;
 
        if (dev->flags & IFF_PROMISC) {
                memset(mc_filter, 0xff, sizeof(mc_filter));
@@ -857,6 +863,7 @@ set_rx_mode(struct net_device *dev)
 
        spin_lock_irqsave (&lp->lock, flags);
        if (memcmp(mc_filter, lp->mc_filter, sizeof(mc_filter))) {
+               int i;
                int saved_bank = inw(ioaddr + CONFIG_0);
                /* Switch to bank 1 and set the multicast table. */
                outw((saved_bank & ~0x0C00) | 0x0480, ioaddr + CONFIG_0);
@@ -899,15 +906,3 @@ module_init(at1700_module_init);
 module_exit(at1700_module_exit);
 #endif /* MODULE */
 MODULE_LICENSE("GPL");
-
-
-/*
- * Local variables:
- *  compile-command: "gcc -DMODULE -D__KERNEL__ -Wall -Wstrict-prototypes -O6 -c at1700.c"
- *  alt-compile-command: "gcc -DMODVERSIONS -DMODULE -D__KERNEL__ -Wall -Wstrict-prototypes -O6 -c at1700.c"
- *  tab-width: 4
- *  c-basic-offset: 4
- *  c-indent-level: 4
- * End:
- */
-