From 90b24664bf5ce254068bd8b06ecea8ba4856d563 Mon Sep 17 00:00:00 2001 From: Kavitha Velayutham Date: Fri, 27 Sep 2019 17:58:14 +0530 Subject: [PATCH] [APR-2987]wlbt: HAL changes for COMMS TTL test scenarios Fixes for handling publish/subscribe TERMINATED event correctly in HAL SCSC-Bug-Id: HOST-11024 Change-Id: I4fc49c4e01ae418119b6bc2e3ac96e951b3bb92e Signed-off-by: Kavitha Velayutham --- wifi_nan.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/wifi_nan.cpp b/wifi_nan.cpp index 5e1ac12..8ef1ebf 100755 --- a/wifi_nan.cpp +++ b/wifi_nan.cpp @@ -368,9 +368,10 @@ class NanCommand : public WifiCommand { int processPublishTerminatedEvent(WifiEvent &event) { NanPublishTerminatedInd ind; + nlattr *vendor_data = event.get_attribute(NL80211_ATTR_VENDOR_DATA); memset(&ind,0,sizeof(ind)); - for(nl_iterator nl_itr((struct nlattr *)event.get_vendor_data()); nl_itr.has_next(); nl_itr.next()) { + for(nl_iterator nl_itr(vendor_data); nl_itr.has_next(); nl_itr.next()) { switch(nl_itr.get_type()) { case NAN_EVT_ATTR_PUBLISH_ID: ind.publish_id = nl_itr.get_u16(); @@ -378,6 +379,8 @@ class NanCommand : public WifiCommand { case NAN_EVT_ATTR_PUBLISH_REASON: ind.reason = (NanStatusType)nl_itr.get_u32(); break; + case NAN_EVT_ATTR_STATUS: + break; default : ALOGE("processPublishTerminatedEvent: unknown attribute(%d)", nl_itr.get_type()); return NL_SKIP; @@ -393,9 +396,10 @@ class NanCommand : public WifiCommand { int processSubscribeTerminatedEvent(WifiEvent &event) { NanSubscribeTerminatedInd ind; + nlattr *vendor_data = event.get_attribute(NL80211_ATTR_VENDOR_DATA); memset(&ind,0,sizeof(ind)); - for(nl_iterator nl_itr((struct nlattr *)event.get_vendor_data()); nl_itr.has_next(); nl_itr.next()) { + for(nl_iterator nl_itr(vendor_data); nl_itr.has_next(); nl_itr.next()) { switch(nl_itr.get_type()) { case NAN_EVT_ATTR_SUBSCRIBE_ID: ind.subscribe_id = nl_itr.get_u16(); @@ -403,6 +407,8 @@ class NanCommand : public WifiCommand { case NAN_EVT_ATTR_SUBSCRIBE_REASON: ind.reason = (NanStatusType)nl_itr.get_u32(); break; + case NAN_EVT_ATTR_STATUS: + break; default : ALOGE("processSubscribeTerminatedEvent: unknown attribute(%d)", nl_itr.get_type()); return NL_SKIP; -- 2.20.1