aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/sfc/net_driver.h
diff options
context:
space:
mode:
authorBen Hutchings <bhutchings@solarflare.com>2011-08-26 13:05:11 -0400
committerBen Hutchings <bhutchings@solarflare.com>2012-01-26 19:11:00 -0500
commitdb3395697cad6e9dff8d21249e0b59dc9bb83b48 (patch)
treef3cfd937eda7e0a88733c4c49e1512fa382253e5 /drivers/net/ethernet/sfc/net_driver.h
parent1ddceb4c69463e09b6929c750046c59589d45d82 (diff)
sfc: Replace efx_rx_buffer::is_page and other booleans with a flags field
Replace checksummed and discard booleans from efx_handle_rx_event() with a bitmask, added to the flags field. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Diffstat (limited to 'drivers/net/ethernet/sfc/net_driver.h')
-rw-r--r--drivers/net/ethernet/sfc/net_driver.h16
1 files changed, 9 insertions, 7 deletions
diff --git a/drivers/net/ethernet/sfc/net_driver.h b/drivers/net/ethernet/sfc/net_driver.h
index c20483efc22c..53864014c2b4 100644
--- a/drivers/net/ethernet/sfc/net_driver.h
+++ b/drivers/net/ethernet/sfc/net_driver.h
@@ -205,12 +205,12 @@ struct efx_tx_queue {
205/** 205/**
206 * struct efx_rx_buffer - An Efx RX data buffer 206 * struct efx_rx_buffer - An Efx RX data buffer
207 * @dma_addr: DMA base address of the buffer 207 * @dma_addr: DMA base address of the buffer
208 * @skb: The associated socket buffer, if any. 208 * @skb: The associated socket buffer. Valid iff !(@flags & %EFX_RX_BUF_PAGE).
209 * If both this and page are %NULL, the buffer slot is currently free. 209 * Will be %NULL if the buffer slot is currently free.
210 * @page: The associated page buffer, if any. 210 * @page: The associated page buffer. Valif iff @flags & %EFX_RX_BUF_PAGE.
211 * If both this and skb are %NULL, the buffer slot is currently free. 211 * Will be %NULL if the buffer slot is currently free.
212 * @len: Buffer length, in bytes. 212 * @len: Buffer length, in bytes.
213 * @is_page: Indicates if @page is valid. If false, @skb is valid. 213 * @flags: Flags for buffer and packet state.
214 */ 214 */
215struct efx_rx_buffer { 215struct efx_rx_buffer {
216 dma_addr_t dma_addr; 216 dma_addr_t dma_addr;
@@ -219,8 +219,11 @@ struct efx_rx_buffer {
219 struct page *page; 219 struct page *page;
220 } u; 220 } u;
221 unsigned int len; 221 unsigned int len;
222 bool is_page; 222 u16 flags;
223}; 223};
224#define EFX_RX_BUF_PAGE 0x0001
225#define EFX_RX_PKT_CSUMMED 0x0002
226#define EFX_RX_PKT_DISCARD 0x0004
224 227
225/** 228/**
226 * struct efx_rx_page_state - Page-based rx buffer state 229 * struct efx_rx_page_state - Page-based rx buffer state
@@ -378,7 +381,6 @@ struct efx_channel {
378 * access with prefetches. 381 * access with prefetches.
379 */ 382 */
380 struct efx_rx_buffer *rx_pkt; 383 struct efx_rx_buffer *rx_pkt;
381 bool rx_pkt_csummed;
382 384
383 struct efx_rx_queue rx_queue; 385 struct efx_rx_queue rx_queue;
384 struct efx_tx_queue tx_queue[EFX_TXQ_TYPES]; 386 struct efx_tx_queue tx_queue[EFX_TXQ_TYPES];