ncsi: Propagate carrier gain/loss events to the NCSI controller
authorJohnathan Mantey <johnathanx.mantey@intel.com>
Fri, 15 Sep 2023 16:12:35 +0000 (09:12 -0700)
committerDavid S. Miller <davem@davemloft.net>
Mon, 18 Sep 2023 06:06:05 +0000 (07:06 +0100)
Report the carrier/no-carrier state for the network interface
shared between the BMC and the passthrough channel. Without this
functionality the BMC is unable to reconfigure the NIC in the event
of a re-cabling to a different subnet.

Signed-off-by: Johnathan Mantey <johnathanx.mantey@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ncsi/ncsi-aen.c

index 62fb103..f8854bf 100644 (file)
@@ -89,6 +89,11 @@ static int ncsi_aen_handler_lsc(struct ncsi_dev_priv *ndp,
        if ((had_link == has_link) || chained)
                return 0;
 
+       if (had_link)
+               netif_carrier_off(ndp->ndev.dev);
+       else
+               netif_carrier_on(ndp->ndev.dev);
+
        if (!ndp->multi_package && !nc->package->multi_channel) {
                if (had_link) {
                        ndp->flags |= NCSI_DEV_RESHUFFLE;