
On Wed, 8 Jul 2009 05:17:08 -0700 Prafulla Wadaskar prafulla@marvell.com wrote:
U-boot might use non-8-byte-aligned addresses for sending data, which the kwgbe_send doesn't accept (bootp does this for me). This patch copies the data to be sent to a temporary buffer if it is non-aligned.
Kirkwood egiga driver may not be the only client for this kind of requirements. Any Ethernet controller using DMA will require aligned data pointer. I would suggest either upper layers should pass the aligned buffer pointers Or this patch should go in net/ethic, so that other drivers can benefit
Well, I've looked around a bit and other drivers also handle it this way - see greth.c for example. I agree that it would be nice to handle it at an upper layer, but that would require a good code review to find the potential places where this problem could occur. I feel I'm a bit too U-boot green to do that as of now :-)
I'll submit a new patch with this malloc'ed though.
// Simon