From 4f20dd52ffa6b9ee43f3f6b9efa422e3aedfb779 Mon Sep 17 00:00:00 2001 From: Gokul Sivakumar Date: Wed, 26 Apr 2023 16:15:56 +0530 Subject: [PATCH] wpa_cli/hostapd_cli: Add driver_flags2 command Leverage the already available control socket cmd "DRIVER_FLAGS2" and dump the driver capab "flags2" bitmask on triggering the new CLI CMD "driver_flags2", similar to the already existing CLI CMD "driver_flags". $ hostapd_cli -i wlan0 driver_flags2 (OR) $ wpa_cli -i wlan0 driver_flags2 0000000000000020: BEACON_RATE_HE Signed-off-by: Gokul Sivakumar --- hostapd/hostapd_cli.c | 9 +++++++++ wpa_supplicant/wpa_cli.c | 10 ++++++++++ 2 files changed, 19 insertions(+) diff --git a/hostapd/hostapd_cli.c b/hostapd/hostapd_cli.c index 01fe34fa0..45497cd01 100644 --- a/hostapd/hostapd_cli.c +++ b/hostapd/hostapd_cli.c @@ -1393,6 +1393,13 @@ static int hostapd_cli_cmd_driver_flags(struct wpa_ctrl *ctrl, int argc, } +static int hostapd_cli_cmd_driver_flags2(struct wpa_ctrl *ctrl, int argc, + char *argv[]) +{ + return wpa_ctrl_command(ctrl, "DRIVER_FLAGS2"); +} + + #ifdef CONFIG_DPP static int hostapd_cli_cmd_dpp_qr_code(struct wpa_ctrl *ctrl, int argc, @@ -1728,6 +1735,8 @@ static const struct hostapd_cli_cmd hostapd_cli_commands[] = { " = send FTM range request"}, { "driver_flags", hostapd_cli_cmd_driver_flags, NULL, " = show supported driver flags"}, + { "driver_flags2", hostapd_cli_cmd_driver_flags2, NULL, + " = show supported driver flags2"}, #ifdef CONFIG_DPP { "dpp_qr_code", hostapd_cli_cmd_dpp_qr_code, NULL, "report a scanned DPP URI from a QR Code" }, diff --git a/wpa_supplicant/wpa_cli.c b/wpa_supplicant/wpa_cli.c index 72e5219fa..65078edf1 100644 --- a/wpa_supplicant/wpa_cli.c +++ b/wpa_supplicant/wpa_cli.c @@ -551,6 +551,13 @@ static int wpa_cli_cmd_driver_flags(struct wpa_ctrl *ctrl, int argc, } +static int wpa_cli_cmd_driver_flags2(struct wpa_ctrl *ctrl, int argc, + char *argv[]) +{ + return wpa_ctrl_command(ctrl, "DRIVER_FLAGS2"); +} + + static int wpa_cli_cmd_get(struct wpa_ctrl *ctrl, int argc, char *argv[]) { return wpa_cli_cmd(ctrl, "GET", 1, argc, argv); @@ -3384,6 +3391,9 @@ static const struct wpa_cli_cmd wpa_cli_commands[] = { { "driver_flags", wpa_cli_cmd_driver_flags, NULL, cli_cmd_flag_none, "= list driver flags" }, + { "driver_flags2", wpa_cli_cmd_driver_flags2, NULL, + cli_cmd_flag_none, + "= list driver flags2" }, { "logon", wpa_cli_cmd_logon, NULL, cli_cmd_flag_none, "= IEEE 802.1X EAPOL state machine logon" },