[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20101202123930.GA23289@biggy>
Date: Thu, 2 Dec 2010 13:39:30 +0100
From: Andreas Fenkart <andreas.fenkart@...eamunlimited.com>
To: David Miller <davem@...emloft.net>
Cc: andreas.fenkart@...eamunlimited.com, netdev@...r.kernel.org
Subject: Re: [PATCH 1/1] ARC vmac ethernet driver.
On Tue, Oct 19, 2010 at 06:53:17AM -0700, David Miller wrote:
> From: Andreas Fenkart <andreas.fenkart@...eamunlimited.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
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists