aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/igb/e1000_mac.c
diff options
context:
space:
mode:
authorAuke Kok <auke-jan.h.kok@intel.com>2008-06-27 14:00:18 -0400
committerJeff Garzik <jgarzik@redhat.com>2008-07-04 08:46:59 -0400
commit652fff321490fc3fcc8e8d302826a9c2379f03d2 (patch)
tree00e9675980cbee174305533dd3d0274715afa5e6 /drivers/net/igb/e1000_mac.c
parentd67ce5338c7c71313f01e508d893bb8104ce459a (diff)
igb: eliminate hw from the hw_dbg macro arguments
Various cosmetic cleanups. Comment fixes. Eliminate the hw part out of the hw_dbg macro since it's always used. Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Diffstat (limited to 'drivers/net/igb/e1000_mac.c')
-rw-r--r--drivers/net/igb/e1000_mac.c75
1 files changed, 37 insertions, 38 deletions
diff --git a/drivers/net/igb/e1000_mac.c b/drivers/net/igb/e1000_mac.c
index 0dadcfdfa176..47ad2c4277c3 100644
--- a/drivers/net/igb/e1000_mac.c
+++ b/drivers/net/igb/e1000_mac.c
@@ -158,12 +158,12 @@ void igb_init_rx_addrs(struct e1000_hw *hw, u16 rar_count)
158 u32 i; 158 u32 i;
159 159
160 /* Setup the receive address */ 160 /* Setup the receive address */
161 hw_dbg(hw, "Programming MAC Address into RAR[0]\n"); 161 hw_dbg("Programming MAC Address into RAR[0]\n");
162 162
163 hw->mac.ops.rar_set(hw, hw->mac.addr, 0); 163 hw->mac.ops.rar_set(hw, hw->mac.addr, 0);
164 164
165 /* Zero out the other (rar_entry_count - 1) receive addresses */ 165 /* Zero out the other (rar_entry_count - 1) receive addresses */
166 hw_dbg(hw, "Clearing RAR[1-%u]\n", rar_count-1); 166 hw_dbg("Clearing RAR[1-%u]\n", rar_count-1);
167 for (i = 1; i < rar_count; i++) { 167 for (i = 1; i < rar_count; i++) {
168 array_wr32(E1000_RA, (i << 1), 0); 168 array_wr32(E1000_RA, (i << 1), 0);
169 wrfl(); 169 wrfl();
@@ -193,7 +193,7 @@ s32 igb_check_alt_mac_addr(struct e1000_hw *hw)
193 ret_val = hw->nvm.ops.read_nvm(hw, NVM_ALT_MAC_ADDR_PTR, 1, 193 ret_val = hw->nvm.ops.read_nvm(hw, NVM_ALT_MAC_ADDR_PTR, 1,
194 &nvm_alt_mac_addr_offset); 194 &nvm_alt_mac_addr_offset);
195 if (ret_val) { 195 if (ret_val) {
196 hw_dbg(hw, "NVM Read Error\n"); 196 hw_dbg("NVM Read Error\n");
197 goto out; 197 goto out;
198 } 198 }
199 199
@@ -209,7 +209,7 @@ s32 igb_check_alt_mac_addr(struct e1000_hw *hw)
209 offset = nvm_alt_mac_addr_offset + (i >> 1); 209 offset = nvm_alt_mac_addr_offset + (i >> 1);
210 ret_val = hw->nvm.ops.read_nvm(hw, offset, 1, &nvm_data); 210 ret_val = hw->nvm.ops.read_nvm(hw, offset, 1, &nvm_data);
211 if (ret_val) { 211 if (ret_val) {
212 hw_dbg(hw, "NVM Read Error\n"); 212 hw_dbg("NVM Read Error\n");
213 goto out; 213 goto out;
214 } 214 }
215 215
@@ -336,7 +336,7 @@ void igb_update_mc_addr_list(struct e1000_hw *hw,
336 } 336 }
337 337
338 /* Clear the old settings from the MTA */ 338 /* Clear the old settings from the MTA */
339 hw_dbg(hw, "Clearing MTA\n"); 339 hw_dbg("Clearing MTA\n");
340 for (i = 0; i < hw->mac.mta_reg_count; i++) { 340 for (i = 0; i < hw->mac.mta_reg_count; i++) {
341 array_wr32(E1000_MTA, i, 0); 341 array_wr32(E1000_MTA, i, 0);
342 wrfl(); 342 wrfl();
@@ -345,7 +345,7 @@ void igb_update_mc_addr_list(struct e1000_hw *hw,
345 /* Load any remaining multicast addresses into the hash table. */ 345 /* Load any remaining multicast addresses into the hash table. */
346 for (; mc_addr_count > 0; mc_addr_count--) { 346 for (; mc_addr_count > 0; mc_addr_count--) {
347 hash_value = igb_hash_mc_addr(hw, mc_addr_list); 347 hash_value = igb_hash_mc_addr(hw, mc_addr_list);
348 hw_dbg(hw, "Hash value = 0x%03X\n", hash_value); 348 hw_dbg("Hash value = 0x%03X\n", hash_value);
349 igb_mta_set(hw, hash_value); 349 igb_mta_set(hw, hash_value);
350 mc_addr_list += ETH_ALEN; 350 mc_addr_list += ETH_ALEN;
351 } 351 }
@@ -540,7 +540,7 @@ s32 igb_check_for_copper_link(struct e1000_hw *hw)
540 */ 540 */
541 ret_val = igb_config_fc_after_link_up(hw); 541 ret_val = igb_config_fc_after_link_up(hw);
542 if (ret_val) 542 if (ret_val)
543 hw_dbg(hw, "Error configuring flow control\n"); 543 hw_dbg("Error configuring flow control\n");
544 544
545out: 545out:
546 return ret_val; 546 return ret_val;
@@ -578,7 +578,7 @@ s32 igb_setup_link(struct e1000_hw *hw)
578 */ 578 */
579 hw->fc.original_type = hw->fc.type; 579 hw->fc.original_type = hw->fc.type;
580 580
581 hw_dbg(hw, "After fix-ups FlowControl is now = %x\n", hw->fc.type); 581 hw_dbg("After fix-ups FlowControl is now = %x\n", hw->fc.type);
582 582
583 /* Call the necessary media_type subroutine to configure the link. */ 583 /* Call the necessary media_type subroutine to configure the link. */
584 ret_val = hw->mac.ops.setup_physical_interface(hw); 584 ret_val = hw->mac.ops.setup_physical_interface(hw);
@@ -591,8 +591,7 @@ s32 igb_setup_link(struct e1000_hw *hw)
591 * control is disabled, because it does not hurt anything to 591 * control is disabled, because it does not hurt anything to
592 * initialize these registers. 592 * initialize these registers.
593 */ 593 */
594 hw_dbg(hw, 594 hw_dbg("Initializing the Flow Control address, type and timer regs\n");
595 "Initializing the Flow Control address, type and timer regs\n");
596 wr32(E1000_FCT, FLOW_CONTROL_TYPE); 595 wr32(E1000_FCT, FLOW_CONTROL_TYPE);
597 wr32(E1000_FCAH, FLOW_CONTROL_ADDRESS_HIGH); 596 wr32(E1000_FCAH, FLOW_CONTROL_ADDRESS_HIGH);
598 wr32(E1000_FCAL, FLOW_CONTROL_ADDRESS_LOW); 597 wr32(E1000_FCAL, FLOW_CONTROL_ADDRESS_LOW);
@@ -689,7 +688,7 @@ static s32 igb_set_default_fc(struct e1000_hw *hw)
689 &nvm_data); 688 &nvm_data);
690 689
691 if (ret_val) { 690 if (ret_val) {
692 hw_dbg(hw, "NVM Read Error\n"); 691 hw_dbg("NVM Read Error\n");
693 goto out; 692 goto out;
694 } 693 }
695 694
@@ -740,7 +739,7 @@ s32 igb_force_mac_fc(struct e1000_hw *hw)
740 * 3: Both Rx and TX flow control (symmetric) is enabled. 739 * 3: Both Rx and TX flow control (symmetric) is enabled.
741 * other: No other values should be possible at this point. 740 * other: No other values should be possible at this point.
742 */ 741 */
743 hw_dbg(hw, "hw->fc.type = %u\n", hw->fc.type); 742 hw_dbg("hw->fc.type = %u\n", hw->fc.type);
744 743
745 switch (hw->fc.type) { 744 switch (hw->fc.type) {
746 case e1000_fc_none: 745 case e1000_fc_none:
@@ -758,7 +757,7 @@ s32 igb_force_mac_fc(struct e1000_hw *hw)
758 ctrl |= (E1000_CTRL_TFCE | E1000_CTRL_RFCE); 757 ctrl |= (E1000_CTRL_TFCE | E1000_CTRL_RFCE);
759 break; 758 break;
760 default: 759 default:
761 hw_dbg(hw, "Flow control param set incorrectly\n"); 760 hw_dbg("Flow control param set incorrectly\n");
762 ret_val = -E1000_ERR_CONFIG; 761 ret_val = -E1000_ERR_CONFIG;
763 goto out; 762 goto out;
764 } 763 }
@@ -801,7 +800,7 @@ s32 igb_config_fc_after_link_up(struct e1000_hw *hw)
801 } 800 }
802 801
803 if (ret_val) { 802 if (ret_val) {
804 hw_dbg(hw, "Error forcing flow control settings\n"); 803 hw_dbg("Error forcing flow control settings\n");
805 goto out; 804 goto out;
806 } 805 }
807 806
@@ -827,7 +826,7 @@ s32 igb_config_fc_after_link_up(struct e1000_hw *hw)
827 goto out; 826 goto out;
828 827
829 if (!(mii_status_reg & MII_SR_AUTONEG_COMPLETE)) { 828 if (!(mii_status_reg & MII_SR_AUTONEG_COMPLETE)) {
830 hw_dbg(hw, "Copper PHY and Auto Neg " 829 hw_dbg("Copper PHY and Auto Neg "
831 "has not completed.\n"); 830 "has not completed.\n");
832 goto out; 831 goto out;
833 } 832 }
@@ -893,11 +892,11 @@ s32 igb_config_fc_after_link_up(struct e1000_hw *hw)
893 */ 892 */
894 if (hw->fc.original_type == e1000_fc_full) { 893 if (hw->fc.original_type == e1000_fc_full) {
895 hw->fc.type = e1000_fc_full; 894 hw->fc.type = e1000_fc_full;
896 hw_dbg(hw, "Flow Control = FULL.\r\n"); 895 hw_dbg("Flow Control = FULL.\r\n");
897 } else { 896 } else {
898 hw->fc.type = e1000_fc_rx_pause; 897 hw->fc.type = e1000_fc_rx_pause;
899 hw_dbg(hw, "Flow Control = " 898 hw_dbg("Flow Control = "
900 "RX PAUSE frames only.\r\n"); 899 "RX PAUSE frames only.\r\n");
901 } 900 }
902 } 901 }
903 /* 902 /*
@@ -913,7 +912,7 @@ s32 igb_config_fc_after_link_up(struct e1000_hw *hw)
913 (mii_nway_lp_ability_reg & NWAY_LPAR_PAUSE) && 912 (mii_nway_lp_ability_reg & NWAY_LPAR_PAUSE) &&
914 (mii_nway_lp_ability_reg & NWAY_LPAR_ASM_DIR)) { 913 (mii_nway_lp_ability_reg & NWAY_LPAR_ASM_DIR)) {
915 hw->fc.type = e1000_fc_tx_pause; 914 hw->fc.type = e1000_fc_tx_pause;
916 hw_dbg(hw, "Flow Control = TX PAUSE frames only.\r\n"); 915 hw_dbg("Flow Control = TX PAUSE frames only.\r\n");
917 } 916 }
918 /* 917 /*
919 * For transmitting PAUSE frames ONLY. 918 * For transmitting PAUSE frames ONLY.
@@ -928,7 +927,7 @@ s32 igb_config_fc_after_link_up(struct e1000_hw *hw)
928 !(mii_nway_lp_ability_reg & NWAY_LPAR_PAUSE) && 927 !(mii_nway_lp_ability_reg & NWAY_LPAR_PAUSE) &&
929 (mii_nway_lp_ability_reg & NWAY_LPAR_ASM_DIR)) { 928 (mii_nway_lp_ability_reg & NWAY_LPAR_ASM_DIR)) {
930 hw->fc.type = e1000_fc_rx_pause; 929 hw->fc.type = e1000_fc_rx_pause;
931 hw_dbg(hw, "Flow Control = RX PAUSE frames only.\r\n"); 930 hw_dbg("Flow Control = RX PAUSE frames only.\r\n");
932 } 931 }
933 /* 932 /*
934 * Per the IEEE spec, at this point flow control should be 933 * Per the IEEE spec, at this point flow control should be
@@ -955,10 +954,10 @@ s32 igb_config_fc_after_link_up(struct e1000_hw *hw)
955 hw->fc.original_type == e1000_fc_tx_pause) || 954 hw->fc.original_type == e1000_fc_tx_pause) ||
956 hw->fc.strict_ieee) { 955 hw->fc.strict_ieee) {
957 hw->fc.type = e1000_fc_none; 956 hw->fc.type = e1000_fc_none;
958 hw_dbg(hw, "Flow Control = NONE.\r\n"); 957 hw_dbg("Flow Control = NONE.\r\n");
959 } else { 958 } else {
960 hw->fc.type = e1000_fc_rx_pause; 959 hw->fc.type = e1000_fc_rx_pause;
961 hw_dbg(hw, "Flow Control = RX PAUSE frames only.\r\n"); 960 hw_dbg("Flow Control = RX PAUSE frames only.\r\n");
962 } 961 }
963 962
964 /* 963 /*
@@ -968,7 +967,7 @@ s32 igb_config_fc_after_link_up(struct e1000_hw *hw)
968 */ 967 */
969 ret_val = hw->mac.ops.get_speed_and_duplex(hw, &speed, &duplex); 968 ret_val = hw->mac.ops.get_speed_and_duplex(hw, &speed, &duplex);
970 if (ret_val) { 969 if (ret_val) {
971 hw_dbg(hw, "Error getting link speed and duplex\n"); 970 hw_dbg("Error getting link speed and duplex\n");
972 goto out; 971 goto out;
973 } 972 }
974 973
@@ -981,7 +980,7 @@ s32 igb_config_fc_after_link_up(struct e1000_hw *hw)
981 */ 980 */
982 ret_val = igb_force_mac_fc(hw); 981 ret_val = igb_force_mac_fc(hw);
983 if (ret_val) { 982 if (ret_val) {
984 hw_dbg(hw, "Error forcing flow control settings\n"); 983 hw_dbg("Error forcing flow control settings\n");
985 goto out; 984 goto out;
986 } 985 }
987 } 986 }
@@ -1007,21 +1006,21 @@ s32 igb_get_speed_and_duplex_copper(struct e1000_hw *hw, u16 *speed,
1007 status = rd32(E1000_STATUS); 1006 status = rd32(E1000_STATUS);
1008 if (status & E1000_STATUS_SPEED_1000) { 1007 if (status & E1000_STATUS_SPEED_1000) {
1009 *speed = SPEED_1000; 1008 *speed = SPEED_1000;
1010 hw_dbg(hw, "1000 Mbs, "); 1009 hw_dbg("1000 Mbs, ");
1011 } else if (status & E1000_STATUS_SPEED_100) { 1010 } else if (status & E1000_STATUS_SPEED_100) {
1012 *speed = SPEED_100; 1011 *speed = SPEED_100;
1013 hw_dbg(hw, "100 Mbs, "); 1012 hw_dbg("100 Mbs, ");
1014 } else { 1013 } else {
1015 *speed = SPEED_10; 1014 *speed = SPEED_10;
1016 hw_dbg(hw, "10 Mbs, "); 1015 hw_dbg("10 Mbs, ");
1017 } 1016 }
1018 1017
1019 if (status & E1000_STATUS_FD) { 1018 if (status & E1000_STATUS_FD) {
1020 *duplex = FULL_DUPLEX; 1019 *duplex = FULL_DUPLEX;
1021 hw_dbg(hw, "Full Duplex\n"); 1020 hw_dbg("Full Duplex\n");
1022 } else { 1021 } else {
1023 *duplex = HALF_DUPLEX; 1022 *duplex = HALF_DUPLEX;
1024 hw_dbg(hw, "Half Duplex\n"); 1023 hw_dbg("Half Duplex\n");
1025 } 1024 }
1026 1025
1027 return 0; 1026 return 0;
@@ -1051,7 +1050,7 @@ s32 igb_get_hw_semaphore(struct e1000_hw *hw)
1051 } 1050 }
1052 1051
1053 if (i == timeout) { 1052 if (i == timeout) {
1054 hw_dbg(hw, "Driver can't access device - SMBI bit is set.\n"); 1053 hw_dbg("Driver can't access device - SMBI bit is set.\n");
1055 ret_val = -E1000_ERR_NVM; 1054 ret_val = -E1000_ERR_NVM;
1056 goto out; 1055 goto out;
1057 } 1056 }
@@ -1071,7 +1070,7 @@ s32 igb_get_hw_semaphore(struct e1000_hw *hw)
1071 if (i == timeout) { 1070 if (i == timeout) {
1072 /* Release semaphores */ 1071 /* Release semaphores */
1073 igb_put_hw_semaphore(hw); 1072 igb_put_hw_semaphore(hw);
1074 hw_dbg(hw, "Driver can't access the NVM\n"); 1073 hw_dbg("Driver can't access the NVM\n");
1075 ret_val = -E1000_ERR_NVM; 1074 ret_val = -E1000_ERR_NVM;
1076 goto out; 1075 goto out;
1077 } 1076 }
@@ -1117,7 +1116,7 @@ s32 igb_get_auto_rd_done(struct e1000_hw *hw)
1117 } 1116 }
1118 1117
1119 if (i == AUTO_READ_DONE_TIMEOUT) { 1118 if (i == AUTO_READ_DONE_TIMEOUT) {
1120 hw_dbg(hw, "Auto read by HW from NVM has not completed.\n"); 1119 hw_dbg("Auto read by HW from NVM has not completed.\n");
1121 ret_val = -E1000_ERR_RESET; 1120 ret_val = -E1000_ERR_RESET;
1122 goto out; 1121 goto out;
1123 } 1122 }
@@ -1140,7 +1139,7 @@ static s32 igb_valid_led_default(struct e1000_hw *hw, u16 *data)
1140 1139
1141 ret_val = hw->nvm.ops.read_nvm(hw, NVM_ID_LED_SETTINGS, 1, data); 1140 ret_val = hw->nvm.ops.read_nvm(hw, NVM_ID_LED_SETTINGS, 1, data);
1142 if (ret_val) { 1141 if (ret_val) {
1143 hw_dbg(hw, "NVM Read Error\n"); 1142 hw_dbg("NVM Read Error\n");
1144 goto out; 1143 goto out;
1145 } 1144 }
1146 1145
@@ -1322,7 +1321,7 @@ s32 igb_disable_pcie_master(struct e1000_hw *hw)
1322 } 1321 }
1323 1322
1324 if (!timeout) { 1323 if (!timeout) {
1325 hw_dbg(hw, "Master requests are pending.\n"); 1324 hw_dbg("Master requests are pending.\n");
1326 ret_val = -E1000_ERR_MASTER_REQUESTS_PENDING; 1325 ret_val = -E1000_ERR_MASTER_REQUESTS_PENDING;
1327 goto out; 1326 goto out;
1328 } 1327 }
@@ -1342,7 +1341,7 @@ void igb_reset_adaptive(struct e1000_hw *hw)
1342 struct e1000_mac_info *mac = &hw->mac; 1341 struct e1000_mac_info *mac = &hw->mac;
1343 1342
1344 if (!mac->adaptive_ifs) { 1343 if (!mac->adaptive_ifs) {
1345 hw_dbg(hw, "Not in Adaptive IFS mode!\n"); 1344 hw_dbg("Not in Adaptive IFS mode!\n");
1346 goto out; 1345 goto out;
1347 } 1346 }
1348 1347
@@ -1372,7 +1371,7 @@ void igb_update_adaptive(struct e1000_hw *hw)
1372 struct e1000_mac_info *mac = &hw->mac; 1371 struct e1000_mac_info *mac = &hw->mac;
1373 1372
1374 if (!mac->adaptive_ifs) { 1373 if (!mac->adaptive_ifs) {
1375 hw_dbg(hw, "Not in Adaptive IFS mode!\n"); 1374 hw_dbg("Not in Adaptive IFS mode!\n");
1376 goto out; 1375 goto out;
1377 } 1376 }
1378 1377
@@ -1413,7 +1412,7 @@ s32 igb_validate_mdi_setting(struct e1000_hw *hw)
1413 s32 ret_val = 0; 1412 s32 ret_val = 0;
1414 1413
1415 if (!hw->mac.autoneg && (hw->phy.mdix == 0 || hw->phy.mdix == 3)) { 1414 if (!hw->mac.autoneg && (hw->phy.mdix == 0 || hw->phy.mdix == 3)) {
1416 hw_dbg(hw, "Invalid MDI setting detected\n"); 1415 hw_dbg("Invalid MDI setting detected\n");
1417 hw->phy.mdix = 1; 1416 hw->phy.mdix = 1;
1418 ret_val = -E1000_ERR_CONFIG; 1417 ret_val = -E1000_ERR_CONFIG;
1419 goto out; 1418 goto out;
@@ -1452,7 +1451,7 @@ s32 igb_write_8bit_ctrl_reg(struct e1000_hw *hw, u32 reg,
1452 break; 1451 break;
1453 } 1452 }
1454 if (!(regvalue & E1000_GEN_CTL_READY)) { 1453 if (!(regvalue & E1000_GEN_CTL_READY)) {
1455 hw_dbg(hw, "Reg %08x did not indicate ready\n", reg); 1454 hw_dbg("Reg %08x did not indicate ready\n", reg);
1456 ret_val = -E1000_ERR_PHY; 1455 ret_val = -E1000_ERR_PHY;
1457 goto out; 1456 goto out;
1458 } 1457 }