diff options
-rw-r--r-- | drivers/net/ethernet/freescale/fec_main.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c index ab10480718a8..d26c29c914ff 100644 --- a/drivers/net/ethernet/freescale/fec_main.c +++ b/drivers/net/ethernet/freescale/fec_main.c @@ -1080,6 +1080,9 @@ fec_enet_rx(struct net_device *ndev, int budget) if (fep->quirks & FEC_QUIRK_SWAP_FRAME) swap_buffer(data, pkt_len); + skb_reserve(skb, NET_IP_ALIGN); + skb_put(skb, pkt_len); /* Make room */ + /* If this is a VLAN packet remove the VLAN Tag */ if (cbd_esc & BD_ENET_RX_VLAN) { /* Push and remove the vlan tag */ @@ -1089,21 +1092,18 @@ fec_enet_rx(struct net_device *ndev, int budget) __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), ntohs(vlan->h_vlan_TCI)); - } - - { - int payload_offset = (2 * ETH_ALEN); - skb_reserve(skb, NET_IP_ALIGN); - skb_put(skb, pkt_len); /* Make room */ /* Extract the frame data without the VLAN header. */ - skb_copy_to_linear_data(skb, data, (2 * ETH_ALEN)); - if (cbd_esc & BD_ENET_RX_VLAN) - payload_offset = (2 * ETH_ALEN) + VLAN_HLEN; - skb_copy_to_linear_data_offset(skb, (2 * ETH_ALEN), - data + payload_offset, - pkt_len - (2 * ETH_ALEN)); + skb_copy_to_linear_data(skb, data, 2 * ETH_ALEN); + skb_copy_to_linear_data_offset(skb, 2 * ETH_ALEN, + data + 2 * ETH_ALEN + + VLAN_HLEN, + pkt_len - 2 * ETH_ALEN); + } else { + skb_copy_to_linear_data(skb, data, pkt_len); + } + { skb->protocol = eth_type_trans(skb, ndev); /* Get receive timestamp from the skb */ |