anchao commented on code in PR #6466: URL: https://github.com/apache/incubator-nuttx/pull/6466#discussion_r900784582
########## drivers/wireless/ieee80211/bcm43xxx/bcmf_driver.c: ########## @@ -666,300 +669,247 @@ void bcmf_wl_scan_event_handler(FAR struct bcmf_dev_s *priv, /* Process escan result payload */ - result = (struct wl_escan_result *)&event[1]; + result = (FAR struct wl_escan_result *)&event[1]; if (len < result->buflen || result->buflen < sizeof(struct wl_escan_result)) { goto exit_invalid_frame; } - /* wl_escan_result structure contains a wl_bss_info field */ - - len = result->buflen - sizeof(struct wl_escan_result) - + sizeof(struct wl_bss_info); + bss = result->bss_info; /* Process bss_infos */ - bss = result->bss_info; - - while (len > 0 && bss_count < result->bss_count) + for (i = 0; i < result->bss_count; i++) { - struct iw_event *iwe; - unsigned int result_size; - size_t essid_len; - size_t essid_len_aligned; - uint8_t *ie_buffer; - unsigned int ie_offset; - unsigned int check_offset; + worst_entries = -1; + worst_rssi = 0; - result_size = BCMF_SCAN_RESULT_SIZE - priv->scan_result_size; - bss_info_len = bss->length; + wlinfo("Scan result: <%.32s> " + "%02x:%02x:%02x:%02x:%02x:%02x " + "signal %d %d %d\n", + bss->SSID, + bss->BSSID.ether_addr_octet[0], + bss->BSSID.ether_addr_octet[1], + bss->BSSID.ether_addr_octet[2], + bss->BSSID.ether_addr_octet[3], + bss->BSSID.ether_addr_octet[4], + bss->BSSID.ether_addr_octet[5], + bss->RSSI, bss->phy_noise, bss->SNR); - if (len < bss_info_len) + for (j = 0; j < priv->scan_result_entries; j++) { - wlerr("bss_len error %d %d\n", len, bss_info_len); - goto exit_invalid_frame; - } - - /* Append current bss_info to priv->scan_results - * FIXME protect this against race conditions - */ + curr = &priv->scan_result[j]; - /* Check if current bss AP is not already detected */ + /* Find worst rssi and mark the entries */ Review Comment: Done ########## drivers/wireless/ieee80211/bcm43xxx/bcmf_driver.c: ########## @@ -666,300 +669,247 @@ void bcmf_wl_scan_event_handler(FAR struct bcmf_dev_s *priv, /* Process escan result payload */ - result = (struct wl_escan_result *)&event[1]; + result = (FAR struct wl_escan_result *)&event[1]; if (len < result->buflen || result->buflen < sizeof(struct wl_escan_result)) { goto exit_invalid_frame; } - /* wl_escan_result structure contains a wl_bss_info field */ - - len = result->buflen - sizeof(struct wl_escan_result) - + sizeof(struct wl_bss_info); + bss = result->bss_info; Review Comment: done -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org