aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ixgb/ixgb_hw.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2010-05-21 00:04:44 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2010-05-21 00:04:44 -0400
commitf8965467f366fd18f01feafb5db10512d7b4422c (patch)
tree3706a9cd779859271ca61b85c63a1bc3f82d626e /drivers/net/ixgb/ixgb_hw.c
parenta26272e5200765691e67d6780e52b32498fdb659 (diff)
parent2ec8c6bb5d8f3a62a79f463525054bae1e3d4487 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next-2.6: (1674 commits) qlcnic: adding co maintainer ixgbe: add support for active DA cables ixgbe: dcb, do not tag tc_prio_control frames ixgbe: fix ixgbe_tx_is_paused logic ixgbe: always enable vlan strip/insert when DCB is enabled ixgbe: remove some redundant code in setting FCoE FIP filter ixgbe: fix wrong offset to fc_frame_header in ixgbe_fcoe_ddp ixgbe: fix header len when unsplit packet overflows to data buffer ipv6: Never schedule DAD timer on dead address ipv6: Use POSTDAD state ipv6: Use state_lock to protect ifa state ipv6: Replace inet6_ifaddr->dead with state cxgb4: notify upper drivers if the device is already up when they load cxgb4: keep interrupts available when the ports are brought down cxgb4: fix initial addition of MAC address cnic: Return SPQ credit to bnx2x after ring setup and shutdown. cnic: Convert cnic_local_flags to atomic ops. can: Fix SJA1000 command register writes on SMP systems bridge: fix build for CONFIG_SYSFS disabled ARCNET: Limit com20020 PCI ID matches for SOHARD cards ... Fix up various conflicts with pcmcia tree drivers/net/ {pcmcia/3c589_cs.c, wireless/orinoco/orinoco_cs.c and wireless/orinoco/spectrum_cs.c} and feature removal (Documentation/feature-removal-schedule.txt). Also fix a non-content conflict due to pm_qos_requirement getting renamed in the PM tree (now pm_qos_request) in net/mac80211/scan.c
Diffstat (limited to 'drivers/net/ixgb/ixgb_hw.c')
-rw-r--r--drivers/net/ixgb/ixgb_hw.c164
1 files changed, 61 insertions, 103 deletions
diff --git a/drivers/net/ixgb/ixgb_hw.c b/drivers/net/ixgb/ixgb_hw.c
index ff67a84e680..397acabccab 100644
--- a/drivers/net/ixgb/ixgb_hw.c
+++ b/drivers/net/ixgb/ixgb_hw.c
@@ -30,9 +30,13 @@
30 * Shared functions for accessing and configuring the adapter 30 * Shared functions for accessing and configuring the adapter
31 */ 31 */
32 32
33#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
34
33#include "ixgb_hw.h" 35#include "ixgb_hw.h"
34#include "ixgb_ids.h" 36#include "ixgb_ids.h"
35 37
38#include <linux/etherdevice.h>
39
36/* Local function prototypes */ 40/* Local function prototypes */
37 41
38static u32 ixgb_hash_mc_addr(struct ixgb_hw *hw, u8 * mc_addr); 42static u32 ixgb_hash_mc_addr(struct ixgb_hw *hw, u8 * mc_addr);
@@ -120,13 +124,13 @@ ixgb_adapter_stop(struct ixgb_hw *hw)
120 u32 ctrl_reg; 124 u32 ctrl_reg;
121 u32 icr_reg; 125 u32 icr_reg;
122 126
123 DEBUGFUNC("ixgb_adapter_stop"); 127 ENTER();
124 128
125 /* If we are stopped or resetting exit gracefully and wait to be 129 /* If we are stopped or resetting exit gracefully and wait to be
126 * started again before accessing the hardware. 130 * started again before accessing the hardware.
127 */ 131 */
128 if (hw->adapter_stopped) { 132 if (hw->adapter_stopped) {
129 DEBUGOUT("Exiting because the adapter is already stopped!!!\n"); 133 pr_debug("Exiting because the adapter is already stopped!!!\n");
130 return false; 134 return false;
131 } 135 }
132 136
@@ -136,7 +140,7 @@ ixgb_adapter_stop(struct ixgb_hw *hw)
136 hw->adapter_stopped = true; 140 hw->adapter_stopped = true;
137 141
138 /* Clear interrupt mask to stop board from generating interrupts */ 142 /* Clear interrupt mask to stop board from generating interrupts */
139 DEBUGOUT("Masking off all interrupts\n"); 143 pr_debug("Masking off all interrupts\n");
140 IXGB_WRITE_REG(hw, IMC, 0xFFFFFFFF); 144 IXGB_WRITE_REG(hw, IMC, 0xFFFFFFFF);
141 145
142 /* Disable the Transmit and Receive units. Then delay to allow 146 /* Disable the Transmit and Receive units. Then delay to allow
@@ -152,12 +156,12 @@ ixgb_adapter_stop(struct ixgb_hw *hw)
152 * the current PCI configuration. The global reset bit is self- 156 * the current PCI configuration. The global reset bit is self-
153 * clearing, and should clear within a microsecond. 157 * clearing, and should clear within a microsecond.
154 */ 158 */
155 DEBUGOUT("Issuing a global reset to MAC\n"); 159 pr_debug("Issuing a global reset to MAC\n");
156 160
157 ctrl_reg = ixgb_mac_reset(hw); 161 ctrl_reg = ixgb_mac_reset(hw);
158 162
159 /* Clear interrupt mask to stop board from generating interrupts */ 163 /* Clear interrupt mask to stop board from generating interrupts */
160 DEBUGOUT("Masking off all interrupts\n"); 164 pr_debug("Masking off all interrupts\n");
161 IXGB_WRITE_REG(hw, IMC, 0xffffffff); 165 IXGB_WRITE_REG(hw, IMC, 0xffffffff);
162 166
163 /* Clear any pending interrupt events. */ 167 /* Clear any pending interrupt events. */
@@ -183,7 +187,7 @@ ixgb_identify_xpak_vendor(struct ixgb_hw *hw)
183 u16 vendor_name[5]; 187 u16 vendor_name[5];
184 ixgb_xpak_vendor xpak_vendor; 188 ixgb_xpak_vendor xpak_vendor;
185 189
186 DEBUGFUNC("ixgb_identify_xpak_vendor"); 190 ENTER();
187 191
188 /* Read the first few bytes of the vendor string from the XPAK NVR 192 /* Read the first few bytes of the vendor string from the XPAK NVR
189 * registers. These are standard XENPAK/XPAK registers, so all XPAK 193 * registers. These are standard XENPAK/XPAK registers, so all XPAK
@@ -222,12 +226,12 @@ ixgb_identify_phy(struct ixgb_hw *hw)
222 ixgb_phy_type phy_type; 226 ixgb_phy_type phy_type;
223 ixgb_xpak_vendor xpak_vendor; 227 ixgb_xpak_vendor xpak_vendor;
224 228
225 DEBUGFUNC("ixgb_identify_phy"); 229 ENTER();
226 230
227 /* Infer the transceiver/phy type from the device id */ 231 /* Infer the transceiver/phy type from the device id */
228 switch (hw->device_id) { 232 switch (hw->device_id) {
229 case IXGB_DEVICE_ID_82597EX: 233 case IXGB_DEVICE_ID_82597EX:
230 DEBUGOUT("Identified TXN17401 optics\n"); 234 pr_debug("Identified TXN17401 optics\n");
231 phy_type = ixgb_phy_type_txn17401; 235 phy_type = ixgb_phy_type_txn17401;
232 break; 236 break;
233 237
@@ -237,30 +241,30 @@ ixgb_identify_phy(struct ixgb_hw *hw)
237 * type of optics. */ 241 * type of optics. */
238 xpak_vendor = ixgb_identify_xpak_vendor(hw); 242 xpak_vendor = ixgb_identify_xpak_vendor(hw);
239 if (xpak_vendor == ixgb_xpak_vendor_intel) { 243 if (xpak_vendor == ixgb_xpak_vendor_intel) {
240 DEBUGOUT("Identified TXN17201 optics\n"); 244 pr_debug("Identified TXN17201 optics\n");
241 phy_type = ixgb_phy_type_txn17201; 245 phy_type = ixgb_phy_type_txn17201;
242 } else { 246 } else {
243 DEBUGOUT("Identified G6005 optics\n"); 247 pr_debug("Identified G6005 optics\n");
244 phy_type = ixgb_phy_type_g6005; 248 phy_type = ixgb_phy_type_g6005;
245 } 249 }
246 break; 250 break;
247 case IXGB_DEVICE_ID_82597EX_LR: 251 case IXGB_DEVICE_ID_82597EX_LR:
248 DEBUGOUT("Identified G6104 optics\n"); 252 pr_debug("Identified G6104 optics\n");
249 phy_type = ixgb_phy_type_g6104; 253 phy_type = ixgb_phy_type_g6104;
250 break; 254 break;
251 case IXGB_DEVICE_ID_82597EX_CX4: 255 case IXGB_DEVICE_ID_82597EX_CX4:
252 DEBUGOUT("Identified CX4\n"); 256 pr_debug("Identified CX4\n");
253 xpak_vendor = ixgb_identify_xpak_vendor(hw); 257 xpak_vendor = ixgb_identify_xpak_vendor(hw);
254 if (xpak_vendor == ixgb_xpak_vendor_intel) { 258 if (xpak_vendor == ixgb_xpak_vendor_intel) {
255 DEBUGOUT("Identified TXN17201 optics\n"); 259 pr_debug("Identified TXN17201 optics\n");
256 phy_type = ixgb_phy_type_txn17201; 260 phy_type = ixgb_phy_type_txn17201;
257 } else { 261 } else {
258 DEBUGOUT("Identified G6005 optics\n"); 262 pr_debug("Identified G6005 optics\n");
259 phy_type = ixgb_phy_type_g6005; 263 phy_type = ixgb_phy_type_g6005;
260 } 264 }
261 break; 265 break;
262 default: 266 default:
263 DEBUGOUT("Unknown physical layer module\n"); 267 pr_debug("Unknown physical layer module\n");
264 phy_type = ixgb_phy_type_unknown; 268 phy_type = ixgb_phy_type_unknown;
265 break; 269 break;
266 } 270 }
@@ -296,18 +300,18 @@ ixgb_init_hw(struct ixgb_hw *hw)
296 u32 ctrl_reg; 300 u32 ctrl_reg;
297 bool status; 301 bool status;
298 302
299 DEBUGFUNC("ixgb_init_hw"); 303 ENTER();
300 304
301 /* Issue a global reset to the MAC. This will reset the chip's 305 /* Issue a global reset to the MAC. This will reset the chip's
302 * transmit, receive, DMA, and link units. It will not effect 306 * transmit, receive, DMA, and link units. It will not effect
303 * the current PCI configuration. The global reset bit is self- 307 * the current PCI configuration. The global reset bit is self-
304 * clearing, and should clear within a microsecond. 308 * clearing, and should clear within a microsecond.
305 */ 309 */
306 DEBUGOUT("Issuing a global reset to MAC\n"); 310 pr_debug("Issuing a global reset to MAC\n");
307 311
308 ctrl_reg = ixgb_mac_reset(hw); 312 ctrl_reg = ixgb_mac_reset(hw);
309 313
310 DEBUGOUT("Issuing an EE reset to MAC\n"); 314 pr_debug("Issuing an EE reset to MAC\n");
311#ifdef HP_ZX1 315#ifdef HP_ZX1
312 /* Workaround for 82597EX reset errata */ 316 /* Workaround for 82597EX reset errata */
313 IXGB_WRITE_REG_IO(hw, CTRL1, IXGB_CTRL1_EE_RST); 317 IXGB_WRITE_REG_IO(hw, CTRL1, IXGB_CTRL1_EE_RST);
@@ -335,7 +339,7 @@ ixgb_init_hw(struct ixgb_hw *hw)
335 * If it is not valid, we fail hardware init. 339 * If it is not valid, we fail hardware init.
336 */ 340 */
337 if (!mac_addr_valid(hw->curr_mac_addr)) { 341 if (!mac_addr_valid(hw->curr_mac_addr)) {
338 DEBUGOUT("MAC address invalid after ixgb_init_rx_addrs\n"); 342 pr_debug("MAC address invalid after ixgb_init_rx_addrs\n");
339 return(false); 343 return(false);
340 } 344 }
341 345
@@ -346,7 +350,7 @@ ixgb_init_hw(struct ixgb_hw *hw)
346 ixgb_get_bus_info(hw); 350 ixgb_get_bus_info(hw);
347 351
348 /* Zero out the Multicast HASH table */ 352 /* Zero out the Multicast HASH table */
349 DEBUGOUT("Zeroing the MTA\n"); 353 pr_debug("Zeroing the MTA\n");
350 for (i = 0; i < IXGB_MC_TBL_SIZE; i++) 354 for (i = 0; i < IXGB_MC_TBL_SIZE; i++)
351 IXGB_WRITE_REG_ARRAY(hw, MTA, i, 0); 355 IXGB_WRITE_REG_ARRAY(hw, MTA, i, 0);
352 356
@@ -379,7 +383,7 @@ ixgb_init_rx_addrs(struct ixgb_hw *hw)
379{ 383{
380 u32 i; 384 u32 i;
381 385
382 DEBUGFUNC("ixgb_init_rx_addrs"); 386 ENTER();
383 387
384 /* 388 /*
385 * If the current mac address is valid, assume it is a software override 389 * If the current mac address is valid, assume it is a software override
@@ -391,35 +395,24 @@ ixgb_init_rx_addrs(struct ixgb_hw *hw)
391 /* Get the MAC address from the eeprom for later reference */ 395 /* Get the MAC address from the eeprom for later reference */
392 ixgb_get_ee_mac_addr(hw, hw->curr_mac_addr); 396 ixgb_get_ee_mac_addr(hw, hw->curr_mac_addr);
393 397
394 DEBUGOUT3(" Keeping Permanent MAC Addr =%.2X %.2X %.2X ", 398 pr_debug("Keeping Permanent MAC Addr = %pM\n",
395 hw->curr_mac_addr[0], 399 hw->curr_mac_addr);
396 hw->curr_mac_addr[1], hw->curr_mac_addr[2]);
397 DEBUGOUT3("%.2X %.2X %.2X\n",
398 hw->curr_mac_addr[3],
399 hw->curr_mac_addr[4], hw->curr_mac_addr[5]);
400 } else { 400 } else {
401 401
402 /* Setup the receive address. */ 402 /* Setup the receive address. */
403 DEBUGOUT("Overriding MAC Address in RAR[0]\n"); 403 pr_debug("Overriding MAC Address in RAR[0]\n");
404 DEBUGOUT3(" New MAC Addr =%.2X %.2X %.2X ", 404 pr_debug("New MAC Addr = %pM\n", hw->curr_mac_addr);
405 hw->curr_mac_addr[0],
406 hw->curr_mac_addr[1], hw->curr_mac_addr[2]);
407 DEBUGOUT3("%.2X %.2X %.2X\n",
408 hw->curr_mac_addr[3],
409 hw->curr_mac_addr[4], hw->curr_mac_addr[5]);
410 405
411 ixgb_rar_set(hw, hw->curr_mac_addr, 0); 406 ixgb_rar_set(hw, hw->curr_mac_addr, 0);
412 } 407 }
413 408
414 /* Zero out the other 15 receive addresses. */ 409 /* Zero out the other 15 receive addresses. */
415 DEBUGOUT("Clearing RAR[1-15]\n"); 410 pr_debug("Clearing RAR[1-15]\n");
416 for (i = 1; i < IXGB_RAR_ENTRIES; i++) { 411 for (i = 1; i < IXGB_RAR_ENTRIES; i++) {
417 /* Write high reg first to disable the AV bit first */ 412 /* Write high reg first to disable the AV bit first */
418 IXGB_WRITE_REG_ARRAY(hw, RA, ((i << 1) + 1), 0); 413 IXGB_WRITE_REG_ARRAY(hw, RA, ((i << 1) + 1), 0);
419 IXGB_WRITE_REG_ARRAY(hw, RA, (i << 1), 0); 414 IXGB_WRITE_REG_ARRAY(hw, RA, (i << 1), 0);
420 } 415 }
421
422 return;
423} 416}
424 417
425/****************************************************************************** 418/******************************************************************************
@@ -444,65 +437,50 @@ ixgb_mc_addr_list_update(struct ixgb_hw *hw,
444 u32 hash_value; 437 u32 hash_value;
445 u32 i; 438 u32 i;
446 u32 rar_used_count = 1; /* RAR[0] is used for our MAC address */ 439 u32 rar_used_count = 1; /* RAR[0] is used for our MAC address */
440 u8 *mca;
447 441
448 DEBUGFUNC("ixgb_mc_addr_list_update"); 442 ENTER();
449 443
450 /* Set the new number of MC addresses that we are being requested to use. */ 444 /* Set the new number of MC addresses that we are being requested to use. */
451 hw->num_mc_addrs = mc_addr_count; 445 hw->num_mc_addrs = mc_addr_count;
452 446
453 /* Clear RAR[1-15] */ 447 /* Clear RAR[1-15] */
454 DEBUGOUT(" Clearing RAR[1-15]\n"); 448 pr_debug("Clearing RAR[1-15]\n");
455 for (i = rar_used_count; i < IXGB_RAR_ENTRIES; i++) { 449 for (i = rar_used_count; i < IXGB_RAR_ENTRIES; i++) {
456 IXGB_WRITE_REG_ARRAY(hw, RA, (i << 1), 0); 450 IXGB_WRITE_REG_ARRAY(hw, RA, (i << 1), 0);
457 IXGB_WRITE_REG_ARRAY(hw, RA, ((i << 1) + 1), 0); 451 IXGB_WRITE_REG_ARRAY(hw, RA, ((i << 1) + 1), 0);
458 } 452 }
459 453
460 /* Clear the MTA */ 454 /* Clear the MTA */
461 DEBUGOUT(" Clearing MTA\n"); 455 pr_debug("Clearing MTA\n");
462 for (i = 0; i < IXGB_MC_TBL_SIZE; i++) 456 for (i = 0; i < IXGB_MC_TBL_SIZE; i++)
463 IXGB_WRITE_REG_ARRAY(hw, MTA, i, 0); 457 IXGB_WRITE_REG_ARRAY(hw, MTA, i, 0);
464 458
465 /* Add the new addresses */ 459 /* Add the new addresses */
460 mca = mc_addr_list;
466 for (i = 0; i < mc_addr_count; i++) { 461 for (i = 0; i < mc_addr_count; i++) {
467 DEBUGOUT(" Adding the multicast addresses:\n"); 462 pr_debug("Adding the multicast addresses:\n");
468 DEBUGOUT7(" MC Addr #%d =%.2X %.2X %.2X %.2X %.2X %.2X\n", i, 463 pr_debug("MC Addr #%d = %pM\n", i, mca);
469 mc_addr_list[i * (IXGB_ETH_LENGTH_OF_ADDRESS + pad)],
470 mc_addr_list[i * (IXGB_ETH_LENGTH_OF_ADDRESS + pad) +
471 1],
472 mc_addr_list[i * (IXGB_ETH_LENGTH_OF_ADDRESS + pad) +
473 2],
474 mc_addr_list[i * (IXGB_ETH_LENGTH_OF_ADDRESS + pad) +
475 3],
476 mc_addr_list[i * (IXGB_ETH_LENGTH_OF_ADDRESS + pad) +
477 4],
478 mc_addr_list[i * (IXGB_ETH_LENGTH_OF_ADDRESS + pad) +
479 5]);
480 464
481 /* Place this multicast address in the RAR if there is room, * 465 /* Place this multicast address in the RAR if there is room, *
482 * else put it in the MTA 466 * else put it in the MTA
483 */ 467 */
484 if (rar_used_count < IXGB_RAR_ENTRIES) { 468 if (rar_used_count < IXGB_RAR_ENTRIES) {
485 ixgb_rar_set(hw, 469 ixgb_rar_set(hw, mca, rar_used_count);
486 mc_addr_list + 470 pr_debug("Added a multicast address to RAR[%d]\n", i);
487 (i * (IXGB_ETH_LENGTH_OF_ADDRESS + pad)),
488 rar_used_count);
489 DEBUGOUT1("Added a multicast address to RAR[%d]\n", i);
490 rar_used_count++; 471 rar_used_count++;
491 } else { 472 } else {
492 hash_value = ixgb_hash_mc_addr(hw, 473 hash_value = ixgb_hash_mc_addr(hw, mca);
493 mc_addr_list +
494 (i *
495 (IXGB_ETH_LENGTH_OF_ADDRESS
496 + pad)));
497 474
498 DEBUGOUT1(" Hash value = 0x%03X\n", hash_value); 475 pr_debug("Hash value = 0x%03X\n", hash_value);
499 476
500 ixgb_mta_set(hw, hash_value); 477 ixgb_mta_set(hw, hash_value);
501 } 478 }
479
480 mca += IXGB_ETH_LENGTH_OF_ADDRESS + pad;
502 } 481 }
503 482
504 DEBUGOUT("MC Update Complete\n"); 483 pr_debug("MC Update Complete\n");
505 return;
506} 484}
507 485
508/****************************************************************************** 486/******************************************************************************
@@ -520,7 +498,7 @@ ixgb_hash_mc_addr(struct ixgb_hw *hw,
520{ 498{
521 u32 hash_value = 0; 499 u32 hash_value = 0;
522 500
523 DEBUGFUNC("ixgb_hash_mc_addr"); 501 ENTER();
524 502
525 /* The portion of the address that is used for the hash table is 503 /* The portion of the address that is used for the hash table is
526 * determined by the mc_filter_type setting. 504 * determined by the mc_filter_type setting.
@@ -547,7 +525,7 @@ ixgb_hash_mc_addr(struct ixgb_hw *hw,
547 break; 525 break;
548 default: 526 default:
549 /* Invalid mc_filter_type, what should we do? */ 527 /* Invalid mc_filter_type, what should we do? */
550 DEBUGOUT("MC filter type param set incorrectly\n"); 528 pr_debug("MC filter type param set incorrectly\n");
551 ASSERT(0); 529 ASSERT(0);
552 break; 530 break;
553 } 531 }
@@ -585,8 +563,6 @@ ixgb_mta_set(struct ixgb_hw *hw,
585 mta_reg |= (1 << hash_bit); 563 mta_reg |= (1 << hash_bit);
586 564
587 IXGB_WRITE_REG_ARRAY(hw, MTA, hash_reg, mta_reg); 565 IXGB_WRITE_REG_ARRAY(hw, MTA, hash_reg, mta_reg);
588
589 return;
590} 566}
591 567
592/****************************************************************************** 568/******************************************************************************
@@ -603,7 +579,7 @@ ixgb_rar_set(struct ixgb_hw *hw,
603{ 579{
604 u32 rar_low, rar_high; 580 u32 rar_low, rar_high;
605 581
606 DEBUGFUNC("ixgb_rar_set"); 582 ENTER();
607 583
608 /* HW expects these in little endian so we reverse the byte order 584 /* HW expects these in little endian so we reverse the byte order
609 * from network order (big endian) to little endian 585 * from network order (big endian) to little endian
@@ -619,7 +595,6 @@ ixgb_rar_set(struct ixgb_hw *hw,
619 595
620 IXGB_WRITE_REG_ARRAY(hw, RA, (index << 1), rar_low); 596 IXGB_WRITE_REG_ARRAY(hw, RA, (index << 1), rar_low);
621 IXGB_WRITE_REG_ARRAY(hw, RA, ((index << 1) + 1), rar_high); 597 IXGB_WRITE_REG_ARRAY(hw, RA, ((index << 1) + 1), rar_high);
622 return;
623} 598}
624 599
625/****************************************************************************** 600/******************************************************************************
@@ -635,7 +610,6 @@ ixgb_write_vfta(struct ixgb_hw *hw,
635 u32 value) 610 u32 value)
636{ 611{
637 IXGB_WRITE_REG_ARRAY(hw, VFTA, offset, value); 612 IXGB_WRITE_REG_ARRAY(hw, VFTA, offset, value);
638 return;
639} 613}
640 614
641/****************************************************************************** 615/******************************************************************************
@@ -650,7 +624,6 @@ ixgb_clear_vfta(struct ixgb_hw *hw)
650 624
651 for (offset = 0; offset < IXGB_VLAN_FILTER_TBL_SIZE; offset++) 625 for (offset = 0; offset < IXGB_VLAN_FILTER_TBL_SIZE; offset++)
652 IXGB_WRITE_REG_ARRAY(hw, VFTA, offset, 0); 626 IXGB_WRITE_REG_ARRAY(hw, VFTA, offset, 0);
653 return;
654} 627}
655 628
656/****************************************************************************** 629/******************************************************************************
@@ -666,7 +639,7 @@ ixgb_setup_fc(struct ixgb_hw *hw)
666 u32 pap_reg = 0; /* by default, assume no pause time */ 639 u32 pap_reg = 0; /* by default, assume no pause time */
667 bool status = true; 640 bool status = true;
668 641
669 DEBUGFUNC("ixgb_setup_fc"); 642 ENTER();
670 643
671 /* Get the current control reg 0 settings */ 644 /* Get the current control reg 0 settings */
672 ctrl_reg = IXGB_READ_REG(hw, CTRL0); 645 ctrl_reg = IXGB_READ_REG(hw, CTRL0);
@@ -710,7 +683,7 @@ ixgb_setup_fc(struct ixgb_hw *hw)
710 break; 683 break;
711 default: 684 default:
712 /* We should never get here. The value should be 0-3. */ 685 /* We should never get here. The value should be 0-3. */
713 DEBUGOUT("Flow control param set incorrectly\n"); 686 pr_debug("Flow control param set incorrectly\n");
714 ASSERT(0); 687 ASSERT(0);
715 break; 688 break;
716 } 689 }
@@ -940,7 +913,7 @@ ixgb_check_for_link(struct ixgb_hw *hw)
940 u32 status_reg; 913 u32 status_reg;
941 u32 xpcss_reg; 914 u32 xpcss_reg;
942 915
943 DEBUGFUNC("ixgb_check_for_link"); 916 ENTER();
944 917
945 xpcss_reg = IXGB_READ_REG(hw, XPCSS); 918 xpcss_reg = IXGB_READ_REG(hw, XPCSS);
946 status_reg = IXGB_READ_REG(hw, STATUS); 919 status_reg = IXGB_READ_REG(hw, STATUS);
@@ -950,7 +923,7 @@ ixgb_check_for_link(struct ixgb_hw *hw)
950 hw->link_up = true; 923 hw->link_up = true;
951 } else if (!(xpcss_reg & IXGB_XPCSS_ALIGN_STATUS) && 924 } else if (!(xpcss_reg & IXGB_XPCSS_ALIGN_STATUS) &&
952 (status_reg & IXGB_STATUS_LU)) { 925 (status_reg & IXGB_STATUS_LU)) {
953 DEBUGOUT("XPCSS Not Aligned while Status:LU is set.\n"); 926 pr_debug("XPCSS Not Aligned while Status:LU is set\n");
954 hw->link_up = ixgb_link_reset(hw); 927 hw->link_up = ixgb_link_reset(hw);
955 } else { 928 } else {
956 /* 929 /*
@@ -981,8 +954,7 @@ bool ixgb_check_for_bad_link(struct ixgb_hw *hw)
981 newRFC = IXGB_READ_REG(hw, RFC); 954 newRFC = IXGB_READ_REG(hw, RFC);
982 if ((hw->lastLFC + 250 < newLFC) 955 if ((hw->lastLFC + 250 < newLFC)
983 || (hw->lastRFC + 250 < newRFC)) { 956 || (hw->lastRFC + 250 < newRFC)) {
984 DEBUGOUT 957 pr_debug("BAD LINK! too many LFC/RFC since last check\n");
985 ("BAD LINK! too many LFC/RFC since last check\n");
986 bad_link_returncode = true; 958 bad_link_returncode = true;
987 } 959 }
988 hw->lastLFC = newLFC; 960 hw->lastLFC = newLFC;
@@ -1002,11 +974,11 @@ ixgb_clear_hw_cntrs(struct ixgb_hw *hw)
1002{ 974{
1003 volatile u32 temp_reg; 975 volatile u32 temp_reg;
1004 976
1005 DEBUGFUNC("ixgb_clear_hw_cntrs"); 977 ENTER();
1006 978
1007 /* if we are stopped or resetting exit gracefully */ 979 /* if we are stopped or resetting exit gracefully */
1008 if (hw->adapter_stopped) { 980 if (hw->adapter_stopped) {
1009 DEBUGOUT("Exiting because the adapter is stopped!!!\n"); 981 pr_debug("Exiting because the adapter is stopped!!!\n");
1010 return; 982 return;
1011 } 983 }
1012 984
@@ -1070,7 +1042,6 @@ ixgb_clear_hw_cntrs(struct ixgb_hw *hw)
1070 temp_reg = IXGB_READ_REG(hw, XOFFRXC); 1042 temp_reg = IXGB_READ_REG(hw, XOFFRXC);
1071 temp_reg = IXGB_READ_REG(hw, XOFFTXC); 1043 temp_reg = IXGB_READ_REG(hw, XOFFTXC);
1072 temp_reg = IXGB_READ_REG(hw, RJC); 1044 temp_reg = IXGB_READ_REG(hw, RJC);
1073 return;
1074} 1045}
1075 1046
1076/****************************************************************************** 1047/******************************************************************************
@@ -1086,7 +1057,6 @@ ixgb_led_on(struct ixgb_hw *hw)
1086 /* To turn on the LED, clear software-definable pin 0 (SDP0). */ 1057 /* To turn on the LED, clear software-definable pin 0 (SDP0). */
1087 ctrl0_reg &= ~IXGB_CTRL0_SDP0; 1058 ctrl0_reg &= ~IXGB_CTRL0_SDP0;
1088 IXGB_WRITE_REG(hw, CTRL0, ctrl0_reg); 1059 IXGB_WRITE_REG(hw, CTRL0, ctrl0_reg);
1089 return;
1090} 1060}
1091 1061
1092/****************************************************************************** 1062/******************************************************************************
@@ -1102,7 +1072,6 @@ ixgb_led_off(struct ixgb_hw *hw)
1102 /* To turn off the LED, set software-definable pin 0 (SDP0). */ 1072 /* To turn off the LED, set software-definable pin 0 (SDP0). */
1103 ctrl0_reg |= IXGB_CTRL0_SDP0; 1073 ctrl0_reg |= IXGB_CTRL0_SDP0;
1104 IXGB_WRITE_REG(hw, CTRL0, ctrl0_reg); 1074 IXGB_WRITE_REG(hw, CTRL0, ctrl0_reg);
1105 return;
1106} 1075}
1107 1076
1108/****************************************************************************** 1077/******************************************************************************
@@ -1142,8 +1111,6 @@ ixgb_get_bus_info(struct ixgb_hw *hw)
1142 1111
1143 hw->bus.width = (status_reg & IXGB_STATUS_BUS64) ? 1112 hw->bus.width = (status_reg & IXGB_STATUS_BUS64) ?
1144 ixgb_bus_width_64 : ixgb_bus_width_32; 1113 ixgb_bus_width_64 : ixgb_bus_width_32;
1145
1146 return;
1147} 1114}
1148 1115
1149/****************************************************************************** 1116/******************************************************************************
@@ -1156,26 +1123,21 @@ static bool
1156mac_addr_valid(u8 *mac_addr) 1123mac_addr_valid(u8 *mac_addr)
1157{ 1124{
1158 bool is_valid = true; 1125 bool is_valid = true;
1159 DEBUGFUNC("mac_addr_valid"); 1126 ENTER();
1160 1127
1161 /* Make sure it is not a multicast address */ 1128 /* Make sure it is not a multicast address */
1162 if (IS_MULTICAST(mac_addr)) { 1129 if (is_multicast_ether_addr(mac_addr)) {
1163 DEBUGOUT("MAC address is multicast\n"); 1130 pr_debug("MAC address is multicast\n");
1164 is_valid = false; 1131 is_valid = false;
1165 } 1132 }
1166 /* Not a broadcast address */ 1133 /* Not a broadcast address */
1167 else if (IS_BROADCAST(mac_addr)) { 1134 else if (is_broadcast_ether_addr(mac_addr)) {
1168 DEBUGOUT("MAC address is broadcast\n"); 1135 pr_debug("MAC address is broadcast\n");
1169 is_valid = false; 1136 is_valid = false;
1170 } 1137 }
1171 /* Reject the zero address */ 1138 /* Reject the zero address */
1172 else if (mac_addr[0] == 0 && 1139 else if (is_zero_ether_addr(mac_addr)) {
1173 mac_addr[1] == 0 && 1140 pr_debug("MAC address is all zeros\n");
1174 mac_addr[2] == 0 &&
1175 mac_addr[3] == 0 &&
1176 mac_addr[4] == 0 &&
1177 mac_addr[5] == 0) {
1178 DEBUGOUT("MAC address is all zeros\n");
1179 is_valid = false; 1141 is_valid = false;
1180 } 1142 }
1181 return (is_valid); 1143 return (is_valid);
@@ -1235,8 +1197,6 @@ ixgb_optics_reset(struct ixgb_hw *hw)
1235 IXGB_PHY_ADDRESS, 1197 IXGB_PHY_ADDRESS,
1236 MDIO_MMD_PMAPMD); 1198 MDIO_MMD_PMAPMD);
1237 } 1199 }
1238
1239 return;
1240} 1200}
1241 1201
1242/****************************************************************************** 1202/******************************************************************************
@@ -1297,6 +1257,4 @@ ixgb_optics_reset_bcm(struct ixgb_hw *hw)
1297 1257
1298 /* SerDes needs extra delay */ 1258 /* SerDes needs extra delay */
1299 msleep(IXGB_SUN_PHY_RESET_DELAY); 1259 msleep(IXGB_SUN_PHY_RESET_DELAY);
1300
1301 return;
1302} 1260}