diff options
| author | Srinivas Girigowda <sgirigow@qca.qualcomm.com> | 2015-03-10 18:42:00 -0700 |
|---|---|---|
| committer | Satish Singh <c_ssing@qca.qualcomm.com> | 2015-03-27 19:32:20 -0700 |
| commit | 8162c65dfdf2d3261bffa3be223c2ef85982cfd5 (patch) | |
| tree | 31eda80eeff565dc90cea8e900700f5bf4a8b010 | |
| parent | e601097f0ebee5476a380a404f2d35032f608d54 (diff) | |
qcacld: extscan: Support for bssid hotlist ap_lost indication
Support for bssid hotlist ap_lost indication.
Change-Id: Ic3f43f8ee6925f3f8ec68e2d69085440dda043f3
CRs-Fixed: 813313
| -rw-r--r-- | CORE/HDD/src/wlan_hdd_cfg80211.c | 207 | ||||
| -rw-r--r-- | CORE/MAC/inc/sirApi.h | 3 | ||||
| -rw-r--r-- | CORE/SERVICES/WMA/wma.c | 22 |
3 files changed, 133 insertions, 99 deletions
diff --git a/CORE/HDD/src/wlan_hdd_cfg80211.c b/CORE/HDD/src/wlan_hdd_cfg80211.c index 84cc4290785e..0f62ccb89be1 100644 --- a/CORE/HDD/src/wlan_hdd_cfg80211.c +++ b/CORE/HDD/src/wlan_hdd_cfg80211.c @@ -1211,7 +1211,11 @@ static const struct nl80211_vendor_cmd_info wlan_hdd_cfg80211_vendor_events[] = .vendor_id = QCA_NL80211_VENDOR_ID, .subcmd = QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_RESET_SSID_HOTLIST }, -#endif + [QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_HOTLIST_AP_LOST_INDEX] = { + .vendor_id = QCA_NL80211_VENDOR_ID, + .subcmd = QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_HOTLIST_AP_LOST + }, +#endif /* FEATURE_WLAN_EXTSCAN */ }; static int is_driver_dfs_capable(struct wiphy *wiphy, @@ -2056,6 +2060,16 @@ static int wlan_hdd_cfg80211_extscan_set_bssid_hotlist(struct wiphy *wiphy, tb[QCA_WLAN_VENDOR_ATTR_EXTSCAN_BSSID_HOTLIST_PARAMS_NUM_AP]); hddLog(VOS_TRACE_LEVEL_INFO, FL("Number of AP (%d)"), pReqMsg->numAp); + /* Parse and fetch lost ap sample size */ + if (!tb[QCA_WLAN_VENDOR_ATTR_EXTSCAN_SIGNIFICANT_CHANGE_PARAMS_LOST_AP_SAMPLE_SIZE]) { + hddLog(LOGE, FL("attr lost ap sample size failed")); + goto fail; + } + + pReqMsg->lost_ap_sample_size = nla_get_u32( + tb[QCA_WLAN_VENDOR_ATTR_EXTSCAN_SIGNIFICANT_CHANGE_PARAMS_LOST_AP_SAMPLE_SIZE]); + hddLog(LOG1, FL("Lost ap sample size (%d)"), pReqMsg->lost_ap_sample_size); + pReqMsg->sessionId = pAdapter->sessionId; hddLog(VOS_TRACE_LEVEL_INFO, FL("Session Id (%d)"), pReqMsg->sessionId); @@ -17932,118 +17946,123 @@ fail: static void wlan_hdd_cfg80211_extscan_hotlist_match_ind(void *ctx, - struct extscan_hotlist_match *pData) + struct extscan_hotlist_match *data) { - hdd_context_t *pHddCtx = (hdd_context_t *)ctx; - struct sk_buff *skb = NULL; - tANI_U32 i; + hdd_context_t *pHddCtx = ctx; + struct sk_buff *skb = NULL; + uint32_t i, index; - ENTER(); + ENTER(); - if (wlan_hdd_validate_context(pHddCtx) || !pData) { - hddLog(VOS_TRACE_LEVEL_ERROR, FL("HDD context is not valid " - "or pData(%p) is null"), pData); - return; - } + if (wlan_hdd_validate_context(pHddCtx) || !data) { + hddLog(LOGE, FL("HDD context is invalid or data(%p) is null"), + data); + return; + } - skb = cfg80211_vendor_event_alloc(pHddCtx->wiphy, + if (data->ap_found) + index = QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_HOTLIST_AP_FOUND_INDEX; + else + index = QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_HOTLIST_AP_LOST_INDEX; + + skb = cfg80211_vendor_event_alloc(pHddCtx->wiphy, NULL, EXTSCAN_EVENT_BUF_SIZE + NLMSG_HDRLEN, - QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_HOTLIST_AP_FOUND_INDEX, - GFP_KERNEL); + index, GFP_KERNEL); - if (!skb) { - hddLog(VOS_TRACE_LEVEL_ERROR, - FL("cfg80211_vendor_event_alloc failed")); - return; - } - hddLog(VOS_TRACE_LEVEL_INFO, "Req Id (%u)", pData->requestId); - hddLog(VOS_TRACE_LEVEL_INFO, "Num results (%u)", pData->numOfAps); - hddLog(VOS_TRACE_LEVEL_INFO, "More Data (%u)", pData->moreData); + if (!skb) { + hddLog(LOGE, FL("cfg80211_vendor_event_alloc failed")); + return; + } + hddLog(LOG1, "Req Id (%u) Num results (%u)", + data->requestId, data->numOfAps); + hddLog(LOG1, "More Data (%u) ap_found (%u)", + data->moreData, data->ap_found); - for (i = 0; i < pData->numOfAps; i++) { - hddLog(VOS_TRACE_LEVEL_INFO, "[index=%d] Timestamp(0x%llX) " - "Ssid (%s) " - "Bssid (" MAC_ADDRESS_STR ") " - "Channel (%u) " - "Rssi (%d) " - "RTT (%u) " - "RTT_SD (%u)", - i, - pData->ap[i].ts, - pData->ap[i].ssid, - MAC_ADDR_ARRAY(pData->ap[i].bssid), - pData->ap[i].channel, - pData->ap[i].rssi, - pData->ap[i].rtt, - pData->ap[i].rtt_sd); - } + for (i = 0; i < data->numOfAps; i++) { + hddLog(LOG1, "[index=%d] Timestamp(0x%llX) " + "Ssid (%s) " + "Bssid (" MAC_ADDRESS_STR ") " + "Channel (%u) " + "Rssi (%d) " + "RTT (%u) " + "RTT_SD (%u)", + i, + data->ap[i].ts, + data->ap[i].ssid, + MAC_ADDR_ARRAY(data->ap[i].bssid), + data->ap[i].channel, + data->ap[i].rssi, + data->ap[i].rtt, + data->ap[i].rtt_sd); + } - if (nla_put_u32(skb, QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_REQUEST_ID, - pData->requestId) || - nla_put_u32(skb, - QCA_WLAN_VENDOR_ATTR_EXTSCAN_NUM_RESULTS_AVAILABLE, - pData->numOfAps)) { - hddLog(VOS_TRACE_LEVEL_ERROR, FL("put fail")); - goto fail; - } + if (nla_put_u32(skb, + QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_REQUEST_ID, + data->requestId) || + nla_put_u32(skb, + QCA_WLAN_VENDOR_ATTR_EXTSCAN_NUM_RESULTS_AVAILABLE, + data->numOfAps)) { + hddLog(LOGE, FL("put fail")); + goto fail; + } - if (pData->numOfAps) { - struct nlattr *aps; + if (data->numOfAps) { + struct nlattr *aps; - aps = nla_nest_start(skb, QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_LIST); - if (!aps) - goto fail; + aps = nla_nest_start(skb, + QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_LIST); + if (!aps) + goto fail; - for (i = 0; i < pData->numOfAps; i++) { - struct nlattr *ap; + for (i = 0; i < data->numOfAps; i++) { + struct nlattr *ap; - ap = nla_nest_start(skb, i); - if (!ap) - goto fail; + ap = nla_nest_start(skb, i); + if (!ap) + goto fail; - if (nla_put_u64(skb, - QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_TIME_STAMP, - pData->ap[i].ts) || - nla_put(skb, - QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_SSID, - sizeof(pData->ap[i].ssid), - pData->ap[i].ssid) || - nla_put(skb, - QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_BSSID, - sizeof(pData->ap[i].bssid), - pData->ap[i].bssid) || - nla_put_u32(skb, - QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_CHANNEL, - pData->ap[i].channel) || - nla_put_s32(skb, - QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_RSSI, - pData->ap[i].rssi) || - nla_put_u32(skb, - QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_RTT, - pData->ap[i].rtt) || - nla_put_u32(skb, - QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_RTT_SD, - pData->ap[i].rtt_sd)) - goto fail; + if (nla_put_u64(skb, + QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_TIME_STAMP, + data->ap[i].ts) || + nla_put(skb, + QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_SSID, + sizeof(data->ap[i].ssid), + data->ap[i].ssid) || + nla_put(skb, + QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_BSSID, + sizeof(data->ap[i].bssid), + data->ap[i].bssid) || + nla_put_u32(skb, + QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_CHANNEL, + data->ap[i].channel) || + nla_put_s32(skb, + QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_RSSI, + data->ap[i].rssi) || + nla_put_u32(skb, + QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_RTT, + data->ap[i].rtt) || + nla_put_u32(skb, + QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_RTT_SD, + data->ap[i].rtt_sd)) + goto fail; - nla_nest_end(skb, ap); - } - nla_nest_end(skb, aps); + nla_nest_end(skb, ap); + } + nla_nest_end(skb, aps); - if (nla_put_u8(skb, - QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_MORE_DATA, - pData->moreData)) - goto fail; - } + if (nla_put_u8(skb, + QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_MORE_DATA, + data->moreData)) + goto fail; + } - cfg80211_vendor_event(skb, GFP_KERNEL); - return; + cfg80211_vendor_event(skb, GFP_KERNEL); + return; fail: - kfree_skb(skb); - return; - + kfree_skb(skb); + return; } /** diff --git a/CORE/MAC/inc/sirApi.h b/CORE/MAC/inc/sirApi.h index d249ddf17b44..8a4b8c5c0a31 100644 --- a/CORE/MAC/inc/sirApi.h +++ b/CORE/MAC/inc/sirApi.h @@ -4977,8 +4977,9 @@ typedef struct struct extscan_hotlist_match { uint32_t requestId; - uint32_t numOfAps; bool moreData; + bool ap_found; + uint32_t numOfAps; tSirWifiScanResult ap[]; }; diff --git a/CORE/SERVICES/WMA/wma.c b/CORE/SERVICES/WMA/wma.c index 8d9aba2a3bb4..d4c312072e37 100644 --- a/CORE/SERVICES/WMA/wma.c +++ b/CORE/SERVICES/WMA/wma.c @@ -2879,8 +2879,8 @@ static int wma_extscan_hotlist_match_event_handler(void *handle, struct extscan_hotlist_match *dest_hotlist; tSirWifiScanResult *dest_ap; wmi_extscan_wlan_descriptor *src_hotlist; - int numap; - int j; + int numap, j, ap_found = 0; + tpAniSirGlobal pMac = (tpAniSirGlobal )vos_get_context( VOS_MODULE_ID_PE, wma->vos_context); if (!pMac) { @@ -2915,13 +2915,24 @@ static int wma_extscan_hotlist_match_event_handler(void *handle, dest_ap = &dest_hotlist->ap[0]; dest_hotlist->numOfAps = event->total_entries; dest_hotlist->requestId = event->config_request_id; + if (event->first_entry_index + + event->num_entries_in_page < event->total_entries) + dest_hotlist->moreData = 1; + else + dest_hotlist->moreData = 0; + WMA_LOGD("%s: Hotlist match: requestId: 0x%x," "numOfAps: %d", __func__, dest_hotlist->requestId, dest_hotlist->numOfAps); + /* + * Currently firmware sends only one bss information in-case + * of both hotlist ap found and lost. + */ for (j = 0; j < numap; j++) { dest_ap->channel = src_hotlist->channel; dest_ap->ts = src_hotlist->tstamp; + ap_found = src_hotlist->flags & WMI_HOTLIST_FLAG_PRESENCE; dest_ap->rtt = src_hotlist->rtt; dest_ap->rtt_sd = src_hotlist->rtt_sd; dest_ap->beaconPeriod = src_hotlist->beacon_interval; @@ -2935,6 +2946,7 @@ static int wma_extscan_hotlist_match_event_handler(void *handle, dest_ap++; src_hotlist++; } + dest_hotlist->ap_found = ap_found; pMac->sme.pExtScanIndCb(pMac->hHdd, eSIR_EXTSCAN_HOTLIST_MATCH_IND, dest_hotlist); @@ -22623,11 +22635,13 @@ VOS_STATUS wma_get_buf_extscan_hotlist_cmd(tp_wma_handle wma_handle, cmd->total_entries = numap; cmd->mode = 1; cmd->num_entries_in_page = min_entries; + cmd->lost_ap_scan_count = photlist->lost_ap_sample_size; cmd->first_entry_index = index; - WMA_LOGD("%s: vdev id:%d total_entries: %d num_entries: %d", + WMA_LOGD("%s: vdev id:%d total_entries: %d num_entries: %d lost_ap_sample_size: %d", __func__, cmd->vdev_id, cmd->total_entries, - cmd->num_entries_in_page); + cmd->num_entries_in_page, + cmd->lost_ap_scan_count); buf_ptr += sizeof(*cmd); WMITLV_SET_HDR(buf_ptr, |
