diff options
author | Ben Hutchings <bhutchings@solarflare.com> | 2012-02-02 16:21:15 -0500 |
---|---|---|
committer | Ben Hutchings <bhutchings@solarflare.com> | 2012-02-13 18:40:49 -0500 |
commit | 5b6262d0ccf759a16fabe11d904a2531125a4b71 (patch) | |
tree | 812b2cab8bbeb0569909d8646ec864bef11c40c7 /drivers/net/ethernet/sfc/tx.c | |
parent | fadac6aae1b8d9344beaa18aa9035869d773fd98 (diff) |
sfc: Replace some literal constants with EFX_PAGE_SIZE/EFX_BUF_SIZE
The 'page size' for PCIe DMA, i.e. the alignment of boundaries at
which DMA must be broken, is 4KB. Name this value as EFX_PAGE_SIZE
and use it in efx_max_tx_len(). Redefine EFX_BUF_SIZE as
EFX_PAGE_SIZE since its value is also a result of that requirement,
and use it in efx_init_special_buffer().
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Diffstat (limited to 'drivers/net/ethernet/sfc/tx.c')
-rw-r--r-- | drivers/net/ethernet/sfc/tx.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/ethernet/sfc/tx.c b/drivers/net/ethernet/sfc/tx.c index 5cb81fa3fcbd..a096e287e95f 100644 --- a/drivers/net/ethernet/sfc/tx.c +++ b/drivers/net/ethernet/sfc/tx.c | |||
@@ -110,7 +110,7 @@ efx_max_tx_len(struct efx_nic *efx, dma_addr_t dma_addr) | |||
110 | * little benefit from using descriptors that cross those | 110 | * little benefit from using descriptors that cross those |
111 | * boundaries and we keep things simple by not doing so. | 111 | * boundaries and we keep things simple by not doing so. |
112 | */ | 112 | */ |
113 | unsigned len = (~dma_addr & 0xfff) + 1; | 113 | unsigned len = (~dma_addr & (EFX_PAGE_SIZE - 1)) + 1; |
114 | 114 | ||
115 | /* Work around hardware bug for unaligned buffers. */ | 115 | /* Work around hardware bug for unaligned buffers. */ |
116 | if (EFX_WORKAROUND_5391(efx) && (dma_addr & 0xf)) | 116 | if (EFX_WORKAROUND_5391(efx) && (dma_addr & 0xf)) |