* [PATCH 4/7] net: emaclite: Add support for little-endian platforms
[not found] ` <1285739538-29058-4-git-send-email-monstr-pSz03upnqPeHXe+LvDLADg@public.gmane.org>
@ 2010-09-29 5:52 ` Michal Simek
2010-09-29 6:11 ` Grant Likely
0 siblings, 1 reply; 4+ messages in thread
From: Michal Simek @ 2010-09-29 5:52 UTC (permalink / raw)
To: linux-kernel-u79uwXL29TY76Z2rM5mHXA
Cc: Eric Dumazet, microblaze-uclinux-rVRm/Wmeqae7NGdpmJTKYQ,
devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
duyl-gjFFaj9aHVfQT0dZR+AlfA, netdev-u79uwXL29TY76Z2rM5mHXA,
linnj-gjFFaj9aHVfQT0dZR+AlfA,
edgar.iglesias-Re5JQEeQqe8AvxtiuMwx3w, David S. Miller,
john.williams-g5w7nrANp4BDPfheJLI6IQ
Upcomming Microblaze is little endian that's why is necessary
to fix protocol and length loading.
Signed-off-by: Michal Simek <monstr-pSz03upnqPeHXe+LvDLADg@public.gmane.org>
CC: "David S. Miller" <davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
CC: Grant Likely <grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org>
CC: Eric Dumazet <eric.dumazet-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
CC: netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
CC: linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
CC: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org
---
drivers/net/xilinx_emaclite.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/net/xilinx_emaclite.c b/drivers/net/xilinx_emaclite.c
index 71122ee..533ebb1 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;
--
1.5.5.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 4/7] net: emaclite: Add support for little-endian platforms
2010-09-29 5:52 ` [PATCH 4/7] net: emaclite: Add support for little-endian platforms Michal Simek
@ 2010-09-29 6:11 ` Grant Likely
[not found] ` <20100929061146.GA2439-MrY2KI0G/OVr83L8+7iqerDks+cytr/Z@public.gmane.org>
0 siblings, 1 reply; 4+ messages in thread
From: Grant Likely @ 2010-09-29 6:11 UTC (permalink / raw)
To: Michal Simek
Cc: linux-kernel, john.williams, edgar.iglesias, duyl, linnj,
microblaze-uclinux, David S. Miller, Eric Dumazet, netdev,
devicetree-discuss
On Wed, Sep 29, 2010 at 03:52:15PM +1000, Michal Simek wrote:
> Upcomming Microblaze is little endian that's why is necessary
> to fix protocol and length loading.
>
> Signed-off-by: Michal Simek <monstr@monstr.eu>
> CC: "David S. Miller" <davem@davemloft.net>
> CC: Grant Likely <grant.likely@secretlab.ca>
> CC: Eric Dumazet <eric.dumazet@gmail.com>
> CC: netdev@vger.kernel.org
> CC: linux-kernel@vger.kernel.org
> CC: devicetree-discuss@lists.ozlabs.org
This should go via davem, but it looks correct to me.
Acked-by: Grant Likely <grant.likely@secretlab.ca>
> ---
> drivers/net/xilinx_emaclite.c | 8 ++++----
> 1 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/net/xilinx_emaclite.c b/drivers/net/xilinx_emaclite.c
> index 71122ee..533ebb1 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;
> --
> 1.5.5.1
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 4/7] net: emaclite: Add support for little-endian platforms
[not found] ` <20100929061146.GA2439-MrY2KI0G/OVr83L8+7iqerDks+cytr/Z@public.gmane.org>
@ 2010-09-29 6:27 ` David Miller
[not found] ` <20100928.232722.189705899.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
0 siblings, 1 reply; 4+ messages in thread
From: David Miller @ 2010-09-29 6:27 UTC (permalink / raw)
To: grant.likely-s3s/WqlpOiPyB63q8FvJNQ
Cc: eric.dumazet-Re5JQEeQqe8AvxtiuMwx3w,
microblaze-uclinux-rVRm/Wmeqae7NGdpmJTKYQ,
devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
linux-kernel-u79uwXL29TY76Z2rM5mHXA, duyl-gjFFaj9aHVfQT0dZR+AlfA,
netdev-u79uwXL29TY76Z2rM5mHXA, linnj-gjFFaj9aHVfQT0dZR+AlfA,
edgar.iglesias-Re5JQEeQqe8AvxtiuMwx3w,
john.williams-g5w7nrANp4BDPfheJLI6IQ
From: Grant Likely <grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org>
Date: Wed, 29 Sep 2010 15:11:46 +0900
> On Wed, Sep 29, 2010 at 03:52:15PM +1000, Michal Simek wrote:
>> Upcomming Microblaze is little endian that's why is necessary
>> to fix protocol and length loading.
>>
>> Signed-off-by: Michal Simek <monstr-pSz03upnqPeHXe+LvDLADg@public.gmane.org>
>> CC: "David S. Miller" <davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
>> CC: Grant Likely <grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org>
>> CC: Eric Dumazet <eric.dumazet-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
>> CC: netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
>> CC: linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
>> CC: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org
>
> This should go via davem, but it looks correct to me.
>
> Acked-by: Grant Likely <grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org>
It doesn't need to, the microblaze guys can integrate this directly:
Acked-by: David S. Miller <davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 4/7] net: emaclite: Add support for little-endian platforms
[not found] ` <20100928.232722.189705899.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
@ 2010-09-29 7:33 ` Michal Simek
0 siblings, 0 replies; 4+ messages in thread
From: Michal Simek @ 2010-09-29 7:33 UTC (permalink / raw)
To: microblaze-uclinux-rVRm/Wmeqae7NGdpmJTKYQ
Cc: eric.dumazet-Re5JQEeQqe8AvxtiuMwx3w,
netdev-u79uwXL29TY76Z2rM5mHXA,
devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
linux-kernel-u79uwXL29TY76Z2rM5mHXA, duyl-gjFFaj9aHVfQT0dZR+AlfA,
linnj-gjFFaj9aHVfQT0dZR+AlfA,
edgar.iglesias-Re5JQEeQqe8AvxtiuMwx3w,
john.williams-g5w7nrANp4BDPfheJLI6IQ
David Miller wrote:
> From: Grant Likely <grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org>
> Date: Wed, 29 Sep 2010 15:11:46 +0900
>
>> On Wed, Sep 29, 2010 at 03:52:15PM +1000, Michal Simek wrote:
>>> Upcomming Microblaze is little endian that's why is necessary
>>> to fix protocol and length loading.
>>>
>>> Signed-off-by: Michal Simek <monstr-pSz03upnqPeHXe+LvDLADg@public.gmane.org>
>>> CC: "David S. Miller" <davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
>>> CC: Grant Likely <grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org>
>>> CC: Eric Dumazet <eric.dumazet-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
>>> CC: netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
>>> CC: linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
>>> CC: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org
>> This should go via davem, but it looks correct to me.
>>
>> Acked-by: Grant Likely <grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org>
>
> It doesn't need to, the microblaze guys can integrate this directly:
>
> Acked-by: David S. Miller <davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
Thanks for ACKs. I will add them and will take care about it.
Michal
--
Michal Simek, Ing. (M.Eng)
w: www.monstr.eu p: +42-0-721842854
Maintainer of Linux kernel 2.6 Microblaze Linux - http://www.monstr.eu/fdt/
Microblaze U-BOOT custodian
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2010-09-29 7:33 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <1285739538-29058-1-git-send-email-monstr@monstr.eu>
[not found] ` <1285739538-29058-2-git-send-email-monstr@monstr.eu>
[not found] ` <1285739538-29058-3-git-send-email-monstr@monstr.eu>
[not found] ` <1285739538-29058-4-git-send-email-monstr@monstr.eu>
[not found] ` <1285739538-29058-4-git-send-email-monstr-pSz03upnqPeHXe+LvDLADg@public.gmane.org>
2010-09-29 5:52 ` [PATCH 4/7] net: emaclite: Add support for little-endian platforms Michal Simek
2010-09-29 6:11 ` Grant Likely
[not found] ` <20100929061146.GA2439-MrY2KI0G/OVr83L8+7iqerDks+cytr/Z@public.gmane.org>
2010-09-29 6:27 ` David Miller
[not found] ` <20100928.232722.189705899.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
2010-09-29 7:33 ` Michal Simek
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).