|
@@ -1388,7 +1388,7 @@ static const struct ethtool_ops bgmac_ethtool_ops = {
|
|
|
* MII
|
|
|
**************************************************/
|
|
|
|
|
|
-static void bgmac_adjust_link(struct net_device *net_dev)
|
|
|
+void bgmac_adjust_link(struct net_device *net_dev)
|
|
|
{
|
|
|
struct bgmac *bgmac = netdev_priv(net_dev);
|
|
|
struct phy_device *phy_dev = net_dev->phydev;
|
|
@@ -1411,8 +1411,9 @@ static void bgmac_adjust_link(struct net_device *net_dev)
|
|
|
phy_print_status(phy_dev);
|
|
|
}
|
|
|
}
|
|
|
+EXPORT_SYMBOL_GPL(bgmac_adjust_link);
|
|
|
|
|
|
-static int bgmac_phy_connect_direct(struct bgmac *bgmac)
|
|
|
+int bgmac_phy_connect_direct(struct bgmac *bgmac)
|
|
|
{
|
|
|
struct fixed_phy_status fphy_status = {
|
|
|
.link = 1,
|
|
@@ -1437,24 +1438,7 @@ static int bgmac_phy_connect_direct(struct bgmac *bgmac)
|
|
|
|
|
|
return err;
|
|
|
}
|
|
|
-
|
|
|
-static int bgmac_phy_connect(struct bgmac *bgmac)
|
|
|
-{
|
|
|
- struct phy_device *phy_dev;
|
|
|
- char bus_id[MII_BUS_ID_SIZE + 3];
|
|
|
-
|
|
|
- /* Connect to the PHY */
|
|
|
- snprintf(bus_id, sizeof(bus_id), PHY_ID_FMT, bgmac->mii_bus->id,
|
|
|
- bgmac->phyaddr);
|
|
|
- phy_dev = phy_connect(bgmac->net_dev, bus_id, &bgmac_adjust_link,
|
|
|
- PHY_INTERFACE_MODE_MII);
|
|
|
- if (IS_ERR(phy_dev)) {
|
|
|
- dev_err(bgmac->dev, "PHY connection failed\n");
|
|
|
- return PTR_ERR(phy_dev);
|
|
|
- }
|
|
|
-
|
|
|
- return 0;
|
|
|
-}
|
|
|
+EXPORT_SYMBOL_GPL(bgmac_phy_connect_direct);
|
|
|
|
|
|
int bgmac_enet_probe(struct bgmac *info)
|
|
|
{
|
|
@@ -1507,10 +1491,7 @@ int bgmac_enet_probe(struct bgmac *info)
|
|
|
|
|
|
netif_napi_add(net_dev, &bgmac->napi, bgmac_poll, BGMAC_WEIGHT);
|
|
|
|
|
|
- if (!bgmac->mii_bus)
|
|
|
- err = bgmac_phy_connect_direct(bgmac);
|
|
|
- else
|
|
|
- err = bgmac_phy_connect(bgmac);
|
|
|
+ err = bgmac_phy_connect(bgmac);
|
|
|
if (err) {
|
|
|
dev_err(bgmac->dev, "Cannot connect to phy\n");
|
|
|
goto err_dma_free;
|