if (g_onoff == G_WLAN_SET_ON) {
- band = *(extra + strlen(BAND_SET_CMD) + 1) - '0';
+ band = htod32((uint)*(extra + strlen(BAND_SET_CMD) + 1) - '0');
if ((band == WLC_BAND_AUTO) || (band == WLC_BAND_5G) || (band == WLC_BAND_2G)) {
WL_TRACE(("%s: set band %d OK\n", __FUNCTION__, band));
goto exit;
}
- else WL_ERROR(("%s: set band %d failed code %d\n", __FUNCTION__, \
+ else WL_ERROR(("%s: set band %d failed code %d\n", __FUNCTION__, \
band, error));
}
- else WL_ERROR(("%s Incorrect band setting, ignored\n", __FUNCTION__));
+ else WL_ERROR(("%s Incorrect band setting %d, ignored\n", __FUNCTION__, band));
}
p += snprintf(p, MAX_WX_STRING, "FAIL");
wl_iw_send_priv_event(dev, "START");
-#if !defined(CSCAN)
#ifdef SOFTAP
if (!ap_fw_loaded) {
wl_iw_iscan_set_scan_broadcast_prep(dev, 0);
}
#else
wl_iw_iscan_set_scan_broadcast_prep(dev, 0);
-#endif
#endif
WL_TRACE(("Exited %s \n", __FUNCTION__));
wl_iscan_results_t list;
wl_scan_results_t *results;
uint32 status;
+ int res;
mutex_lock(&wl_cache_lock);
if (iscan->list_cur) {
memset(&list, 0, sizeof(list));
list.results.buflen = htod32(WLC_IW_ISCAN_MAXLEN);
- (void) dev_iw_iovar_getbuf(
+ res = dev_iw_iovar_getbuf(
iscan->dev,
"iscanresults",
&list,
WL_ISCAN_RESULTS_FIXED_SIZE,
buf->iscan_buf,
WLC_IW_ISCAN_MAXLEN);
- results->buflen = dtoh32(results->buflen);
- results->version = dtoh32(results->version);
- results->count = dtoh32(results->count);
- WL_SCAN(("results->count = %d\n", results->count));
-
- WL_SCAN(("results->buflen = %d\n", results->buflen));
- status = dtoh32(list_buf->status);
+ if (res == 0) {
+ results->buflen = dtoh32(results->buflen);
+ results->version = dtoh32(results->version);
+ results->count = dtoh32(results->count);
+ WL_SCAN(("results->count = %d\n", results->count));
+
+ WL_SCAN(("results->buflen = %d\n", results->buflen));
+ status = dtoh32(list_buf->status);
+ } else {
+ WL_ERROR(("%s returns error %d\n", __FUNCTION__, res));
+ status = WL_SCAN_RESULTS_NO_MEM;
+ }
mutex_unlock(&wl_cache_lock);
return status;
}
memset(&wrqu, 0, sizeof(wrqu));
wireless_send_event(iscan->dev, SIOCGIWSCAN, &wrqu, NULL);
-#if !defined(CSCAN)
if (g_first_broadcast_scan == BROADCAST_SCAN_FIRST_STARTED)
g_first_broadcast_scan = BROADCAST_SCAN_FIRST_RESULT_READY;
-#endif
WL_TRACE(("Send Event ISCAN complete\n"));
#endif
}
}
leaf = kmalloc(bi->length + WLC_IW_SS_CACHE_CTRL_FIELD_MAXLEN, GFP_KERNEL);
if (!leaf) {
+ WL_ERROR(("Memory alloc failure %d\n", \
+ bi->length + WLC_IW_SS_CACHE_CTRL_FIELD_MAXLEN));
mutex_unlock(&wl_cache_lock);
return -ENOMEM;
}
wlc_ssid_t ssid;
iscan_info_t *iscan = g_iscan;
-#if !defined(CSCAN)
if (g_first_broadcast_scan == BROADCAST_SCAN_FIRST_IDLE) {
g_first_broadcast_scan = BROADCAST_SCAN_FIRST_STARTED;
WL_TRACE(("%s: First Brodcast scan was forced\n", __FUNCTION__));
WL_TRACE(("%s: ignore ISCAN request first BS is not done yet\n", __FUNCTION__));
return 0;
}
-#endif
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27))
if (flag)
return -EINVAL;
}
-#if !defined(CSCAN)
if (g_first_broadcast_scan < BROADCAST_SCAN_FIRST_RESULT_READY) {
WL_TRACE(("%s %s: first ISCAN results are NOT ready yet \n", \
dev->name, __FUNCTION__));
return -EAGAIN;
}
-#endif
-
+
if ((!iscan) || (iscan->sysioc_pid < 0)) {
WL_TRACE(("%ssysioc_pid\n", __FUNCTION__));
return wl_iw_get_scan(dev, info, dwrq, extra);
dwrq->length += merged_len;
wl_iw_run_ss_cache_timer(0);
wl_iw_run_ss_cache_timer(1);
-
+#endif /* CSCAN */
g_first_broadcast_scan = BROADCAST_SCAN_FIRST_RESULT_CONSUMED;
-#endif
WL_TRACE(("%s return to WE %d bytes APs=%d\n", __FUNCTION__, dwrq->length, counter));
if ((!dev) && (!g_iscan) && (!iscan->iscan_ex_params_p)) {
WL_ERROR(("%s error exit\n", __FUNCTION__));
err = -1;
+ goto exit;
+ }
+
+ if (g_first_broadcast_scan < BROADCAST_SCAN_FIRST_RESULT_CONSUMED) {
+ WL_ERROR(("%s First ISCAN in progress : ignoring\n", __FUNCTION__));
+ goto exit;
}
params_size += WL_SCAN_PARAMS_SSID_MAX * sizeof(wlc_ssid_t);
get_parmeter_from_string(&str_ptr, GET_SCAN_TYPE, PTYPE_INTDEC, \
&iscan->iscan_ex_params_p->params.scan_type, 1);
-
res = wl_iw_combined_scan_set(dev, ssids_local, nssid, nchan);
} else {
goto exit_proc;
}
-
res = wl_iw_combined_scan_set(dev, ssids_local, nssid, nchan);
exit_proc: