From cab7253af0a8edba72c930465acdf6ae9b9e42fc Mon Sep 17 00:00:00 2001 From: Abhinav Kumar Date: Fri, 22 Nov 2019 12:19:22 +0530 Subject: [PATCH] qcacld-3.0: Set wdev for vendor event HANG_REASON_INDEX Supplicant delivers the HANG event via HIDL for STA and via a legacy socket interface for SAP standalone case. As per current supplicant implementation, wdev_id only matters when the HANG event gets processed via HIDL. Currently, for STA interface, host sends wdev as NULL to cfg80211_vendor_event_alloc, this allows userspace to process nl_cmd for QCA_NL80211_VENDOR_SUBCMD_HANG_REASON_INDEX event with the 1st interface which is p2p in supplicant instead of WLAN interface. Set wdev with the proper value for STA interface to avoid processing nl_cmd with P2P interface by userspace. Change-Id: If3c1b2e11daf682a6ef535014738f4b2a2b5d009 CRs-Fixed: 2580359 --- core/hdd/src/wlan_hdd_cfg80211.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c index f3a2f43726..a09fa117f7 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.c +++ b/core/hdd/src/wlan_hdd_cfg80211.c @@ -1056,6 +1056,8 @@ int wlan_hdd_send_hang_reason_event(struct hdd_context *hdd_ctx, { struct sk_buff *vendor_event; enum qca_wlan_vendor_hang_reason hang_reason; + struct hdd_adapter *sta_adapter; + struct wireless_dev *wdev = NULL; hdd_enter(); @@ -1064,8 +1066,12 @@ int wlan_hdd_send_hang_reason_event(struct hdd_context *hdd_ctx, return -EINVAL; } + sta_adapter = hdd_get_adapter(hdd_ctx, QDF_STA_MODE); + if (sta_adapter) + wdev = &(sta_adapter->wdev); + vendor_event = cfg80211_vendor_event_alloc(hdd_ctx->wiphy, - NULL, + wdev, sizeof(uint32_t), HANG_REASON_INDEX, GFP_KERNEL);