From: Ben Hutchings <bhutchings@solarflare.com>
To: Jeff Garzik <jgarzik@pobox.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
netdev@vger.kernel.org, linux-net-drivers@solarflare.com
Subject: [PATCH 10/16] sfc: Use DMA_BIT_MASK() instead of our own DMA mask macros
Date: Fri, 16 May 2008 21:18:48 +0100 [thread overview]
Message-ID: <20080516201848.GC28241@solarflare.com> (raw)
In-Reply-To: <20080516201005.GS28241@solarflare.com>
Also change type of efx_nic_type::max_dma_mask to u64, matching
pci_dma_supported() parameter type.
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
---
drivers/net/sfc/bitfield.h | 3 ---
drivers/net/sfc/falcon.c | 13 ++-----------
drivers/net/sfc/net_driver.h | 2 +-
3 files changed, 3 insertions(+), 15 deletions(-)
diff --git a/drivers/net/sfc/bitfield.h b/drivers/net/sfc/bitfield.h
index c98a591..2c79d27 100644
--- a/drivers/net/sfc/bitfield.h
+++ b/drivers/net/sfc/bitfield.h
@@ -501,8 +501,5 @@ typedef union efx_oword {
#define DMA_ADDR_T_WIDTH (8 * sizeof(dma_addr_t))
#define EFX_DMA_TYPE_WIDTH(width) \
(((width) < DMA_ADDR_T_WIDTH) ? (width) : DMA_ADDR_T_WIDTH)
-#define EFX_DMA_MAX_MASK ((DMA_ADDR_T_WIDTH == 64) ? \
- ~((u64) 0) : ~((u32) 0))
-#define EFX_DMA_MASK(mask) ((mask) & EFX_DMA_MAX_MASK)
#endif /* EFX_BITFIELD_H */
diff --git a/drivers/net/sfc/falcon.c b/drivers/net/sfc/falcon.c
index e02f1d1..475b596 100644
--- a/drivers/net/sfc/falcon.c
+++ b/drivers/net/sfc/falcon.c
@@ -116,17 +116,8 @@ MODULE_PARM_DESC(rx_xon_thresh_bytes, "RX fifo XON threshold");
**************************************************************************
*/
-/* DMA address mask (up to 46-bit, avoiding compiler warnings)
- *
- * Note that it is possible to have a platform with 64-bit longs and
- * 32-bit DMA addresses, or vice versa. EFX_DMA_MASK takes care of the
- * platform DMA mask.
- */
-#if BITS_PER_LONG == 64
-#define FALCON_DMA_MASK EFX_DMA_MASK(0x00003fffffffffffUL)
-#else
-#define FALCON_DMA_MASK EFX_DMA_MASK(0x00003fffffffffffULL)
-#endif
+/* DMA address mask */
+#define FALCON_DMA_MASK DMA_BIT_MASK(46)
/* TX DMA length mask (13-bit) */
#define FALCON_TX_DMA_MASK (4096 - 1)
diff --git a/drivers/net/sfc/net_driver.h b/drivers/net/sfc/net_driver.h
index a84f975..77418ae 100644
--- a/drivers/net/sfc/net_driver.h
+++ b/drivers/net/sfc/net_driver.h
@@ -800,7 +800,7 @@ struct efx_nic_type {
unsigned int txd_ring_mask;
unsigned int rxd_ring_mask;
unsigned int evq_size;
- dma_addr_t max_dma_mask;
+ u64 max_dma_mask;
unsigned int tx_dma_mask;
unsigned bug5391_mask;
--
Ben Hutchings, Senior Software Engineer, Solarflare Communications
Not speaking for my employer; that's the marketing department's job.
next prev parent reply other threads:[~2008-05-16 20:19 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-05-16 20:10 [PATCH 00/16]: sfc: Cleanup requested by Andrew Morton Ben Hutchings
2008-05-16 20:13 ` [PATCH 01/16] sfc: Use mod_timer() to set expiry and add_timer() together Ben Hutchings
2008-05-22 10:01 ` Jeff Garzik
2008-05-16 20:14 ` [PATCH 02/16] sfc: Removed casts to void Ben Hutchings
2008-05-16 20:15 ` [PATCH 03/16] sfc: Simplified efx_rx_calc_buffer_size() using get_order() Ben Hutchings
2008-05-16 20:15 ` [PATCH 04/16] sfc: Removed unncesssary UL suffixes on 0 literals Ben Hutchings
2008-05-16 20:15 ` [PATCH 05/16] sfc: Added and removed braces to comply with kernel style Ben Hutchings
2008-05-16 20:16 ` [PATCH 06/16] sfc: Replaced various macros with inline functions Ben Hutchings
2008-05-16 20:16 ` [PATCH 07/16] sfc: Merged efx_page_offset() into efx_rx_buf_offset() Ben Hutchings
2008-05-16 20:17 ` [PATCH 08/16] sfc: Use resource_size_t for PCI bus address Ben Hutchings
2008-05-16 20:18 ` [PATCH 09/16] sfc: Correct and expand some comments Ben Hutchings
2008-05-16 20:18 ` Ben Hutchings [this message]
2008-05-16 20:19 ` [PATCH 11/16] sfc: Do not define inline macro Ben Hutchings
2008-05-16 20:19 ` [PATCH 12/16] sfc: Use __packed macro Ben Hutchings
2008-05-16 20:19 ` [PATCH 13/16] sfc: Change type of efx_nic::nic_data to struct falcon_nic_data * Ben Hutchings
2008-05-16 20:20 ` [PATCH 14/16] sfc: Remove redundant casts to and from void * Ben Hutchings
2008-05-16 20:20 ` [PATCH 15/16] sfc: Added checks for heap allocation failure Ben Hutchings
2008-05-16 20:21 ` [PATCH 16/16] sfc: Remove sub-minor component from driver version Ben Hutchings
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20080516201848.GC28241@solarflare.com \
--to=bhutchings@solarflare.com \
--cc=akpm@linux-foundation.org \
--cc=jgarzik@pobox.com \
--cc=linux-net-drivers@solarflare.com \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.