From: Paolo Abeni <pabeni@redhat.com>
To: Herve Codina <herve.codina@bootlin.com>,
Vadim Fedorenko <vadim.fedorenko@linux.dev>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>
Cc: Andrew Lunn <andrew@lunn.ch>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
Mark Brown <broonie@kernel.org>,
Thomas Petazzoni <thomas.petazzoni@bootlin.com>,
linuxppc-dev@lists.ozlabs.org
Subject: Re: [PATCH v2 5/6] net: wan: fsl_qmc_hdlc: Add runtime timeslots changes support
Date: Thu, 01 Feb 2024 13:01:51 +0100 [thread overview]
Message-ID: <a8845eca2d9bab5d7805c19a16811820671c41f2.camel@redhat.com> (raw)
In-Reply-To: <20240130084035.115086-6-herve.codina@bootlin.com>
On Tue, 2024-01-30 at 09:40 +0100, Herve Codina wrote:
> QMC channels support runtime timeslots changes but nothing is done at
> the QMC HDLC driver to handle these changes.
>
> Use existing IFACE ioctl in order to configure the timeslots to use.
>
> Signed-off-by: Herve Codina <herve.codina@bootlin.com>
> Reviewed-by: Christophe Leroy <christophe.leroy@csgroup.eu>
> Acked-by: Jakub Kicinski <kuba@kernel.org>
> ---
> drivers/net/wan/fsl_qmc_hdlc.c | 155 ++++++++++++++++++++++++++++++++-
> 1 file changed, 154 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/wan/fsl_qmc_hdlc.c b/drivers/net/wan/fsl_qmc_hdlc.c
> index e7b2b72a6050..8316f2984864 100644
> --- a/drivers/net/wan/fsl_qmc_hdlc.c
> +++ b/drivers/net/wan/fsl_qmc_hdlc.c
> @@ -7,6 +7,7 @@
> * Author: Herve Codina <herve.codina@bootlin.com>
> */
>
> +#include <linux/bitmap.h>
> #include <linux/dma-mapping.h>
> #include <linux/hdlc.h>
> #include <linux/module.h>
> @@ -32,6 +33,7 @@ struct qmc_hdlc {
> struct qmc_hdlc_desc tx_descs[8];
> unsigned int tx_out;
> struct qmc_hdlc_desc rx_descs[4];
> + u32 slot_map;
> };
>
> static inline struct qmc_hdlc *netdev_to_qmc_hdlc(struct net_device *netdev)
> @@ -202,6 +204,147 @@ static netdev_tx_t qmc_hdlc_xmit(struct sk_buff *skb, struct net_device *netdev)
> return NETDEV_TX_OK;
> }
>
> +static int qmc_hdlc_xlate_slot_map(struct qmc_hdlc *qmc_hdlc,
> + u32 slot_map, struct qmc_chan_ts_info *ts_info)
> +{
> + DECLARE_BITMAP(ts_mask_avail, 64);
> + DECLARE_BITMAP(ts_mask, 64);
> + DECLARE_BITMAP(map, 64);
> + u32 array32[2];
> +
> + /* Tx and Rx available masks must be identical */
> + if (ts_info->rx_ts_mask_avail != ts_info->tx_ts_mask_avail) {
> + dev_err(qmc_hdlc->dev, "tx and rx available timeslots mismatch (0x%llx, 0x%llx)\n",
> + ts_info->rx_ts_mask_avail, ts_info->tx_ts_mask_avail);
> + return -EINVAL;
> + }
> +
> + bitmap_from_arr64(ts_mask_avail, &ts_info->rx_ts_mask_avail, 64);
> + array32[0] = slot_map;
> + array32[1] = 0;
> + bitmap_from_arr32(map, array32, 64);
What about using bitmap_from_u64 everywhere ?
Cheers,
Paolo
next prev parent reply other threads:[~2024-02-01 12:02 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-30 8:40 [PATCH v2 0/6] Add support for QMC HDLC Herve Codina
2024-01-30 8:40 ` [PATCH v2 1/6] net: wan: " Herve Codina
2024-02-01 11:41 ` Paolo Abeni
2024-02-05 14:22 ` Herve Codina
2024-02-05 15:49 ` Paolo Abeni
2024-02-05 16:35 ` Herve Codina
2024-01-30 8:40 ` [PATCH v2 2/6] MAINTAINERS: Add the Freescale QMC HDLC driver entry Herve Codina
2024-01-30 8:40 ` [PATCH v2 3/6] bitmap: Make bitmap_onto() available to users Herve Codina
2024-01-30 8:40 ` [PATCH v2 4/6] bitmap: Introduce bitmap_off() Herve Codina
2024-01-30 8:40 ` [PATCH v2 5/6] net: wan: fsl_qmc_hdlc: Add runtime timeslots changes support Herve Codina
2024-02-01 12:01 ` Paolo Abeni [this message]
2024-02-05 15:00 ` Herve Codina
2024-01-30 8:40 ` [PATCH v2 6/6] net: wan: fsl_qmc_hdlc: Add framer support Herve Codina
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=a8845eca2d9bab5d7805c19a16811820671c41f2.camel@redhat.com \
--to=pabeni@redhat.com \
--cc=andrew@lunn.ch \
--cc=broonie@kernel.org \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=herve.codina@bootlin.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=netdev@vger.kernel.org \
--cc=thomas.petazzoni@bootlin.com \
--cc=vadim.fedorenko@linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).