diff options
author | jfv <jfv@FreeBSD.org> | 2009-06-24 17:41:29 +0000 |
---|---|---|
committer | jfv <jfv@FreeBSD.org> | 2009-06-24 17:41:29 +0000 |
commit | bd3587c757355e28ac6abbaf11703661599270bb (patch) | |
tree | 2ecc6e8fbc53f9378cbe7397d226334796447dd4 /sys/dev/e1000/if_em.h | |
parent | 7d778199caba58e2bf12662021294f3869f8f1dd (diff) | |
download | FreeBSD-src-bd3587c757355e28ac6abbaf11703661599270bb.zip FreeBSD-src-bd3587c757355e28ac6abbaf11703661599270bb.tar.gz |
Updates for both the em and igb drivers, add support
for multiqueue tx, shared code updates, new device
support, and some bug fixes.
Diffstat (limited to 'sys/dev/e1000/if_em.h')
-rw-r--r-- | sys/dev/e1000/if_em.h | 79 |
1 files changed, 17 insertions, 62 deletions
diff --git a/sys/dev/e1000/if_em.h b/sys/dev/e1000/if_em.h index 215a2b1..7487a89 100644 --- a/sys/dev/e1000/if_em.h +++ b/sys/dev/e1000/if_em.h @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2001-2008, Intel Corporation + Copyright (c) 2001-2009, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without @@ -36,7 +36,7 @@ #ifndef _EM_H_DEFINED_ #define _EM_H_DEFINED_ -#define IFNET_BUF_RING + /* Tunables */ /* @@ -232,6 +232,7 @@ #define HW_DEBUGOUT2(S, A, B) if (DEBUG_HW) printf(S "\n", A, B) #define EM_MAX_SCATTER 64 +#define EM_VFTA_SIZE 128 #define EM_TSO_SIZE (65535 + sizeof(struct ether_vlan_header)) #define EM_TSO_SEG_SIZE 4096 /* Max dma segment size */ #define EM_MSIX_MASK 0x01F00000 /* For 82574 use */ @@ -254,38 +255,11 @@ #define EM_FIFO_HDR 0x10 #define EM_82547_PKT_THRESH 0x3e0 -#ifdef EM_TIMESYNC /* Precision Time Sync (IEEE 1588) defines */ #define ETHERTYPE_IEEE1588 0x88F7 #define PICOSECS_PER_TICK 20833 #define TSYNC_PORT 319 /* UDP port for the protocol */ -/* TIMESYNC IOCTL defines */ -#define EM_TIMESYNC_READTS _IOWR('i', 127, struct em_tsync_read) - -/* Used in the READTS IOCTL */ -struct em_tsync_read { - int read_current_time; - struct timespec system_time; - u64 network_time; - u64 rx_stamp; - u64 tx_stamp; - u16 seqid; - unsigned char srcid[6]; - int rx_valid; - int tx_valid; -}; - -#endif /* EM_TIMESYNC */ - -struct adapter; - -struct em_int_delay_info { - struct adapter *adapter; /* Back-pointer to the adapter struct */ - int offset; /* Register offset to read/write */ - int value; /* Current value in usecs */ -}; - /* * Bus dma allocation structure used by * e1000_dma_malloc and e1000_dma_free. @@ -299,13 +273,19 @@ struct em_dma_alloc { int dma_nseg; }; +struct adapter; + +struct em_int_delay_info { + struct adapter *adapter; /* Back-pointer to the adapter struct */ + int offset; /* Register offset to read/write */ + int value; /* Current value in usecs */ +}; + /* Our adapter structure */ struct adapter { struct ifnet *ifp; -#ifdef IFNET_BUF_RING +#if __FreeBSD_version >= 800000 struct buf_ring *br; -#else - void *br; #endif struct e1000_hw hw; @@ -320,7 +300,7 @@ struct adapter { struct resource *ioport; int io_rid; - /* 82574 uses 3 int vectors */ + /* 82574 may use 3 int vectors */ struct resource *res[3]; void *tag[3]; int rid[3]; @@ -345,8 +325,11 @@ struct adapter { struct task tx_task; struct taskqueue *tq; /* private task queue */ +#if __FreeBSD_version >= 700029 eventhandler_tag vlan_attach; eventhandler_tag vlan_detach; + u32 num_vlans; +#endif /* Management and WOL features */ int wol; @@ -377,6 +360,7 @@ struct adapter { uint32_t next_tx_to_clean; volatile uint16_t num_tx_desc_avail; uint16_t num_tx_desc; + uint16_t last_hw_offload; uint32_t txd_cmd; struct em_buffer *tx_buffer_area; bus_dma_tag_t txtag; /* dma tag for tx */ @@ -433,11 +417,6 @@ struct adapter { boolean_t pcix_82544; boolean_t in_detach; -#ifdef EM_TIMESYNC - u64 last_stamp; - u64 last_sec; - u32 last_ns; -#endif struct e1000_hw_stats stats; }; @@ -457,7 +436,6 @@ typedef struct _em_vendor_info_t { unsigned int index; } em_vendor_info_t; - struct em_buffer { int next_eop; /* Index of the desc to watch */ struct mbuf *m_head; @@ -496,27 +474,4 @@ typedef struct _DESCRIPTOR_PAIR #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) -#ifdef IFNET_BUF_RING -#define ADAPTER_RING_EMPTY(adapter) drbr_empty((adapter)->ifp, (adapter)->br) -#define em_dequeue drbr_dequeue - -#else -#define ADAPTER_RING_EMPTY(adapter) IFQ_DRV_IS_EMPTY(&((adapter)->ifp->if_snd)) -#define drbr_free(br, type) -static __inline struct mbuf * -em_dequeue(struct ifnet *ifp, struct buf_ring *br) -{ - struct mbuf *m; - - IFQ_DRV_DEQUEUE(&ifp->if_snd, m); - return (m); -} -#ifdef BUF_RING_UNDEFINED - -struct buf_ring { -}; - -#endif -#endif - #endif /* _EM_H_DEFINED_ */ |