hc
2024-01-03 2f7c68cb55ecb7331f2381deb497c27155f32faf
kernel/drivers/net/phy/bcm87xx.c
....@@ -1,8 +1,5 @@
1
+// SPDX-License-Identifier: GPL-2.0
12 /*
2
- * This file is subject to the terms and conditions of the GNU General Public
3
- * License. See the file "COPYING" in the main directory of this archive
4
- * for more details.
5
- *
63 * Copyright (C) 2011 - 2012 Cavium, Inc.
74 */
85
....@@ -58,7 +55,7 @@
5855 u16 mask = be32_to_cpup(paddr++);
5956 u16 val_bits = be32_to_cpup(paddr++);
6057 int val;
61
- u32 regnum = MII_ADDR_C45 | (devid << 16) | reg;
58
+ u32 regnum = mdiobus_c45_addr(devid, reg);
6259 val = 0;
6360 if (mask) {
6461 val = phy_read(phydev, regnum);
....@@ -84,16 +81,16 @@
8481 }
8582 #endif /* CONFIG_OF_MDIO */
8683
84
+static int bcm87xx_get_features(struct phy_device *phydev)
85
+{
86
+ linkmode_set_bit(ETHTOOL_LINK_MODE_10000baseR_FEC_BIT,
87
+ phydev->supported);
88
+ return 0;
89
+}
90
+
8791 static int bcm87xx_config_init(struct phy_device *phydev)
8892 {
89
- phydev->supported = SUPPORTED_10000baseR_FEC;
90
- phydev->advertising = ADVERTISED_10000baseR_FEC;
91
- phydev->state = PHY_NOLINK;
92
- phydev->autoneg = AUTONEG_DISABLE;
93
-
94
- bcm87xx_of_reg_init(phydev);
95
-
96
- return 0;
93
+ return bcm87xx_of_reg_init(phydev);
9794 }
9895
9996 static int bcm87xx_config_aneg(struct phy_device *phydev)
....@@ -193,7 +190,7 @@
193190 .phy_id = PHY_ID_BCM8706,
194191 .phy_id_mask = 0xffffffff,
195192 .name = "Broadcom BCM8706",
196
- .flags = PHY_HAS_INTERRUPT,
193
+ .get_features = bcm87xx_get_features,
197194 .config_init = bcm87xx_config_init,
198195 .config_aneg = bcm87xx_config_aneg,
199196 .read_status = bcm87xx_read_status,
....@@ -205,7 +202,7 @@
205202 .phy_id = PHY_ID_BCM8727,
206203 .phy_id_mask = 0xffffffff,
207204 .name = "Broadcom BCM8727",
208
- .flags = PHY_HAS_INTERRUPT,
205
+ .get_features = bcm87xx_get_features,
209206 .config_init = bcm87xx_config_init,
210207 .config_aneg = bcm87xx_config_aneg,
211208 .read_status = bcm87xx_read_status,
....@@ -217,4 +214,4 @@
217214
218215 module_phy_driver(bcm87xx_driver);
219216
220
-MODULE_LICENSE("GPL");
217
+MODULE_LICENSE("GPL v2");