aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/e1000/e1000.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/e1000/e1000.h')
-rw-r--r--drivers/net/e1000/e1000.h71
1 files changed, 41 insertions, 30 deletions
diff --git a/drivers/net/e1000/e1000.h b/drivers/net/e1000/e1000.h
index 31feae1ea390..19e317eaf5bc 100644
--- a/drivers/net/e1000/e1000.h
+++ b/drivers/net/e1000/e1000.h
@@ -90,10 +90,13 @@ struct e1000_adapter;
90#define E1000_ERR(args...) printk(KERN_ERR "e1000: " args) 90#define E1000_ERR(args...) printk(KERN_ERR "e1000: " args)
91 91
92#define PFX "e1000: " 92#define PFX "e1000: "
93#define DPRINTK(nlevel, klevel, fmt, args...) \ 93
94 (void)((NETIF_MSG_##nlevel & adapter->msg_enable) && \ 94#define DPRINTK(nlevel, klevel, fmt, args...) \
95 printk(KERN_##klevel PFX "%s: %s: " fmt, adapter->netdev->name, \ 95do { \
96 __FUNCTION__ , ## args)) 96 if (NETIF_MSG_##nlevel & adapter->msg_enable) \
97 printk(KERN_##klevel PFX "%s: %s: " fmt, \
98 adapter->netdev->name, __func__, ##args); \
99} while (0)
97 100
98#define E1000_MAX_INTR 10 101#define E1000_MAX_INTR 10
99 102
@@ -151,9 +154,9 @@ struct e1000_adapter;
151#define E1000_MASTER_SLAVE e1000_ms_hw_default 154#define E1000_MASTER_SLAVE e1000_ms_hw_default
152#endif 155#endif
153 156
154#define E1000_MNG_VLAN_NONE -1 157#define E1000_MNG_VLAN_NONE (-1)
155/* Number of packet split data buffers (not including the header buffer) */ 158/* Number of packet split data buffers (not including the header buffer) */
156#define PS_PAGE_BUFFERS MAX_PS_BUFFERS-1 159#define PS_PAGE_BUFFERS (MAX_PS_BUFFERS - 1)
157 160
158/* wrapper around a pointer to a socket buffer, 161/* wrapper around a pointer to a socket buffer,
159 * so a DMA handle can be stored along with the buffer */ 162 * so a DMA handle can be stored along with the buffer */
@@ -165,9 +168,13 @@ struct e1000_buffer {
165 u16 next_to_watch; 168 u16 next_to_watch;
166}; 169};
167 170
171struct e1000_ps_page {
172 struct page *ps_page[PS_PAGE_BUFFERS];
173};
168 174
169struct e1000_ps_page { struct page *ps_page[PS_PAGE_BUFFERS]; }; 175struct e1000_ps_page_dma {
170struct e1000_ps_page_dma { u64 ps_page_dma[PS_PAGE_BUFFERS]; }; 176 u64 ps_page_dma[PS_PAGE_BUFFERS];
177};
171 178
172struct e1000_tx_ring { 179struct e1000_tx_ring {
173 /* pointer to the descriptor ring memory */ 180 /* pointer to the descriptor ring memory */
@@ -217,13 +224,13 @@ struct e1000_rx_ring {
217 u16 rdt; 224 u16 rdt;
218}; 225};
219 226
220#define E1000_DESC_UNUSED(R) \ 227#define E1000_DESC_UNUSED(R) \
221 ((((R)->next_to_clean > (R)->next_to_use) ? 0 : (R)->count) + \ 228 ((((R)->next_to_clean > (R)->next_to_use) \
222 (R)->next_to_clean - (R)->next_to_use - 1) 229 ? 0 : (R)->count) + (R)->next_to_clean - (R)->next_to_use - 1)
223 230
224#define E1000_RX_DESC_PS(R, i) \ 231#define E1000_RX_DESC_PS(R, i) \
225 (&(((union e1000_rx_desc_packet_split *)((R).desc))[i])) 232 (&(((union e1000_rx_desc_packet_split *)((R).desc))[i]))
226#define E1000_RX_DESC_EXT(R, i) \ 233#define E1000_RX_DESC_EXT(R, i) \
227 (&(((union e1000_rx_desc_extended *)((R).desc))[i])) 234 (&(((union e1000_rx_desc_extended *)((R).desc))[i]))
228#define E1000_GET_DESC(R, i, type) (&(((struct type *)((R).desc))[i])) 235#define E1000_GET_DESC(R, i, type) (&(((struct type *)((R).desc))[i]))
229#define E1000_RX_DESC(R, i) E1000_GET_DESC(R, i, e1000_rx_desc) 236#define E1000_RX_DESC(R, i) E1000_GET_DESC(R, i, e1000_rx_desc)
@@ -246,9 +253,7 @@ struct e1000_adapter {
246 u16 link_speed; 253 u16 link_speed;
247 u16 link_duplex; 254 u16 link_duplex;
248 spinlock_t stats_lock; 255 spinlock_t stats_lock;
249#ifdef CONFIG_E1000_NAPI
250 spinlock_t tx_queue_lock; 256 spinlock_t tx_queue_lock;
251#endif
252 unsigned int total_tx_bytes; 257 unsigned int total_tx_bytes;
253 unsigned int total_tx_packets; 258 unsigned int total_tx_packets;
254 unsigned int total_rx_bytes; 259 unsigned int total_rx_bytes;
@@ -286,22 +291,16 @@ struct e1000_adapter {
286 bool detect_tx_hung; 291 bool detect_tx_hung;
287 292
288 /* RX */ 293 /* RX */
289#ifdef CONFIG_E1000_NAPI 294 bool (*clean_rx)(struct e1000_adapter *adapter,
290 bool (*clean_rx) (struct e1000_adapter *adapter, 295 struct e1000_rx_ring *rx_ring,
291 struct e1000_rx_ring *rx_ring, 296 int *work_done, int work_to_do);
292 int *work_done, int work_to_do); 297 void (*alloc_rx_buf)(struct e1000_adapter *adapter,
293#else 298 struct e1000_rx_ring *rx_ring,
294 bool (*clean_rx) (struct e1000_adapter *adapter, 299 int cleaned_count);
295 struct e1000_rx_ring *rx_ring);
296#endif
297 void (*alloc_rx_buf) (struct e1000_adapter *adapter,
298 struct e1000_rx_ring *rx_ring,
299 int cleaned_count);
300 struct e1000_rx_ring *rx_ring; /* One per active queue */ 300 struct e1000_rx_ring *rx_ring; /* One per active queue */
301#ifdef CONFIG_E1000_NAPI
302 struct napi_struct napi; 301 struct napi_struct napi;
303 struct net_device *polling_netdev; /* One per active queue */ 302 struct net_device *polling_netdev; /* One per active queue */
304#endif 303
305 int num_tx_queues; 304 int num_tx_queues;
306 int num_rx_queues; 305 int num_rx_queues;
307 306
@@ -317,7 +316,6 @@ struct e1000_adapter {
317 u64 gorcl_old; 316 u64 gorcl_old;
318 u16 rx_ps_bsize0; 317 u16 rx_ps_bsize0;
319 318
320
321 /* OS defined structs */ 319 /* OS defined structs */
322 struct net_device *netdev; 320 struct net_device *netdev;
323 struct pci_dev *pdev; 321 struct pci_dev *pdev;
@@ -342,6 +340,10 @@ struct e1000_adapter {
342 bool quad_port_a; 340 bool quad_port_a;
343 unsigned long flags; 341 unsigned long flags;
344 u32 eeprom_wol; 342 u32 eeprom_wol;
343
344 /* for ioport free */
345 int bars;
346 int need_ioport;
345}; 347};
346 348
347enum e1000_state_t { 349enum e1000_state_t {
@@ -353,9 +355,18 @@ enum e1000_state_t {
353extern char e1000_driver_name[]; 355extern char e1000_driver_name[];
354extern const char e1000_driver_version[]; 356extern const char e1000_driver_version[];
355 357
358extern int e1000_up(struct e1000_adapter *adapter);
359extern void e1000_down(struct e1000_adapter *adapter);
360extern void e1000_reinit_locked(struct e1000_adapter *adapter);
361extern void e1000_reset(struct e1000_adapter *adapter);
362extern int e1000_set_spd_dplx(struct e1000_adapter *adapter, u16 spddplx);
363extern int e1000_setup_all_rx_resources(struct e1000_adapter *adapter);
364extern int e1000_setup_all_tx_resources(struct e1000_adapter *adapter);
365extern void e1000_free_all_rx_resources(struct e1000_adapter *adapter);
366extern void e1000_free_all_tx_resources(struct e1000_adapter *adapter);
367extern void e1000_update_stats(struct e1000_adapter *adapter);
356extern void e1000_power_up_phy(struct e1000_adapter *); 368extern void e1000_power_up_phy(struct e1000_adapter *);
357extern void e1000_set_ethtool_ops(struct net_device *netdev); 369extern void e1000_set_ethtool_ops(struct net_device *netdev);
358extern void e1000_check_options(struct e1000_adapter *adapter); 370extern void e1000_check_options(struct e1000_adapter *adapter);
359 371
360
361#endif /* _E1000_H_ */ 372#endif /* _E1000_H_ */