Skip to content

Commit 8616f50

Browse files
authored
RDKB-62199: Increasing the MAX_SCANNED_VAPS macro for DPP scanning (#652)
RDKB-62199: Increasing the MAX_SCANNED_VAPS macro for DPP scanning Reason for change: The BSS scan results are getting truncated to 32 max results. Have changed the BSS results to be in dynamic mem to reduce stack memory. Test Procedure: Ensure that the scan for CCE IEs were successful Risks: Medium Priority: P1 Signed-off-by: sriraaman-c <[email protected]>
1 parent ac68fc8 commit 8616f50

File tree

3 files changed

+24
-12
lines changed

3 files changed

+24
-12
lines changed

build/openwrt/makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ include makefile.inc
3232
EASY_MESH_NODE = 1
3333
EM_APP = 1
3434
ONEWIFI_STA_MGR_APP_SUPPORT = 1
35+
ONEWIFI_EASYCONNECT_APP_SUPPORT = 1
3536

3637
# wifi hal rules
3738
HAL_LIBRARY = $(INSTALLDIR)/lib/libwifihal.a
@@ -489,7 +490,7 @@ ALL_HEBUS_LIB_OBJECTS = $(HEBUS_OBJECTS)
489490
ALLOBJECTS = $(CXXOBJECTS) $(COBJECTS) $(WEBCONFIG_OBJECTS) $(HEBUS_OBJECTS)
490491

491492
CFLAGS += $(INCLUDEDIRS) $(INCLUDE_HE_LIB_DIRS) -g -Os -fPIC -D_ANSC_LINUX -D_COSA_INTEL_USG_ATOM_ -DUSE_NOTIFY_COMPONENT -DCISCO_XB3_PLATFORM_CHANGES -DDUAL_CORE_XB3 -DFEATURE_ONE_WIFI -DWIFI_HAL_VERSION_3 -DFEATURE_SUPPORT_PASSPOINT -DFEATURE_SUPPORT_WEBCONFIG -DBANANA_PI_PORT -DNL80211_ACL -D_PLATFORM_BANANAPI_R4_ -DFEATURE_SINGLE_PHY -DEASY_MESH_NODE -DEM_APP \
492-
-DONEWIFI_STA_MGR_APP_SUPPORT
493+
-DONEWIFI_STA_MGR_APP_SUPPORT -DONEWIFI_EASYCONNECT_APP_SUPPORT
493494

494495
ifneq ($(OS), Darwin)
495496
CFLAGS += -DPLATFORM_LINUX

include/wifi_base.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,7 @@ typedef struct {
413413
char wps_pin[10];
414414
} __attribute__((__packed__)) wps_pin_config_t;
415415

416-
#define MAX_SCANNED_VAPS 32
416+
#define MAX_SCANNED_VAPS 200
417417

418418
typedef struct {
419419
unsigned int radio_index;

source/core/wifi_ctrl.c

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1060,27 +1060,38 @@ int start_wifi_health_monitor_thread(void)
10601060

10611061
int scan_results_callback(int radio_index, wifi_bss_info_t **bss, unsigned int *num)
10621062
{
1063-
scan_results_t res;
1064-
1065-
memset(&res, 0, sizeof(scan_results_t));
1066-
1067-
res.radio_index = radio_index;
1063+
scan_results_t *res;
10681064

10691065
if (*num) {
10701066
// if number of scanned AP's is more than size of res.bss array - truncate
10711067
if (*num > MAX_SCANNED_VAPS){
10721068
*num = MAX_SCANNED_VAPS;
10731069
}
1074-
res.num = *num;
1075-
memcpy((unsigned char *)res.bss, (unsigned char *)(*bss), (*num)*sizeof(wifi_bss_info_t));
10761070
}
1071+
1072+
res = (scan_results_t *)calloc(1, sizeof(scan_results_t));
1073+
if(!res) {
1074+
wifi_util_dbg_print(WIFI_CTRL,"%s:%d Failed to allocate memory for scan_results_t\n", __FUNCTION__, __LINE__);
1075+
return RETURN_ERR;
1076+
}
1077+
1078+
res->radio_index = radio_index;
1079+
res->num = *num;
1080+
memcpy((unsigned char *)res->bss, (unsigned char *)(*bss), (*num)*sizeof(wifi_bss_info_t));
1081+
10771082
if (is_sta_enabled()) {
1078-
push_event_to_ctrl_queue(&res, sizeof(scan_results_t), wifi_event_type_hal_ind,
1079-
wifi_event_scan_results, NULL);
1083+
if(push_event_to_ctrl_queue(res, sizeof(scan_results_t), wifi_event_type_hal_ind,
1084+
wifi_event_scan_results, NULL) != RETURN_OK) {
1085+
wifi_util_error_print(WIFI_CTRL,"%s:%d Failed to push scan_results to queue\n", __FUNCTION__, __LINE__);
1086+
free(*bss);
1087+
free(res);
1088+
return RETURN_ERR;
1089+
}
10801090
}
10811091
free(*bss);
1092+
free(res);
10821093

1083-
return 0;
1094+
return RETURN_OK;
10841095
}
10851096

10861097
void sta_connection_handler(const char *vif_name, wifi_bss_info_t *bss_info, wifi_station_stats_t *sta)

0 commit comments

Comments
 (0)