diff options
author | David S. Miller <davem@davemloft.net> | 2010-04-07 02:53:30 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-04-07 02:53:30 -0400 |
commit | 4a35ecf8bf1c4b039503fa554100fe85c761de76 (patch) | |
tree | 9b75f5d5636004d9a9aa496924377379be09aa1f /drivers/net/gianfar.c | |
parent | b4d562e3c3553ac58c7120555c4e4aefbb090a2a (diff) | |
parent | fb9e2d887243499b8d28efcf80821c4f6a092395 (diff) |
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
Conflicts:
drivers/net/bonding/bond_main.c
drivers/net/via-velocity.c
drivers/net/wireless/iwlwifi/iwl-agn.c
Diffstat (limited to 'drivers/net/gianfar.c')
-rw-r--r-- | drivers/net/gianfar.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/drivers/net/gianfar.c b/drivers/net/gianfar.c index fdd26c2b1a2f..5175233f11f2 100644 --- a/drivers/net/gianfar.c +++ b/drivers/net/gianfar.c | |||
@@ -676,7 +676,7 @@ static int gfar_of_init(struct of_device *ofdev, struct net_device **pdev) | |||
676 | priv->rx_queue[i] = NULL; | 676 | priv->rx_queue[i] = NULL; |
677 | 677 | ||
678 | for (i = 0; i < priv->num_tx_queues; i++) { | 678 | for (i = 0; i < priv->num_tx_queues; i++) { |
679 | priv->tx_queue[i] = (struct gfar_priv_tx_q *)kmalloc( | 679 | priv->tx_queue[i] = (struct gfar_priv_tx_q *)kzalloc( |
680 | sizeof (struct gfar_priv_tx_q), GFP_KERNEL); | 680 | sizeof (struct gfar_priv_tx_q), GFP_KERNEL); |
681 | if (!priv->tx_queue[i]) { | 681 | if (!priv->tx_queue[i]) { |
682 | err = -ENOMEM; | 682 | err = -ENOMEM; |
@@ -689,7 +689,7 @@ static int gfar_of_init(struct of_device *ofdev, struct net_device **pdev) | |||
689 | } | 689 | } |
690 | 690 | ||
691 | for (i = 0; i < priv->num_rx_queues; i++) { | 691 | for (i = 0; i < priv->num_rx_queues; i++) { |
692 | priv->rx_queue[i] = (struct gfar_priv_rx_q *)kmalloc( | 692 | priv->rx_queue[i] = (struct gfar_priv_rx_q *)kzalloc( |
693 | sizeof (struct gfar_priv_rx_q), GFP_KERNEL); | 693 | sizeof (struct gfar_priv_rx_q), GFP_KERNEL); |
694 | if (!priv->rx_queue[i]) { | 694 | if (!priv->rx_queue[i]) { |
695 | err = -ENOMEM; | 695 | err = -ENOMEM; |
@@ -1120,10 +1120,10 @@ static int gfar_probe(struct of_device *ofdev, | |||
1120 | /* provided which set of benchmarks. */ | 1120 | /* provided which set of benchmarks. */ |
1121 | printk(KERN_INFO "%s: Running with NAPI enabled\n", dev->name); | 1121 | printk(KERN_INFO "%s: Running with NAPI enabled\n", dev->name); |
1122 | for (i = 0; i < priv->num_rx_queues; i++) | 1122 | for (i = 0; i < priv->num_rx_queues; i++) |
1123 | printk(KERN_INFO "%s: :RX BD ring size for Q[%d]: %d\n", | 1123 | printk(KERN_INFO "%s: RX BD ring size for Q[%d]: %d\n", |
1124 | dev->name, i, priv->rx_queue[i]->rx_ring_size); | 1124 | dev->name, i, priv->rx_queue[i]->rx_ring_size); |
1125 | for(i = 0; i < priv->num_tx_queues; i++) | 1125 | for(i = 0; i < priv->num_tx_queues; i++) |
1126 | printk(KERN_INFO "%s:TX BD ring size for Q[%d]: %d\n", | 1126 | printk(KERN_INFO "%s: TX BD ring size for Q[%d]: %d\n", |
1127 | dev->name, i, priv->tx_queue[i]->tx_ring_size); | 1127 | dev->name, i, priv->tx_queue[i]->tx_ring_size); |
1128 | 1128 | ||
1129 | return 0; | 1129 | return 0; |
@@ -1638,13 +1638,13 @@ static void free_skb_resources(struct gfar_private *priv) | |||
1638 | /* Go through all the buffer descriptors and free their data buffers */ | 1638 | /* Go through all the buffer descriptors and free their data buffers */ |
1639 | for (i = 0; i < priv->num_tx_queues; i++) { | 1639 | for (i = 0; i < priv->num_tx_queues; i++) { |
1640 | tx_queue = priv->tx_queue[i]; | 1640 | tx_queue = priv->tx_queue[i]; |
1641 | if(!tx_queue->tx_skbuff) | 1641 | if(tx_queue->tx_skbuff) |
1642 | free_skb_tx_queue(tx_queue); | 1642 | free_skb_tx_queue(tx_queue); |
1643 | } | 1643 | } |
1644 | 1644 | ||
1645 | for (i = 0; i < priv->num_rx_queues; i++) { | 1645 | for (i = 0; i < priv->num_rx_queues; i++) { |
1646 | rx_queue = priv->rx_queue[i]; | 1646 | rx_queue = priv->rx_queue[i]; |
1647 | if(!rx_queue->rx_skbuff) | 1647 | if(rx_queue->rx_skbuff) |
1648 | free_skb_rx_queue(rx_queue); | 1648 | free_skb_rx_queue(rx_queue); |
1649 | } | 1649 | } |
1650 | 1650 | ||
@@ -2393,6 +2393,7 @@ struct sk_buff * gfar_new_skb(struct net_device *dev) | |||
2393 | * as many bytes as needed to align the data properly | 2393 | * as many bytes as needed to align the data properly |
2394 | */ | 2394 | */ |
2395 | skb_reserve(skb, alignamount); | 2395 | skb_reserve(skb, alignamount); |
2396 | GFAR_CB(skb)->alignamount = alignamount; | ||
2396 | 2397 | ||
2397 | return skb; | 2398 | return skb; |
2398 | } | 2399 | } |
@@ -2533,13 +2534,13 @@ int gfar_clean_rx_ring(struct gfar_priv_rx_q *rx_queue, int rx_work_limit) | |||
2533 | newskb = skb; | 2534 | newskb = skb; |
2534 | else if (skb) { | 2535 | else if (skb) { |
2535 | /* | 2536 | /* |
2536 | * We need to reset ->data to what it | 2537 | * We need to un-reserve() the skb to what it |
2537 | * was before gfar_new_skb() re-aligned | 2538 | * was before gfar_new_skb() re-aligned |
2538 | * it to an RXBUF_ALIGNMENT boundary | 2539 | * it to an RXBUF_ALIGNMENT boundary |
2539 | * before we put the skb back on the | 2540 | * before we put the skb back on the |
2540 | * recycle list. | 2541 | * recycle list. |
2541 | */ | 2542 | */ |
2542 | skb->data = skb->head + NET_SKB_PAD; | 2543 | skb_reserve(skb, -GFAR_CB(skb)->alignamount); |
2543 | __skb_queue_head(&priv->rx_recycle, skb); | 2544 | __skb_queue_head(&priv->rx_recycle, skb); |
2544 | } | 2545 | } |
2545 | } else { | 2546 | } else { |