diff options
author | Claudiu Manoil <claudiu.manoil@freescale.com> | 2014-03-20 17:54:18 (GMT) |
---|---|---|
committer | Matthew Weigel <Matthew.Weigel@freescale.com> | 2014-12-11 18:38:10 (GMT) |
commit | 7d35103be8df37f81fe10ec0b917a9047d0bc97f (patch) | |
tree | c04ba5a0db674fc322b3352137f11faf1829a332 /drivers/net/ethernet/freescale/gianfar.c | |
parent | 9bd646d13416116fefaad7f714eccdaa0fca0a18 (diff) | |
download | linux-fsl-qoriq-7d35103be8df37f81fe10ec0b917a9047d0bc97f.tar.xz |
gianfar: Make FCB access endian safe
Use conversion macros to correctly access the BE
fields of the Rx and Tx Frame Control Block on LE CPUs.
Signed-off-by: Claudiu Manoil <claudiu.manoil@freescale.com>
Change-Id: Ieb5b1d44449f6acbfcc39ba2a0d8cd23669b5d4c
Reviewed-on: http://git.am.freescale.net:8181/21175
Tested-by: Review Code-CDREVIEW <CDREVIEW@freescale.com>
Reviewed-by: Zhengxiong Jin <Jason.Jin@freescale.com>
Diffstat (limited to 'drivers/net/ethernet/freescale/gianfar.c')
-rw-r--r-- | drivers/net/ethernet/freescale/gianfar.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/net/ethernet/freescale/gianfar.c b/drivers/net/ethernet/freescale/gianfar.c index d0095d8..148b520 100644 --- a/drivers/net/ethernet/freescale/gianfar.c +++ b/drivers/net/ethernet/freescale/gianfar.c @@ -2352,10 +2352,11 @@ static int gfar_enet_open(struct net_device *dev) return err; } + void inline gfar_tx_vlan(struct sk_buff *skb, struct txfcb *fcb) { fcb->flags |= TXFCB_VLN; - fcb->vlctl = vlan_tx_tag_get(skb); + fcb->vlctl = cpu_to_be16(vlan_tx_tag_get(skb)); } /* This is called by the kernel when a frame is ready for transmission. @@ -2533,7 +2534,7 @@ static int gfar_start_xmit(struct sk_buff *skb, struct net_device *dev) */ vlan_ctrl = gfar_read(®s->dfvlan); vlan_ctrl &= ~0xFFFF; - vlan_ctrl |= (fcb->vlctl & 0xFFFF); + vlan_ctrl |= (be16_to_cpu(fcb->vlctl) & 0xFFFF); gfar_write(®s->dfvlan, vlan_ctrl); #endif } @@ -3007,8 +3008,9 @@ static void gfar_process_frame(struct net_device *dev, struct sk_buff *skb, * RXFCB_VLN is pseudo randomly set. */ if (dev->features & NETIF_F_HW_VLAN_CTAG_RX && - fcb->flags & RXFCB_VLN) - __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), fcb->vlctl); + be16_to_cpu(fcb->flags) & RXFCB_VLN) + __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), + be16_to_cpu(fcb->vlctl)); /* Send the packet up the stack */ napi_gro_receive(napi, skb); |