From: Kavitha Velayutham Date: Fri, 27 Sep 2019 12:28:14 +0000 (+0530) Subject: [APR-2987]wlbt: HAL changes for COMMS TTL test scenarios X-Git-Tag: MMI-QSBS30.62-29-11-5~3 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=b31c4ffd86cf879e70e6c5d02ef3180f0749aa82;p=GitHub%2FMotorolaMobilityLLC%2Fhardware-samsung_slsi-scsc_wifibt-wifi_hal.git [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 --- 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;