[LEDE-DEV] [PATCH] kernel: adm6996: set carrier status

Matthias Schiffer mschiffer at universe-factory.net
Mon Aug 8 02:34:03 PDT 2016


On 08/07/2016 10:24 PM, Mathias Kresin wrote:
> Due to the missing carrier status set, the interface wasn't usable on a
> BTHOMEHUB2B after ip link down and up as it is done in preinit.
> 
> Signed-off-by: Mathias Kresin <dev at kresin.me>
> ---
>  target/linux/generic/files/drivers/net/phy/adm6996.c | 11 +++++++++++
>  1 file changed, 11 insertions(+)
> 
> diff --git a/target/linux/generic/files/drivers/net/phy/adm6996.c b/target/linux/generic/files/drivers/net/phy/adm6996.c
> index a2ff2b0..7823b8b 100644
> --- a/target/linux/generic/files/drivers/net/phy/adm6996.c
> +++ b/target/linux/generic/files/drivers/net/phy/adm6996.c
> @@ -1052,6 +1052,17 @@ static int adm6996_read_status(struct phy_device *phydev)
>  	phydev->speed = SPEED_100;
>  	phydev->duplex = DUPLEX_FULL;
>  	phydev->link = 1;
> +
> +	if (phydev->link) {

This doesn't look right. You test phydev->link right after it is set to 1,
so the else branch doesn't do anything.

Regards,
Matthias

> +		phydev->state = PHY_RUNNING;
> +		netif_carrier_on(phydev->attached_dev);
> +		phydev->adjust_link(phydev->attached_dev);
> +	} else {
> +		phydev->state = PHY_NOLINK;
> +		netif_carrier_off(phydev->attached_dev);
> +		phydev->adjust_link(phydev->attached_dev);
> +	}
> +
>  	return 0;
>  }
>  
> 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://lists.infradead.org/pipermail/lede-dev/attachments/20160808/28daba46/attachment.sig>


More information about the Lede-dev mailing list