summaryrefslogtreecommitdiffstats
path: root/drivers/net/xilinx_emaclite.c
diff options
context:
space:
mode:
authorMichal Simek <monstr@monstr.eu>2010-09-10 13:22:35 +0200
committerMichal Simek <monstr@monstr.eu>2010-10-21 07:51:56 +0200
commit44180a573ec936cd989a7c0478f5fd1cf8e1ebc3 (patch)
treeb59dc64239ace523cbde97d11e7ec84b8c292428 /drivers/net/xilinx_emaclite.c
parentmicroblaze: trivial: Add comment for AXI pvr (diff)
downloadlinux-44180a573ec936cd989a7c0478f5fd1cf8e1ebc3.tar.xz
linux-44180a573ec936cd989a7c0478f5fd1cf8e1ebc3.zip
net: emaclite: Add support for little-endian platforms
Upcomming Microblaze is little endian that's why is necessary to fix protocol and length loading. Signed-off-by: Michal Simek <monstr@monstr.eu> Acked-by: Grant Likely <grant.likely@secretlab.ca> Acked-by: David S. Miller <davem@davemloft.net> CC: Eric Dumazet <eric.dumazet@gmail.com> CC: netdev@vger.kernel.org CC: linux-kernel@vger.kernel.org CC: devicetree-discuss@lists.ozlabs.org
Diffstat (limited to 'drivers/net/xilinx_emaclite.c')
-rw-r--r--drivers/net/xilinx_emaclite.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/net/xilinx_emaclite.c b/drivers/net/xilinx_emaclite.c
index ecbbb688eba0..4da1d90c2895 100644
--- a/drivers/net/xilinx_emaclite.c
+++ b/drivers/net/xilinx_emaclite.c
@@ -430,8 +430,8 @@ static u16 xemaclite_recv_data(struct net_local *drvdata, u8 *data)
}
/* Get the protocol type of the ethernet frame that arrived */
- proto_type = ((in_be32(addr + XEL_HEADER_OFFSET +
- XEL_RXBUFF_OFFSET) >> XEL_HEADER_SHIFT) &
+ proto_type = ((ntohl(in_be32(addr + XEL_HEADER_OFFSET +
+ XEL_RXBUFF_OFFSET)) >> XEL_HEADER_SHIFT) &
XEL_RPLR_LENGTH_MASK);
/* Check if received ethernet frame is a raw ethernet frame
@@ -439,9 +439,9 @@ static u16 xemaclite_recv_data(struct net_local *drvdata, u8 *data)
if (proto_type > (ETH_FRAME_LEN + ETH_FCS_LEN)) {
if (proto_type == ETH_P_IP) {
- length = ((in_be32(addr +
+ length = ((ntohl(in_be32(addr +
XEL_HEADER_IP_LENGTH_OFFSET +
- XEL_RXBUFF_OFFSET) >>
+ XEL_RXBUFF_OFFSET)) >>
XEL_HEADER_SHIFT) &
XEL_RPLR_LENGTH_MASK);
length += ETH_HLEN + ETH_FCS_LEN;