[PATCH v4 5/5] net: wan: fsl_qmc_hdlc: Add framer support
Andy Shevchenko
andriy.shevchenko at linux.intel.com
Fri Feb 23 02:49:40 AEDT 2024
On Thu, Feb 22, 2024 at 03:22:18PM +0100, Herve Codina wrote:
> Add framer support in the fsl_qmc_hdlc driver in order to be able to
> signal carrier changes to the network stack based on the framer status
> Also use this framer to provide information related to the E1/T1 line
> interface on IF_GET_IFACE and configure the line interface according to
> IF_IFACE_{E1,T1} information.
...
> +static int qmc_hdlc_framer_set_carrier(struct qmc_hdlc *qmc_hdlc)
> +{
> + struct framer_status framer_status;
> + unsigned long flags;
> + int ret;
> +
> + if (!qmc_hdlc->framer)
> + return 0;
> + spin_lock_irqsave(&qmc_hdlc->carrier_lock, flags);
cleanup.h ?
> + ret = framer_get_status(qmc_hdlc->framer, &framer_status);
> + if (ret) {
> + dev_err(qmc_hdlc->dev, "get framer status failed (%d)\n", ret);
> + goto end;
> + }
> + if (framer_status.link_is_on)
> + netif_carrier_on(qmc_hdlc->netdev);
> + else
> + netif_carrier_off(qmc_hdlc->netdev);
> +
> +end:
> + spin_unlock_irqrestore(&qmc_hdlc->carrier_lock, flags);
> + return ret;
> +}
--
With Best Regards,
Andy Shevchenko
More information about the Linuxppc-dev
mailing list