diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-10-29 17:17:12 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-10-29 17:17:12 -0400 |
commit | 1840897ab5d39b2e510c610ee262ded79919e718 (patch) | |
tree | 0b7fe95e3eda357d35b0d017f2b678b652307827 /drivers/net/e1000e/82571.c | |
parent | d56f84e7e317c69adefb2454a3d538a6d7e11e4b (diff) | |
parent | a4765fa7bfb92d5b9de19a503674b6624f95a7ae (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: (34 commits)
b43: Fix warning at drivers/mmc/core/core.c:237 in mmc_wait_for_cmd
mac80211: fix failure to check kmalloc return value in key_key_read
libertas: Fix sd8686 firmware reload
ath9k: Fix incorrect access of rate flags in RC
netfilter: xt_socket: Make tproto signed in socket_mt6_v1().
stmmac: enable/disable rx/tx in the core with a single write.
net: atarilance - flags should be unsigned long
netxen: fix kdump
pktgen: Limit how much data we copy onto the stack.
net: Limit socket I/O iovec total length to INT_MAX.
USB: gadget: fix ethernet gadget crash in gether_setup
fib: Fix fib zone and its hash leak on namespace stop
cxgb3: Fix panic in free_tx_desc()
cxgb3: fix crash due to manipulating queues before registration
8390: Don't oops on starting dev queue
dccp ccid-2: Stop polling
dccp: Refine the wait-for-ccid mechanism
dccp: Extend CCID packet dequeueing interface
dccp: Return-value convention of hc_tx_send_packet()
igbvf: fix panic on load
...
Diffstat (limited to 'drivers/net/e1000e/82571.c')
-rw-r--r-- | drivers/net/e1000e/82571.c | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/drivers/net/e1000e/82571.c b/drivers/net/e1000e/82571.c index ca663f19d7df..7236f1a53ba0 100644 --- a/drivers/net/e1000e/82571.c +++ b/drivers/net/e1000e/82571.c | |||
@@ -52,6 +52,10 @@ | |||
52 | (ID_LED_DEF1_DEF2)) | 52 | (ID_LED_DEF1_DEF2)) |
53 | 53 | ||
54 | #define E1000_GCR_L1_ACT_WITHOUT_L0S_RX 0x08000000 | 54 | #define E1000_GCR_L1_ACT_WITHOUT_L0S_RX 0x08000000 |
55 | #define E1000_BASE1000T_STATUS 10 | ||
56 | #define E1000_IDLE_ERROR_COUNT_MASK 0xFF | ||
57 | #define E1000_RECEIVE_ERROR_COUNTER 21 | ||
58 | #define E1000_RECEIVE_ERROR_MAX 0xFFFF | ||
55 | 59 | ||
56 | #define E1000_NVM_INIT_CTRL2_MNGM 0x6000 /* Manageability Operation Mode mask */ | 60 | #define E1000_NVM_INIT_CTRL2_MNGM 0x6000 /* Manageability Operation Mode mask */ |
57 | 61 | ||
@@ -1243,6 +1247,39 @@ static s32 e1000_led_on_82574(struct e1000_hw *hw) | |||
1243 | } | 1247 | } |
1244 | 1248 | ||
1245 | /** | 1249 | /** |
1250 | * e1000_check_phy_82574 - check 82574 phy hung state | ||
1251 | * @hw: pointer to the HW structure | ||
1252 | * | ||
1253 | * Returns whether phy is hung or not | ||
1254 | **/ | ||
1255 | bool e1000_check_phy_82574(struct e1000_hw *hw) | ||
1256 | { | ||
1257 | u16 status_1kbt = 0; | ||
1258 | u16 receive_errors = 0; | ||
1259 | bool phy_hung = false; | ||
1260 | s32 ret_val = 0; | ||
1261 | |||
1262 | /* | ||
1263 | * Read PHY Receive Error counter first, if its is max - all F's then | ||
1264 | * read the Base1000T status register If both are max then PHY is hung. | ||
1265 | */ | ||
1266 | ret_val = e1e_rphy(hw, E1000_RECEIVE_ERROR_COUNTER, &receive_errors); | ||
1267 | |||
1268 | if (ret_val) | ||
1269 | goto out; | ||
1270 | if (receive_errors == E1000_RECEIVE_ERROR_MAX) { | ||
1271 | ret_val = e1e_rphy(hw, E1000_BASE1000T_STATUS, &status_1kbt); | ||
1272 | if (ret_val) | ||
1273 | goto out; | ||
1274 | if ((status_1kbt & E1000_IDLE_ERROR_COUNT_MASK) == | ||
1275 | E1000_IDLE_ERROR_COUNT_MASK) | ||
1276 | phy_hung = true; | ||
1277 | } | ||
1278 | out: | ||
1279 | return phy_hung; | ||
1280 | } | ||
1281 | |||
1282 | /** | ||
1246 | * e1000_setup_link_82571 - Setup flow control and link settings | 1283 | * e1000_setup_link_82571 - Setup flow control and link settings |
1247 | * @hw: pointer to the HW structure | 1284 | * @hw: pointer to the HW structure |
1248 | * | 1285 | * |
@@ -1859,6 +1896,7 @@ struct e1000_info e1000_82574_info = { | |||
1859 | | FLAG_HAS_SMART_POWER_DOWN | 1896 | | FLAG_HAS_SMART_POWER_DOWN |
1860 | | FLAG_HAS_AMT | 1897 | | FLAG_HAS_AMT |
1861 | | FLAG_HAS_CTRLEXT_ON_LOAD, | 1898 | | FLAG_HAS_CTRLEXT_ON_LOAD, |
1899 | .flags2 = FLAG2_CHECK_PHY_HANG, | ||
1862 | .pba = 36, | 1900 | .pba = 36, |
1863 | .max_hw_frame_size = DEFAULT_JUMBO, | 1901 | .max_hw_frame_size = DEFAULT_JUMBO, |
1864 | .get_variants = e1000_get_variants_82571, | 1902 | .get_variants = e1000_get_variants_82571, |