net: phylink: Add PHYLINK_DEV operation type
In the PHYLINK_DEV operation type, the PHYLINK infrastructure can work without an attached net_device. For printing usecases, instead, a struct device * should be passed to PHYLINK using the phylink_config structure. Also, netif_carrier_* calls ar guarded by the presence of a valid net_device. When using the PHYLINK_DEV operation type, we cannot check link status using the netif_carrier_ok() API so instead, keep an internal state of the MAC and call mac_link_{down,up} only when the link changed. Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com> Signed-off-by: Vladimir Oltean <olteanv@gmail.com> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:

committed by
David S. Miller

parent
44cc27e43f
commit
43de61959b
@@ -56,6 +56,7 @@ struct phylink_link_state {
|
||||
|
||||
enum phylink_op_type {
|
||||
PHYLINK_NETDEV = 0,
|
||||
PHYLINK_DEV,
|
||||
};
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user