diff options
author | Ben Hutchings <bhutchings@solarflare.com> | 2012-02-02 21:21:15 +0000 |
---|---|---|
committer | Ben Hutchings <bhutchings@solarflare.com> | 2012-02-13 23:40:49 +0000 |
commit | 5b6262d0ccf759a16fabe11d904a2531125a4b71 (patch) | |
tree | 812b2cab8bbeb0569909d8646ec864bef11c40c7 /drivers/net/ethernet/sfc/nic.c | |
parent | fadac6aae1b8d9344beaa18aa9035869d773fd98 (diff) | |
download | blackbird-op-linux-5b6262d0ccf759a16fabe11d904a2531125a4b71.tar.gz blackbird-op-linux-5b6262d0ccf759a16fabe11d904a2531125a4b71.zip |
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/nic.c')
-rw-r--r-- | drivers/net/ethernet/sfc/nic.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/net/ethernet/sfc/nic.c b/drivers/net/ethernet/sfc/nic.c index a43d1ca270c0..dd50c4f73a9d 100644 --- a/drivers/net/ethernet/sfc/nic.c +++ b/drivers/net/ethernet/sfc/nic.c @@ -54,9 +54,6 @@ #define EFX_FLUSH_INTERVAL 10 #define EFX_FLUSH_POLL_COUNT 100 -/* Size and alignment of special buffers (4KB) */ -#define EFX_BUF_SIZE 4096 - /* Depth of RX flush request fifo */ #define EFX_RX_FLUSH_COUNT 4 @@ -196,7 +193,7 @@ efx_init_special_buffer(struct efx_nic *efx, struct efx_special_buffer *buffer) /* Write buffer descriptors to NIC */ for (i = 0; i < buffer->entries; i++) { index = buffer->index + i; - dma_addr = buffer->dma_addr + (i * 4096); + dma_addr = buffer->dma_addr + (i * EFX_BUF_SIZE); netif_dbg(efx, probe, efx->net_dev, "mapping special buffer %d at %llx\n", index, (unsigned long long)dma_addr); |