summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@arm.linux.org.uk>2014-03-12 17:45:57 +0000
committerRussell King <rmk+kernel@arm.linux.org.uk>2014-10-17 14:35:48 +0100
commite8d8ba2f37b2f4fdf10e690e7e07ee9ff164e857 (patch)
tree4c5c03ad3823d5711c130fd1843b6cbdad882629
parent932e908a07bb584119b7aee4280b95adf415f246 (diff)
net:fec: extract and record vlan tag receive processing in one place
Rather than having the vlan tag processing scattered in multiple different places, we can now localize the reading of the tag with storing the tag in the skb. Group this code together. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
-rw-r--r--drivers/net/ethernet/freescale/fec_main.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c
index 791d6f519256..ab10480718a8 100644
--- a/drivers/net/ethernet/freescale/fec_main.c
+++ b/drivers/net/ethernet/freescale/fec_main.c
@@ -977,7 +977,6 @@ fec_enet_rx(struct net_device *ndev, int budget)
ushort pkt_len;
__u8 *data;
int pkt_received = 0;
- u16 vlan_tag;
unsigned int index = fep->rx_next;
#ifdef CONFIG_M532x
@@ -1084,9 +1083,12 @@ fec_enet_rx(struct net_device *ndev, int budget)
/* If this is a VLAN packet remove the VLAN Tag */
if (cbd_esc & BD_ENET_RX_VLAN) {
/* Push and remove the vlan tag */
- struct vlan_hdr *vlan_header =
+ struct vlan_hdr *vlan =
(struct vlan_hdr *) (data + ETH_HLEN);
- vlan_tag = ntohs(vlan_header->h_vlan_TCI);
+
+ __vlan_hwaccel_put_tag(skb,
+ htons(ETH_P_8021Q),
+ ntohs(vlan->h_vlan_TCI));
}
{
@@ -1118,12 +1120,6 @@ fec_enet_rx(struct net_device *ndev, int budget)
}
}
- /* Handle received VLAN packets */
- if (cbd_esc & BD_ENET_RX_VLAN)
- __vlan_hwaccel_put_tag(skb,
- htons(ETH_P_8021Q),
- vlan_tag);
-
napi_gro_receive(&fep->napi, skb);
}