[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAK8U23YF53F0-zMbq5mk2kY4nkS1L0NH9j-UJrdaS5VUZ5JZdA@mail.gmail.com>
Date: Sat, 7 Jun 2025 14:54:57 -0300
From: Ramon Fontes <ramonreisfontes@...il.com>
To: Alexander Aring <aahringo@...hat.com>
Cc: davem@...emloft.net, kuba@...nel.org, pabeni@...hat.com,
linux-wpan@...r.kernel.org, alex.aring@...il.com, miquel.raynal@...tlin.com,
netdev@...r.kernel.org
Subject: Re: [PATCH] mac802154_hwsim: allow users to specify the number of
simulated radios dinamically instead of the previously hardcoded value of 2
> handle as unsigned then this check would not be necessary?
Yeah, it does make sense. However, I have a bit of an embarrassing
question. How do I submit an updated patch in this same thread? I
tried before but it didn’t work as expected. Should I send it manually
via email with the same subject, or is there a better way to do it
properly?
-
Ramon
Em sáb., 7 de jun. de 2025 às 14:34, Alexander Aring
<aahringo@...hat.com> escreveu:
>
> Hi,
>
> On Tue, Jun 3, 2025 at 2:33 PM Ramon Fontes <ramonreisfontes@...il.com> wrote:
> >
> > * Added a new module parameter radios
> > * Modified the loop in hwsim_probe()
> > * Updated log message in hwsim_probe()
> >
>
> no problem with this patch, just a note see below.
>
> Acked-by: Alexander Aring <aahringo@...hat.com>
>
> > Signed-off-by: Ramon Fontes <ramonreisfontes@...il.com>
> > ---
> > drivers/net/ieee802154/mac802154_hwsim.c | 11 +++++++++--
> > 1 file changed, 9 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/net/ieee802154/mac802154_hwsim.c b/drivers/net/ieee802154/mac802154_hwsim.c
> > index 2f7520454..dadae6247 100644
> > --- a/drivers/net/ieee802154/mac802154_hwsim.c
> > +++ b/drivers/net/ieee802154/mac802154_hwsim.c
> > @@ -27,6 +27,10 @@
> > MODULE_DESCRIPTION("Software simulator of IEEE 802.15.4 radio(s) for mac802154");
> > MODULE_LICENSE("GPL");
> >
> > +static int radios = 2;
> > +module_param(radios, int, 0444);
> > +MODULE_PARM_DESC(radios, "Number of simulated radios");
> > +
> > static LIST_HEAD(hwsim_phys);
> > static DEFINE_MUTEX(hwsim_phys_lock);
> >
> > @@ -1018,13 +1022,13 @@ static int hwsim_probe(struct platform_device *pdev)
> > struct hwsim_phy *phy, *tmp;
> > int err, i;
> >
> > - for (i = 0; i < 2; i++) {
> > + for (i = 0; i < radios; i++) {
> > err = hwsim_add_one(NULL, &pdev->dev, true);
> > if (err < 0)
> > goto err_slave;
> > }
> >
> > - dev_info(&pdev->dev, "Added 2 mac802154 hwsim hardware radios\n");
> > + dev_info(&pdev->dev, "Added %d mac802154 hwsim hardware radios\n", radios);
> > return 0;
> >
> > err_slave:
> > @@ -1057,6 +1061,9 @@ static __init int hwsim_init_module(void)
> > {
> > int rc;
> >
> > + if (radios < 0)
> > + return -EINVAL;
> > +
>
> handle as unsigned then this check would not be necessary?
>
> - Alex
>
Powered by blists - more mailing lists