diff options
author | Ralf Baechle <ralf@linux-mips.org> | 2005-10-10 15:50:36 +0200 |
---|---|---|
committer | Jeff Garzik <jgarzik@pobox.com> | 2005-10-19 00:03:47 +0200 |
commit | 04115def6ad7ef51440365b65a7324fcb82d5d1d (patch) | |
tree | 14e7113cad4264ec4cf6f26730437c293f182802 /drivers/net/sb1250-mac.c | |
parent | [PATCH] sb1250-mac: Check the actual setting for reporting hw checksumming. (diff) | |
download | linux-04115def6ad7ef51440365b65a7324fcb82d5d1d.tar.xz linux-04115def6ad7ef51440365b65a7324fcb82d5d1d.zip |
[PATCH] sb1250-mac: Ensure 16-byte alignment of the descriptor ring.
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
drivers/net/sb1250-mac.c | 9 ++++++++-
1 files changed, 8 insertions(+), 1 deletion(-)
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
Diffstat (limited to 'drivers/net/sb1250-mac.c')
-rw-r--r-- | drivers/net/sb1250-mac.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/net/sb1250-mac.c b/drivers/net/sb1250-mac.c index 0f828da0339d..cb4ea4158457 100644 --- a/drivers/net/sb1250-mac.c +++ b/drivers/net/sb1250-mac.c @@ -750,7 +750,14 @@ static void sbdma_initctx(sbmacdma_t *d, d->sbdma_maxdescr = maxdescr; d->sbdma_dscrtable = (sbdmadscr_t *) - kmalloc(d->sbdma_maxdescr*sizeof(sbdmadscr_t), GFP_KERNEL); + kmalloc((d->sbdma_maxdescr+1)*sizeof(sbdmadscr_t), GFP_KERNEL); + + /* + * The descriptor table must be aligned to at least 16 bytes or the + * MAC will corrupt it. + */ + d->sbdma_dscrtable = (sbdmadscr_t *) + ALIGN((unsigned long)d->sbdma_dscrtable, sizeof(sbdmadscr_t)); memset(d->sbdma_dscrtable,0,d->sbdma_maxdescr*sizeof(sbdmadscr_t)); |