All of lore.kernel.org
 help / color / mirror / Atom feed
From: Zong-Zhe Yang <kevin_yang@realtek.com>
To: Raja Mani <raja.mani@oss.qualcomm.com>,
	"johannes@sipsolutions.net" <johannes@sipsolutions.net>
Cc: "linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>
Subject: RE: [PATCH 5/5] iw: bitrate: support link id
Date: Tue, 16 Sep 2025 02:27:00 +0000	[thread overview]
Message-ID: <41315cdd01e347ac927bc51bfacb050b@realtek.com> (raw)
In-Reply-To: <51e6a40d-8f1b-40ed-9105-4b0af0c544b9@oss.qualcomm.com>

Raja Mani <raja.mani@oss.qualcomm.com> wrote:
> 
> On 9/12/2025 3:24 PM, Zong-Zhe Yang wrote:
> > Since nl80211 requires valid link id (NL80211_FLAG_MLO_VALID_LINK_ID),
> > support link-id field for MLD. For non-MLD, just as before, no need to
> > assign link-id field.
> >
> > Signed-off-by: Zong-Zhe Yang <kevin_yang@realtek.com>
> > ---
> >   bitrate.c   | 29 +++++++++++++++++++++++++++--
> >   interface.c | 32 +++++++++++++++++++++++++++-----
> >   iw.h        |  2 +-
> >   3 files changed, 55 insertions(+), 8 deletions(-)
> >
> > diff --git a/bitrate.c b/bitrate.c
> > index 16f118cce4ec..78d399d227e2 100644
> > --- a/bitrate.c
> > +++ b/bitrate.c
> > @@ -195,7 +195,7 @@ static int parse_eht_gi(char *eht_gi)
> >
> >   int set_bitrates(struct nl_msg *msg,
> >                int argc, char **argv,
> > -              enum nl80211_attrs attr)
> > +              enum nl80211_attrs attr, int *link_id)
> >   {
> >       struct nlattr *nl_rates, *nl_band;
> >       int i, ret = 0;
> > @@ -242,6 +242,7 @@ int set_bitrates(struct nl_msg *msg,
> >       char *he_gi_argv = NULL;
> >       int eht_gi = 0, eht_ltf = 0;
> >       char *eht_gi_argv = NULL;
> > +     bool has_link_id = false;
> >
> >       enum {
> >               S_NONE,
> > @@ -250,6 +251,7 @@ int set_bitrates(struct nl_msg *msg,
> >               S_VHT,
> >               S_HE,
> >               S_EHT,
> > +             S_LINK_ID,
> >               S_GI,
> >               S_HE_GI,
> >               S_HE_LTF,
> > @@ -347,6 +349,11 @@ int set_bitrates(struct nl_msg *msg,
> >                       eht_argv = eht_argv_6;
> >                       eht_argc = &eht_argc_6;
> >                       have_eht_mcs_6 = true;
> > +             } else if (strcmp(argv[i], "link-id") == 0) {
> 
> Missed to include this new arg in 'tidconf' and 'bitrates' option's help text ?

Thanks.
I will send v2.

> 
> > +                     if (has_link_id)
> > +                             return 1;
> > +                     parser_state = S_LINK_ID;
> > +                     has_link_id = true;
> >               } else if (strcmp(argv[i], "sgi-2.4") == 0) {
> >                       sgi_24 = 1;
> >                       parser_state = S_GI; @@ -427,6 +434,11 @@ int
> > set_bitrates(struct nl_msg *msg,
> >                               return 1;
> >                       eht_argv[(*eht_argc)++] = argv[i];
> >                       break;
> > +             case S_LINK_ID:
> > +                     *link_id = strtol(argv[i], &end, 0);
> > +                     if (*end != '\0')
> > +                             return 1;
> > +                     break;
> >               case S_GI:
> >                       break;
> >               case S_HE_GI:
> > @@ -618,7 +630,20 @@ static int handle_bitrates(struct nl80211_state *state,
> >                          int argc, char **argv,
> >                          enum id_input id)
> >   {
> > -     return set_bitrates(msg, argc, argv, NL80211_ATTR_TX_RATES);
> > +     int link_id = -1;
> > +     int ret;
> > +
> > +     ret = set_bitrates(msg, argc, argv, NL80211_ATTR_TX_RATES, &link_id);
> > +     if (ret)
> > +             return ret;
> > +
> > +     if (link_id >= 0)
> > +             NLA_PUT_U8(msg, NL80211_ATTR_MLO_LINK_ID, link_id);
> > +
> > +     return 0;
> > +
> > + nla_put_failure:
> > +     return -ENOBUFS;
> >   }
> >
> >   #define DESCR_LEGACY "[legacy-<2.4|5> <legacy rate in Mbps>*]"
> > diff --git a/interface.c b/interface.c index
> > 65a4006963e5..0f1e9647f0e4 100644
> > --- a/interface.c
> > +++ b/interface.c
> > @@ -796,10 +796,11 @@ static int toggle_tid_param(const char *argv0, const char *argv1,
> >       return -ENOBUFS;
> >   }
> >
> > -static int handle_tid_config(struct nl80211_state *state,
> > -                          struct nl_msg *msg,
> > -                          int argc, char **argv,
> > -                          enum id_input id)
> > +static int __handle_tid_config(struct nl80211_state *state,
> > +                            struct nl_msg *msg,
> > +                            int argc, char **argv,
> > +                            enum id_input id,
> > +                            int *link_id)
> >   {
> >       struct nlattr *tids_array = NULL;
> >       struct nlattr *tids_entry = NULL; @@ -989,7 +990,7 @@ static int
> > handle_tid_config(struct nl80211_state *state,
> >                               if (txrate_type != NL80211_TX_RATE_AUTOMATIC) {
> >                                       attr =
> NL80211_TID_CONFIG_ATTR_TX_RATE;
> >                                       ret = set_bitrates(msg, argc, argv,
> > -                                                        attr);
> > +                                                        attr,
> > + link_id);
> >                                       if (ret < 2)
> >                                               return 1;
> >
> > @@ -1020,6 +1021,27 @@ nla_put_failure:
> >       return -ENOBUFS;
> >   }
> >
> > +static int handle_tid_config(struct nl80211_state *state,
> > +                          struct nl_msg *msg,
> > +                          int argc, char **argv,
> > +                          enum id_input id) {
> > +     int link_id = -1;
> > +     int ret;
> > +
> > +     ret = __handle_tid_config(state, msg, argc, argv, id, &link_id);
> > +     if (ret)
> > +             return ret;
> > +
> > +     if (link_id >= 0)
> > +             NLA_PUT_U8(msg, NL80211_ATTR_MLO_LINK_ID, link_id);
> > +
> > +     return 0;
> > +
> > + nla_put_failure:
> > +     return -ENOBUFS;
> > +}
> > +
> >   COMMAND(set, tidconf, "[peer <MAC address>] tids <mask> [override] [sretry <num>]
> [lretry <num>] "
> >       "[ampdu [on|off]] [amsdu [on|off]] [noack [on|off]] [rtscts [on|off]]"
> >       "[bitrates <type [auto|fixed|limit]> [legacy-<2.4|5> <legacy rate in Mbps>*]
> [ht-mcs-<2.4|5> <MCS index>*]"
> > diff --git a/iw.h b/iw.h
> > index 145b058d86ba..5c4ab6b0b38e 100644
> > --- a/iw.h
> > +++ b/iw.h
> > @@ -302,7 +302,7 @@ void nan_bf(uint8_t idx, uint8_t *bf, uint16_t bf_len, const uint8_t
> *buf,
> >   char *hex2bin(const char *hex, char *buf);
> >
> >   int set_bitrates(struct nl_msg *msg, int argc, char **argv,
> > -              enum nl80211_attrs attr);
> > +              enum nl80211_attrs attr, int *link_id);
> >
> >   int calc_s1g_ch_center_freq(__u8 ch_index, __u8 s1g_oper_class);
> >


      reply	other threads:[~2025-09-16  2:27 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-12  9:54 [PATCH 0/5] iw: support EHT and link id for setting bitrate Zong-Zhe Yang
2025-09-12  9:54 ` [PATCH 1/5] iw: update nl80211.h Zong-Zhe Yang
2025-09-12  9:54 ` [PATCH 2/5] iw: info: extended features print EHT beacon rate Zong-Zhe Yang
2025-09-12  9:54 ` [PATCH 3/5] iw: bitrate: refactor description Zong-Zhe Yang
2025-09-12  9:54 ` [PATCH 4/5] iw: bitrate: support EHT rate/gi/ltf Zong-Zhe Yang
2025-09-12  9:54 ` [PATCH 5/5] iw: bitrate: support link id Zong-Zhe Yang
2025-09-15  4:26   ` Raja Mani
2025-09-16  2:27     ` Zong-Zhe Yang [this message]

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=41315cdd01e347ac927bc51bfacb050b@realtek.com \
    --to=kevin_yang@realtek.com \
    --cc=johannes@sipsolutions.net \
    --cc=linux-wireless@vger.kernel.org \
    --cc=raja.mani@oss.qualcomm.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.