diff options
Diffstat (limited to 'drivers/net/e1000e/e1000.h')
-rw-r--r-- | drivers/net/e1000e/e1000.h | 56 |
1 files changed, 47 insertions, 9 deletions
diff --git a/drivers/net/e1000e/e1000.h b/drivers/net/e1000e/e1000.h index f9a31c82f871..9549879e66a0 100644 --- a/drivers/net/e1000e/e1000.h +++ b/drivers/net/e1000e/e1000.h | |||
@@ -1,7 +1,7 @@ | |||
1 | /******************************************************************************* | 1 | /******************************************************************************* |
2 | 2 | ||
3 | Intel PRO/1000 Linux driver | 3 | Intel PRO/1000 Linux driver |
4 | Copyright(c) 1999 - 2010 Intel Corporation. | 4 | Copyright(c) 1999 - 2011 Intel Corporation. |
5 | 5 | ||
6 | This program is free software; you can redistribute it and/or modify it | 6 | This program is free software; you can redistribute it and/or modify it |
7 | under the terms and conditions of the GNU General Public License, | 7 | under the terms and conditions of the GNU General Public License, |
@@ -31,6 +31,7 @@ | |||
31 | #ifndef _E1000_H_ | 31 | #ifndef _E1000_H_ |
32 | #define _E1000_H_ | 32 | #define _E1000_H_ |
33 | 33 | ||
34 | #include <linux/bitops.h> | ||
34 | #include <linux/types.h> | 35 | #include <linux/types.h> |
35 | #include <linux/timer.h> | 36 | #include <linux/timer.h> |
36 | #include <linux/workqueue.h> | 37 | #include <linux/workqueue.h> |
@@ -38,6 +39,8 @@ | |||
38 | #include <linux/netdevice.h> | 39 | #include <linux/netdevice.h> |
39 | #include <linux/pci.h> | 40 | #include <linux/pci.h> |
40 | #include <linux/pci-aspm.h> | 41 | #include <linux/pci-aspm.h> |
42 | #include <linux/crc32.h> | ||
43 | #include <linux/if_vlan.h> | ||
41 | 44 | ||
42 | #include "hw.h" | 45 | #include "hw.h" |
43 | 46 | ||
@@ -153,6 +156,33 @@ struct e1000_info; | |||
153 | /* Time to wait before putting the device into D3 if there's no link (in ms). */ | 156 | /* Time to wait before putting the device into D3 if there's no link (in ms). */ |
154 | #define LINK_TIMEOUT 100 | 157 | #define LINK_TIMEOUT 100 |
155 | 158 | ||
159 | #define DEFAULT_RDTR 0 | ||
160 | #define DEFAULT_RADV 8 | ||
161 | #define BURST_RDTR 0x20 | ||
162 | #define BURST_RADV 0x20 | ||
163 | |||
164 | /* | ||
165 | * in the case of WTHRESH, it appears at least the 82571/2 hardware | ||
166 | * writes back 4 descriptors when WTHRESH=5, and 3 descriptors when | ||
167 | * WTHRESH=4, and since we want 64 bytes at a time written back, set | ||
168 | * it to 5 | ||
169 | */ | ||
170 | #define E1000_TXDCTL_DMA_BURST_ENABLE \ | ||
171 | (E1000_TXDCTL_GRAN | /* set descriptor granularity */ \ | ||
172 | E1000_TXDCTL_COUNT_DESC | \ | ||
173 | (5 << 16) | /* wthresh must be +1 more than desired */\ | ||
174 | (1 << 8) | /* hthresh */ \ | ||
175 | 0x1f) /* pthresh */ | ||
176 | |||
177 | #define E1000_RXDCTL_DMA_BURST_ENABLE \ | ||
178 | (0x01000000 | /* set descriptor granularity */ \ | ||
179 | (4 << 16) | /* set writeback threshold */ \ | ||
180 | (4 << 8) | /* set prefetch threshold */ \ | ||
181 | 0x20) /* set hthresh */ | ||
182 | |||
183 | #define E1000_TIDV_FPD (1 << 31) | ||
184 | #define E1000_RDTR_FPD (1 << 31) | ||
185 | |||
156 | enum e1000_boards { | 186 | enum e1000_boards { |
157 | board_82571, | 187 | board_82571, |
158 | board_82572, | 188 | board_82572, |
@@ -252,7 +282,7 @@ struct e1000_adapter { | |||
252 | 282 | ||
253 | const struct e1000_info *ei; | 283 | const struct e1000_info *ei; |
254 | 284 | ||
255 | struct vlan_group *vlgrp; | 285 | unsigned long active_vlans[BITS_TO_LONGS(VLAN_N_VID)]; |
256 | u32 bd_number; | 286 | u32 bd_number; |
257 | u32 rx_buffer_len; | 287 | u32 rx_buffer_len; |
258 | u16 mng_vlan_id; | 288 | u16 mng_vlan_id; |
@@ -336,6 +366,7 @@ struct e1000_adapter { | |||
336 | /* structs defined in e1000_hw.h */ | 366 | /* structs defined in e1000_hw.h */ |
337 | struct e1000_hw hw; | 367 | struct e1000_hw hw; |
338 | 368 | ||
369 | spinlock_t stats64_lock; | ||
339 | struct e1000_hw_stats stats; | 370 | struct e1000_hw_stats stats; |
340 | struct e1000_phy_info phy_info; | 371 | struct e1000_phy_info phy_info; |
341 | struct e1000_phy_stats phy_stats; | 372 | struct e1000_phy_stats phy_stats; |
@@ -360,16 +391,14 @@ struct e1000_adapter { | |||
360 | 391 | ||
361 | bool fc_autoneg; | 392 | bool fc_autoneg; |
362 | 393 | ||
363 | unsigned long led_status; | ||
364 | |||
365 | unsigned int flags; | 394 | unsigned int flags; |
366 | unsigned int flags2; | 395 | unsigned int flags2; |
367 | struct work_struct downshift_task; | 396 | struct work_struct downshift_task; |
368 | struct work_struct update_phy_task; | 397 | struct work_struct update_phy_task; |
369 | struct work_struct led_blink_task; | ||
370 | struct work_struct print_hang_task; | 398 | struct work_struct print_hang_task; |
371 | 399 | ||
372 | bool idle_check; | 400 | bool idle_check; |
401 | int phy_hang_count; | ||
373 | }; | 402 | }; |
374 | 403 | ||
375 | struct e1000_info { | 404 | struct e1000_info { |
@@ -425,6 +454,10 @@ struct e1000_info { | |||
425 | #define FLAG2_DISABLE_ASPM_L1 (1 << 3) | 454 | #define FLAG2_DISABLE_ASPM_L1 (1 << 3) |
426 | #define FLAG2_HAS_PHY_STATS (1 << 4) | 455 | #define FLAG2_HAS_PHY_STATS (1 << 4) |
427 | #define FLAG2_HAS_EEE (1 << 5) | 456 | #define FLAG2_HAS_EEE (1 << 5) |
457 | #define FLAG2_DMA_BURST (1 << 6) | ||
458 | #define FLAG2_DISABLE_ASPM_L0S (1 << 7) | ||
459 | #define FLAG2_DISABLE_AIM (1 << 8) | ||
460 | #define FLAG2_CHECK_PHY_HANG (1 << 9) | ||
428 | 461 | ||
429 | #define E1000_RX_DESC_PS(R, i) \ | 462 | #define E1000_RX_DESC_PS(R, i) \ |
430 | (&(((union e1000_rx_desc_packet_split *)((R).desc))[i])) | 463 | (&(((union e1000_rx_desc_packet_split *)((R).desc))[i])) |
@@ -461,10 +494,13 @@ extern int e1000e_setup_rx_resources(struct e1000_adapter *adapter); | |||
461 | extern int e1000e_setup_tx_resources(struct e1000_adapter *adapter); | 494 | extern int e1000e_setup_tx_resources(struct e1000_adapter *adapter); |
462 | extern void e1000e_free_rx_resources(struct e1000_adapter *adapter); | 495 | extern void e1000e_free_rx_resources(struct e1000_adapter *adapter); |
463 | extern void e1000e_free_tx_resources(struct e1000_adapter *adapter); | 496 | extern void e1000e_free_tx_resources(struct e1000_adapter *adapter); |
464 | extern void e1000e_update_stats(struct e1000_adapter *adapter); | 497 | extern struct rtnl_link_stats64 *e1000e_get_stats64(struct net_device *netdev, |
498 | struct rtnl_link_stats64 | ||
499 | *stats); | ||
465 | extern void e1000e_set_interrupt_capability(struct e1000_adapter *adapter); | 500 | extern void e1000e_set_interrupt_capability(struct e1000_adapter *adapter); |
466 | extern void e1000e_reset_interrupt_capability(struct e1000_adapter *adapter); | 501 | extern void e1000e_reset_interrupt_capability(struct e1000_adapter *adapter); |
467 | extern void e1000e_disable_aspm(struct pci_dev *pdev, u16 state); | 502 | extern void e1000e_get_hw_control(struct e1000_adapter *adapter); |
503 | extern void e1000e_release_hw_control(struct e1000_adapter *adapter); | ||
468 | 504 | ||
469 | extern unsigned int copybreak; | 505 | extern unsigned int copybreak; |
470 | 506 | ||
@@ -482,7 +518,8 @@ extern struct e1000_info e1000_pch_info; | |||
482 | extern struct e1000_info e1000_pch2_info; | 518 | extern struct e1000_info e1000_pch2_info; |
483 | extern struct e1000_info e1000_es2_info; | 519 | extern struct e1000_info e1000_es2_info; |
484 | 520 | ||
485 | extern s32 e1000e_read_pba_num(struct e1000_hw *hw, u32 *pba_num); | 521 | extern s32 e1000_read_pba_string_generic(struct e1000_hw *hw, u8 *pba_num, |
522 | u32 pba_num_size); | ||
486 | 523 | ||
487 | extern s32 e1000e_commit_phy(struct e1000_hw *hw); | 524 | extern s32 e1000e_commit_phy(struct e1000_hw *hw); |
488 | 525 | ||
@@ -534,7 +571,7 @@ extern s32 e1000e_valid_led_default(struct e1000_hw *hw, u16 *data); | |||
534 | extern void e1000e_config_collision_dist(struct e1000_hw *hw); | 571 | extern void e1000e_config_collision_dist(struct e1000_hw *hw); |
535 | extern s32 e1000e_config_fc_after_link_up(struct e1000_hw *hw); | 572 | extern s32 e1000e_config_fc_after_link_up(struct e1000_hw *hw); |
536 | extern s32 e1000e_force_mac_fc(struct e1000_hw *hw); | 573 | extern s32 e1000e_force_mac_fc(struct e1000_hw *hw); |
537 | extern s32 e1000e_blink_led(struct e1000_hw *hw); | 574 | extern s32 e1000e_blink_led_generic(struct e1000_hw *hw); |
538 | extern void e1000_write_vfta_generic(struct e1000_hw *hw, u32 offset, u32 value); | 575 | extern void e1000_write_vfta_generic(struct e1000_hw *hw, u32 offset, u32 value); |
539 | extern s32 e1000_check_alt_mac_addr_generic(struct e1000_hw *hw); | 576 | extern s32 e1000_check_alt_mac_addr_generic(struct e1000_hw *hw); |
540 | extern void e1000e_reset_adaptive(struct e1000_hw *hw); | 577 | extern void e1000e_reset_adaptive(struct e1000_hw *hw); |
@@ -602,6 +639,7 @@ extern s32 e1000_get_phy_info_ife(struct e1000_hw *hw); | |||
602 | extern s32 e1000_check_polarity_ife(struct e1000_hw *hw); | 639 | extern s32 e1000_check_polarity_ife(struct e1000_hw *hw); |
603 | extern s32 e1000_phy_force_speed_duplex_ife(struct e1000_hw *hw); | 640 | extern s32 e1000_phy_force_speed_duplex_ife(struct e1000_hw *hw); |
604 | extern s32 e1000_check_polarity_igp(struct e1000_hw *hw); | 641 | extern s32 e1000_check_polarity_igp(struct e1000_hw *hw); |
642 | extern bool e1000_check_phy_82574(struct e1000_hw *hw); | ||
605 | 643 | ||
606 | static inline s32 e1000_phy_hw_reset(struct e1000_hw *hw) | 644 | static inline s32 e1000_phy_hw_reset(struct e1000_hw *hw) |
607 | { | 645 | { |