[APR-2987]wlbt: HAL changes for COMMS TTL test scenarios
authorKavitha Velayutham <k.velayutham@samsung.com>
Fri, 27 Sep 2019 12:28:14 +0000 (17:58 +0530)
committerchenyt17 <chenyt17@lenovo.com>
Fri, 28 May 2021 05:27:08 +0000 (13:27 +0800)
Fixes for handling publish/subscribe  TERMINATED event correctly in HAL

SCSC-Bug-Id: HOST-11024

Change-Id: I4fc49c4e01ae418119b6bc2e3ac96e951b3bb92e
Signed-off-by: Kavitha Velayutham <k.velayutham@samsung.com>
wifi_nan.cpp

index 5e1ac12989f5622c60f365e1181c5413a5d738c3..8ef1ebf68830467a42f735ff71dc6ac2842f822e 100755 (executable)
@@ -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;