Currently, setting RTS threshold changes the threshold for all radios in a
multi-radio wiphy. But different radios in a multi-radio wiphy can have
different RTS threshold requirements. Modify the iw command to get radio
index from user to operate on per-radio attributes in a multi-radio wiphy.
Modify the command such that the legacy userspace will still interact with
traditional drivers as well as multi-radio wiphy drivers. Also, print the
RTS threshold along with other per-radio attributes for each radio under
the section - "Supported wiphy radios" in iw phy#XXX info command.
In order to be able to set RTS threshold for a particular radio from user
space, without disturbing the other radios in a wiphy, pass the radio
index for which RTS threshold needs to be changed as optional pair of
arguments, along with its corresponding RTS threshold value. The valid
radio index values can be checked in iw phy#XXX info, under "Supported
wiphy radios". If radio index is not available, i.e., in case of single
radio wiphy, passing radio index is not required. If the radio index is not
provided, then the current behavior of setting passed RTS threshold to all
radios will be retained.
Command Usage:
iw phyX set rts <rts threshold|off> [radio <radio index>]
Sample output:
root@buildroot:~# iw phyXXX info
Wiphy phy0
wiphy index: 0
max # scan SSIDs: 16
max scan IEs length: 339 bytes
RTS threshold: 536
Retry short limit: 7
Retry long limit: 4
.....
Supported wiphy radios:
* Idx 0:
RTS Threshold: 536
Frequency Range: 5170 MHz - 5835 MHz
.....
* Idx 1:
RTS Threshold: 231
Frequency Range: 2312 MHz - 2732 MHz
.....
* Idx 2:
RTS Threshold: 425
Frequency Range: 5945 MHz - 7125 MHz
.....
Globally valid interface combinations:
.....
Signed-off-by: Roopni Devanathan <quic_rdevanat@quicinc.com>
Link: https://patch.msgid.link/20250718102659.111058-1-quic_rdevanat@quicinc.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
if (!have_combinations)
printf("\t\t\tRadio level interface combinations are not supported\n");
break;
+ case NL80211_WIPHY_RADIO_ATTR_RTS_THRESHOLD:
+ printf("\t\t\tRTS Threshold: %d\n",
+ nla_get_u32(radio_prop));
+ break;
default:
printf("\t\t\t* <failed to parse>\n");
}
enum id_input id)
{
unsigned int rts;
+ char *end;
- if (argc != 1)
+ if (argc != 1 && argc != 3)
return 1;
if (strcmp("off", argv[0]) == 0)
rts = -1;
else {
- char *end;
-
if (!*argv[0])
return 1;
rts = strtoul(argv[0], &end, 10);
NLA_PUT_U32(msg, NL80211_ATTR_WIPHY_RTS_THRESHOLD, rts);
+ argv++;
+ argc--;
+
+ if (argc > 1 && strcmp("radio", argv[0]) == 0) {
+ int radio_idx;
+
+ argv++;
+ argc--;
+
+ radio_idx = strtoul(argv[0], &end, 10);
+ if (*end != '\0')
+ return 1;
+
+ NLA_PUT_U8(msg, NL80211_ATTR_WIPHY_RADIO_INDEX, radio_idx);
+ argv++;
+ argc--;
+ }
+
+ if (argc)
+ return 1;
+
return 0;
nla_put_failure:
return -ENOBUFS;
}
-COMMAND(set, rts, "<rts threshold|off>",
+COMMAND(set, rts, "<rts threshold|off> [radio <radio index>]",
NL80211_CMD_SET_WIPHY, 0, CIB_PHY, handle_rts,
"Set rts threshold.");