2010-11-28 18:03:48 +00:00
|
|
|
Index: linux-2.6.32.26/drivers/net/cpmac.c
|
2010-11-25 11:58:02 +00:00
|
|
|
===================================================================
|
2010-11-28 18:03:48 +00:00
|
|
|
--- linux-2.6.32.26.orig/drivers/net/cpmac.c 2010-11-28 05:23:59.482390691 -0800
|
|
|
|
+++ linux-2.6.32.26/drivers/net/cpmac.c 2010-11-28 05:26:02.494883201 -0800
|
|
|
|
@@ -369,6 +369,7 @@
|
2010-11-25 11:58:02 +00:00
|
|
|
struct cpmac_desc *desc)
|
|
|
|
{
|
|
|
|
struct sk_buff *skb, *result = NULL;
|
|
|
|
+ int offset;
|
|
|
|
|
|
|
|
if (unlikely(netif_msg_hw(priv)))
|
|
|
|
cpmac_dump_desc(priv->dev, desc);
|
2010-11-28 18:03:48 +00:00
|
|
|
@@ -382,9 +383,13 @@
|
2010-11-25 11:58:02 +00:00
|
|
|
|
|
|
|
skb = netdev_alloc_skb(priv->dev, CPMAC_SKB_SIZE);
|
|
|
|
if (likely(skb)) {
|
|
|
|
- skb_reserve(skb, 2);
|
|
|
|
+ offset = 2;
|
|
|
|
+ if (priv->phy) {
|
|
|
|
+ offset += priv->phy->pkt_align;
|
|
|
|
+ }
|
|
|
|
+ skb_reserve(skb, offset);
|
|
|
|
+
|
|
|
|
skb_put(desc->skb, desc->datalen);
|
|
|
|
- desc->skb->protocol = eth_type_trans(desc->skb, priv->dev);
|
|
|
|
desc->skb->ip_summed = CHECKSUM_NONE;
|
|
|
|
priv->dev->stats.rx_packets++;
|
|
|
|
priv->dev->stats.rx_bytes += desc->datalen;
|
2010-11-28 18:03:48 +00:00
|
|
|
@@ -456,7 +461,12 @@
|
2010-11-25 11:58:02 +00:00
|
|
|
|
|
|
|
skb = cpmac_rx_one(priv, desc);
|
|
|
|
if (likely(skb)) {
|
|
|
|
- netif_receive_skb(skb);
|
|
|
|
+ if (priv->phy->netif_receive_skb) {
|
|
|
|
+ priv->phy->netif_receive_skb(skb);
|
|
|
|
+ } else {
|
|
|
|
+ skb->protocol = eth_type_trans(skb, priv->dev);
|
|
|
|
+ netif_receive_skb(skb);
|
|
|
|
+ }
|
|
|
|
received++;
|
|
|
|
}
|
|
|
|
desc = desc->next;
|
2010-11-28 18:03:48 +00:00
|
|
|
@@ -951,7 +961,7 @@
|
2010-11-25 11:58:02 +00:00
|
|
|
|
|
|
|
static int cpmac_open(struct net_device *dev)
|
|
|
|
{
|
|
|
|
- int i, size, res;
|
|
|
|
+ int i, size, res, offset;
|
|
|
|
struct cpmac_priv *priv = netdev_priv(dev);
|
|
|
|
struct resource *mem;
|
|
|
|
struct cpmac_desc *desc;
|
2010-11-28 18:03:48 +00:00
|
|
|
@@ -995,7 +1005,12 @@
|
2010-11-25 11:58:02 +00:00
|
|
|
res = -ENOMEM;
|
|
|
|
goto fail_desc;
|
|
|
|
}
|
|
|
|
- skb_reserve(skb, 2);
|
|
|
|
+ offset = 2;
|
|
|
|
+ if (priv->phy) {
|
|
|
|
+ offset += priv->phy->pkt_align;
|
|
|
|
+ }
|
|
|
|
+ skb_reserve(skb, offset);
|
|
|
|
+
|
|
|
|
desc->skb = skb;
|
|
|
|
desc->data_mapping = dma_map_single(&dev->dev, skb->data,
|
|
|
|
CPMAC_SKB_SIZE,
|