summaryrefslogtreecommitdiff
path: root/legacy
diff options
context:
space:
mode:
authorHsiu-Chang Chen <hsiuchangchen@google.com>2023-05-15 11:10:50 +0800
committerHsiu-Chang Chen <hsiuchangchen@google.com>2023-05-15 11:10:50 +0800
commit57b87486133ed9baa03e28cee1a0164e47543275 (patch)
treed5fabcf098d44a04e4ba0bf75d1e4da78b59caa3 /legacy
parenta007dee9ad77c844e99e2a07103ed37edb7801ad (diff)
downloadwlan-57b87486133ed9baa03e28cee1a0164e47543275.tar.gz
wifihal: Mask pub_sub_id to single byte
Framework interprets pub_sub_id as signed char for which subscribe ids are observed to be negative. Mask pub_sub_id received in the publishCancel and subscribeCancel request as single byte to avoid incorrect translation. Bug: 278825501 Test: Regression Test Change-Id: Ie5f07a10baac0292bc8827e8633ab1c4d6af7055
Diffstat (limited to 'legacy')
-rw-r--r--legacy/qcwcn/wifi_hal/nan_req.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/legacy/qcwcn/wifi_hal/nan_req.cpp b/legacy/qcwcn/wifi_hal/nan_req.cpp
index 4452783..f411802 100644
--- a/legacy/qcwcn/wifi_hal/nan_req.cpp
+++ b/legacy/qcwcn/wifi_hal/nan_req.cpp
@@ -788,7 +788,7 @@ wifi_error NanCommand::putNanPublish(transaction_id id, const NanPublishRequest
if (pReq->publish_id == 0) {
pFwReq->fwHeader.handle = 0xFFFF;
} else {
- pFwReq->fwHeader.handle = pReq->publish_id;
+ pFwReq->fwHeader.handle = (pReq->publish_id & 0xFF);
}
pFwReq->fwHeader.transactionId = id;
@@ -992,7 +992,7 @@ wifi_error NanCommand::putNanPublishCancel(transaction_id id, const NanPublishCa
pFwReq->fwHeader.msgVersion = (u16)NAN_MSG_VERSION1;
pFwReq->fwHeader.msgId = NAN_MSG_ID_PUBLISH_SERVICE_CANCEL_REQ;
pFwReq->fwHeader.msgLen = message_len;
- pFwReq->fwHeader.handle = pReq->publish_id;
+ pFwReq->fwHeader.handle = (pReq->publish_id & 0xFF);
pFwReq->fwHeader.transactionId = id;
mVendorData = (char *)pFwReq;
@@ -1085,7 +1085,7 @@ wifi_error NanCommand::putNanSubscribe(transaction_id id,
if (pReq->subscribe_id == 0) {
pFwReq->fwHeader.handle = 0xFFFF;
} else {
- pFwReq->fwHeader.handle = pReq->subscribe_id;
+ pFwReq->fwHeader.handle = (pReq->subscribe_id & 0xFF);
}
pFwReq->fwHeader.transactionId = id;
@@ -1291,7 +1291,7 @@ wifi_error NanCommand::putNanSubscribeCancel(transaction_id id,
pFwReq->fwHeader.msgVersion = (u16)NAN_MSG_VERSION1;
pFwReq->fwHeader.msgId = NAN_MSG_ID_SUBSCRIBE_SERVICE_CANCEL_REQ;
pFwReq->fwHeader.msgLen = message_len;
- pFwReq->fwHeader.handle = pReq->subscribe_id;
+ pFwReq->fwHeader.handle = (pReq->subscribe_id & 0xFF);
pFwReq->fwHeader.transactionId = id;
mVendorData = (char *)pFwReq;
@@ -1355,7 +1355,7 @@ wifi_error NanCommand::putNanTransmitFollowup(transaction_id id,
pFwReq->fwHeader.msgVersion = (u16)NAN_MSG_VERSION1;
pFwReq->fwHeader.msgId = NAN_MSG_ID_TRANSMIT_FOLLOWUP_REQ;
pFwReq->fwHeader.msgLen = message_len;
- pFwReq->fwHeader.handle = pReq->publish_subscribe_id;
+ pFwReq->fwHeader.handle = (pReq->publish_subscribe_id & 0xFF);
pFwReq->fwHeader.transactionId = id;
pFwReq->transmitFollowupReqParams.matchHandle = pReq->requestor_instance_id;