]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - drivers/net/gianfar.c
Merge branch 'master' into csb1725
[mv-sheeva.git] / drivers / net / gianfar.c
index 4f7c3f3ca234634203c246d4e6494930de5f7247..d1bec6269173844cfb17786c99936beee8dfd197 100644 (file)
@@ -577,11 +577,10 @@ static int gfar_parse_group(struct device_node *np,
                        irq_of_parse_and_map(np, 1);
                priv->gfargrp[priv->num_grps].interruptError =
                        irq_of_parse_and_map(np,2);
-               if (priv->gfargrp[priv->num_grps].interruptTransmit < 0 ||
-                       priv->gfargrp[priv->num_grps].interruptReceive < 0 ||
-                       priv->gfargrp[priv->num_grps].interruptError < 0) {
+               if (priv->gfargrp[priv->num_grps].interruptTransmit == NO_IRQ ||
+                   priv->gfargrp[priv->num_grps].interruptReceive  == NO_IRQ ||
+                   priv->gfargrp[priv->num_grps].interruptError    == NO_IRQ)
                        return -EINVAL;
-               }
        }
 
        priv->gfargrp[priv->num_grps].grp_id = priv->num_grps;
@@ -654,9 +653,8 @@ static int gfar_of_init(struct platform_device *ofdev, struct net_device **pdev)
        priv->node = ofdev->dev.of_node;
        priv->ndev = dev;
 
-       dev->num_tx_queues = num_tx_qs;
-       dev->real_num_tx_queues = num_tx_qs;
        priv->num_tx_queues = num_tx_qs;
+       netif_set_real_num_rx_queues(dev, num_rx_qs);
        priv->num_rx_queues = num_rx_qs;
        priv->num_grps = 0x0;
 
@@ -1859,7 +1857,7 @@ static int register_grp_irqs(struct gfar_priv_grp *grp)
                                printk(KERN_ERR "%s: Can't get IRQ %d\n",
                                        dev->name, grp->interruptError);
 
