summaryrefslogtreecommitdiffstats
path: root/freebsd/sys/dev/e1000/if_igb.h
diff options
context:
space:
mode:
Diffstat (limited to 'freebsd/sys/dev/e1000/if_igb.h')
-rw-r--r--freebsd/sys/dev/e1000/if_igb.h255
1 files changed, 140 insertions, 115 deletions
diff --git a/freebsd/sys/dev/e1000/if_igb.h b/freebsd/sys/dev/e1000/if_igb.h
index 6f3a3a54..0c447412 100644
--- a/freebsd/sys/dev/e1000/if_igb.h
+++ b/freebsd/sys/dev/e1000/if_igb.h
@@ -1,6 +1,6 @@
/******************************************************************************
- Copyright (c) 2001-2011, Intel Corporation
+ Copyright (c) 2001-2013, Intel Corporation
All rights reserved.
Redistribution and use in source and binary forms, with or without
@@ -162,6 +162,9 @@
/* PHY master/slave setting */
#define IGB_MASTER_SLAVE e1000_ms_hw_default
+/* Support AutoMediaDetect for Marvell M88 PHY in i354 */
+#define IGB_MEDIA_RESET (1 << 0)
+
/*
* Micellaneous constants
*/
@@ -173,11 +176,13 @@
#define IGB_SMARTSPEED_MAX 15
#define IGB_MAX_LOOP 10
-#define IGB_RX_PTHRESH (hw->mac.type <= e1000_82576 ? 16 : 8)
+#define IGB_RX_PTHRESH ((hw->mac.type == e1000_i354) ? 12 : \
+ ((hw->mac.type <= e1000_82576) ? 16 : 8))
#define IGB_RX_HTHRESH 8
-#define IGB_RX_WTHRESH 1
+#define IGB_RX_WTHRESH ((hw->mac.type == e1000_82576 && \
+ adapter->msix_mem) ? 1 : 4)
-#define IGB_TX_PTHRESH 8
+#define IGB_TX_PTHRESH ((hw->mac.type == e1000_i354) ? 20 : 8)
#define IGB_TX_HTHRESH 1
#define IGB_TX_WTHRESH ((hw->mac.type != e1000_82575 && \
adapter->msix_mem) ? 1 : 16)
@@ -190,11 +195,6 @@
#define IGB_EEPROM_APME 0x400;
/* Queue minimum free for use */
#define IGB_QUEUE_THRESHOLD (adapter->num_tx_desc / 8)
-/* Queue bit defines */
-#define IGB_QUEUE_IDLE 1
-#define IGB_QUEUE_WORKING 2
-#define IGB_QUEUE_HUNG 4
-#define IGB_QUEUE_DEPLETED 8
/*
* TDBA/RDBA should be aligned on 16 byte boundary. But TDLEN/RDLEN should be
@@ -228,8 +228,10 @@
#define IGB_BR_SIZE 4096 /* ring buf size */
#define IGB_TSO_SIZE (65535 + sizeof(struct ether_vlan_header))
#define IGB_TSO_SEG_SIZE 4096 /* Max dma segment size */
+#define IGB_TXPBSIZE 20408
#define IGB_HDR_BUF 128
#define IGB_PKTTYPE_MASK 0x0000FFF0
+#define IGB_DMCTLX_DCFLUSH_DIS 0x80000000 /* Disable DMA Coalesce Flush */
#define ETH_ZLEN 60
#define ETH_ADDR_LEN 6
@@ -245,6 +247,7 @@
#define IGB_DEFAULT_ITR ((1000000/IGB_INTS_PER_SEC) << 2)
#define IGB_LINK_ITR 2000
+#define I210_LINK_DELAY 1000
/* Precision Time Sync (IEEE 1588) defines */
#define ETHERTYPE_IEEE1588 0x88F7
@@ -284,34 +287,42 @@ struct igb_queue {
};
/*
- * Transmit ring: one per queue
+ * The transmit ring, one per queue
*/
struct tx_ring {
- struct adapter *adapter;
- u32 me;
+ struct adapter *adapter;
struct mtx tx_mtx;
- char mtx_name[16];
+ u32 me;
+ int watchdog_time;
+ union e1000_adv_tx_desc *tx_base;
+ struct igb_tx_buf *tx_buffers;
struct igb_dma_alloc txdma;
- struct e1000_tx_desc *tx_base;
- u32 next_avail_desc;
- u32 next_to_clean;
volatile u16 tx_avail;
- struct igb_tx_buffer *tx_buffers;
+ u16 next_avail_desc;
+ u16 next_to_clean;
+ u16 process_limit;
+ u16 num_desc;
+ enum {
+ IGB_QUEUE_IDLE = 1,
+ IGB_QUEUE_WORKING = 2,
+ IGB_QUEUE_HUNG = 4,
+ IGB_QUEUE_DEPLETED = 8,
+ } queue_status;
+ u32 txd_cmd;
+ bus_dma_tag_t txtag;
+ char mtx_name[16];
#ifndef IGB_LEGACY_TX
struct buf_ring *br;
struct task txq_task;
#endif
- bus_dma_tag_t txtag;
-
- u32 bytes;
+ u32 bytes; /* used for AIM */
u32 packets;
-
- int queue_status;
- int watchdog_time;
- int tdt;
- int tdh;
+ /* Soft Stats */
+ unsigned long tso_tx;
+ unsigned long no_tx_map_avail;
+ unsigned long no_tx_dma_setup;
u64 no_desc_avail;
- u64 tx_packets;
+ u64 total_packets;
};
/*
@@ -353,43 +364,38 @@ struct rx_ring {
};
struct adapter {
- struct ifnet *ifp;
- struct e1000_hw hw;
-
- struct e1000_osdep osdep;
- struct device *dev;
- struct cdev *led_dev;
-
- struct resource *pci_mem;
- struct resource *msix_mem;
- struct resource *res;
- void *tag;
- u32 que_mask;
-
- int linkvec;
- int link_mask;
- struct task link_task;
- int link_irq;
-
- struct ifmedia media;
- struct callout timer;
- int msix; /* total vectors allocated */
- int if_flags;
- int max_frame_size;
- int min_frame_size;
- int pause_frames;
- struct mtx core_mtx;
- int igb_insert_vlan_header;
- u16 num_queues;
- u16 vf_ifp; /* a VF interface */
-
- eventhandler_tag vlan_attach;
- eventhandler_tag vlan_detach;
- u32 num_vlans;
-
- /* Management and WOL features */
- int wol;
- int has_manage;
+ struct ifnet *ifp;
+ struct e1000_hw hw;
+
+ struct e1000_osdep osdep;
+ struct device *dev;
+ struct cdev *led_dev;
+
+ struct resource *pci_mem;
+ struct resource *msix_mem;
+ int memrid;
+
+ /*
+ * Interrupt resources: this set is
+ * either used for legacy, or for Link
+ * when doing MSIX
+ */
+ void *tag;
+ struct resource *res;
+
+ struct ifmedia media;
+ struct callout timer;
+ int msix;
+ int if_flags;
+ int pause_frames;
+
+ struct mtx core_mtx;
+
+ eventhandler_tag vlan_attach;
+ eventhandler_tag vlan_detach;
+
+ u16 num_vlans;
+ u16 num_queues;
/*
** Shadow VFTA table, this is needed because
@@ -397,66 +403,86 @@ struct adapter {
** a soft reset and the driver needs to be able
** to repopulate it.
*/
- u32 shadow_vfta[IGB_VFTA_SIZE];
+ u32 shadow_vfta[IGB_VFTA_SIZE];
/* Info about the interface */
- u16 link_active;
- u16 fc;
- u16 link_speed;
- u16 link_duplex;
- u32 smartspeed;
- u32 dmac;
- int enable_aim;
-
- /* Interface queues */
+ u32 optics;
+ u32 fc; /* local flow ctrl setting */
+ int advertise; /* link speeds */
+ bool link_active;
+ u16 max_frame_size;
+ u16 num_segs;
+ u16 link_speed;
+ bool link_up;
+ u32 linkvec;
+ u16 link_duplex;
+ u32 dmac;
+ int link_mask;
+
+ /* Flags */
+ u32 flags;
+
+ /* Mbuf cluster size */
+ u32 rx_mbuf_sz;
+
+ /* Support for pluggable optics */
+ bool sfp_probe;
+ struct task link_task; /* Link tasklet */
+ struct task mod_task; /* SFP tasklet */
+ struct task msf_task; /* Multispeed Fiber */
+ struct taskqueue *tq;
+
+ /*
+ ** Queues:
+ ** This is the irq holder, it has
+ ** and RX/TX pair or rings associated
+ ** with it.
+ */
struct igb_queue *queues;
/*
- * Transmit rings
+ * Transmit rings:
+ * Allocated at run time, an array of rings.
*/
struct tx_ring *tx_rings;
- u16 num_tx_desc;
-
- /* Multicast array pointer */
- u8 *mta;
+ u32 num_tx_desc;
- /*
- * Receive rings
+ /*
+ * Receive rings:
+ * Allocated at run time, an array of rings.
*/
struct rx_ring *rx_rings;
- bool rx_hdr_split;
- u16 num_rx_desc;
- int rx_process_limit;
- u32 rx_mbuf_sz;
- u32 rx_mask;
+ u64 que_mask;
+ u32 num_rx_desc;
+
+ /* Multicast array memory */
+ u8 *mta;
/* Misc stats maintained by the driver */
- unsigned long dropped_pkts;
- unsigned long mbuf_defrag_failed;
- unsigned long mbuf_header_failed;
- unsigned long mbuf_packet_failed;
- unsigned long no_tx_map_avail;
- unsigned long no_tx_dma_setup;
- unsigned long watchdog_events;
- unsigned long rx_overruns;
- unsigned long device_control;
- unsigned long rx_control;
- unsigned long int_mask;
- unsigned long eint_mask;
- unsigned long packet_buf_alloc_rx;
- unsigned long packet_buf_alloc_tx;
-
- boolean_t in_detach;
-
-#ifdef IGB_IEEE1588
- /* IEEE 1588 precision time support */
- struct cyclecounter cycles;
- struct nettimer clock;
- struct nettime_compare compare;
- struct hwtstamp_ctrl hwtstamp;
-#endif
+ unsigned long dropped_pkts;
+ unsigned long mbuf_defrag_failed;
+ unsigned long mbuf_header_failed;
+ unsigned long mbuf_packet_failed;
+ unsigned long no_tx_dma_setup;
+ unsigned long watchdog_events;
+ unsigned long link_irq;
+ unsigned long rx_overruns;
+ unsigned long device_control;
+ unsigned long rx_control;
+ unsigned long int_mask;
+ unsigned long eint_mask;
+ unsigned long packet_buf_alloc_rx;
+ unsigned long packet_buf_alloc_tx;
+ /* Used in pf and vf */
+ void *stats;
+
+ int enable_aim;
+ int has_manage;
+ int wol;
+ int rx_process_limit;
+ u16 vf_ifp; /* a VF interface */
+ bool in_detach; /* Used only in igb_ioctl */
- void *stats;
};
/* ******************************************************************************
@@ -474,11 +500,10 @@ typedef struct _igb_vendor_info_t {
unsigned int index;
} igb_vendor_info_t;
-
-struct igb_tx_buffer {
- int next_eop; /* Index of the desc to watch */
- struct mbuf *m_head;
- bus_dmamap_t map; /* bus_dma map for packet */
+struct igb_tx_buf {
+ union e1000_adv_tx_desc *eop;
+ struct mbuf *m_head;
+ bus_dmamap_t map;
};
struct igb_rx_buf {