From 335074e703f94cb39d21975df0c8abe2424dc39b Mon Sep 17 00:00:00 2001 From: Abhinav Kumar Date: Thu, 21 Nov 2019 17:29:44 +0530 Subject: [PATCH] qcacld-3.0: Set wdev for vendor event BEACON_REPORTING_INDEX Currently host sends wdev as NULL to cfg80211_vendor_event_alloc, this allows userspace to process nl_cmd for QCA_NL80211_VENDOR_SUBCMD_BEACON_REPORTING_INDEX event with P2P interface instead of WLAN. Set wdev with proper value to avoid processing nl_cmd with P2P interface by userspace. Change-Id: If0b99efdc76c1f89b6b07ee72edc6c5e2994a90c CRs-Fixed: 2568776 --- core/hdd/src/wlan_hdd_bcn_recv.c | 9 +++++++-- core/mac/inc/sir_api.h | 2 ++ core/mac/src/pe/sch/sch_beacon_process.c | 2 ++ 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/core/hdd/src/wlan_hdd_bcn_recv.c b/core/hdd/src/wlan_hdd_bcn_recv.c index e16de6e8cb75..b30436590ced 100644 --- a/core/hdd/src/wlan_hdd_bcn_recv.c +++ b/core/hdd/src/wlan_hdd_bcn_recv.c @@ -126,15 +126,20 @@ static void hdd_send_bcn_recv_info(hdd_handle_t hdd_handle, struct hdd_context *hdd_ctx = hdd_handle_to_context(hdd_handle); uint32_t data_len; int flags = cds_get_gfp_flags(); + struct hdd_adapter *adapter; if (wlan_hdd_validate_context(hdd_ctx)) return; data_len = get_beacon_report_data_len(beacon_report); + adapter = hdd_get_adapter_by_vdev(hdd_ctx, beacon_report->vdev_id); + if (hdd_validate_adapter(adapter)) + return; + vendor_event = cfg80211_vendor_event_alloc( - hdd_ctx->wiphy, NULL, + hdd_ctx->wiphy, &(adapter->wdev), data_len, QCA_NL80211_VENDOR_SUBCMD_BEACON_REPORTING_INDEX, flags); @@ -423,7 +428,7 @@ void hdd_beacon_recv_pause_indication(hdd_handle_t hdd_handle, vendor_event = cfg80211_vendor_event_alloc( - hdd_ctx->wiphy, NULL, + hdd_ctx->wiphy, &(adapter->wdev), data_len, QCA_NL80211_VENDOR_SUBCMD_BEACON_REPORTING_INDEX, flags); diff --git a/core/mac/inc/sir_api.h b/core/mac/inc/sir_api.h index a9dfd564826a..9d1733839172 100644 --- a/core/mac/inc/sir_api.h +++ b/core/mac/inc/sir_api.h @@ -193,6 +193,7 @@ struct rsn_caps { /** * struct wlan_beacon_report - Beacon info to be send to userspace + * @vdev_id: vdev id * @ssid: ssid present in beacon * @bssid: bssid present in beacon * @frequency: channel frequency in MHz @@ -201,6 +202,7 @@ struct rsn_caps { * @boot_time: Boot time when beacon received */ struct wlan_beacon_report { + uint8_t vdev_id; struct wlan_ssid ssid; struct qdf_mac_addr bssid; uint32_t frequency; diff --git a/core/mac/src/pe/sch/sch_beacon_process.c b/core/mac/src/pe/sch/sch_beacon_process.c index 4ed7f7305b19..a2c2d42d1b15 100644 --- a/core/mac/src/pe/sch/sch_beacon_process.c +++ b/core/mac/src/pe/sch/sch_beacon_process.c @@ -1113,6 +1113,8 @@ void sch_send_beacon_report(struct mac_context *mac_ctx, qdf_do_div(qdf_get_monotonic_boottime(), QDF_MC_TIMER_TO_MS_UNIT); + beacon_report.vdev_id = session->vdev_id; + /* Send report to upper layer */ mac_ctx->lim.sme_bcn_rcv_callback(mac_ctx->hdd_handle, &beacon_report);