-                               goto err_irq_fail;
+                       goto err_irq_fail;
                }
 
                if ((err = request_irq(grp->interruptTransmit, gfar_transmit,
@@ -2048,7 +2046,6 @@ static int gfar_start_xmit(struct sk_buff *skb, struct net_device *dev)
        u32 bufaddr;
        unsigned long flags;
        unsigned int nr_frags, nr_txbds, length;
-       union skb_shared_tx *shtx;
 
        /*
         * TOE=1 frames larger than 2500 bytes may see excess delays
@@ -2069,15 +2066,15 @@ static int gfar_start_xmit(struct sk_buff *skb, struct net_device *dev)
        txq = netdev_get_tx_queue(dev, rq);
        base = tx_queue->tx_bd_base;
        regs = tx_queue->grp->regs;
-       shtx = skb_tx(skb);
 
        /* check if time stamp should be generated */
-       if (unlikely(shtx->hardware && priv->hwts_tx_en))
+       if (unlikely(skb_shinfo(skb)->tx_flags & SKBTX_HW_TSTAMP &&
+                    priv->hwts_tx_en))
                do_tstamp = 1;
 
        /* make space for additional header when fcb is needed */
        if (((skb->ip_summed == CHECKSUM_PARTIAL) ||
-                       (priv->vlgrp && vlan_tx_tag_present(skb)) ||
+                       vlan_tx_tag_present(skb) ||
                        unlikely(do_tstamp)) &&
                        (skb_headroom(skb) < GMAC_FCB_LEN)) {
                struct sk_buff *skb_new;
@@ -2163,7 +2160,7 @@ static int gfar_start_xmit(struct sk_buff *skb, struct net_device *dev)
                gfar_tx_checksum(skb, fcb);
        }
 
-       if (priv->vlgrp && vlan_tx_tag_present(skb)) {
+       if (vlan_tx_tag_present(skb)) {
                if (unlikely(NULL == fcb)) {
                        fcb = gfar_add_fcb(skb);
                        lstatus |= BD_LFLAG(TXBD_TOE);
@@ -2174,7 +2171,7 @@ static int gfar_start_xmit(struct sk_buff *skb, struct net_device *dev)
 
        /* Setup tx hardware time stamping if requested */
        if (unlikely(do_tstamp)) {
-               shtx->in_progress = 1;
+               skb_shinfo(skb)->tx_flags |= SKBTX_IN_PROGRESS;
                if (fcb == NULL)
                        fcb = gfar_add_fcb(skb);
                fcb->ptp = 1;
@@ -2446,7 +2443,6 @@ static int gfar_clean_tx_ring(struct gfar_priv_tx_q *tx_queue)
        int howmany = 0;
        u32 lstatus;
        size_t buflen;
-       union skb_shared_tx *shtx;
 
        rx_queue = priv->rx_queue[tx_queue->qindex];
        bdp = tx_queue->dirty_tx;
@@ -2461,8 +2457,7 @@ static int gfar_clean_tx_ring(struct gfar_priv_tx_q *tx_queue)
                 * When time stamping, one additional TxBD must be freed.
                 * Also, we need to dma_unmap_single() the TxPAL.
                 */
-               shtx = skb_tx(skb);
-               if (unlikely(shtx->in_progress))
+               if (unlikely(skb_shinfo(skb)->tx_flags & SKBTX_IN_PROGRESS))
                        nr_txbds = frags + 2;
                else
                        nr_txbds = frags + 1;
@@ -2476,7 +2471,7 @@ static int gfar_clean_tx_ring(struct gfar_priv_tx_q *tx_queue)
                                (lstatus & BD_LENGTH_MASK))
                        break;
 
-               if (unlikely(shtx->in_progress)) {
+               if (unlikely(skb_shinfo(skb)->tx_flags & SKBTX_IN_PROGRESS)) {
                        next = next_txbd(bdp, base, tx_ring_size);
                        buflen = next->length + GMAC_FCB_LEN;
                } else
@@ -2485,7 +2480,7 @@ static int gfar_clean_tx_ring(struct gfar_priv_tx_q *tx_queue)
                dma_unmap_single(&priv->ofdev->dev, bdp->bufPtr,
                                buflen, DMA_TO_DEVICE);
 
-               if (unlikely(shtx->in_progress)) {
+               if (unlikely(skb_shinfo(skb)->tx_flags & SKBTX_IN_PROGRESS)) {
                        struct skb_shared_hwtstamps shhwtstamps;
                        u64 *ns = (u64*) (((u32)skb->data + 0x10) & ~0x7);
                        memset(&shhwtstamps, 0, sizeof(shhwtstamps));
@@ -2515,7 +2510,7 @@ static int gfar_clean_tx_ring(struct gfar_priv_tx_q *tx_queue)
                                skb_recycle_check(skb, priv->rx_buffer_size +
                                        RXBUF_ALIGNMENT)) {
                        gfar_align_skb(skb);
-                       __skb_queue_head(&priv->rx_recycle, skb);
+                       skb_queue_head(&priv->rx_recycle, skb);
                } else
                        dev_kfree_skb_any(skb);
 
@@ -2598,7 +2593,7 @@ struct sk_buff * gfar_new_skb(struct net_device *dev)
        struct gfar_private *priv = netdev_priv(dev);
        struct sk_buff *skb = NULL;
 
-       skb = __skb_dequeue(&priv->rx_recycle);
+       skb = skb_dequeue(&priv->rx_recycle);
        if (!skb)
                skb = gfar_alloc_skb(dev);
 
@@ -2657,7 +2652,7 @@ static inline void gfar_rx_checksum(struct sk_buff *skb, struct rxfcb *fcb)
        if ((fcb->flags & RXFCB_CSUM_MASK) == (RXFCB_CIP | RXFCB_CTU))
                skb->ip_summed = CHECKSUM_UNNECESSARY;
        else
-               skb->ip_summed = CHECKSUM_NONE;
+               skb_checksum_none_assert(skb);
 }
 
 
@@ -2754,7 +2749,7 @@ int gfar_clean_rx_ring(struct gfar_priv_rx_q *rx_queue, int rx_work_limit)
                        if (unlikely(!newskb))
                                newskb = skb;
                        else if (skb)
-                               __skb_queue_head(&priv->rx_recycle, skb);
+                               skb_queue_head(&priv->rx_recycle, skb);
                } else {
                        /* Increment the number of packets */
                        rx_queue->stats.rx_packets++;