public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Andreas Fenkart <andreas.fenkart@streamunlimited.com>
To: David Miller <davem@davemloft.net>
Cc: andreas.fenkart@streamunlimited.com, netdev@vger.kernel.org
Subject: Re: [PATCH 1/1] ARC vmac ethernet driver.
Date: Thu, 2 Dec 2010 13:39:30 +0100	[thread overview]
Message-ID: <20101202123930.GA23289@biggy> (raw)
In-Reply-To: <20101019.065317.246538050.davem@davemloft.net>

On Tue, Oct 19, 2010 at 06:53:17AM -0700, David Miller wrote:
> From: Andreas Fenkart <andreas.fenkart@streamunlimited.com>
> Date: Fri, 15 Oct 2010 09:54:14 +0200
> 
> > +/* arcvmac private data structures */
> > +struct vmac_buffer_desc {
> > +	unsigned int info;
> > +	dma_addr_t data;
> > +};
> 
> If this is the actual descriptor used by the hardware you
> cannot define it this way.

Changed to this

	/* arcvmac private data structures */
	struct vmac_buffer_desc {
					__le32 info;
					__le32 data;
	};

> 
> dma_addr_t is a variable type, on some platforms it is a
> "u32", on others it is a "u64" but you cannot assume one
> way or another.

Added this check

  if (dma_get_mask(&pdev->dev) > DMA_BIT_MASK(32) ||
      pdev->dev.coherent_dma_mask > DMA_BIT_MASK(32)) {
    dev_err(&pdev->dev, "arcvmac supports only 32-bit DMA addresses\n");
    return -ENODEV;
  }

> 
> Also, are these values big or little endian?  You must use
> the appropriate endian types such as __be32 et al. and then
> access the members using the proper conversion functions.

Using cpu_to_le32 / le32_to_cpu when accessing register map,
buffer descriptors.

Andreas

  reply	other threads:[~2010-12-02 12:37 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-15  7:54 [PATCH 0/1] ARC vmac ethernet driver Andreas Fenkart
2010-10-15  7:54 ` [PATCH 1/1] " Andreas Fenkart
2010-10-19 13:53   ` David Miller
2010-12-02 12:39     ` Andreas Fenkart [this message]
2010-12-02 12:46       ` [PATCH 1/1] arcvmac submit #4 Andreas Fenkart
2010-12-02 13:10         ` Andreas Fenkart
2010-12-02 13:21           ` [PATCH 1/1] arcvmac submit #4a Andreas Fenkart
2010-12-08 17:00             ` David Miller
2011-02-15  9:31               ` [PATCH 1/1] ARC VMAC ethernet driver Andreas Fenkart
2011-02-15 10:02                 ` Eric Dumazet
2011-02-17  9:26                   ` Andreas Fenkart
2011-02-17  9:31                     ` Andreas Fenkart
2011-02-17 10:13                       ` Eric Dumazet
  -- strict thread matches above, loose matches on Subject: below --
2010-02-22  0:21 [PATCH 1/1] ARC vmac " Andreas Fenkart
2010-02-22 23:40 ` David Miller
2010-03-01 23:18   ` [PATCH 0/5] " Andreas Fenkart
2010-03-01 23:18     ` [PATCH 1/1] " Andreas Fenkart

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=20101202123930.GA23289@biggy \
    --to=andreas.fenkart@streamunlimited.com \
    --cc=davem@davemloft.net \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox