cmd->base.duplex = DUPLEX_UNKNOWN;
port = nfp_port_from_netdev(netdev);
- eth_port = __nfp_port_get_eth_port(port);
+ eth_port = nfp_port_get_eth_port(port);
if (eth_port)
cmd->base.autoneg = eth_port->aneg != NFP_ANEG_DISABLED ?
AUTONEG_ENABLE : AUTONEG_DISABLE;
/* Use link speed from ETH table if available, otherwise try the BAR */
if (eth_port) {
- int err;
-
- if (test_bit(NFP_PORT_CHANGED, &port->flags)) {
- err = nfp_net_refresh_eth_port(port);
- if (err)
- return err;
- }
-
cmd->base.port = eth_port->port_type;
cmd->base.speed = eth_port->speed;
cmd->base.duplex = DUPLEX_FULL;
return port->eth_port;
}
+struct nfp_eth_table_port *nfp_port_get_eth_port(struct nfp_port *port)
+{
+ if (!__nfp_port_get_eth_port(port))
+ return NULL;
+
+ if (test_bit(NFP_PORT_CHANGED, &port->flags))
+ if (nfp_net_refresh_eth_port(port))
+ return NULL;
+
+ return __nfp_port_get_eth_port(port);
+}
+
int
nfp_port_get_phys_port_name(struct net_device *netdev, char *name, size_t len)
{
struct nfp_port *nfp_port_from_netdev(struct net_device *netdev);
struct nfp_eth_table_port *__nfp_port_get_eth_port(struct nfp_port *port);
+struct nfp_eth_table_port *nfp_port_get_eth_port(struct nfp_port *port);
int
nfp_port_get_phys_port_name(struct net_device *netdev, char *name, size_t len);