They can be found on BCM47xx SoCs and provide gigabit ethernet.
--- a/drivers/net/ethernet/broadcom/bgmac.c
+++ b/drivers/net/ethernet/broadcom/bgmac.c
-@@ -1201,27 +1201,14 @@ static int bgmac_set_mac_address(struct
+@@ -1229,27 +1229,14 @@ static int bgmac_set_mac_address(struct
static int bgmac_ioctl(struct net_device *net_dev, struct ifreq *ifr, int cmd)
{
struct bgmac *bgmac = netdev_priv(net_dev);
- default:
- return -EOPNOTSUPP;
- }
-+ if (!netif_running(net_dev))
-+ return -EINVAL;
++ if (!netif_running(net_dev))
++ return -EINVAL;
+
+ if (!bgmac->phydev)
+ return -EINVAL;
}
static const struct net_device_ops bgmac_netdev_ops = {
-@@ -1243,61 +1230,18 @@ static int bgmac_get_settings(struct net
+@@ -1271,61 +1258,16 @@ static int bgmac_get_settings(struct net
{
struct bgmac *bgmac = netdev_priv(net_dev);
}
-#if 0
-+
static int bgmac_set_settings(struct net_device *net_dev,
struct ethtool_cmd *cmd)
{
+ return phy_ethtool_sset(bgmac->phydev, cmd);
}
-#endif
-+
static void bgmac_get_drvinfo(struct net_device *net_dev,
struct ethtool_drvinfo *info)
-@@ -1308,6 +1252,7 @@ static void bgmac_get_drvinfo(struct net
+@@ -1336,6 +1278,7 @@ static void bgmac_get_drvinfo(struct net
static const struct ethtool_ops bgmac_ethtool_ops = {
.get_settings = bgmac_get_settings,
.get_drvinfo = bgmac_get_drvinfo,
};
-@@ -1326,10 +1271,42 @@ static int bgmac_mii_write(struct mii_bu
+@@ -1354,10 +1297,36 @@ static int bgmac_mii_write(struct mii_bu
return bgmac_phy_write(bus->priv, mii_id, regnum, value);
}
+{
+ struct bgmac *bgmac = netdev_priv(dev);
+ struct phy_device *phydev = bgmac->phydev;
-+ int status_changed = 0;
++ bool status_changed = 0;
+
+ BUG_ON(!phydev);
+
+ bgmac->old_duplex = phydev->duplex;
+ }
+
-+ if (status_changed) {
-+ pr_info("%s: link %s", dev->name, phydev->link ?
-+ "UP" : "DOWN");
-+ if (phydev->link)
-+ pr_cont(" - %d/%s", phydev->speed,
-+ phydev->duplex == DUPLEX_FULL ? "full" : "half");
-+ pr_cont("\n");
-+ }
++ if (status_changed)
++ phy_print_status(phydev);
+}
+
static int bgmac_mii_register(struct bgmac *bgmac)
mii_bus = mdiobus_alloc();
if (!mii_bus)
-@@ -1360,7 +1337,29 @@ static int bgmac_mii_register(struct bgm
+@@ -1388,7 +1357,28 @@ static int bgmac_mii_register(struct bgm
bgmac->mii_bus = mii_bus;
+ PHY_INTERFACE_MODE_MII);
+
+ if (IS_ERR(phydev)) {
-+ netdev_err(net_dev, "could not attach PHY: %s", phy_id);
++ netdev_err(net_dev, "could not attach PHY: %s\n", phy_id);
+ bgmac->phyaddr = BGMAC_PHY_NOREGS;
+ return PTR_ERR(phydev);
+ }
+ bgmac->old_duplex = -1;
+ bgmac->phyaddr = phydev->addr;
+
-+ netdev_info(net_dev, "attached PHY driver [%s] "
-+ "(mii_bus:phy_addr=%s)\n",
-+ phydev->drv->name, dev_name(&phydev->dev));
++ netdev_info(net_dev, "attached PHY driver [%s] (mii_bus:phy_addr=%s)\n",
++ phydev->drv->name, dev_name(&phydev->dev));
+
+ return 0;
kfree(mii_bus->irq);
--- a/drivers/net/ethernet/broadcom/bgmac.h
+++ b/drivers/net/ethernet/broadcom/bgmac.h
-@@ -399,7 +399,10 @@ struct bgmac {
+@@ -401,7 +401,10 @@ struct bgmac {
struct bcma_device *cmn; /* Reference to CMN core for BCM4706 */
struct net_device *net_dev;
struct napi_struct napi;