Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/e1000/if_em.h
Show First 20 Lines • Show All 324 Lines • ▼ Show 20 Lines | struct tx_ring { | ||||
u32 ims; | u32 ims; | ||||
int busy; | int busy; | ||||
struct em_dma_alloc txdma; | struct em_dma_alloc txdma; | ||||
struct e1000_tx_desc *tx_base; | struct e1000_tx_desc *tx_base; | ||||
struct task tx_task; | struct task tx_task; | ||||
struct taskqueue *tq; | struct taskqueue *tq; | ||||
u32 next_avail_desc; | u32 next_avail_desc; | ||||
u32 next_to_clean; | u32 next_to_clean; | ||||
struct em_buffer *tx_buffers; | struct em_txbuffer *tx_buffers; | ||||
volatile u16 tx_avail; | volatile u16 tx_avail; | ||||
u32 tx_tso; /* last tx was tso */ | u32 tx_tso; /* last tx was tso */ | ||||
u16 last_hw_offload; | u16 last_hw_offload; | ||||
u8 last_hw_ipcso; | u8 last_hw_ipcso; | ||||
u8 last_hw_ipcss; | u8 last_hw_ipcss; | ||||
u8 last_hw_tucso; | u8 last_hw_tucso; | ||||
u8 last_hw_tucss; | u8 last_hw_tucss; | ||||
#if __FreeBSD_version >= 800000 | #if __FreeBSD_version >= 800000 | ||||
Show All 15 Lines | struct rx_ring { | ||||
u32 me; | u32 me; | ||||
u32 msix; | u32 msix; | ||||
u32 ims; | u32 ims; | ||||
struct mtx rx_mtx; | struct mtx rx_mtx; | ||||
char mtx_name[16]; | char mtx_name[16]; | ||||
u32 payload; | u32 payload; | ||||
struct task rx_task; | struct task rx_task; | ||||
struct taskqueue *tq; | struct taskqueue *tq; | ||||
struct e1000_rx_desc *rx_base; | union e1000_rx_desc_extended *rx_base; | ||||
struct em_dma_alloc rxdma; | struct em_dma_alloc rxdma; | ||||
u32 next_to_refresh; | u32 next_to_refresh; | ||||
u32 next_to_check; | u32 next_to_check; | ||||
struct em_buffer *rx_buffers; | struct em_rxbuffer *rx_buffers; | ||||
struct mbuf *fmp; | struct mbuf *fmp; | ||||
struct mbuf *lmp; | struct mbuf *lmp; | ||||
/* Interrupt resources */ | /* Interrupt resources */ | ||||
void *tag; | void *tag; | ||||
struct resource *res; | struct resource *res; | ||||
bus_dma_tag_t rxtag; | bus_dma_tag_t rxtag; | ||||
bool discard; | bool discard; | ||||
▲ Show 20 Lines • Show All 116 Lines • ▼ Show 20 Lines | |||||
typedef struct _em_vendor_info_t { | typedef struct _em_vendor_info_t { | ||||
unsigned int vendor_id; | unsigned int vendor_id; | ||||
unsigned int device_id; | unsigned int device_id; | ||||
unsigned int subvendor_id; | unsigned int subvendor_id; | ||||
unsigned int subdevice_id; | unsigned int subdevice_id; | ||||
unsigned int index; | unsigned int index; | ||||
} em_vendor_info_t; | } em_vendor_info_t; | ||||
struct em_buffer { | struct em_txbuffer { | ||||
int next_eop; /* Index of the desc to watch */ | int next_eop; /* Index of the desc to watch */ | ||||
struct mbuf *m_head; | struct mbuf *m_head; | ||||
bus_dmamap_t map; /* bus_dma map for packet */ | bus_dmamap_t map; /* bus_dma map for packet */ | ||||
}; | }; | ||||
struct em_rxbuffer { | |||||
int next_eop; /* Index of the desc to watch */ | |||||
struct mbuf *m_head; | |||||
bus_dmamap_t map; /* bus_dma map for packet */ | |||||
bus_addr_t paddr; | |||||
}; | |||||
/* | /* | ||||
** Find the number of unrefreshed RX descriptors | ** Find the number of unrefreshed RX descriptors | ||||
*/ | */ | ||||
static inline u16 | static inline u16 | ||||
e1000_rx_unrefreshed(struct rx_ring *rxr) | e1000_rx_unrefreshed(struct rx_ring *rxr) | ||||
{ | { | ||||
struct adapter *adapter = rxr->adapter; | struct adapter *adapter = rxr->adapter; | ||||
Show All 19 Lines | |||||
#define EM_RX_LOCK(_sc) mtx_lock(&(_sc)->rx_mtx) | #define EM_RX_LOCK(_sc) mtx_lock(&(_sc)->rx_mtx) | ||||
#define EM_CORE_UNLOCK(_sc) mtx_unlock(&(_sc)->core_mtx) | #define EM_CORE_UNLOCK(_sc) mtx_unlock(&(_sc)->core_mtx) | ||||
#define EM_TX_UNLOCK(_sc) mtx_unlock(&(_sc)->tx_mtx) | #define EM_TX_UNLOCK(_sc) mtx_unlock(&(_sc)->tx_mtx) | ||||
#define EM_RX_UNLOCK(_sc) mtx_unlock(&(_sc)->rx_mtx) | #define EM_RX_UNLOCK(_sc) mtx_unlock(&(_sc)->rx_mtx) | ||||
#define EM_CORE_LOCK_ASSERT(_sc) mtx_assert(&(_sc)->core_mtx, MA_OWNED) | #define EM_CORE_LOCK_ASSERT(_sc) mtx_assert(&(_sc)->core_mtx, MA_OWNED) | ||||
#define EM_TX_LOCK_ASSERT(_sc) mtx_assert(&(_sc)->tx_mtx, MA_OWNED) | #define EM_TX_LOCK_ASSERT(_sc) mtx_assert(&(_sc)->tx_mtx, MA_OWNED) | ||||
#define EM_RX_LOCK_ASSERT(_sc) mtx_assert(&(_sc)->rx_mtx, MA_OWNED) | #define EM_RX_LOCK_ASSERT(_sc) mtx_assert(&(_sc)->rx_mtx, MA_OWNED) | ||||
#define EM_RSSRK_SIZE 4 | |||||
#define EM_RSSRK_VAL(key, i) (key[(i) * EM_RSSRK_SIZE] | \ | |||||
key[(i) * EM_RSSRK_SIZE + 1] << 8 | \ | |||||
key[(i) * EM_RSSRK_SIZE + 2] << 16 | \ | |||||
key[(i) * EM_RSSRK_SIZE + 3] << 24) | |||||
#endif /* _EM_H_DEFINED_ */ | #endif /* _EM_H_DEFINED_ */ |