ath5k: remove get_tx_stats() mac80211 op
[safe/jmp/linux-2.6] / drivers / net / wan / hd64572.c
index 1de3cb7..84f0137 100644 (file)
@@ -131,6 +131,7 @@ static inline void sca_set_carrier(port_t *port)
 static void sca_init_port(port_t *port)
 {
        card_t *card = port->card;
+       u16 dmac_rx = get_dmac_rx(port), dmac_tx = get_dmac_tx(port);
        int transmit, i;
 
        port->rxin = 0;
@@ -138,7 +139,6 @@ static void sca_init_port(port_t *port)
        port->txlast = 0;
 
        for (transmit = 0; transmit < 2; transmit++) {
-               u16 dmac = transmit ? get_dmac_tx(port) : get_dmac_rx(port);
                u16 buffs = transmit ? card->tx_ring_buffers
                        : card->rx_ring_buffers;
 
@@ -152,42 +152,37 @@ static void sca_init_port(port_t *port)
                        writew(0, &desc->len);
                        writeb(0, &desc->stat);
                }
-
-               /* DMA disable - to halt state */
-               sca_out(0, transmit ? DSR_TX(port->chan) :
-                       DSR_RX(port->chan), card);
-               /* software ABORT - to initial state */
-               sca_out(DCR_ABORT, transmit ? DCR_TX(port->chan) :
-                       DCR_RX(port->chan), card);
-
-               /* current desc addr */
-               sca_outl(desc_offset(port, 0, transmit), dmac + CDAL, card);
-               if (!transmit)
-                       sca_outl(desc_offset(port, buffs - 1, transmit),
-                                dmac + EDAL, card);
-               else
-                       sca_outl(desc_offset(port, 0, transmit), dmac + EDAL,
-                                card);
-
-               /* clear frame end interrupt counter */
-               sca_out(DCR_CLEAR_EOF, transmit ? DCR_TX(port->chan) :
-                       DCR_RX(port->chan), card);
-
-               if (!transmit) { /* Receive */
-                       /* set buffer length */
-                       sca_outw(HDLC_MAX_MRU, dmac + BFLL, card);
-                       /* Chain mode, Multi-frame */
-                       sca_out(0x14, DMR_RX(port->chan), card);
-                       sca_out(DIR_EOME, DIR_RX(port->chan), card);
-                       /* DMA enable */
-                       sca_out(DSR_DE, DSR_RX(port->chan), card);
-               } else {        /* Transmit */
-                       /* Chain mode, Multi-frame */
-                       sca_out(0x14, DMR_TX(port->chan), card);
-                       /* enable underflow interrupts */
-                       sca_out(DIR_EOME, DIR_TX(port->chan), card);
-               }
        }
+
+       /* DMA disable - to halt state */
+       sca_out(0, DSR_RX(port->chan), card);
+       sca_out(0, DSR_TX(port->chan), card);
+
+       /* software ABORT - to initial state */
+       sca_out(DCR_ABORT, DCR_RX(port->chan), card);
+       sca_out(DCR_ABORT, DCR_TX(port->chan), card);
+
+       /* current desc addr */
+       sca_outl(desc_offset(port, 0, 0), dmac_rx + CDAL, card);
+       sca_outl(desc_offset(port, card->tx_ring_buffers - 1, 0),
+                dmac_rx + EDAL, card);
+       sca_outl(desc_offset(port, 0, 1), dmac_tx + CDAL, card);
+       sca_outl(desc_offset(port, 0, 1), dmac_tx + EDAL, card);
+
+       /* clear frame end interrupt counter */
+       sca_out(DCR_CLEAR_EOF, DCR_RX(port->chan), card);
+       sca_out(DCR_CLEAR_EOF, DCR_TX(port->chan), card);
+
+       /* Receive */
+       sca_outw(HDLC_MAX_MRU, dmac_rx + BFLL, card); /* set buffer length */
+       sca_out(0x14, DMR_RX(port->chan), card); /* Chain mode, Multi-frame */
+       sca_out(DIR_EOME, DIR_RX(port->chan), card); /* enable interrupts */
+       sca_out(DSR_DE, DSR_RX(port->chan), card); /* DMA enable */
+
+       /* Transmit */
+       sca_out(0x14, DMR_TX(port->chan), card); /* Chain mode, Multi-frame */
+       sca_out(DIR_EOME, DIR_TX(port->chan), card); /* enable interrupts */
+
        sca_set_carrier(port);
        netif_napi_add(port->netdev, &port->napi, sca_poll, NAPI_WEIGHT);
 }
@@ -346,7 +341,7 @@ static int sca_poll(struct napi_struct *napi, int budget)
                received = sca_rx_done(port, budget);
 
        if (received < budget) {
-               netif_rx_complete(port->netdev, napi);
+               napi_complete(napi);
                enable_intr(port);
        }
 
@@ -364,7 +359,7 @@ static irqreturn_t sca_intr(int irq, void *dev_id)
                if (port && (isr0 & (i ? 0x08002200 : 0x00080022))) {
                        handled = 1;
                        disable_intr(port);
-                       netif_rx_schedule(port->netdev, &port->napi);
+                       napi_schedule(&port->napi);
                }
        }
 
@@ -534,8 +529,9 @@ static void sca_dump_rings(struct net_device *dev)
               sca_in(DSR_RX(port->chan), card) & DSR_DE ? "" : "in");
        for (cnt = 0; cnt < port->card->rx_ring_buffers; cnt++)
                printk(" %02X", readb(&(desc_address(port, cnt, 0)->stat)));
+       printk(KERN_CONT "\n");
 
-       printk("\n" KERN_DEBUG "TX ring: CDA=%u EDA=%u DSR=%02X in=%u "
+       printk(KERN_DEBUG "TX ring: CDA=%u EDA=%u DSR=%02X in=%u "
               "last=%u %sactive",
               sca_inl(get_dmac_tx(port) + CDAL, card),
               sca_inl(get_dmac_tx(port) + EDAL, card),
@@ -566,7 +562,7 @@ static void sca_dump_rings(struct net_device *dev)
 #endif /* DEBUG_RINGS */
 
 
-static int sca_xmit(struct sk_buff *skb, struct net_device *dev)
+static netdev_tx_t sca_xmit(struct sk_buff *skb, struct net_device *dev)
 {
        port_t *port = dev_to_port(dev);
        card_t *card = port->card;
@@ -605,7 +601,7 @@ static int sca_xmit(struct sk_buff *skb, struct net_device *dev)
        spin_unlock_irq(&port->lock);
 
        dev_kfree_skb(skb);
-       return 0;
+       return NETDEV_TX_OK;
 }