| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Applied Micro X-Gene SoC Ethernet v2 Driver |
|---|
| 3 | 4 | * |
|---|
| 4 | 5 | * Copyright (c) 2017, Applied Micro Circuits Corporation |
|---|
| 5 | 6 | * Author(s): Iyappan Subramanian <isubramanian@apm.com> |
|---|
| 6 | 7 | * Keyur Chudgar <kchudgar@apm.com> |
|---|
| 7 | | - * |
|---|
| 8 | | - * This program is free software; you can redistribute it and/or modify it |
|---|
| 9 | | - * under the terms of the GNU General Public License as published by the |
|---|
| 10 | | - * Free Software Foundation; either version 2 of the License, or (at your |
|---|
| 11 | | - * option) any later version. |
|---|
| 12 | | - * |
|---|
| 13 | | - * This program is distributed in the hope that it will be useful, |
|---|
| 14 | | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|---|
| 15 | | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|---|
| 16 | | - * GNU General Public License for more details. |
|---|
| 17 | | - * |
|---|
| 18 | | - * You should have received a copy of the GNU General Public License |
|---|
| 19 | | - * along with this program. If not, see <http://www.gnu.org/licenses/>. |
|---|
| 20 | 8 | */ |
|---|
| 21 | 9 | |
|---|
| 22 | 10 | #include "main.h" |
|---|
| .. | .. |
|---|
| 109 | 97 | |
|---|
| 110 | 98 | int xge_mdio_config(struct net_device *ndev) |
|---|
| 111 | 99 | { |
|---|
| 100 | + __ETHTOOL_DECLARE_LINK_MODE_MASK(mask) = { 0, }; |
|---|
| 112 | 101 | struct xge_pdata *pdata = netdev_priv(ndev); |
|---|
| 113 | 102 | struct device *dev = &pdata->pdev->dev; |
|---|
| 114 | 103 | struct mii_bus *mdio_bus; |
|---|
| .. | .. |
|---|
| 148 | 137 | goto err; |
|---|
| 149 | 138 | } |
|---|
| 150 | 139 | |
|---|
| 151 | | - phydev->supported &= ~(SUPPORTED_10baseT_Half | |
|---|
| 152 | | - SUPPORTED_10baseT_Full | |
|---|
| 153 | | - SUPPORTED_100baseT_Half | |
|---|
| 154 | | - SUPPORTED_100baseT_Full | |
|---|
| 155 | | - SUPPORTED_1000baseT_Half | |
|---|
| 156 | | - SUPPORTED_AUI | |
|---|
| 157 | | - SUPPORTED_MII | |
|---|
| 158 | | - SUPPORTED_FIBRE | |
|---|
| 159 | | - SUPPORTED_BNC); |
|---|
| 160 | | - phydev->advertising = phydev->supported; |
|---|
| 140 | + linkmode_set_bit_array(phy_10_100_features_array, |
|---|
| 141 | + ARRAY_SIZE(phy_10_100_features_array), |
|---|
| 142 | + mask); |
|---|
| 143 | + linkmode_set_bit(ETHTOOL_LINK_MODE_1000baseT_Half_BIT, mask); |
|---|
| 144 | + linkmode_set_bit(ETHTOOL_LINK_MODE_AUI_BIT, mask); |
|---|
| 145 | + linkmode_set_bit(ETHTOOL_LINK_MODE_MII_BIT, mask); |
|---|
| 146 | + linkmode_set_bit(ETHTOOL_LINK_MODE_FIBRE_BIT, mask); |
|---|
| 147 | + linkmode_set_bit(ETHTOOL_LINK_MODE_BNC_BIT, mask); |
|---|
| 148 | + |
|---|
| 149 | + linkmode_andnot(phydev->supported, phydev->supported, mask); |
|---|
| 150 | + linkmode_copy(phydev->advertising, phydev->supported); |
|---|
| 161 | 151 | pdata->phy_speed = SPEED_UNKNOWN; |
|---|
| 162 | 152 | |
|---|
| 163 | 153 | return 0; |
|---|