aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw/nes/nes_nic.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/infiniband/hw/nes/nes_nic.c')
-rw-r--r--drivers/infiniband/hw/nes/nes_nic.c57
1 files changed, 7 insertions, 50 deletions
diff --git a/drivers/infiniband/hw/nes/nes_nic.c b/drivers/infiniband/hw/nes/nes_nic.c
index 3d550dc77d0d..7dd6ce6e7b99 100644
--- a/drivers/infiniband/hw/nes/nes_nic.c
+++ b/drivers/infiniband/hw/nes/nes_nic.c
@@ -1461,9 +1461,9 @@ static int nes_netdev_get_settings(struct net_device *netdev, struct ethtool_cmd
1461 } 1461 }
1462 return 0; 1462 return 0;
1463 } 1463 }
1464 if ((phy_type == NES_PHY_TYPE_IRIS) || 1464 if ((phy_type == NES_PHY_TYPE_ARGUS) ||
1465 (phy_type == NES_PHY_TYPE_ARGUS) || 1465 (phy_type == NES_PHY_TYPE_SFP_D) ||
1466 (phy_type == NES_PHY_TYPE_SFP_D)) { 1466 (phy_type == NES_PHY_TYPE_KR)) {
1467 et_cmd->transceiver = XCVR_EXTERNAL; 1467 et_cmd->transceiver = XCVR_EXTERNAL;
1468 et_cmd->port = PORT_FIBRE; 1468 et_cmd->port = PORT_FIBRE;
1469 et_cmd->supported = SUPPORTED_FIBRE; 1469 et_cmd->supported = SUPPORTED_FIBRE;
@@ -1583,8 +1583,7 @@ struct net_device *nes_netdev_init(struct nes_device *nesdev,
1583 struct net_device *netdev; 1583 struct net_device *netdev;
1584 struct nic_qp_map *curr_qp_map; 1584 struct nic_qp_map *curr_qp_map;
1585 u32 u32temp; 1585 u32 u32temp;
1586 u16 phy_data; 1586 u8 phy_type = nesdev->nesadapter->phy_type[nesdev->mac_index];
1587 u16 temp_phy_data;
1588 1587
1589 netdev = alloc_etherdev(sizeof(struct nes_vnic)); 1588 netdev = alloc_etherdev(sizeof(struct nes_vnic));
1590 if (!netdev) { 1589 if (!netdev) {
@@ -1692,65 +1691,23 @@ struct net_device *nes_netdev_init(struct nes_device *nesdev,
1692 1691
1693 if ((nesdev->netdev_count == 0) && 1692 if ((nesdev->netdev_count == 0) &&
1694 ((PCI_FUNC(nesdev->pcidev->devfn) == nesdev->mac_index) || 1693 ((PCI_FUNC(nesdev->pcidev->devfn) == nesdev->mac_index) ||
1695 ((nesdev->nesadapter->phy_type[nesdev->mac_index] == NES_PHY_TYPE_PUMA_1G) && 1694 ((phy_type == NES_PHY_TYPE_PUMA_1G) &&
1696 (((PCI_FUNC(nesdev->pcidev->devfn) == 1) && (nesdev->mac_index == 2)) || 1695 (((PCI_FUNC(nesdev->pcidev->devfn) == 1) && (nesdev->mac_index == 2)) ||
1697 ((PCI_FUNC(nesdev->pcidev->devfn) == 2) && (nesdev->mac_index == 1)))))) { 1696 ((PCI_FUNC(nesdev->pcidev->devfn) == 2) && (nesdev->mac_index == 1)))))) {
1698 /*
1699 * nes_debug(NES_DBG_INIT, "Setting up PHY interrupt mask. Using register index 0x%04X\n",
1700 * NES_IDX_PHY_PCS_CONTROL_STATUS0 + (0x200 * (nesvnic->logical_port & 1)));
1701 */
1702 u32temp = nes_read_indexed(nesdev, NES_IDX_PHY_PCS_CONTROL_STATUS0 + 1697 u32temp = nes_read_indexed(nesdev, NES_IDX_PHY_PCS_CONTROL_STATUS0 +
1703 (0x200 * (nesdev->mac_index & 1))); 1698 (0x200 * (nesdev->mac_index & 1)));
1704 if (nesdev->nesadapter->phy_type[nesdev->mac_index] != NES_PHY_TYPE_PUMA_1G) { 1699 if (phy_type != NES_PHY_TYPE_PUMA_1G) {
1705 u32temp |= 0x00200000; 1700 u32temp |= 0x00200000;
1706 nes_write_indexed(nesdev, NES_IDX_PHY_PCS_CONTROL_STATUS0 + 1701 nes_write_indexed(nesdev, NES_IDX_PHY_PCS_CONTROL_STATUS0 +
1707 (0x200 * (nesdev->mac_index & 1)), u32temp); 1702 (0x200 * (nesdev->mac_index & 1)), u32temp);
1708 } 1703 }
1709 1704
1710 u32temp = nes_read_indexed(nesdev, NES_IDX_PHY_PCS_CONTROL_STATUS0 +
1711 (0x200 * (nesdev->mac_index & 1)));
1712
1713 if ((u32temp&0x0f1f0000) == 0x0f0f0000) {
1714 if (nesdev->nesadapter->phy_type[nesdev->mac_index] == NES_PHY_TYPE_IRIS) {
1715 nes_init_phy(nesdev);
1716 nes_read_10G_phy_reg(nesdev, nesdev->nesadapter->phy_index[nesdev->mac_index], 1, 1);
1717 temp_phy_data = (u16)nes_read_indexed(nesdev,
1718 NES_IDX_MAC_MDIO_CONTROL);
1719 u32temp = 20;
1720 do {
1721 nes_read_10G_phy_reg(nesdev, nesdev->nesadapter->phy_index[nesdev->mac_index], 1, 1);
1722 phy_data = (u16)nes_read_indexed(nesdev,
1723 NES_IDX_MAC_MDIO_CONTROL);
1724 if ((phy_data == temp_phy_data) || (!(--u32temp)))
1725 break;
1726 temp_phy_data = phy_data;
1727 } while (1);
1728 if (phy_data & 4) {
1729 nes_debug(NES_DBG_INIT, "The Link is UP!!.\n");
1730 nesvnic->linkup = 1;
1731 } else {
1732 nes_debug(NES_DBG_INIT, "The Link is DOWN!!.\n");
1733 }
1734 } else {
1735 nes_debug(NES_DBG_INIT, "The Link is UP!!.\n");
1736 nesvnic->linkup = 1;
1737 }
1738 } else if (nesdev->nesadapter->phy_type[nesdev->mac_index] == NES_PHY_TYPE_PUMA_1G) {
1739 nes_debug(NES_DBG_INIT, "mac_index=%d, logical_port=%d, u32temp=0x%04X, PCI_FUNC=%d\n",
1740 nesdev->mac_index, nesvnic->logical_port, u32temp, PCI_FUNC(nesdev->pcidev->devfn));
1741 if (((nesdev->mac_index < 2) && ((u32temp&0x01010000) == 0x01010000)) ||
1742 ((nesdev->mac_index > 1) && ((u32temp&0x02020000) == 0x02020000))) {
1743 nes_debug(NES_DBG_INIT, "The Link is UP!!.\n");
1744 nesvnic->linkup = 1;
1745 }
1746 }
1747 /* clear the MAC interrupt status, assumes direct logical to physical mapping */ 1705 /* clear the MAC interrupt status, assumes direct logical to physical mapping */
1748 u32temp = nes_read_indexed(nesdev, NES_IDX_MAC_INT_STATUS + (0x200 * nesdev->mac_index)); 1706 u32temp = nes_read_indexed(nesdev, NES_IDX_MAC_INT_STATUS + (0x200 * nesdev->mac_index));
1749 nes_debug(NES_DBG_INIT, "Phy interrupt status = 0x%X.\n", u32temp); 1707 nes_debug(NES_DBG_INIT, "Phy interrupt status = 0x%X.\n", u32temp);
1750 nes_write_indexed(nesdev, NES_IDX_MAC_INT_STATUS + (0x200 * nesdev->mac_index), u32temp); 1708 nes_write_indexed(nesdev, NES_IDX_MAC_INT_STATUS + (0x200 * nesdev->mac_index), u32temp);
1751 1709
1752 if (nesdev->nesadapter->phy_type[nesdev->mac_index] != NES_PHY_TYPE_IRIS) 1710 nes_init_phy(nesdev);
1753 nes_init_phy(nesdev);
1754 1711
1755 } 1712 }
1756 1713