From: Grant Likely <grant.likely@secretlab.ca>
To: Michal Simek <monstr@monstr.eu>
Cc: linux-kernel@vger.kernel.org, john.williams@petalogix.com,
edgar.iglesias@gmail.com, duyl@xilinx.com, linnj@xilinx.com,
microblaze-uclinux@itee.uq.edu.au,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <eric.dumazet@gmail.com>,
netdev@vger.kernel.org, devicetree-discuss@lists.ozlabs.org
Subject: Re: [PATCH 4/7] net: emaclite: Add support for little-endian platforms
Date: Wed, 29 Sep 2010 15:11:46 +0900 [thread overview]
Message-ID: <20100929061146.GA2439@angua.secretlab.ca> (raw)
In-Reply-To: <1285739538-29058-5-git-send-email-monstr@monstr.eu>
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
>
next prev parent reply other threads:[~2010-09-29 6:11 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-09-29 5:52 Microblaze little-endian port + driver changes Michal Simek
2010-09-29 5:52 ` [PATCH 1/7] of: GPIO: Fix OF probing on little-endian systems Michal Simek
2010-09-29 5:52 ` Michal Simek
2010-09-29 5:52 ` [PATCH 2/7] of: MTD: " Michal Simek
2010-09-29 5:52 ` Michal Simek
2010-09-29 5:52 ` Michal Simek
2010-09-29 5:52 ` [PATCH 3/7] of: Fix uart16550 initialization " Michal Simek
2010-09-29 5:52 ` Michal Simek
2010-09-29 5:52 ` [PATCH 4/7] net: emaclite: Add support for little-endian platforms Michal Simek
2010-09-29 5:52 ` Michal Simek
2010-09-29 5:52 ` [PATCH 5/7] microblaze: Add PVR for endians plus detection Michal Simek
2010-09-29 5:52 ` [PATCH 6/7] microblaze: KGDB little endian support Michal Simek
2010-09-29 5:52 ` [PATCH 7/7] microblaze: Add support for little-endian Microblaze Michal Simek
2010-09-29 6:27 ` Grant Likely
[not found] ` <AANLkTikvfr90AZRJXz6CQg2FJTG13ygzxp0J9OpkL03c@mail.gmail.com>
2010-09-29 7:48 ` Grant Likely
2010-09-29 6:12 ` [PATCH 5/7] microblaze: Add PVR for endians plus detection Grant Likely
2010-09-29 6:11 ` Grant Likely [this message]
2010-09-29 6:27 ` [PATCH 4/7] net: emaclite: Add support for little-endian platforms David Miller
2010-09-29 6:27 ` David Miller
2010-09-29 7:33 ` Michal Simek
2010-09-29 7:33 ` Michal Simek
2010-09-29 6:29 ` [PATCH 3/7] of: Fix uart16550 initialization on little-endian systems Grant Likely
2010-09-29 6:29 ` Grant Likely
2010-09-29 6:29 ` [PATCH 2/7] of: MTD: Fix OF probing " Grant Likely
2010-09-29 6:29 ` Grant Likely
2010-09-29 6:29 ` Grant Likely
2010-09-29 6:30 ` [PATCH 1/7] of: GPIO: " Grant Likely
2010-09-29 6:30 ` Grant Likely
2010-10-10 6:02 ` Microblaze little-endian port + driver changes Grant Likely
2010-10-10 23:34 ` Michal Simek
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20100929061146.GA2439@angua.secretlab.ca \
--to=grant.likely@secretlab.ca \
--cc=davem@davemloft.net \
--cc=devicetree-discuss@lists.ozlabs.org \
--cc=duyl@xilinx.com \
--cc=edgar.iglesias@gmail.com \
--cc=eric.dumazet@gmail.com \
--cc=john.williams@petalogix.com \
--cc=linnj@xilinx.com \
--cc=linux-kernel@vger.kernel.org \
--cc=microblaze-uclinux@itee.uq.edu.au \
--cc=monstr@monstr.eu \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.