From 289fbe01c7096d74b3c63a4dd1f63495b464141a Mon Sep 17 00:00:00 2001 From: vemax78 Date: Wed, 28 May 2014 22:49:03 +0200 Subject: [PATCH] Fix error into wifi change frequency --- src/wtp/binding/ieee80211/wifi_nl80211.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/wtp/binding/ieee80211/wifi_nl80211.c b/src/wtp/binding/ieee80211/wifi_nl80211.c index 6f4796b..1a89d05 100644 --- a/src/wtp/binding/ieee80211/wifi_nl80211.c +++ b/src/wtp/binding/ieee80211/wifi_nl80211.c @@ -323,11 +323,6 @@ static int nl80211_device_changefrequency(struct wifi_device* device, struct wif ASSERT(device != NULL); ASSERT(freq != NULL); - /* Delay request if not found BSS interface */ - if (!device->wlanactive) { - return 0; - } - /* Search a valid interface */ for (wlansearch = device->wlans->first; wlansearch; wlansearch = wlansearch->next) { struct wifi_wlan* element = (struct wifi_wlan*)wlansearch->item; @@ -357,7 +352,9 @@ static int nl80211_device_changefrequency(struct wifi_device* device, struct wif /* Set wifi frequency */ result = nl80211_send_and_recv_msg(devicehandle->globalhandle, msg, NULL, NULL); - if (result) { + if (!result) { + capwap_logging_error("Change %s frequency %d", wlan->virtname, (int)freq->frequency); + } else { capwap_logging_error("Unable set frequency %d, error code: %d", (int)freq->frequency, result); } @@ -1484,6 +1481,11 @@ static int nl80211_device_setfrequency(struct wifi_device* device) { ASSERT(device != NULL); ASSERT(device->handle != NULL); + /* Delay request if not found BSS interface */ + if (!device->wlanactive) { + return 0; + } + return nl80211_device_changefrequency(device, &device->currentfrequency); }