Wifi-Hal: Enable SSI in SDEA

Bug: 35193423
Change-Id: Ib817c352c2ae720fa09e9ab43226a100ceca943b
diff --git a/qcwcn/wifi_hal/nan_i.h b/qcwcn/wifi_hal/nan_i.h
index 87f6b7d..640a831 100644
--- a/qcwcn/wifi_hal/nan_i.h
+++ b/qcwcn/wifi_hal/nan_i.h
@@ -167,6 +167,7 @@
     NAN_TLV_TYPE_NAN20_RANGING_REQUEST = 24,
     NAN_TLV_TYPE_NAN20_RANGING_RESULT = 25,
     NAN_TLV_TYPE_NAN20_RANGING_REQUEST_RECEIVED = 26,
+    NAN_TLV_TYPE_SDEA_SERVICE_SPECIFIC_INFO = 28,
     NAN_TLV_TYPE_SDF_LAST = 4095,
 
     /* Configuration types */
diff --git a/qcwcn/wifi_hal/nan_ind.cpp b/qcwcn/wifi_hal/nan_ind.cpp
index 7d937c1..0f6167c 100644
--- a/qcwcn/wifi_hal/nan_ind.cpp
+++ b/qcwcn/wifi_hal/nan_ind.cpp
@@ -347,6 +347,14 @@
             }
             memcpy(&event->range_info, outputTlv.value, outputTlv.length);
             break;
+        case NAN_TLV_TYPE_SDEA_SERVICE_SPECIFIC_INFO:
+            if (outputTlv.length > NAN_MAX_SDEA_SERVICE_SPECIFIC_INFO_LEN) {
+                outputTlv.length = NAN_MAX_SDEA_SERVICE_SPECIFIC_INFO_LEN;
+            }
+            event->sdea_service_specific_info_len = outputTlv.length;
+            memcpy(event->sdea_service_specific_info, outputTlv.value,
+                   outputTlv.length);
+            break;
         default:
             ALOGV("Unknown TLV type skipped");
             break;
@@ -433,6 +441,14 @@
             }
             memcpy(event->addr, outputTlv.value, outputTlv.length);
             break;
+        case NAN_TLV_TYPE_SDEA_SERVICE_SPECIFIC_INFO:
+            if (outputTlv.length > NAN_MAX_SDEA_SERVICE_SPECIFIC_INFO_LEN) {
+                outputTlv.length = NAN_MAX_SDEA_SERVICE_SPECIFIC_INFO_LEN;
+            }
+            event->sdea_service_specific_info_len = outputTlv.length;
+            memcpy(event->sdea_service_specific_info, outputTlv.value,
+                   outputTlv.length);
+            break;
         default:
             ALOGV("Unknown TLV type skipped");
             break;
diff --git a/qcwcn/wifi_hal/nan_req.cpp b/qcwcn/wifi_hal/nan_req.cpp
index 4e9e4d7..964aa79 100644
--- a/qcwcn/wifi_hal/nan_req.cpp
+++ b/qcwcn/wifi_hal/nan_req.cpp
@@ -577,7 +577,8 @@
           SIZEOF_TLV_HDR + sizeof(NanFWRangeConfigParams) : 0) +
         ((pReq->range_response_cfg.publish_id ||
           pReq->range_response_cfg.ranging_response) ?
-          SIZEOF_TLV_HDR + sizeof(NanFWRangeReqMsg) : 0);
+          SIZEOF_TLV_HDR + sizeof(NanFWRangeReqMsg) : 0)  +
+        (pReq->sdea_service_specific_info_len ? SIZEOF_TLV_HDR + pReq->sdea_service_specific_info_len : 0);
 
     pNanPublishServiceReqMsg pFwReq = (pNanPublishServiceReqMsg)malloc(message_len);
     if (pFwReq == NULL) {
@@ -704,6 +705,11 @@
                                                     (const u8*)&pNanFWRangingCfg, tlvs);
     }
 
+    if (pReq->sdea_service_specific_info_len) {
+        tlvs = addTlv(NAN_TLV_TYPE_SDEA_SERVICE_SPECIFIC_INFO, pReq->sdea_service_specific_info_len,
+                      (const u8*)&pReq->sdea_service_specific_info[0], tlvs);
+    }
+
     if (pReq->range_response_cfg.publish_id || pReq->range_response_cfg.ranging_response) {
 
         NanFWRangeReqMsg pNanFWRangeReqMsg;
@@ -797,7 +803,8 @@
           SIZEOF_TLV_HDR + sizeof(NanFWRangeConfigParams) : 0) +
         ((pReq->range_response_cfg.requestor_instance_id ||
           pReq->range_response_cfg.ranging_response) ?
-          SIZEOF_TLV_HDR + sizeof(NanFWRangeReqMsg) : 0);
+          SIZEOF_TLV_HDR + sizeof(NanFWRangeReqMsg) : 0) +
+        (pReq->sdea_service_specific_info_len ? SIZEOF_TLV_HDR + pReq->sdea_service_specific_info_len : 0);
 
     message_len += \
         (pReq->num_intf_addr_present * (SIZEOF_TLV_HDR + NAN_MAC_ADDR_LEN));
@@ -930,6 +937,11 @@
                                                     (const u8*)&pNanFWRangingCfg, tlvs);
     }
 
+    if (pReq->sdea_service_specific_info_len) {
+        tlvs = addTlv(NAN_TLV_TYPE_SDEA_SERVICE_SPECIFIC_INFO, pReq->sdea_service_specific_info_len,
+                      (const u8*)&pReq->sdea_service_specific_info[0], tlvs);
+    }
+
     if (pReq->range_response_cfg.requestor_instance_id || pReq->range_response_cfg.ranging_response) {
         NanFWRangeReqMsg pNanFWRangeReqMsg;
         memset(&pNanFWRangeReqMsg, 0, sizeof(NanFWRangeReqMsg));
@@ -1007,7 +1019,8 @@
     size_t message_len =
         sizeof(NanMsgHeader) + sizeof(NanTransmitFollowupReqParams) +
         (pReq->service_specific_info_len ? SIZEOF_TLV_HDR +
-         pReq->service_specific_info_len : 0);
+         pReq->service_specific_info_len : 0) +
+        (pReq->sdea_service_specific_info_len ? SIZEOF_TLV_HDR + pReq->sdea_service_specific_info_len : 0);
 
     /* Mac address needs to be added in TLV */
     message_len += (SIZEOF_TLV_HDR + sizeof(pReq->addr));
@@ -1049,6 +1062,11 @@
                       (const u8*)&pReq->service_specific_info[0], tlvs);
     }
 
+    if (pReq->sdea_service_specific_info_len) {
+        tlvs = addTlv(NAN_TLV_TYPE_SDEA_SERVICE_SPECIFIC_INFO, pReq->sdea_service_specific_info_len,
+                      (const u8*)&pReq->sdea_service_specific_info[0], tlvs);
+    }
+
     mVendorData = (char *)pFwReq;
     mDataLen = message_len;