aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ixgbe/ixgbe_phy.c
diff options
context:
space:
mode:
authorJesse Brandeburg <jesse.brandeburg@intel.com>2008-10-31 03:46:40 -0400
committerJeff Garzik <jgarzik@redhat.com>2008-11-02 08:00:32 -0500
commit0befdb3e0a26a8949063915274e1bec8873c526b (patch)
treea0b0b94919131a3e1952136f3c93b0c52a211fea /drivers/net/ixgbe/ixgbe_phy.c
parente053b628d367cd7b39ae2c4bb0124edc2e058a41 (diff)
ixgbe: add device support for 82598AT (copper 10GbE) adapters
Intel is currently shipping support for adapters with a phy that does 10GBase-T (copper), which is 10 Gigabit ethernet over standard Category 6 cabling. Signed-off-by: Jesse Brandeburg <jesse.brandeburg@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/ixgbe/ixgbe_phy.c')
-rw-r--r--drivers/net/ixgbe/ixgbe_phy.c68
1 files changed, 68 insertions, 0 deletions
diff --git a/drivers/net/ixgbe/ixgbe_phy.c b/drivers/net/ixgbe/ixgbe_phy.c
index 764035a8c9a1..981e6d849592 100644
--- a/drivers/net/ixgbe/ixgbe_phy.c
+++ b/drivers/net/ixgbe/ixgbe_phy.c
@@ -121,6 +121,9 @@ static enum ixgbe_phy_type ixgbe_get_phy_type_from_id(u32 phy_id)
121 enum ixgbe_phy_type phy_type; 121 enum ixgbe_phy_type phy_type;
122 122
123 switch (phy_id) { 123 switch (phy_id) {
124 case TN1010_PHY_ID:
125 phy_type = ixgbe_phy_tn;
126 break;
124 case QT2022_PHY_ID: 127 case QT2022_PHY_ID:
125 phy_type = ixgbe_phy_qt; 128 phy_type = ixgbe_phy_qt;
126 break; 129 break;
@@ -426,3 +429,68 @@ s32 ixgbe_setup_phy_link_speed_generic(struct ixgbe_hw *hw,
426 return 0; 429 return 0;
427} 430}
428 431
432/**
433 * ixgbe_check_phy_link_tnx - Determine link and speed status
434 * @hw: pointer to hardware structure
435 *
436 * Reads the VS1 register to determine if link is up and the current speed for
437 * the PHY.
438 **/
439s32 ixgbe_check_phy_link_tnx(struct ixgbe_hw *hw, ixgbe_link_speed *speed,
440 bool *link_up)
441{
442 s32 status = 0;
443 u32 time_out;
444 u32 max_time_out = 10;
445 u16 phy_link = 0;
446 u16 phy_speed = 0;
447 u16 phy_data = 0;
448
449 /* Initialize speed and link to default case */
450 *link_up = false;
451 *speed = IXGBE_LINK_SPEED_10GB_FULL;
452
453 /*
454 * Check current speed and link status of the PHY register.
455 * This is a vendor specific register and may have to
456 * be changed for other copper PHYs.
457 */
458 for (time_out = 0; time_out < max_time_out; time_out++) {
459 udelay(10);
460 status = hw->phy.ops.read_reg(hw,
461 IXGBE_MDIO_VENDOR_SPECIFIC_1_STATUS,
462 IXGBE_MDIO_VENDOR_SPECIFIC_1_DEV_TYPE,
463 &phy_data);
464 phy_link = phy_data &
465 IXGBE_MDIO_VENDOR_SPECIFIC_1_LINK_STATUS;
466 phy_speed = phy_data &
467 IXGBE_MDIO_VENDOR_SPECIFIC_1_SPEED_STATUS;
468 if (phy_link == IXGBE_MDIO_VENDOR_SPECIFIC_1_LINK_STATUS) {
469 *link_up = true;
470 if (phy_speed ==
471 IXGBE_MDIO_VENDOR_SPECIFIC_1_SPEED_STATUS)
472 *speed = IXGBE_LINK_SPEED_1GB_FULL;
473 break;
474 }
475 }
476
477 return status;
478}
479
480/**
481 * ixgbe_get_phy_firmware_version_tnx - Gets the PHY Firmware Version
482 * @hw: pointer to hardware structure
483 * @firmware_version: pointer to the PHY Firmware Version
484 **/
485s32 ixgbe_get_phy_firmware_version_tnx(struct ixgbe_hw *hw,
486 u16 *firmware_version)
487{
488 s32 status = 0;
489
490 status = hw->phy.ops.read_reg(hw, TNX_FW_REV,
491 IXGBE_MDIO_VENDOR_SPECIFIC_1_DEV_TYPE,
492 firmware_version);
493
494 return status;
495}
496