Lines Matching +full:use +full:- +full:ring +full:- +full:sense

1 /* SPDX-License-Identifier: GPL-2.0 */
2 /* Copyright(c) 2007 - 2018 Intel Corporation. */
18 #include <linux/i2c-algo-bit.h>
119 * PTHRESH - MAC will consider prefetch if it has fewer than this number of
122 * HTHRESH - MAC will only prefetch if there are at least this many descriptors
125 * WTHRESH - RX descriptor writeback threshold - MAC will delay writing back
129 #define IGB_RX_PTHRESH ((hw->mac.type == e1000_i354) ? 12 : 8)
131 #define IGB_TX_PTHRESH ((hw->mac.type == e1000_i354) ? 20 : 8)
133 #define IGB_RX_WTHRESH ((hw->mac.type == e1000_82576 && \
134 (adapter->flags & IGB_FLAG_HAS_MSIX)) ? 1 : 4)
135 #define IGB_TX_WTHRESH ((hw->mac.type == e1000_82576 && \
136 (adapter->flags & IGB_FLAG_HAS_MSIX)) ? 1 : 16)
152 * use a 2K buffer for receives and need 1536/1534 to store the data for
162 #define IGB_MAX_FRAME_BUILD_SKB (IGB_RXBUFFER_1536 - NET_IP_ALIGN)
171 pad_size = SKB_WITH_OVERHEAD(page_size) - rx_buf_len; in igb_compute_pad()
185 * cache-line alignment. in igb_skb_pad()
193 rx_buf_len -= NET_IP_ALIGN; in igb_skb_pad()
217 #define IGB_MNG_VLAN_NONE -1
307 struct igb_ring *ring; /* pointer to linked list of rings */ member
312 u8 itr; /* current ITR setting for ring */
324 void *desc; /* descriptor ring memory */
325 unsigned long flags; /* ring specific flags */
326 void __iomem *tail; /* pointer to ring tail register */
327 dma_addr_t dma; /* phys address of the ring */
328 unsigned int size; /* length of desc. ring in bytes */
330 u16 count; /* number of desc. in the ring */
331 u8 queue_index; /* logical index of the ring*/
332 u8 reg_idx; /* physical index of the ring */
378 struct igb_ring ring[] ____cacheline_internodealigned_in_smp; member
390 #define ring_uses_large_buffer(ring) \ argument
391 test_bit(IGB_RING_FLAG_RX_3K_BUFFER, &(ring)->flags)
392 #define set_ring_uses_large_buffer(ring) \ argument
393 set_bit(IGB_RING_FLAG_RX_3K_BUFFER, &(ring)->flags)
394 #define clear_ring_uses_large_buffer(ring) \ argument
395 clear_bit(IGB_RING_FLAG_RX_3K_BUFFER, &(ring)->flags)
397 #define ring_uses_build_skb(ring) \ argument
398 test_bit(IGB_RING_FLAG_RX_BUILD_SKB_ENABLED, &(ring)->flags)
399 #define set_ring_build_skb_enabled(ring) \ argument
400 set_bit(IGB_RING_FLAG_RX_BUILD_SKB_ENABLED, &(ring)->flags)
401 #define clear_ring_build_skb_enabled(ring) \ argument
402 clear_bit(IGB_RING_FLAG_RX_BUILD_SKB_ENABLED, &(ring)->flags)
404 static inline unsigned int igb_rx_bufsz(struct igb_ring *ring) in igb_rx_bufsz() argument
407 if (ring_uses_large_buffer(ring)) in igb_rx_bufsz()
410 if (ring_uses_build_skb(ring)) in igb_rx_bufsz()
416 static inline unsigned int igb_rx_pg_order(struct igb_ring *ring) in igb_rx_pg_order() argument
419 if (ring_uses_large_buffer(ring)) in igb_rx_pg_order()
430 (&(((union e1000_adv_rx_desc *)((R)->desc))[i]))
432 (&(((union e1000_adv_tx_desc *)((R)->desc))[i]))
434 (&(((struct e1000_adv_tx_context_desc *)((R)->desc))[i]))
436 /* igb_test_staterr - tests bits within Rx descriptor status and error fields */
440 return rx_desc->wb.upper.status_error & cpu_to_le32(stat_err_bits); in igb_test_staterr()
443 /* igb_desc_unused - calculate if we have unused descriptors */
444 static inline int igb_desc_unused(struct igb_ring *ring) in igb_desc_unused() argument
446 if (ring->next_to_clean > ring->next_to_use) in igb_desc_unused()
447 return ring->next_to_clean - ring->next_to_use - 1; in igb_desc_unused()
449 return ring->count + ring->next_to_clean - ring->next_to_use - 1; in igb_desc_unused()
475 /* The number of L2 ether-type filter registers, Index 3 is reserved
478 #define MAX_ETYPE_FILTER (4 - 1)
503 * match_flags - 1 byte
504 * etype - 2 bytes
505 * vlan_tci - 2 bytes
576 u8 __iomem *io_addr; /* Mainly for iounmap use */
693 /* Media Auto Sense */
719 struct igb_ring *ring,
765 if (hw->phy.ops.reset) in igb_reset_phy()
766 return hw->phy.ops.reset(hw); in igb_reset_phy()
773 if (hw->phy.ops.read_reg) in igb_read_phy_reg()
774 return hw->phy.ops.read_reg(hw, offset, data); in igb_read_phy_reg()
781 if (hw->phy.ops.write_reg) in igb_write_phy_reg()
782 return hw->phy.ops.write_reg(hw, offset, data); in igb_write_phy_reg()
789 if (hw->phy.ops.get_phy_info) in igb_get_phy_info()
790 return hw->phy.ops.get_phy_info(hw); in igb_get_phy_info()
797 return netdev_get_tx_queue(tx_ring->netdev, tx_ring->queue_index); in txring_txq()