35 #include "e1000_mac.h"
36 #include "e1000_82575.h"
42 #include <linux/inet_lro.h>
43 #define MAX_LRO_AGGR 32
44 #define MAX_LRO_DESCRIPTORS 8
48 #define IGB_MIN_DYN_ITR 3000
49 #define IGB_MAX_DYN_ITR 96000
52 #define IGB_START_ITR 648
54 #define IGB_DYN_ITR_PACKET_THRESHOLD 2
55 #define IGB_DYN_ITR_LENGTH_LOW 200
56 #define IGB_DYN_ITR_LENGTH_HIGH 1000
59 #define IGB_DEFAULT_TXD 256
60 #define IGB_MIN_TXD 80
61 #define IGB_MAX_TXD 4096
63 #define IGB_DEFAULT_RXD 256
64 #define IGB_MIN_RXD 80
65 #define IGB_MAX_RXD 4096
67 #define IGB_DEFAULT_ITR 3
68 #define IGB_MAX_ITR_USECS 10000
69 #define IGB_MIN_ITR_USECS 10
72 #define IGB_MAX_RX_QUEUES 4
73 #define IGB_MAX_TX_QUEUES 4
86 #define IGB_RX_PTHRESH 16
87 #define IGB_RX_HTHRESH 8
88 #define IGB_RX_WTHRESH 1
91 #define MAXIMUM_ETHERNET_VLAN_SIZE 1522
94 #define IGB_RXBUFFER_128 128
95 #define IGB_RXBUFFER_256 256
96 #define IGB_RXBUFFER_512 512
97 #define IGB_RXBUFFER_1024 1024
98 #define IGB_RXBUFFER_2048 2048
99 #define IGB_RXBUFFER_4096 4096
100 #define IGB_RXBUFFER_8192 8192
101 #define IGB_RXBUFFER_16384 16384
107 #define IGB_TX_QUEUE_WAKE 16
109 #define IGB_RX_BUFFER_WRITE 16
111 #define AUTO_ALL_MODES 0
112 #define IGB_EEPROM_APME 0x0400
114 #ifndef IGB_MASTER_SLAVE
116 #define IGB_MASTER_SLAVE e1000_ms_hw_default
119 #define IGB_MNG_VLAN_NONE -1
129 unsigned long time_stamp;
137 unsigned int page_offset;
142 struct igb_queue_stats {
148 struct igb_adapter *adapter;
157 struct igb_buffer *buffer_info;
166 unsigned int total_bytes;
167 unsigned int total_packets;
170 rtdm_irq_t irq_handle;
175 struct igb_queue_stats tx_stats;
180 struct igb_queue_stats rx_stats;
181 struct napi_struct napi;
183 struct igb_ring *buddy;
184 #ifdef CONFIG_IGB_LRO
185 struct net_lro_mgr lro_mgr;
191 char name[IFNAMSIZ + 5];
194 #define IGB_DESC_UNUSED(R) \
195 ((((R)->next_to_clean > (R)->next_to_use) ? 0 : (R)->count) + \
196 (R)->next_to_clean - (R)->next_to_use - 1)
198 #define E1000_RX_DESC_ADV(R, i) \
199 (&(((union e1000_adv_rx_desc *)((R).desc))[i]))
200 #define E1000_TX_DESC_ADV(R, i) \
201 (&(((union e1000_adv_tx_desc *)((R).desc))[i]))
202 #define E1000_TX_CTXTDESC_ADV(R, i) \
203 (&(((struct e1000_adv_tx_context_desc *)((R).desc))[i]))
204 #define E1000_GET_DESC(R, i, type) (&(((struct type *)((R).desc))[i]))
205 #define E1000_TX_DESC(R, i) E1000_GET_DESC(R, i, e1000_tx_desc)
206 #define E1000_RX_DESC(R, i) E1000_GET_DESC(R, i, e1000_rx_desc)
211 struct timer_list watchdog_timer;
212 struct timer_list phy_info_timer;
213 struct vlan_group *vlgrp;
221 unsigned int total_tx_bytes;
222 unsigned int total_tx_packets;
223 unsigned int total_rx_bytes;
224 unsigned int total_rx_packets;
231 struct work_struct reset_task;
232 struct work_struct watchdog_task;
234 u8 tx_timeout_factor;
235 struct timer_list blink_timer;
236 unsigned long led_status;
239 struct igb_ring *tx_ring;
240 unsigned int restart_queue;
241 unsigned long tx_queue_len;
247 u32 tx_timeout_count;
250 struct igb_ring *rx_ring;
257 u32 alloc_rx_buff_failed;
266 struct rtnet_device *netdev;
269 struct pci_dev *pdev;
270 struct net_device_stats net_stats;
272 rtdm_irq_t irq_handle;
273 rtdm_nrtsig_t mod_timer_sig;
277 struct e1000_hw_stats stats;
278 struct e1000_phy_info phy_info;
279 struct e1000_phy_stats phy_stats;
283 struct igb_ring test_tx_ring;
284 struct igb_ring test_rx_ring;
288 struct msix_entry *msix_entries;
289 u32 eims_enable_mask;
301 struct igb_ring *multi_tx_table[IGB_MAX_TX_QUEUES];
302 #ifdef CONFIG_IGB_LRO
303 unsigned int lro_max_aggr;
304 unsigned int lro_aggregated;
305 unsigned int lro_flushed;
306 unsigned int lro_no_desc;
308 unsigned int tx_ring_count;
309 unsigned int rx_ring_count;
312 #define IGB_FLAG_HAS_MSI (1 << 0)
313 #define IGB_FLAG_MSI_ENABLE (1 << 1)
314 #define IGB_FLAG_DCA_ENABLED (1 << 2)
315 #define IGB_FLAG_IN_NETPOLL (1 << 3)
316 #define IGB_FLAG_QUAD_PORT_A (1 << 4)
317 #define IGB_FLAG_NEED_CTX_IDX (1 << 5)
329 extern char igb_driver_name[];
330 extern char igb_driver_version[];
332 extern char *igb_get_hw_dev_name(
struct e1000_hw *hw);
333 extern int igb_up(
struct igb_adapter *);
334 extern void igb_down(
struct igb_adapter *);
335 extern void igb_reinit_locked(
struct igb_adapter *);
336 extern void igb_reset(
struct igb_adapter *);
337 extern int igb_set_spd_dplx(
struct igb_adapter *, u16);
338 extern int igb_setup_tx_resources(
struct igb_adapter *,
struct igb_ring *);
339 extern int igb_setup_rx_resources(
struct igb_adapter *,
struct igb_ring *);
340 extern void igb_free_tx_resources(
struct igb_ring *);
341 extern void igb_free_rx_resources(
struct igb_ring *);
342 extern void igb_update_stats(
struct igb_adapter *);
343 extern void igb_set_ethtool_ops(
struct net_device *);
345 static inline s32 igb_reset_phy(
struct e1000_hw *hw)
347 if (hw->phy.ops.reset_phy)
348 return hw->phy.ops.reset_phy(hw);
353 static inline s32 igb_read_phy_reg(
struct e1000_hw *hw, u32 offset, u16 *data)
355 if (hw->phy.ops.read_phy_reg)
356 return hw->phy.ops.read_phy_reg(hw, offset, data);
361 static inline s32 igb_write_phy_reg(
struct e1000_hw *hw, u32 offset, u16 data)
363 if (hw->phy.ops.write_phy_reg)
364 return hw->phy.ops.write_phy_reg(hw, offset, data);
369 static inline s32 igb_get_phy_info(
struct e1000_hw *hw)
371 if (hw->phy.ops.get_phy_info)
372 return hw->phy.ops.get_phy_info(hw);
ipipe_spinlock_t rtdm_lock_t
Lock variable.
Definition: driver.h:528