Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
SVN-Revision: 35555
-ar8216_config_init(struct phy_device *pdev)
+ar8216_config_init(struct phy_device *phydev)
- struct ar8216_priv *priv = pdev->priv;
- struct net_device *dev = pdev->attached_dev;
+ struct ar8216_priv *priv = phydev->priv;
+ struct net_device *dev = phydev->attached_dev;
struct switch_dev *swdev;
int ret;
if (!priv) {
struct switch_dev *swdev;
int ret;
if (!priv) {
- priv = ar8xxx_create_mii(pdev->bus);
+ priv = ar8xxx_create_mii(phydev->bus);
if (priv == NULL)
return -ENOMEM;
if (priv == NULL)
return -ENOMEM;
+ if (phydev->addr != 0) {
if (chip_is_ar8316(priv)) {
/* check if we're attaching to the switch twice */
if (chip_is_ar8316(priv)) {
/* check if we're attaching to the switch twice */
- pdev = pdev->bus->phy_map[0];
- if (!pdev) {
+ phydev = phydev->bus->phy_map[0];
+ if (!phydev) {
ar8xxx_free(priv);
return 0;
}
/* switch device has not been initialized, reuse priv */
ar8xxx_free(priv);
return 0;
}
/* switch device has not been initialized, reuse priv */
priv->port4_phy = true;
priv->dev.ports = (AR8216_NUM_PORTS - 1);
priv->port4_phy = true;
priv->dev.ports = (AR8216_NUM_PORTS - 1);
return 0;
}
ar8xxx_free(priv);
/* switch device has been initialized, reinit */
return 0;
}
ar8xxx_free(priv);
/* switch device has been initialized, reinit */
priv->dev.ports = (AR8216_NUM_PORTS - 1);
priv->initialized = false;
priv->port4_phy = true;
priv->dev.ports = (AR8216_NUM_PORTS - 1);
priv->initialized = false;
priv->port4_phy = true;
- ret = register_switch(swdev, pdev->attached_dev);
+ ret = register_switch(swdev, phydev->attached_dev);
if (ret)
goto err_free_priv;
pr_info("%s: %s switch driver attached.\n",
if (ret)
goto err_free_priv;
pr_info("%s: %s switch driver attached.\n",
- pdev->attached_dev->name, swdev->name);
+ phydev->attached_dev->name, swdev->name);
unregister_switch(&priv->dev);
err_free_priv:
ar8xxx_free(priv);
unregister_switch(&priv->dev);
err_free_priv:
ar8xxx_free(priv);
-ar8216_probe(struct phy_device *pdev)
+ar8216_probe(struct phy_device *phydev)
{
struct ar8216_priv *priv;
int ret;
/* skip PHYs at unused adresses */
{
struct ar8216_priv *priv;
int ret;
/* skip PHYs at unused adresses */
- if (pdev->addr != 0 && pdev->addr != 4)
+ if (phydev->addr != 0 && phydev->addr != 4)
- if (!ar8xxx_is_possible(pdev->bus))
+ if (!ar8xxx_is_possible(phydev->bus))
- priv = ar8xxx_create_mii(pdev->bus);
+ priv = ar8xxx_create_mii(phydev->bus);
if (priv == NULL)
return -ENOMEM;
if (priv == NULL)
return -ENOMEM;
ret = ar8xxx_probe_switch(priv);
if (ret)
goto out;
ret = ar8xxx_probe_switch(priv);
if (ret)
goto out;
+ if (phydev->addr == 0) {
if (ar8xxx_has_gige(priv)) {
if (ar8xxx_has_gige(priv)) {
- pdev->supported = SUPPORTED_1000baseT_Full;
- pdev->advertising = ADVERTISED_1000baseT_Full;
+ phydev->supported = SUPPORTED_1000baseT_Full;
+ phydev->advertising = ADVERTISED_1000baseT_Full;
- pdev->supported = SUPPORTED_100baseT_Full;
- pdev->advertising = ADVERTISED_100baseT_Full;
+ phydev->supported = SUPPORTED_100baseT_Full;
+ phydev->advertising = ADVERTISED_100baseT_Full;
}
} else {
if (ar8xxx_has_gige(priv)) {
}
} else {
if (ar8xxx_has_gige(priv)) {
- pdev->supported |= SUPPORTED_1000baseT_Full;
- pdev->advertising |= ADVERTISED_1000baseT_Full;
+ phydev->supported |= SUPPORTED_1000baseT_Full;
+ phydev->advertising |= ADVERTISED_1000baseT_Full;
-ar8216_detach(struct phy_device *pdev)
+ar8216_detach(struct phy_device *phydev)
- struct net_device *dev = pdev->attached_dev;
+ struct net_device *dev = phydev->attached_dev;
-ar8216_remove(struct phy_device *pdev)
+ar8216_remove(struct phy_device *phydev)
- struct ar8216_priv *priv = pdev->priv;
+ struct ar8216_priv *priv = phydev->priv;
unregister_switch(&priv->dev);
ar8xxx_mib_stop(priv);
unregister_switch(&priv->dev);
ar8xxx_mib_stop(priv);