diff options
Diffstat (limited to 'drivers/net/e1000e/lib.c')
-rw-r--r-- | drivers/net/e1000e/lib.c | 261 |
1 files changed, 134 insertions, 127 deletions
diff --git a/drivers/net/e1000e/lib.c b/drivers/net/e1000e/lib.c index 99ba2b8a2a05..a86c17548c1e 100644 --- a/drivers/net/e1000e/lib.c +++ b/drivers/net/e1000e/lib.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /******************************************************************************* | 1 | /******************************************************************************* |
2 | 2 | ||
3 | Intel PRO/1000 Linux driver | 3 | Intel PRO/1000 Linux driver |
4 | Copyright(c) 1999 - 2008 Intel Corporation. | 4 | Copyright(c) 1999 - 2009 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, |
@@ -26,11 +26,6 @@ | |||
26 | 26 | ||
27 | *******************************************************************************/ | 27 | *******************************************************************************/ |
28 | 28 | ||
29 | #include <linux/netdevice.h> | ||
30 | #include <linux/ethtool.h> | ||
31 | #include <linux/delay.h> | ||
32 | #include <linux/pci.h> | ||
33 | |||
34 | #include "e1000.h" | 29 | #include "e1000.h" |
35 | 30 | ||
36 | enum e1000_mng_mode { | 31 | enum e1000_mng_mode { |
@@ -87,7 +82,24 @@ s32 e1000e_get_bus_info_pcie(struct e1000_hw *hw) | |||
87 | } | 82 | } |
88 | 83 | ||
89 | /** | 84 | /** |
90 | * e1000e_write_vfta - Write value to VLAN filter table | 85 | * e1000_clear_vfta_generic - Clear VLAN filter table |
86 | * @hw: pointer to the HW structure | ||
87 | * | ||
88 | * Clears the register array which contains the VLAN filter table by | ||
89 | * setting all the values to 0. | ||
90 | **/ | ||
91 | void e1000_clear_vfta_generic(struct e1000_hw *hw) | ||
92 | { | ||
93 | u32 offset; | ||
94 | |||
95 | for (offset = 0; offset < E1000_VLAN_FILTER_TBL_SIZE; offset++) { | ||
96 | E1000_WRITE_REG_ARRAY(hw, E1000_VFTA, offset, 0); | ||
97 | e1e_flush(); | ||
98 | } | ||
99 | } | ||
100 | |||
101 | /** | ||
102 | * e1000_write_vfta_generic - Write value to VLAN filter table | ||
91 | * @hw: pointer to the HW structure | 103 | * @hw: pointer to the HW structure |
92 | * @offset: register offset in VLAN filter table | 104 | * @offset: register offset in VLAN filter table |
93 | * @value: register value written to VLAN filter table | 105 | * @value: register value written to VLAN filter table |
@@ -95,7 +107,7 @@ s32 e1000e_get_bus_info_pcie(struct e1000_hw *hw) | |||
95 | * Writes value at the given offset in the register array which stores | 107 | * Writes value at the given offset in the register array which stores |
96 | * the VLAN filter table. | 108 | * the VLAN filter table. |
97 | **/ | 109 | **/ |
98 | void e1000e_write_vfta(struct e1000_hw *hw, u32 offset, u32 value) | 110 | void e1000_write_vfta_generic(struct e1000_hw *hw, u32 offset, u32 value) |
99 | { | 111 | { |
100 | E1000_WRITE_REG_ARRAY(hw, E1000_VFTA, offset, value); | 112 | E1000_WRITE_REG_ARRAY(hw, E1000_VFTA, offset, value); |
101 | e1e_flush(); | 113 | e1e_flush(); |
@@ -115,12 +127,12 @@ void e1000e_init_rx_addrs(struct e1000_hw *hw, u16 rar_count) | |||
115 | u32 i; | 127 | u32 i; |
116 | 128 | ||
117 | /* Setup the receive address */ | 129 | /* Setup the receive address */ |
118 | hw_dbg(hw, "Programming MAC Address into RAR[0]\n"); | 130 | e_dbg("Programming MAC Address into RAR[0]\n"); |
119 | 131 | ||
120 | e1000e_rar_set(hw, hw->mac.addr, 0); | 132 | e1000e_rar_set(hw, hw->mac.addr, 0); |
121 | 133 | ||
122 | /* Zero out the other (rar_entry_count - 1) receive addresses */ | 134 | /* Zero out the other (rar_entry_count - 1) receive addresses */ |
123 | hw_dbg(hw, "Clearing RAR[1-%u]\n", rar_count-1); | 135 | e_dbg("Clearing RAR[1-%u]\n", rar_count-1); |
124 | for (i = 1; i < rar_count; i++) { | 136 | for (i = 1; i < rar_count; i++) { |
125 | E1000_WRITE_REG_ARRAY(hw, E1000_RA, (i << 1), 0); | 137 | E1000_WRITE_REG_ARRAY(hw, E1000_RA, (i << 1), 0); |
126 | e1e_flush(); | 138 | e1e_flush(); |
@@ -276,7 +288,7 @@ void e1000e_update_mc_addr_list_generic(struct e1000_hw *hw, | |||
276 | for (; mc_addr_count > 0; mc_addr_count--) { | 288 | for (; mc_addr_count > 0; mc_addr_count--) { |
277 | u32 hash_value, hash_reg, hash_bit, mta; | 289 | u32 hash_value, hash_reg, hash_bit, mta; |
278 | hash_value = e1000_hash_mc_addr(hw, mc_addr_list); | 290 | hash_value = e1000_hash_mc_addr(hw, mc_addr_list); |
279 | hw_dbg(hw, "Hash value = 0x%03X\n", hash_value); | 291 | e_dbg("Hash value = 0x%03X\n", hash_value); |
280 | hash_reg = (hash_value >> 5) & (hw->mac.mta_reg_count - 1); | 292 | hash_reg = (hash_value >> 5) & (hw->mac.mta_reg_count - 1); |
281 | hash_bit = hash_value & 0x1F; | 293 | hash_bit = hash_value & 0x1F; |
282 | mta = (1 << hash_bit); | 294 | mta = (1 << hash_bit); |
@@ -300,45 +312,43 @@ void e1000e_update_mc_addr_list_generic(struct e1000_hw *hw, | |||
300 | **/ | 312 | **/ |
301 | void e1000e_clear_hw_cntrs_base(struct e1000_hw *hw) | 313 | void e1000e_clear_hw_cntrs_base(struct e1000_hw *hw) |
302 | { | 314 | { |
303 | u32 temp; | 315 | er32(CRCERRS); |
304 | 316 | er32(SYMERRS); | |
305 | temp = er32(CRCERRS); | 317 | er32(MPC); |
306 | temp = er32(SYMERRS); | 318 | er32(SCC); |
307 | temp = er32(MPC); | 319 | er32(ECOL); |
308 | temp = er32(SCC); | 320 | er32(MCC); |
309 | temp = er32(ECOL); | 321 | er32(LATECOL); |
310 | temp = er32(MCC); | 322 | er32(COLC); |
311 | temp = er32(LATECOL); | 323 | er32(DC); |
312 | temp = er32(COLC); | 324 | er32(SEC); |
313 | temp = er32(DC); | 325 | er32(RLEC); |
314 | temp = er32(SEC); | 326 | er32(XONRXC); |
315 | temp = er32(RLEC); | 327 | er32(XONTXC); |
316 | temp = er32(XONRXC); | 328 | er32(XOFFRXC); |
317 | temp = er32(XONTXC); | 329 | er32(XOFFTXC); |
318 | temp = er32(XOFFRXC); | 330 | er32(FCRUC); |
319 | temp = er32(XOFFTXC); | 331 | er32(GPRC); |
320 | temp = er32(FCRUC); | 332 | er32(BPRC); |
321 | temp = er32(GPRC); | 333 | er32(MPRC); |
322 | temp = er32(BPRC); | 334 | er32(GPTC); |
323 | temp = er32(MPRC); | 335 | er32(GORCL); |
324 | temp = er32(GPTC); | 336 | er32(GORCH); |
325 | temp = er32(GORCL); | 337 | er32(GOTCL); |
326 | temp = er32(GORCH); | 338 | er32(GOTCH); |
327 | temp = er32(GOTCL); | 339 | er32(RNBC); |
328 | temp = er32(GOTCH); | 340 | er32(RUC); |
329 | temp = er32(RNBC); | 341 | er32(RFC); |
330 | temp = er32(RUC); | 342 | er32(ROC); |
331 | temp = er32(RFC); | 343 | er32(RJC); |
332 | temp = er32(ROC); | 344 | er32(TORL); |
333 | temp = er32(RJC); | 345 | er32(TORH); |
334 | temp = er32(TORL); | 346 | er32(TOTL); |
335 | temp = er32(TORH); | 347 | er32(TOTH); |
336 | temp = er32(TOTL); | 348 | er32(TPR); |
337 | temp = er32(TOTH); | 349 | er32(TPT); |
338 | temp = er32(TPR); | 350 | er32(MPTC); |
339 | temp = er32(TPT); | 351 | er32(BPTC); |
340 | temp = er32(MPTC); | ||
341 | temp = er32(BPTC); | ||
342 | } | 352 | } |
343 | 353 | ||
344 | /** | 354 | /** |
@@ -376,7 +386,7 @@ s32 e1000e_check_for_copper_link(struct e1000_hw *hw) | |||
376 | if (!link) | 386 | if (!link) |
377 | return ret_val; /* No link detected */ | 387 | return ret_val; /* No link detected */ |
378 | 388 | ||
379 | mac->get_link_status = 0; | 389 | mac->get_link_status = false; |
380 | 390 | ||
381 | /* | 391 | /* |
382 | * Check if there was DownShift, must be checked | 392 | * Check if there was DownShift, must be checked |
@@ -408,7 +418,7 @@ s32 e1000e_check_for_copper_link(struct e1000_hw *hw) | |||
408 | */ | 418 | */ |
409 | ret_val = e1000e_config_fc_after_link_up(hw); | 419 | ret_val = e1000e_config_fc_after_link_up(hw); |
410 | if (ret_val) { | 420 | if (ret_val) { |
411 | hw_dbg(hw, "Error configuring flow control\n"); | 421 | e_dbg("Error configuring flow control\n"); |
412 | } | 422 | } |
413 | 423 | ||
414 | return ret_val; | 424 | return ret_val; |
@@ -448,7 +458,7 @@ s32 e1000e_check_for_fiber_link(struct e1000_hw *hw) | |||
448 | mac->autoneg_failed = 1; | 458 | mac->autoneg_failed = 1; |
449 | return 0; | 459 | return 0; |
450 | } | 460 | } |
451 | hw_dbg(hw, "NOT RXing /C/, disable AutoNeg and force link.\n"); | 461 | e_dbg("NOT RXing /C/, disable AutoNeg and force link.\n"); |
452 | 462 | ||
453 | /* Disable auto-negotiation in the TXCW register */ | 463 | /* Disable auto-negotiation in the TXCW register */ |
454 | ew32(TXCW, (mac->txcw & ~E1000_TXCW_ANE)); | 464 | ew32(TXCW, (mac->txcw & ~E1000_TXCW_ANE)); |
@@ -461,7 +471,7 @@ s32 e1000e_check_for_fiber_link(struct e1000_hw *hw) | |||
461 | /* Configure Flow Control after forcing link up. */ | 471 | /* Configure Flow Control after forcing link up. */ |
462 | ret_val = e1000e_config_fc_after_link_up(hw); | 472 | ret_val = e1000e_config_fc_after_link_up(hw); |
463 | if (ret_val) { | 473 | if (ret_val) { |
464 | hw_dbg(hw, "Error configuring flow control\n"); | 474 | e_dbg("Error configuring flow control\n"); |
465 | return ret_val; | 475 | return ret_val; |
466 | } | 476 | } |
467 | } else if ((ctrl & E1000_CTRL_SLU) && (rxcw & E1000_RXCW_C)) { | 477 | } else if ((ctrl & E1000_CTRL_SLU) && (rxcw & E1000_RXCW_C)) { |
@@ -471,7 +481,7 @@ s32 e1000e_check_for_fiber_link(struct e1000_hw *hw) | |||
471 | * and disable forced link in the Device Control register | 481 | * and disable forced link in the Device Control register |
472 | * in an attempt to auto-negotiate with our link partner. | 482 | * in an attempt to auto-negotiate with our link partner. |
473 | */ | 483 | */ |
474 | hw_dbg(hw, "RXing /C/, enable AutoNeg and stop forcing link.\n"); | 484 | e_dbg("RXing /C/, enable AutoNeg and stop forcing link.\n"); |
475 | ew32(TXCW, mac->txcw); | 485 | ew32(TXCW, mac->txcw); |
476 | ew32(CTRL, (ctrl & ~E1000_CTRL_SLU)); | 486 | ew32(CTRL, (ctrl & ~E1000_CTRL_SLU)); |
477 | 487 | ||
@@ -513,7 +523,7 @@ s32 e1000e_check_for_serdes_link(struct e1000_hw *hw) | |||
513 | mac->autoneg_failed = 1; | 523 | mac->autoneg_failed = 1; |
514 | return 0; | 524 | return 0; |
515 | } | 525 | } |
516 | hw_dbg(hw, "NOT RXing /C/, disable AutoNeg and force link.\n"); | 526 | e_dbg("NOT RXing /C/, disable AutoNeg and force link.\n"); |
517 | 527 | ||
518 | /* Disable auto-negotiation in the TXCW register */ | 528 | /* Disable auto-negotiation in the TXCW register */ |
519 | ew32(TXCW, (mac->txcw & ~E1000_TXCW_ANE)); | 529 | ew32(TXCW, (mac->txcw & ~E1000_TXCW_ANE)); |
@@ -526,7 +536,7 @@ s32 e1000e_check_for_serdes_link(struct e1000_hw *hw) | |||
526 | /* Configure Flow Control after forcing link up. */ | 536 | /* Configure Flow Control after forcing link up. */ |
527 | ret_val = e1000e_config_fc_after_link_up(hw); | 537 | ret_val = e1000e_config_fc_after_link_up(hw); |
528 | if (ret_val) { | 538 | if (ret_val) { |
529 | hw_dbg(hw, "Error configuring flow control\n"); | 539 | e_dbg("Error configuring flow control\n"); |
530 | return ret_val; | 540 | return ret_val; |
531 | } | 541 | } |
532 | } else if ((ctrl & E1000_CTRL_SLU) && (rxcw & E1000_RXCW_C)) { | 542 | } else if ((ctrl & E1000_CTRL_SLU) && (rxcw & E1000_RXCW_C)) { |
@@ -536,7 +546,7 @@ s32 e1000e_check_for_serdes_link(struct e1000_hw *hw) | |||
536 | * and disable forced link in the Device Control register | 546 | * and disable forced link in the Device Control register |
537 | * in an attempt to auto-negotiate with our link partner. | 547 | * in an attempt to auto-negotiate with our link partner. |
538 | */ | 548 | */ |
539 | hw_dbg(hw, "RXing /C/, enable AutoNeg and stop forcing link.\n"); | 549 | e_dbg("RXing /C/, enable AutoNeg and stop forcing link.\n"); |
540 | ew32(TXCW, mac->txcw); | 550 | ew32(TXCW, mac->txcw); |
541 | ew32(CTRL, (ctrl & ~E1000_CTRL_SLU)); | 551 | ew32(CTRL, (ctrl & ~E1000_CTRL_SLU)); |
542 | 552 | ||
@@ -553,11 +563,11 @@ s32 e1000e_check_for_serdes_link(struct e1000_hw *hw) | |||
553 | if (rxcw & E1000_RXCW_SYNCH) { | 563 | if (rxcw & E1000_RXCW_SYNCH) { |
554 | if (!(rxcw & E1000_RXCW_IV)) { | 564 | if (!(rxcw & E1000_RXCW_IV)) { |
555 | mac->serdes_has_link = true; | 565 | mac->serdes_has_link = true; |
556 | hw_dbg(hw, "SERDES: Link up - forced.\n"); | 566 | e_dbg("SERDES: Link up - forced.\n"); |
557 | } | 567 | } |
558 | } else { | 568 | } else { |
559 | mac->serdes_has_link = false; | 569 | mac->serdes_has_link = false; |
560 | hw_dbg(hw, "SERDES: Link down - force failed.\n"); | 570 | e_dbg("SERDES: Link down - force failed.\n"); |
561 | } | 571 | } |
562 | } | 572 | } |
563 | 573 | ||
@@ -570,20 +580,20 @@ s32 e1000e_check_for_serdes_link(struct e1000_hw *hw) | |||
570 | if (rxcw & E1000_RXCW_SYNCH) { | 580 | if (rxcw & E1000_RXCW_SYNCH) { |
571 | if (!(rxcw & E1000_RXCW_IV)) { | 581 | if (!(rxcw & E1000_RXCW_IV)) { |
572 | mac->serdes_has_link = true; | 582 | mac->serdes_has_link = true; |
573 | hw_dbg(hw, "SERDES: Link up - autoneg " | 583 | e_dbg("SERDES: Link up - autoneg " |
574 | "completed sucessfully.\n"); | 584 | "completed sucessfully.\n"); |
575 | } else { | 585 | } else { |
576 | mac->serdes_has_link = false; | 586 | mac->serdes_has_link = false; |
577 | hw_dbg(hw, "SERDES: Link down - invalid" | 587 | e_dbg("SERDES: Link down - invalid" |
578 | "codewords detected in autoneg.\n"); | 588 | "codewords detected in autoneg.\n"); |
579 | } | 589 | } |
580 | } else { | 590 | } else { |
581 | mac->serdes_has_link = false; | 591 | mac->serdes_has_link = false; |
582 | hw_dbg(hw, "SERDES: Link down - no sync.\n"); | 592 | e_dbg("SERDES: Link down - no sync.\n"); |
583 | } | 593 | } |
584 | } else { | 594 | } else { |
585 | mac->serdes_has_link = false; | 595 | mac->serdes_has_link = false; |
586 | hw_dbg(hw, "SERDES: Link down - autoneg failed\n"); | 596 | e_dbg("SERDES: Link down - autoneg failed\n"); |
587 | } | 597 | } |
588 | } | 598 | } |
589 | 599 | ||
@@ -614,7 +624,7 @@ static s32 e1000_set_default_fc_generic(struct e1000_hw *hw) | |||
614 | ret_val = e1000_read_nvm(hw, NVM_INIT_CONTROL2_REG, 1, &nvm_data); | 624 | ret_val = e1000_read_nvm(hw, NVM_INIT_CONTROL2_REG, 1, &nvm_data); |
615 | 625 | ||
616 | if (ret_val) { | 626 | if (ret_val) { |
617 | hw_dbg(hw, "NVM Read Error\n"); | 627 | e_dbg("NVM Read Error\n"); |
618 | return ret_val; | 628 | return ret_val; |
619 | } | 629 | } |
620 | 630 | ||
@@ -667,7 +677,7 @@ s32 e1000e_setup_link(struct e1000_hw *hw) | |||
667 | */ | 677 | */ |
668 | hw->fc.current_mode = hw->fc.requested_mode; | 678 | hw->fc.current_mode = hw->fc.requested_mode; |
669 | 679 | ||
670 | hw_dbg(hw, "After fix-ups FlowControl is now = %x\n", | 680 | e_dbg("After fix-ups FlowControl is now = %x\n", |
671 | hw->fc.current_mode); | 681 | hw->fc.current_mode); |
672 | 682 | ||
673 | /* Call the necessary media_type subroutine to configure the link. */ | 683 | /* Call the necessary media_type subroutine to configure the link. */ |
@@ -681,7 +691,7 @@ s32 e1000e_setup_link(struct e1000_hw *hw) | |||
681 | * control is disabled, because it does not hurt anything to | 691 | * control is disabled, because it does not hurt anything to |
682 | * initialize these registers. | 692 | * initialize these registers. |
683 | */ | 693 | */ |
684 | hw_dbg(hw, "Initializing the Flow Control address, type and timer regs\n"); | 694 | e_dbg("Initializing the Flow Control address, type and timer regs\n"); |
685 | ew32(FCT, FLOW_CONTROL_TYPE); | 695 | ew32(FCT, FLOW_CONTROL_TYPE); |
686 | ew32(FCAH, FLOW_CONTROL_ADDRESS_HIGH); | 696 | ew32(FCAH, FLOW_CONTROL_ADDRESS_HIGH); |
687 | ew32(FCAL, FLOW_CONTROL_ADDRESS_LOW); | 697 | ew32(FCAL, FLOW_CONTROL_ADDRESS_LOW); |
@@ -751,7 +761,7 @@ static s32 e1000_commit_fc_settings_generic(struct e1000_hw *hw) | |||
751 | txcw = (E1000_TXCW_ANE | E1000_TXCW_FD | E1000_TXCW_PAUSE_MASK); | 761 | txcw = (E1000_TXCW_ANE | E1000_TXCW_FD | E1000_TXCW_PAUSE_MASK); |
752 | break; | 762 | break; |
753 | default: | 763 | default: |
754 | hw_dbg(hw, "Flow control param set incorrectly\n"); | 764 | e_dbg("Flow control param set incorrectly\n"); |
755 | return -E1000_ERR_CONFIG; | 765 | return -E1000_ERR_CONFIG; |
756 | break; | 766 | break; |
757 | } | 767 | } |
@@ -789,7 +799,7 @@ static s32 e1000_poll_fiber_serdes_link_generic(struct e1000_hw *hw) | |||
789 | break; | 799 | break; |
790 | } | 800 | } |
791 | if (i == FIBER_LINK_UP_LIMIT) { | 801 | if (i == FIBER_LINK_UP_LIMIT) { |
792 | hw_dbg(hw, "Never got a valid link from auto-neg!!!\n"); | 802 | e_dbg("Never got a valid link from auto-neg!!!\n"); |
793 | mac->autoneg_failed = 1; | 803 | mac->autoneg_failed = 1; |
794 | /* | 804 | /* |
795 | * AutoNeg failed to achieve a link, so we'll call | 805 | * AutoNeg failed to achieve a link, so we'll call |
@@ -799,13 +809,13 @@ static s32 e1000_poll_fiber_serdes_link_generic(struct e1000_hw *hw) | |||
799 | */ | 809 | */ |
800 | ret_val = mac->ops.check_for_link(hw); | 810 | ret_val = mac->ops.check_for_link(hw); |
801 | if (ret_val) { | 811 | if (ret_val) { |
802 | hw_dbg(hw, "Error while checking for link\n"); | 812 | e_dbg("Error while checking for link\n"); |
803 | return ret_val; | 813 | return ret_val; |
804 | } | 814 | } |
805 | mac->autoneg_failed = 0; | 815 | mac->autoneg_failed = 0; |
806 | } else { | 816 | } else { |
807 | mac->autoneg_failed = 0; | 817 | mac->autoneg_failed = 0; |
808 | hw_dbg(hw, "Valid Link Found\n"); | 818 | e_dbg("Valid Link Found\n"); |
809 | } | 819 | } |
810 | 820 | ||
811 | return 0; | 821 | return 0; |
@@ -841,7 +851,7 @@ s32 e1000e_setup_fiber_serdes_link(struct e1000_hw *hw) | |||
841 | * then the link-up status bit will be set and the flow control enable | 851 | * then the link-up status bit will be set and the flow control enable |
842 | * bits (RFCE and TFCE) will be set according to their negotiated value. | 852 | * bits (RFCE and TFCE) will be set according to their negotiated value. |
843 | */ | 853 | */ |
844 | hw_dbg(hw, "Auto-negotiation enabled\n"); | 854 | e_dbg("Auto-negotiation enabled\n"); |
845 | 855 | ||
846 | ew32(CTRL, ctrl); | 856 | ew32(CTRL, ctrl); |
847 | e1e_flush(); | 857 | e1e_flush(); |
@@ -856,7 +866,7 @@ s32 e1000e_setup_fiber_serdes_link(struct e1000_hw *hw) | |||
856 | (er32(CTRL) & E1000_CTRL_SWDPIN1)) { | 866 | (er32(CTRL) & E1000_CTRL_SWDPIN1)) { |
857 | ret_val = e1000_poll_fiber_serdes_link_generic(hw); | 867 | ret_val = e1000_poll_fiber_serdes_link_generic(hw); |
858 | } else { | 868 | } else { |
859 | hw_dbg(hw, "No signal detected\n"); | 869 | e_dbg("No signal detected\n"); |
860 | } | 870 | } |
861 | 871 | ||
862 | return 0; | 872 | return 0; |
@@ -952,7 +962,7 @@ s32 e1000e_force_mac_fc(struct e1000_hw *hw) | |||
952 | * 3: Both Rx and Tx flow control (symmetric) is enabled. | 962 | * 3: Both Rx and Tx flow control (symmetric) is enabled. |
953 | * other: No other values should be possible at this point. | 963 | * other: No other values should be possible at this point. |
954 | */ | 964 | */ |
955 | hw_dbg(hw, "hw->fc.current_mode = %u\n", hw->fc.current_mode); | 965 | e_dbg("hw->fc.current_mode = %u\n", hw->fc.current_mode); |
956 | 966 | ||
957 | switch (hw->fc.current_mode) { | 967 | switch (hw->fc.current_mode) { |
958 | case e1000_fc_none: | 968 | case e1000_fc_none: |
@@ -970,7 +980,7 @@ s32 e1000e_force_mac_fc(struct e1000_hw *hw) | |||
970 | ctrl |= (E1000_CTRL_TFCE | E1000_CTRL_RFCE); | 980 | ctrl |= (E1000_CTRL_TFCE | E1000_CTRL_RFCE); |
971 | break; | 981 | break; |
972 | default: | 982 | default: |
973 | hw_dbg(hw, "Flow control param set incorrectly\n"); | 983 | e_dbg("Flow control param set incorrectly\n"); |
974 | return -E1000_ERR_CONFIG; | 984 | return -E1000_ERR_CONFIG; |
975 | } | 985 | } |
976 | 986 | ||
@@ -1011,7 +1021,7 @@ s32 e1000e_config_fc_after_link_up(struct e1000_hw *hw) | |||
1011 | } | 1021 | } |
1012 | 1022 | ||
1013 | if (ret_val) { | 1023 | if (ret_val) { |
1014 | hw_dbg(hw, "Error forcing flow control settings\n"); | 1024 | e_dbg("Error forcing flow control settings\n"); |
1015 | return ret_val; | 1025 | return ret_val; |
1016 | } | 1026 | } |
1017 | 1027 | ||
@@ -1035,7 +1045,7 @@ s32 e1000e_config_fc_after_link_up(struct e1000_hw *hw) | |||
1035 | return ret_val; | 1045 | return ret_val; |
1036 | 1046 | ||
1037 | if (!(mii_status_reg & MII_SR_AUTONEG_COMPLETE)) { | 1047 | if (!(mii_status_reg & MII_SR_AUTONEG_COMPLETE)) { |
1038 | hw_dbg(hw, "Copper PHY and Auto Neg " | 1048 | e_dbg("Copper PHY and Auto Neg " |
1039 | "has not completed.\n"); | 1049 | "has not completed.\n"); |
1040 | return ret_val; | 1050 | return ret_val; |
1041 | } | 1051 | } |
@@ -1076,7 +1086,6 @@ s32 e1000e_config_fc_after_link_up(struct e1000_hw *hw) | |||
1076 | * 1 | 1 | 0 | 0 | e1000_fc_none | 1086 | * 1 | 1 | 0 | 0 | e1000_fc_none |
1077 | * 1 | 1 | 0 | 1 | e1000_fc_rx_pause | 1087 | * 1 | 1 | 0 | 1 | e1000_fc_rx_pause |
1078 | * | 1088 | * |
1079 | * | ||
1080 | * Are both PAUSE bits set to 1? If so, this implies | 1089 | * Are both PAUSE bits set to 1? If so, this implies |
1081 | * Symmetric Flow Control is enabled at both ends. The | 1090 | * Symmetric Flow Control is enabled at both ends. The |
1082 | * ASM_DIR bits are irrelevant per the spec. | 1091 | * ASM_DIR bits are irrelevant per the spec. |
@@ -1100,10 +1109,10 @@ s32 e1000e_config_fc_after_link_up(struct e1000_hw *hw) | |||
1100 | */ | 1109 | */ |
1101 | if (hw->fc.requested_mode == e1000_fc_full) { | 1110 | if (hw->fc.requested_mode == e1000_fc_full) { |
1102 | hw->fc.current_mode = e1000_fc_full; | 1111 | hw->fc.current_mode = e1000_fc_full; |
1103 | hw_dbg(hw, "Flow Control = FULL.\r\n"); | 1112 | e_dbg("Flow Control = FULL.\r\n"); |
1104 | } else { | 1113 | } else { |
1105 | hw->fc.current_mode = e1000_fc_rx_pause; | 1114 | hw->fc.current_mode = e1000_fc_rx_pause; |
1106 | hw_dbg(hw, "Flow Control = " | 1115 | e_dbg("Flow Control = " |
1107 | "RX PAUSE frames only.\r\n"); | 1116 | "RX PAUSE frames only.\r\n"); |
1108 | } | 1117 | } |
1109 | } | 1118 | } |
@@ -1114,14 +1123,13 @@ s32 e1000e_config_fc_after_link_up(struct e1000_hw *hw) | |||
1114 | * PAUSE | ASM_DIR | PAUSE | ASM_DIR | Result | 1123 | * PAUSE | ASM_DIR | PAUSE | ASM_DIR | Result |
1115 | *-------|---------|-------|---------|-------------------- | 1124 | *-------|---------|-------|---------|-------------------- |
1116 | * 0 | 1 | 1 | 1 | e1000_fc_tx_pause | 1125 | * 0 | 1 | 1 | 1 | e1000_fc_tx_pause |
1117 | * | ||
1118 | */ | 1126 | */ |
1119 | else if (!(mii_nway_adv_reg & NWAY_AR_PAUSE) && | 1127 | else if (!(mii_nway_adv_reg & NWAY_AR_PAUSE) && |
1120 | (mii_nway_adv_reg & NWAY_AR_ASM_DIR) && | 1128 | (mii_nway_adv_reg & NWAY_AR_ASM_DIR) && |
1121 | (mii_nway_lp_ability_reg & NWAY_LPAR_PAUSE) && | 1129 | (mii_nway_lp_ability_reg & NWAY_LPAR_PAUSE) && |
1122 | (mii_nway_lp_ability_reg & NWAY_LPAR_ASM_DIR)) { | 1130 | (mii_nway_lp_ability_reg & NWAY_LPAR_ASM_DIR)) { |
1123 | hw->fc.current_mode = e1000_fc_tx_pause; | 1131 | hw->fc.current_mode = e1000_fc_tx_pause; |
1124 | hw_dbg(hw, "Flow Control = Tx PAUSE frames only.\r\n"); | 1132 | e_dbg("Flow Control = Tx PAUSE frames only.\r\n"); |
1125 | } | 1133 | } |
1126 | /* | 1134 | /* |
1127 | * For transmitting PAUSE frames ONLY. | 1135 | * For transmitting PAUSE frames ONLY. |
@@ -1130,21 +1138,20 @@ s32 e1000e_config_fc_after_link_up(struct e1000_hw *hw) | |||
1130 | * PAUSE | ASM_DIR | PAUSE | ASM_DIR | Result | 1138 | * PAUSE | ASM_DIR | PAUSE | ASM_DIR | Result |
1131 | *-------|---------|-------|---------|-------------------- | 1139 | *-------|---------|-------|---------|-------------------- |
1132 | * 1 | 1 | 0 | 1 | e1000_fc_rx_pause | 1140 | * 1 | 1 | 0 | 1 | e1000_fc_rx_pause |
1133 | * | ||
1134 | */ | 1141 | */ |
1135 | else if ((mii_nway_adv_reg & NWAY_AR_PAUSE) && | 1142 | else if ((mii_nway_adv_reg & NWAY_AR_PAUSE) && |
1136 | (mii_nway_adv_reg & NWAY_AR_ASM_DIR) && | 1143 | (mii_nway_adv_reg & NWAY_AR_ASM_DIR) && |
1137 | !(mii_nway_lp_ability_reg & NWAY_LPAR_PAUSE) && | 1144 | !(mii_nway_lp_ability_reg & NWAY_LPAR_PAUSE) && |
1138 | (mii_nway_lp_ability_reg & NWAY_LPAR_ASM_DIR)) { | 1145 | (mii_nway_lp_ability_reg & NWAY_LPAR_ASM_DIR)) { |
1139 | hw->fc.current_mode = e1000_fc_rx_pause; | 1146 | hw->fc.current_mode = e1000_fc_rx_pause; |
1140 | hw_dbg(hw, "Flow Control = Rx PAUSE frames only.\r\n"); | 1147 | e_dbg("Flow Control = Rx PAUSE frames only.\r\n"); |
1141 | } else { | 1148 | } else { |
1142 | /* | 1149 | /* |
1143 | * Per the IEEE spec, at this point flow control | 1150 | * Per the IEEE spec, at this point flow control |
1144 | * should be disabled. | 1151 | * should be disabled. |
1145 | */ | 1152 | */ |
1146 | hw->fc.current_mode = e1000_fc_none; | 1153 | hw->fc.current_mode = e1000_fc_none; |
1147 | hw_dbg(hw, "Flow Control = NONE.\r\n"); | 1154 | e_dbg("Flow Control = NONE.\r\n"); |
1148 | } | 1155 | } |
1149 | 1156 | ||
1150 | /* | 1157 | /* |
@@ -1154,7 +1161,7 @@ s32 e1000e_config_fc_after_link_up(struct e1000_hw *hw) | |||
1154 | */ | 1161 | */ |
1155 | ret_val = mac->ops.get_link_up_info(hw, &speed, &duplex); | 1162 | ret_val = mac->ops.get_link_up_info(hw, &speed, &duplex); |
1156 | if (ret_val) { | 1163 | if (ret_val) { |
1157 | hw_dbg(hw, "Error getting link speed and duplex\n"); | 1164 | e_dbg("Error getting link speed and duplex\n"); |
1158 | return ret_val; | 1165 | return ret_val; |
1159 | } | 1166 | } |
1160 | 1167 | ||
@@ -1167,7 +1174,7 @@ s32 e1000e_config_fc_after_link_up(struct e1000_hw *hw) | |||
1167 | */ | 1174 | */ |
1168 | ret_val = e1000e_force_mac_fc(hw); | 1175 | ret_val = e1000e_force_mac_fc(hw); |
1169 | if (ret_val) { | 1176 | if (ret_val) { |
1170 | hw_dbg(hw, "Error forcing flow control settings\n"); | 1177 | e_dbg("Error forcing flow control settings\n"); |
1171 | return ret_val; | 1178 | return ret_val; |
1172 | } | 1179 | } |
1173 | } | 1180 | } |
@@ -1191,21 +1198,21 @@ s32 e1000e_get_speed_and_duplex_copper(struct e1000_hw *hw, u16 *speed, u16 *dup | |||
1191 | status = er32(STATUS); | 1198 | status = er32(STATUS); |
1192 | if (status & E1000_STATUS_SPEED_1000) { | 1199 | if (status & E1000_STATUS_SPEED_1000) { |
1193 | *speed = SPEED_1000; | 1200 | *speed = SPEED_1000; |
1194 | hw_dbg(hw, "1000 Mbs, "); | 1201 | e_dbg("1000 Mbs, "); |
1195 | } else if (status & E1000_STATUS_SPEED_100) { | 1202 | } else if (status & E1000_STATUS_SPEED_100) { |
1196 | *speed = SPEED_100; | 1203 | *speed = SPEED_100; |
1197 | hw_dbg(hw, "100 Mbs, "); | 1204 | e_dbg("100 Mbs, "); |
1198 | } else { | 1205 | } else { |
1199 | *speed = SPEED_10; | 1206 | *speed = SPEED_10; |
1200 | hw_dbg(hw, "10 Mbs, "); | 1207 | e_dbg("10 Mbs, "); |
1201 | } | 1208 | } |
1202 | 1209 | ||
1203 | if (status & E1000_STATUS_FD) { | 1210 | if (status & E1000_STATUS_FD) { |
1204 | *duplex = FULL_DUPLEX; | 1211 | *duplex = FULL_DUPLEX; |
1205 | hw_dbg(hw, "Full Duplex\n"); | 1212 | e_dbg("Full Duplex\n"); |
1206 | } else { | 1213 | } else { |
1207 | *duplex = HALF_DUPLEX; | 1214 | *duplex = HALF_DUPLEX; |
1208 | hw_dbg(hw, "Half Duplex\n"); | 1215 | e_dbg("Half Duplex\n"); |
1209 | } | 1216 | } |
1210 | 1217 | ||
1211 | return 0; | 1218 | return 0; |
@@ -1251,7 +1258,7 @@ s32 e1000e_get_hw_semaphore(struct e1000_hw *hw) | |||
1251 | } | 1258 | } |
1252 | 1259 | ||
1253 | if (i == timeout) { | 1260 | if (i == timeout) { |
1254 | hw_dbg(hw, "Driver can't access device - SMBI bit is set.\n"); | 1261 | e_dbg("Driver can't access device - SMBI bit is set.\n"); |
1255 | return -E1000_ERR_NVM; | 1262 | return -E1000_ERR_NVM; |
1256 | } | 1263 | } |
1257 | 1264 | ||
@@ -1270,7 +1277,7 @@ s32 e1000e_get_hw_semaphore(struct e1000_hw *hw) | |||
1270 | if (i == timeout) { | 1277 | if (i == timeout) { |
1271 | /* Release semaphores */ | 1278 | /* Release semaphores */ |
1272 | e1000e_put_hw_semaphore(hw); | 1279 | e1000e_put_hw_semaphore(hw); |
1273 | hw_dbg(hw, "Driver can't access the NVM\n"); | 1280 | e_dbg("Driver can't access the NVM\n"); |
1274 | return -E1000_ERR_NVM; | 1281 | return -E1000_ERR_NVM; |
1275 | } | 1282 | } |
1276 | 1283 | ||
@@ -1310,7 +1317,7 @@ s32 e1000e_get_auto_rd_done(struct e1000_hw *hw) | |||
1310 | } | 1317 | } |
1311 | 1318 | ||
1312 | if (i == AUTO_READ_DONE_TIMEOUT) { | 1319 | if (i == AUTO_READ_DONE_TIMEOUT) { |
1313 | hw_dbg(hw, "Auto read by HW from NVM has not completed.\n"); | 1320 | e_dbg("Auto read by HW from NVM has not completed.\n"); |
1314 | return -E1000_ERR_RESET; | 1321 | return -E1000_ERR_RESET; |
1315 | } | 1322 | } |
1316 | 1323 | ||
@@ -1331,7 +1338,7 @@ s32 e1000e_valid_led_default(struct e1000_hw *hw, u16 *data) | |||
1331 | 1338 | ||
1332 | ret_val = e1000_read_nvm(hw, NVM_ID_LED_SETTINGS, 1, data); | 1339 | ret_val = e1000_read_nvm(hw, NVM_ID_LED_SETTINGS, 1, data); |
1333 | if (ret_val) { | 1340 | if (ret_val) { |
1334 | hw_dbg(hw, "NVM Read Error\n"); | 1341 | e_dbg("NVM Read Error\n"); |
1335 | return ret_val; | 1342 | return ret_val; |
1336 | } | 1343 | } |
1337 | 1344 | ||
@@ -1585,7 +1592,7 @@ s32 e1000e_disable_pcie_master(struct e1000_hw *hw) | |||
1585 | } | 1592 | } |
1586 | 1593 | ||
1587 | if (!timeout) { | 1594 | if (!timeout) { |
1588 | hw_dbg(hw, "Master requests are pending.\n"); | 1595 | e_dbg("Master requests are pending.\n"); |
1589 | return -E1000_ERR_MASTER_REQUESTS_PENDING; | 1596 | return -E1000_ERR_MASTER_REQUESTS_PENDING; |
1590 | } | 1597 | } |
1591 | 1598 | ||
@@ -1608,7 +1615,7 @@ void e1000e_reset_adaptive(struct e1000_hw *hw) | |||
1608 | mac->ifs_step_size = IFS_STEP; | 1615 | mac->ifs_step_size = IFS_STEP; |
1609 | mac->ifs_ratio = IFS_RATIO; | 1616 | mac->ifs_ratio = IFS_RATIO; |
1610 | 1617 | ||
1611 | mac->in_ifs_mode = 0; | 1618 | mac->in_ifs_mode = false; |
1612 | ew32(AIT, 0); | 1619 | ew32(AIT, 0); |
1613 | } | 1620 | } |
1614 | 1621 | ||
@@ -1625,7 +1632,7 @@ void e1000e_update_adaptive(struct e1000_hw *hw) | |||
1625 | 1632 | ||
1626 | if ((mac->collision_delta * mac->ifs_ratio) > mac->tx_packet_delta) { | 1633 | if ((mac->collision_delta * mac->ifs_ratio) > mac->tx_packet_delta) { |
1627 | if (mac->tx_packet_delta > MIN_NUM_XMITS) { | 1634 | if (mac->tx_packet_delta > MIN_NUM_XMITS) { |
1628 | mac->in_ifs_mode = 1; | 1635 | mac->in_ifs_mode = true; |
1629 | if (mac->current_ifs_val < mac->ifs_max_val) { | 1636 | if (mac->current_ifs_val < mac->ifs_max_val) { |
1630 | if (!mac->current_ifs_val) | 1637 | if (!mac->current_ifs_val) |
1631 | mac->current_ifs_val = mac->ifs_min_val; | 1638 | mac->current_ifs_val = mac->ifs_min_val; |
@@ -1639,7 +1646,7 @@ void e1000e_update_adaptive(struct e1000_hw *hw) | |||
1639 | if (mac->in_ifs_mode && | 1646 | if (mac->in_ifs_mode && |
1640 | (mac->tx_packet_delta <= MIN_NUM_XMITS)) { | 1647 | (mac->tx_packet_delta <= MIN_NUM_XMITS)) { |
1641 | mac->current_ifs_val = 0; | 1648 | mac->current_ifs_val = 0; |
1642 | mac->in_ifs_mode = 0; | 1649 | mac->in_ifs_mode = false; |
1643 | ew32(AIT, 0); | 1650 | ew32(AIT, 0); |
1644 | } | 1651 | } |
1645 | } | 1652 | } |
@@ -1809,7 +1816,7 @@ s32 e1000e_acquire_nvm(struct e1000_hw *hw) | |||
1809 | if (!timeout) { | 1816 | if (!timeout) { |
1810 | eecd &= ~E1000_EECD_REQ; | 1817 | eecd &= ~E1000_EECD_REQ; |
1811 | ew32(EECD, eecd); | 1818 | ew32(EECD, eecd); |
1812 | hw_dbg(hw, "Could not acquire NVM grant\n"); | 1819 | e_dbg("Could not acquire NVM grant\n"); |
1813 | return -E1000_ERR_NVM; | 1820 | return -E1000_ERR_NVM; |
1814 | } | 1821 | } |
1815 | 1822 | ||
@@ -1914,7 +1921,7 @@ static s32 e1000_ready_nvm_eeprom(struct e1000_hw *hw) | |||
1914 | } | 1921 | } |
1915 | 1922 | ||
1916 | if (!timeout) { | 1923 | if (!timeout) { |
1917 | hw_dbg(hw, "SPI NVM Status error\n"); | 1924 | e_dbg("SPI NVM Status error\n"); |
1918 | return -E1000_ERR_NVM; | 1925 | return -E1000_ERR_NVM; |
1919 | } | 1926 | } |
1920 | } | 1927 | } |
@@ -1943,7 +1950,7 @@ s32 e1000e_read_nvm_eerd(struct e1000_hw *hw, u16 offset, u16 words, u16 *data) | |||
1943 | */ | 1950 | */ |
1944 | if ((offset >= nvm->word_size) || (words > (nvm->word_size - offset)) || | 1951 | if ((offset >= nvm->word_size) || (words > (nvm->word_size - offset)) || |
1945 | (words == 0)) { | 1952 | (words == 0)) { |
1946 | hw_dbg(hw, "nvm parameter(s) out of bounds\n"); | 1953 | e_dbg("nvm parameter(s) out of bounds\n"); |
1947 | return -E1000_ERR_NVM; | 1954 | return -E1000_ERR_NVM; |
1948 | } | 1955 | } |
1949 | 1956 | ||
@@ -1986,11 +1993,11 @@ s32 e1000e_write_nvm_spi(struct e1000_hw *hw, u16 offset, u16 words, u16 *data) | |||
1986 | */ | 1993 | */ |
1987 | if ((offset >= nvm->word_size) || (words > (nvm->word_size - offset)) || | 1994 | if ((offset >= nvm->word_size) || (words > (nvm->word_size - offset)) || |
1988 | (words == 0)) { | 1995 | (words == 0)) { |
1989 | hw_dbg(hw, "nvm parameter(s) out of bounds\n"); | 1996 | e_dbg("nvm parameter(s) out of bounds\n"); |
1990 | return -E1000_ERR_NVM; | 1997 | return -E1000_ERR_NVM; |
1991 | } | 1998 | } |
1992 | 1999 | ||
1993 | ret_val = nvm->ops.acquire_nvm(hw); | 2000 | ret_val = nvm->ops.acquire(hw); |
1994 | if (ret_val) | 2001 | if (ret_val) |
1995 | return ret_val; | 2002 | return ret_val; |
1996 | 2003 | ||
@@ -2001,7 +2008,7 @@ s32 e1000e_write_nvm_spi(struct e1000_hw *hw, u16 offset, u16 words, u16 *data) | |||
2001 | 2008 | ||
2002 | ret_val = e1000_ready_nvm_eeprom(hw); | 2009 | ret_val = e1000_ready_nvm_eeprom(hw); |
2003 | if (ret_val) { | 2010 | if (ret_val) { |
2004 | nvm->ops.release_nvm(hw); | 2011 | nvm->ops.release(hw); |
2005 | return ret_val; | 2012 | return ret_val; |
2006 | } | 2013 | } |
2007 | 2014 | ||
@@ -2040,7 +2047,7 @@ s32 e1000e_write_nvm_spi(struct e1000_hw *hw, u16 offset, u16 words, u16 *data) | |||
2040 | } | 2047 | } |
2041 | 2048 | ||
2042 | msleep(10); | 2049 | msleep(10); |
2043 | nvm->ops.release_nvm(hw); | 2050 | nvm->ops.release(hw); |
2044 | return 0; | 2051 | return 0; |
2045 | } | 2052 | } |
2046 | 2053 | ||
@@ -2066,7 +2073,7 @@ s32 e1000e_read_mac_addr(struct e1000_hw *hw) | |||
2066 | ret_val = e1000_read_nvm(hw, NVM_ALT_MAC_ADDR_PTR, 1, | 2073 | ret_val = e1000_read_nvm(hw, NVM_ALT_MAC_ADDR_PTR, 1, |
2067 | &mac_addr_offset); | 2074 | &mac_addr_offset); |
2068 | if (ret_val) { | 2075 | if (ret_val) { |
2069 | hw_dbg(hw, "NVM Read Error\n"); | 2076 | e_dbg("NVM Read Error\n"); |
2070 | return ret_val; | 2077 | return ret_val; |
2071 | } | 2078 | } |
2072 | if (mac_addr_offset == 0xFFFF) | 2079 | if (mac_addr_offset == 0xFFFF) |
@@ -2081,7 +2088,7 @@ s32 e1000e_read_mac_addr(struct e1000_hw *hw) | |||
2081 | ret_val = e1000_read_nvm(hw, mac_addr_offset, 1, | 2088 | ret_val = e1000_read_nvm(hw, mac_addr_offset, 1, |
2082 | &nvm_data); | 2089 | &nvm_data); |
2083 | if (ret_val) { | 2090 | if (ret_val) { |
2084 | hw_dbg(hw, "NVM Read Error\n"); | 2091 | e_dbg("NVM Read Error\n"); |
2085 | return ret_val; | 2092 | return ret_val; |
2086 | } | 2093 | } |
2087 | if (nvm_data & 0x0001) | 2094 | if (nvm_data & 0x0001) |
@@ -2096,7 +2103,7 @@ s32 e1000e_read_mac_addr(struct e1000_hw *hw) | |||
2096 | offset = mac_addr_offset + (i >> 1); | 2103 | offset = mac_addr_offset + (i >> 1); |
2097 | ret_val = e1000_read_nvm(hw, offset, 1, &nvm_data); | 2104 | ret_val = e1000_read_nvm(hw, offset, 1, &nvm_data); |
2098 | if (ret_val) { | 2105 | if (ret_val) { |
2099 | hw_dbg(hw, "NVM Read Error\n"); | 2106 | e_dbg("NVM Read Error\n"); |
2100 | return ret_val; | 2107 | return ret_val; |
2101 | } | 2108 | } |
2102 | hw->mac.perm_addr[i] = (u8)(nvm_data & 0xFF); | 2109 | hw->mac.perm_addr[i] = (u8)(nvm_data & 0xFF); |
@@ -2129,14 +2136,14 @@ s32 e1000e_validate_nvm_checksum_generic(struct e1000_hw *hw) | |||
2129 | for (i = 0; i < (NVM_CHECKSUM_REG + 1); i++) { | 2136 | for (i = 0; i < (NVM_CHECKSUM_REG + 1); i++) { |
2130 | ret_val = e1000_read_nvm(hw, i, 1, &nvm_data); | 2137 | ret_val = e1000_read_nvm(hw, i, 1, &nvm_data); |
2131 | if (ret_val) { | 2138 | if (ret_val) { |
2132 | hw_dbg(hw, "NVM Read Error\n"); | 2139 | e_dbg("NVM Read Error\n"); |
2133 | return ret_val; | 2140 | return ret_val; |
2134 | } | 2141 | } |
2135 | checksum += nvm_data; | 2142 | checksum += nvm_data; |
2136 | } | 2143 | } |
2137 | 2144 | ||
2138 | if (checksum != (u16) NVM_SUM) { | 2145 | if (checksum != (u16) NVM_SUM) { |
2139 | hw_dbg(hw, "NVM Checksum Invalid\n"); | 2146 | e_dbg("NVM Checksum Invalid\n"); |
2140 | return -E1000_ERR_NVM; | 2147 | return -E1000_ERR_NVM; |
2141 | } | 2148 | } |
2142 | 2149 | ||
@@ -2160,7 +2167,7 @@ s32 e1000e_update_nvm_checksum_generic(struct e1000_hw *hw) | |||
2160 | for (i = 0; i < NVM_CHECKSUM_REG; i++) { | 2167 | for (i = 0; i < NVM_CHECKSUM_REG; i++) { |
2161 | ret_val = e1000_read_nvm(hw, i, 1, &nvm_data); | 2168 | ret_val = e1000_read_nvm(hw, i, 1, &nvm_data); |
2162 | if (ret_val) { | 2169 | if (ret_val) { |
2163 | hw_dbg(hw, "NVM Read Error while updating checksum.\n"); | 2170 | e_dbg("NVM Read Error while updating checksum.\n"); |
2164 | return ret_val; | 2171 | return ret_val; |
2165 | } | 2172 | } |
2166 | checksum += nvm_data; | 2173 | checksum += nvm_data; |
@@ -2168,7 +2175,7 @@ s32 e1000e_update_nvm_checksum_generic(struct e1000_hw *hw) | |||
2168 | checksum = (u16) NVM_SUM - checksum; | 2175 | checksum = (u16) NVM_SUM - checksum; |
2169 | ret_val = e1000_write_nvm(hw, NVM_CHECKSUM_REG, 1, &checksum); | 2176 | ret_val = e1000_write_nvm(hw, NVM_CHECKSUM_REG, 1, &checksum); |
2170 | if (ret_val) | 2177 | if (ret_val) |
2171 | hw_dbg(hw, "NVM Write Error while updating checksum.\n"); | 2178 | e_dbg("NVM Write Error while updating checksum.\n"); |
2172 | 2179 | ||
2173 | return ret_val; | 2180 | return ret_val; |
2174 | } | 2181 | } |
@@ -2231,7 +2238,7 @@ static s32 e1000_mng_enable_host_if(struct e1000_hw *hw) | |||
2231 | /* Check that the host interface is enabled. */ | 2238 | /* Check that the host interface is enabled. */ |
2232 | hicr = er32(HICR); | 2239 | hicr = er32(HICR); |
2233 | if ((hicr & E1000_HICR_EN) == 0) { | 2240 | if ((hicr & E1000_HICR_EN) == 0) { |
2234 | hw_dbg(hw, "E1000_HOST_EN bit disabled.\n"); | 2241 | e_dbg("E1000_HOST_EN bit disabled.\n"); |
2235 | return -E1000_ERR_HOST_INTERFACE_COMMAND; | 2242 | return -E1000_ERR_HOST_INTERFACE_COMMAND; |
2236 | } | 2243 | } |
2237 | /* check the previous command is completed */ | 2244 | /* check the previous command is completed */ |
@@ -2243,7 +2250,7 @@ static s32 e1000_mng_enable_host_if(struct e1000_hw *hw) | |||
2243 | } | 2250 | } |
2244 | 2251 | ||
2245 | if (i == E1000_MNG_DHCP_COMMAND_TIMEOUT) { | 2252 | if (i == E1000_MNG_DHCP_COMMAND_TIMEOUT) { |
2246 | hw_dbg(hw, "Previous command timeout failed .\n"); | 2253 | e_dbg("Previous command timeout failed .\n"); |
2247 | return -E1000_ERR_HOST_INTERFACE_COMMAND; | 2254 | return -E1000_ERR_HOST_INTERFACE_COMMAND; |
2248 | } | 2255 | } |
2249 | 2256 | ||
@@ -2282,7 +2289,7 @@ bool e1000e_enable_tx_pkt_filtering(struct e1000_hw *hw) | |||
2282 | 2289 | ||
2283 | /* No manageability, no filtering */ | 2290 | /* No manageability, no filtering */ |
2284 | if (!e1000e_check_mng_mode(hw)) { | 2291 | if (!e1000e_check_mng_mode(hw)) { |
2285 | hw->mac.tx_pkt_filtering = 0; | 2292 | hw->mac.tx_pkt_filtering = false; |
2286 | return 0; | 2293 | return 0; |
2287 | } | 2294 | } |
2288 | 2295 | ||
@@ -2292,7 +2299,7 @@ bool e1000e_enable_tx_pkt_filtering(struct e1000_hw *hw) | |||
2292 | */ | 2299 | */ |
2293 | ret_val = e1000_mng_enable_host_if(hw); | 2300 | ret_val = e1000_mng_enable_host_if(hw); |
2294 | if (ret_val != 0) { | 2301 | if (ret_val != 0) { |
2295 | hw->mac.tx_pkt_filtering = 0; | 2302 | hw->mac.tx_pkt_filtering = false; |
2296 | return ret_val; | 2303 | return ret_val; |
2297 | } | 2304 | } |
2298 | 2305 | ||
@@ -2311,17 +2318,17 @@ bool e1000e_enable_tx_pkt_filtering(struct e1000_hw *hw) | |||
2311 | * take the safe route of assuming Tx filtering is enabled. | 2318 | * take the safe route of assuming Tx filtering is enabled. |
2312 | */ | 2319 | */ |
2313 | if ((hdr_csum != csum) || (hdr->signature != E1000_IAMT_SIGNATURE)) { | 2320 | if ((hdr_csum != csum) || (hdr->signature != E1000_IAMT_SIGNATURE)) { |
2314 | hw->mac.tx_pkt_filtering = 1; | 2321 | hw->mac.tx_pkt_filtering = true; |
2315 | return 1; | 2322 | return 1; |
2316 | } | 2323 | } |
2317 | 2324 | ||
2318 | /* Cookie area is valid, make the final check for filtering. */ | 2325 | /* Cookie area is valid, make the final check for filtering. */ |
2319 | if (!(hdr->status & E1000_MNG_DHCP_COOKIE_STATUS_PARSING)) { | 2326 | if (!(hdr->status & E1000_MNG_DHCP_COOKIE_STATUS_PARSING)) { |
2320 | hw->mac.tx_pkt_filtering = 0; | 2327 | hw->mac.tx_pkt_filtering = false; |
2321 | return 0; | 2328 | return 0; |
2322 | } | 2329 | } |
2323 | 2330 | ||
2324 | hw->mac.tx_pkt_filtering = 1; | 2331 | hw->mac.tx_pkt_filtering = true; |
2325 | return 1; | 2332 | return 1; |
2326 | } | 2333 | } |
2327 | 2334 | ||
@@ -2353,7 +2360,7 @@ static s32 e1000_mng_write_cmd_header(struct e1000_hw *hw, | |||
2353 | } | 2360 | } |
2354 | 2361 | ||
2355 | /** | 2362 | /** |
2356 | * e1000_mng_host_if_write - Writes to the manageability host interface | 2363 | * e1000_mng_host_if_write - Write to the manageability host interface |
2357 | * @hw: pointer to the HW structure | 2364 | * @hw: pointer to the HW structure |
2358 | * @buffer: pointer to the host interface buffer | 2365 | * @buffer: pointer to the host interface buffer |
2359 | * @length: size of the buffer | 2366 | * @length: size of the buffer |
@@ -2478,7 +2485,7 @@ bool e1000e_enable_mng_pass_thru(struct e1000_hw *hw) | |||
2478 | { | 2485 | { |
2479 | u32 manc; | 2486 | u32 manc; |
2480 | u32 fwsm, factps; | 2487 | u32 fwsm, factps; |
2481 | bool ret_val = 0; | 2488 | bool ret_val = false; |
2482 | 2489 | ||
2483 | manc = er32(MANC); | 2490 | manc = er32(MANC); |
2484 | 2491 | ||
@@ -2493,13 +2500,13 @@ bool e1000e_enable_mng_pass_thru(struct e1000_hw *hw) | |||
2493 | if (!(factps & E1000_FACTPS_MNGCG) && | 2500 | if (!(factps & E1000_FACTPS_MNGCG) && |
2494 | ((fwsm & E1000_FWSM_MODE_MASK) == | 2501 | ((fwsm & E1000_FWSM_MODE_MASK) == |
2495 | (e1000_mng_mode_pt << E1000_FWSM_MODE_SHIFT))) { | 2502 | (e1000_mng_mode_pt << E1000_FWSM_MODE_SHIFT))) { |
2496 | ret_val = 1; | 2503 | ret_val = true; |
2497 | return ret_val; | 2504 | return ret_val; |
2498 | } | 2505 | } |
2499 | } else { | 2506 | } else { |
2500 | if ((manc & E1000_MANC_SMBUS_EN) && | 2507 | if ((manc & E1000_MANC_SMBUS_EN) && |
2501 | !(manc & E1000_MANC_ASF_EN)) { | 2508 | !(manc & E1000_MANC_ASF_EN)) { |
2502 | ret_val = 1; | 2509 | ret_val = true; |
2503 | return ret_val; | 2510 | return ret_val; |
2504 | } | 2511 | } |
2505 | } | 2512 | } |
@@ -2514,14 +2521,14 @@ s32 e1000e_read_pba_num(struct e1000_hw *hw, u32 *pba_num) | |||
2514 | 2521 | ||
2515 | ret_val = e1000_read_nvm(hw, NVM_PBA_OFFSET_0, 1, &nvm_data); | 2522 | ret_val = e1000_read_nvm(hw, NVM_PBA_OFFSET_0, 1, &nvm_data); |
2516 | if (ret_val) { | 2523 | if (ret_val) { |
2517 | hw_dbg(hw, "NVM Read Error\n"); | 2524 | e_dbg("NVM Read Error\n"); |
2518 | return ret_val; | 2525 | return ret_val; |
2519 | } | 2526 | } |
2520 | *pba_num = (u32)(nvm_data << 16); | 2527 | *pba_num = (u32)(nvm_data << 16); |
2521 | 2528 | ||
2522 | ret_val = e1000_read_nvm(hw, NVM_PBA_OFFSET_1, 1, &nvm_data); | 2529 | ret_val = e1000_read_nvm(hw, NVM_PBA_OFFSET_1, 1, &nvm_data); |
2523 | if (ret_val) { | 2530 | if (ret_val) { |
2524 | hw_dbg(hw, "NVM Read Error\n"); | 2531 | e_dbg("NVM Read Error\n"); |
2525 | return ret_val; | 2532 | return ret_val; |
2526 | } | 2533 | } |
2527 | *pba_num |= nvm_data; | 2534 | *pba_num |= nvm_data; |