Fix error into wifi change frequency

This commit is contained in:
vemax78 2014-05-28 22:49:03 +02:00
parent 3573dd4251
commit 289fbe01c7
1 changed files with 8 additions and 6 deletions

View File

@ -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);
}