diff mbox

wpa_supplicant: Include frequencies in get_capability channels

Message ID 1364301936-9228-1-git-send-email-br1@einfach.org
State Changes Requested
Headers show

Commit Message

Bruno Randolf March 26, 2013, 12:45 p.m. UTC
Also print the frequencies in MHz in the "get_capability channels" command and
add a tag "NO_IBSS" if IBSS mode is not allowed on a channel.

Signed-hostap: Bruno Randolf <br1@einfach.org>
---
 wpa_supplicant/ctrl_iface.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Comments

Jouni Malinen March 30, 2013, 5:44 p.m. UTC | #1
On Tue, Mar 26, 2013 at 12:45:36PM +0000, Bruno Randolf wrote:
> Also print the frequencies in MHz in the "get_capability channels" command and
> add a tag "NO_IBSS" if IBSS mode is not allowed on a channel.

This control interface command may already be used by external programs
and changing the format of the returned information could result in
compatibility issues. As such, I don't think this is acceptable without
introducing a different way of fetching this new format (e.g.,
"get_capability freq").
Bruno Randolf April 5, 2013, 3:56 p.m. UTC | #2
On 03/30/2013 05:44 PM, Jouni Malinen wrote:
> On Tue, Mar 26, 2013 at 12:45:36PM +0000, Bruno Randolf wrote:
>> Also print the frequencies in MHz in the "get_capability channels" command and
>> add a tag "NO_IBSS" if IBSS mode is not allowed on a channel.
>
> This control interface command may already be used by external programs
> and changing the format of the returned information could result in
> compatibility issues. As such, I don't think this is acceptable without
> introducing a different way of fetching this new format (e.g.,
> "get_capability freq").

Thanks, I sent a new patch.

bruno
diff mbox

Patch

diff --git a/wpa_supplicant/ctrl_iface.c b/wpa_supplicant/ctrl_iface.c
index 5bcf748..5703a80 100644
--- a/wpa_supplicant/ctrl_iface.c
+++ b/wpa_supplicant/ctrl_iface.c
@@ -2917,7 +2917,7 @@  static int ctrl_iface_get_capability_channels(struct wpa_supplicant *wpa_s,
 		default:
 			continue;
 		}
-		ret = os_snprintf(pos, end - pos, "Mode[%s] Channels:", hmode);
+		ret = os_snprintf(pos, end - pos, "Mode[%s] Channels:\n", hmode);
 		if (ret < 0 || ret >= end - pos)
 			return pos - buf;
 		pos += ret;
@@ -2925,7 +2925,9 @@  static int ctrl_iface_get_capability_channels(struct wpa_supplicant *wpa_s,
 		for (i = 0; i < wpa_s->hw.modes[j].num_channels; i++) {
 			if (chnl[i].flag & HOSTAPD_CHAN_DISABLED)
 				continue;
-			ret = os_snprintf(pos, end - pos, " %d", chnl[i].chan);
+			ret = os_snprintf(pos, end - pos, " %d = %d MHz%s\n",
+					  chnl[i].chan, chnl[i].freq,
+					  chnl[i].flag & HOSTAPD_CHAN_NO_IBSS ? " (NO_IBSS)" : "");
 			if (ret < 0 || ret >= end - pos)
 				return pos - buf;
 			pos += ret;