summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSubhani Shaik <subhanis@codeaurora.org>2017-05-15 22:19:56 -0700
committerEtan Cohen <etancohen@google.com>2017-05-22 16:06:33 -0700
commitcc4ae5a919abc6b3ecab3800a6debc74a9f9068d (patch)
tree78a8f6e8c82bde4212dbabe1b9ab8468ac3ead06
parent7c502817336adcd23446c7cb8f5e167678f00bed (diff)
downloadandroid_hardware_qcom_wlan-cc4ae5a919abc6b3ecab3800a6debc74a9f9068d.tar.gz
android_hardware_qcom_wlan-cc4ae5a919abc6b3ecab3800a6debc74a9f9068d.tar.bz2
android_hardware_qcom_wlan-cc4ae5a919abc6b3ecab3800a6debc74a9f9068d.zip
WifiHal: Fix cfg discovery indication
When NAN Enable is initiated followed by Config, the cfg discovery indication value is not passed correctly in HAL. Bug: 38321768 Test: AttachTest:test_attach_multiple_sessions bad TLV issue resolved Change-Id: Iaa8d2f65bdca4556c6fa2eef91c18959e0e3cd69
-rw-r--r--qcwcn/wifi_hal/nan_req.cpp74
1 files changed, 34 insertions, 40 deletions
diff --git a/qcwcn/wifi_hal/nan_req.cpp b/qcwcn/wifi_hal/nan_req.cpp
index 5a634ed..53287b3 100644
--- a/qcwcn/wifi_hal/nan_req.cpp
+++ b/qcwcn/wifi_hal/nan_req.cpp
@@ -104,8 +104,8 @@ int NanCommand::putNanEnable(transaction_id id, const NanEnableRequest *pReq)
sizeof(pReq->config_cluster_attribute_val)) : 0 \
) + \
(
- pReq->config_scan_params ? (SIZEOF_TLV_HDR + \
- NAN_MAX_SOCIAL_CHANNELS * sizeof(u32)) : 0 \
+ pReq->config_scan_params ? NAN_MAX_SOCIAL_CHANNELS *
+ (SIZEOF_TLV_HDR + sizeof(u32)) : 0 \
) + \
(
pReq->config_random_factor_force ? (SIZEOF_TLV_HDR + \
@@ -136,8 +136,8 @@ int NanCommand::putNanEnable(transaction_id id, const NanEnableRequest *pReq)
sizeof(u32)) : 0 \
) + \
(
- pReq->discovery_indication_cfg ? (SIZEOF_TLV_HDR + \
- sizeof(u32)) : 0 \
+ /* Always include cfg discovery indication TLV */
+ SIZEOF_TLV_HDR + sizeof(u32) \
) + \
(
pReq->config_subscribe_sid_beacon ? (SIZEOF_TLV_HDR + \
@@ -291,19 +291,13 @@ int NanCommand::putNanEnable(transaction_id id, const NanEnableRequest *pReq)
sizeof(u32),
(const u8*)&pReq->disc_mac_addr_rand_interval_sec, tlvs);
}
- if (pReq->discovery_indication_cfg) {
- NanConfigDiscoveryIndications discovery_indications;
- discovery_indications.disableDiscoveryMacAddressEvent =
- (pReq->discovery_indication_cfg & BIT_0) ? 1 : 0;
- discovery_indications.disableDiscoveryStartedClusterEvent =
- (pReq->discovery_indication_cfg & BIT_1) ? 1 : 0;
- discovery_indications.disableDiscoveryJoinedClusterEvent =
- (pReq->discovery_indication_cfg & BIT_2) ? 1 : 0;
- tlvs = addTlv(NAN_TLV_TYPE_CONFIG_DISCOVERY_INDICATIONS,
- sizeof(u32),
- (const u8*)&discovery_indications, tlvs);
- }
+ u32 config_discovery_indications;
+ config_discovery_indications = (u32)pReq->discovery_indication_cfg;
+ tlvs = addTlv(NAN_TLV_TYPE_CONFIG_DISCOVERY_INDICATIONS,
+ sizeof(u32),
+ (const u8*)&config_discovery_indications, tlvs);
+
if (pReq->config_subscribe_sid_beacon) {
tlvs = addTlv(NAN_TLV_TYPE_SUBSCRIBE_SID_BEACON,
sizeof(pReq->subscribe_sid_beacon_val),
@@ -358,7 +352,7 @@ int NanCommand::putNanDisable(transaction_id id)
int NanCommand::putNanConfig(transaction_id id, const NanConfigRequest *pReq)
{
ALOGV("NAN_CONFIG");
- size_t message_len = NAN_MAX_CONFIGURATION_REQ_SIZE;
+ size_t message_len = 0;
int idx = 0;
if (pReq == NULL ||
@@ -395,8 +389,8 @@ int NanCommand::putNanConfig(transaction_id id, const NanConfigRequest *pReq)
sizeof(pReq->config_cluster_attribute_val)) : 0 \
) + \
(
- pReq->config_scan_params ? (SIZEOF_TLV_HDR + \
- NAN_MAX_SOCIAL_CHANNELS * sizeof(u32)) : 0 \
+ pReq->config_scan_params ? NAN_MAX_SOCIAL_CHANNELS *
+ (SIZEOF_TLV_HDR + sizeof(u32)) : 0 \
) + \
(
pReq->config_random_factor_force ? (SIZEOF_TLV_HDR + \
@@ -423,13 +417,13 @@ int NanCommand::putNanConfig(transaction_id id, const NanConfigRequest *pReq)
sizeof(u32)) : 0 \
) + \
(
- pReq->discovery_indication_cfg ? (SIZEOF_TLV_HDR + \
- sizeof(u32)) : 0 \
- ) + \
- (
pReq->config_subscribe_sid_beacon ? (SIZEOF_TLV_HDR + \
sizeof(pReq->subscribe_sid_beacon_val)) : 0 \
- ) ;
+ ) + \
+ (
+ /* Always include cfg discovery indication TLV */
+ SIZEOF_TLV_HDR + sizeof(u32) \
+ );
if (pReq->num_config_discovery_attr) {
for (idx = 0; idx < pReq->num_config_discovery_attr; idx ++) {
@@ -466,7 +460,6 @@ int NanCommand::putNanConfig(transaction_id id, const NanConfigRequest *pReq)
tlvs = addTlv(NAN_TLV_TYPE_MASTER_PREFERENCE, sizeof(pReq->master_pref),
(const u8*)&pReq->master_pref, tlvs);
}
-
if (pReq->config_rssi_window_size) {
tlvs = addTlv(NAN_TLV_TYPE_RSSI_AVERAGING_WINDOW_SIZE, sizeof(pReq->rssi_window_size_val),
(const u8*)&pReq->rssi_window_size_val, tlvs);
@@ -475,6 +468,15 @@ int NanCommand::putNanConfig(transaction_id id, const NanConfigRequest *pReq)
tlvs = addTlv(NAN_TLV_TYPE_24G_RSSI_CLOSE_PROXIMITY, sizeof(pReq->rssi_proximity),
(const u8*)&pReq->rssi_proximity, tlvs);
}
+ if (pReq->config_5g_rssi_close_proximity) {
+ tlvs = addTlv(NAN_TLV_TYPE_5G_RSSI_CLOSE_PROXIMITY,
+ sizeof(pReq->rssi_close_proximity_5g_val),
+ (const u8*)&pReq->rssi_close_proximity_5g_val, tlvs);
+ }
+ if (pReq->config_cluster_attribute_val) {
+ tlvs = addTlv(NAN_TLV_TYPE_CLUSTER_ATTRIBUTE_IN_SDF, sizeof(pReq->config_cluster_attribute_val),
+ (const u8*)&pReq->config_cluster_attribute_val, tlvs);
+ }
if (pReq->config_scan_params) {
u32 socialChannelParamVal[NAN_MAX_SOCIAL_CHANNELS];
/* Fill the social channel param */
@@ -521,7 +523,6 @@ int NanCommand::putNanConfig(transaction_id id, const NanConfigRequest *pReq)
calcNanFurtherAvailabilityMapSize(&pReq->fam_val),
(const u8*)(tlvs + SIZEOF_TLV_HDR), tlvs);
}
-
if (pReq->config_dw.config_2dot4g_dw_band) {
tlvs = addTlv(NAN_TLV_TYPE_2G_COMMITTED_DW,
sizeof(pReq->config_dw.dw_2dot4g_interval_val),
@@ -537,26 +538,19 @@ int NanCommand::putNanConfig(transaction_id id, const NanConfigRequest *pReq)
sizeof(u32),
(const u8*)&pReq->disc_mac_addr_rand_interval_sec, tlvs);
}
-
- if (pReq->discovery_indication_cfg) {
- NanConfigDiscoveryIndications discovery_indications;
- discovery_indications.disableDiscoveryMacAddressEvent =
- (pReq->discovery_indication_cfg & BIT_0) ? 1 : 0;
- discovery_indications.disableDiscoveryStartedClusterEvent =
- (pReq->discovery_indication_cfg & BIT_1) ? 1 : 0;
- discovery_indications.disableDiscoveryJoinedClusterEvent =
- (pReq->discovery_indication_cfg & BIT_2) ? 1 : 0;
-
- tlvs = addTlv(NAN_TLV_TYPE_CONFIG_DISCOVERY_INDICATIONS,
- sizeof(u32),
- (const u8*)&discovery_indications, tlvs);
- }
if (pReq->config_subscribe_sid_beacon) {
tlvs = addTlv(NAN_TLV_TYPE_SUBSCRIBE_SID_BEACON,
sizeof(pReq->subscribe_sid_beacon_val),
(const u8*)&pReq->subscribe_sid_beacon_val, tlvs);
}
+ u32 config_discovery_indications;
+ config_discovery_indications = (u32)(pReq->discovery_indication_cfg);
+ /* Always include the discovery cfg TLV as there is no cfg flag */
+ tlvs = addTlv(NAN_TLV_TYPE_CONFIG_DISCOVERY_INDICATIONS,
+ sizeof(u32),
+ (const u8*)&config_discovery_indications, tlvs);
+
mVendorData = (char*)pFwReq;
mDataLen = message_len;