summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/hdd/src/wlan_hdd_nan_datapath.c36
-rw-r--r--core/hdd/src/wlan_hdd_nan_datapath.h4
-rw-r--r--core/mac/inc/sir_api.h1
-rw-r--r--core/mac/src/pe/nan/nan_datapath.c3
-rw-r--r--core/wma/src/wma_nan_datapath.c7
5 files changed, 34 insertions, 17 deletions
diff --git a/core/hdd/src/wlan_hdd_nan_datapath.c b/core/hdd/src/wlan_hdd_nan_datapath.c
index 28136fff5109..b40b3cb055c8 100644
--- a/core/hdd/src/wlan_hdd_nan_datapath.c
+++ b/core/hdd/src/wlan_hdd_nan_datapath.c
@@ -57,6 +57,9 @@ qca_wlan_vendor_ndp_policy[QCA_WLAN_VENDOR_ATTR_NDP_PARAMS_MAX + 1] = {
.len = QDF_MAC_ADDR_SIZE },
[QCA_WLAN_VENDOR_ATTR_NDP_INSTANCE_ID_ARRAY] = { .type = NLA_BINARY,
.len = NDP_NUM_INSTANCE_ID },
+ [QCA_WLAN_VENDOR_ATTR_NDP_DRV_RESPONSE_STATUS_TYPE] = { .type =
+ NLA_U32 },
+ [QCA_WLAN_VENDOR_ATTR_NDP_DRV_RETURN_VALUE] = { .type = NLA_U32 },
[QCA_WLAN_VENDOR_ATTR_NDP_CHANNEL_CONFIG] = { .type = NLA_U32 },
[QCA_WLAN_VENDOR_ATTR_NDP_NCS_SK_TYPE] = { .type = NLA_U32 },
[QCA_WLAN_VENDOR_ATTR_NDP_PMK] = { .type = NLA_BINARY,
@@ -804,7 +807,7 @@ static int hdd_ndp_end_req_handler(hdd_context_t *hdd_ctx, struct nlattr **tb)
* QCA_WLAN_VENDOR_ATTR_NDP_SUBCMD =
* QCA_WLAN_VENDOR_ATTR_NDP_INTERFACE_CREATE (4 bytes)
* QCA_WLAN_VENDOR_ATTR_NDP_TRANSACTION_ID (2 bytes)
- * QCA_WLAN_VENDOR_ATTR_NDP_DRV_RETURN_TYPE (4 bytes)
+ * QCA_WLAN_VENDOR_ATTR_NDP_DRV_RESPONSE_STATUS_TYPE (4 bytes)
* QCA_WLAN_VENDOR_ATTR_NDP_DRV_RETURN_VALUE
*
* Return: none
@@ -881,7 +884,8 @@ static void hdd_ndp_iface_create_rsp_handler(hdd_adapter_t *adapter,
}
/* Status code */
- if (nla_put_u32(vendor_event, QCA_WLAN_VENDOR_ATTR_NDP_DRV_RETURN_TYPE,
+ if (nla_put_u32(vendor_event,
+ QCA_WLAN_VENDOR_ATTR_NDP_DRV_RESPONSE_STATUS_TYPE,
create_status)) {
hdd_err("VENDOR_ATTR_NDP_DRV_RETURN_TYPE put fail");
goto nla_put_failure;
@@ -901,7 +905,8 @@ static void hdd_ndp_iface_create_rsp_handler(hdd_adapter_t *adapter,
hdd_info("create transaction id: %d, value: %d",
QCA_WLAN_VENDOR_ATTR_NDP_TRANSACTION_ID, create_transaction_id);
hdd_info("status code: %d, value: %d",
- QCA_WLAN_VENDOR_ATTR_NDP_DRV_RETURN_TYPE, create_status);
+ QCA_WLAN_VENDOR_ATTR_NDP_DRV_RESPONSE_STATUS_TYPE,
+ create_status);
hdd_info("Return value: %d, value: %d",
QCA_WLAN_VENDOR_ATTR_NDP_DRV_RETURN_VALUE, create_reason);
@@ -987,7 +992,7 @@ static void hdd_ndp_iface_delete_rsp_handler(hdd_adapter_t *adapter,
* QCA_WLAN_VENDOR_ATTR_NDP_SUBCMD =
* QCA_WLAN_VENDOR_ATTR_NDP_INTERFACE_DELETE (4 bytes)
* QCA_WLAN_VENDOR_ATTR_NDP_TRANSACTION_ID (2 bytes)
- * QCA_WLAN_VENDOR_ATTR_NDP_DRV_RETURN_TYPE (4 bytes)
+ * QCA_WLAN_VENDOR_ATTR_NDP_DRV_RESPONSE_STATUS_TYPE (4 bytes)
* QCA_WLAN_VENDOR_ATTR_NDP_DRV_RETURN_VALUE (4 bytes)
*
* Return: none
@@ -1049,7 +1054,7 @@ void hdd_ndp_session_end_handler(hdd_adapter_t *adapter)
/* Status code */
if (nla_put_u32(vendor_event,
- QCA_WLAN_VENDOR_ATTR_NDP_DRV_RETURN_TYPE,
+ QCA_WLAN_VENDOR_ATTR_NDP_DRV_RESPONSE_STATUS_TYPE,
ndp_ctx->ndi_delete_rsp_status)) {
hdd_err("VENDOR_ATTR_NDP_DRV_RETURN_TYPE put fail");
goto failure;
@@ -1069,7 +1074,7 @@ void hdd_ndp_session_end_handler(hdd_adapter_t *adapter)
QCA_WLAN_VENDOR_ATTR_NDP_TRANSACTION_ID,
ndp_ctx->ndp_delete_transaction_id);
hdd_info("status code: %d, value: %d",
- QCA_WLAN_VENDOR_ATTR_NDP_DRV_RETURN_TYPE,
+ QCA_WLAN_VENDOR_ATTR_NDP_DRV_RESPONSE_STATUS_TYPE,
ndp_ctx->ndi_delete_rsp_status);
hdd_info("Return value: %d, value: %d",
QCA_WLAN_VENDOR_ATTR_NDP_DRV_RETURN_VALUE,
@@ -1098,7 +1103,7 @@ failure:
* QCA_WLAN_VENDOR_ATTR_NDP_INITIATOR_RESPONSE (4 bytes)
* QCA_WLAN_VENDOR_ATTR_NDP_TRANSACTION_ID (2 bytes)
* QCA_WLAN_VENDOR_ATTR_NDP_INSTANCE_ID (4 bytes)
- * QCA_WLAN_VENDOR_ATTR_NDP_DRV_RETURN_TYPE (4 bytes)
+ * QCA_WLAN_VENDOR_ATTR_NDP_DRV_RESPONSE_STATUS_TYPE (4 bytes)
* QCA_WLAN_VENDOR_ATTR_NDP_DRV_RETURN_VALUE (4 bytes)
*
* Return: none
@@ -1143,7 +1148,8 @@ static void hdd_ndp_initiator_rsp_handler(hdd_adapter_t *adapter,
rsp->ndp_instance_id))
goto ndp_initiator_rsp_nla_failed;
- if (nla_put_u32(vendor_event, QCA_WLAN_VENDOR_ATTR_NDP_DRV_RETURN_TYPE,
+ if (nla_put_u32(vendor_event,
+ QCA_WLAN_VENDOR_ATTR_NDP_DRV_RESPONSE_STATUS_TYPE,
rsp->status))
goto ndp_initiator_rsp_nla_failed;
@@ -1520,8 +1526,8 @@ ndp_indication_nla_failed:
* QCA_WLAN_VENDOR_ATTR_NDP_SUBCMD =
* QCA_WLAN_VENDOR_ATTR_NDP_RESPONDER_RESPONSE (4 bytes)
* QCA_WLAN_VENDOR_ATTR_NDP_TRANSACTION_ID (2 bytes)
- * QCA_WLAN_VENDOR_ATTR_NDP_DRV_RETURN_TYPE (4 bytes)
- * QCA_WLAN_VENDOR_ATTR_NDP_RESPONSE_CODE (4 bytes)
+ * QCA_WLAN_VENDOR_ATTR_NDP_DRV_RESPONSE_STATUS_TYPE (4 bytes)
+ * QCA_WLAN_VENDOR_ATTR_NDP_DRV_RETURN_VALUE (4 bytes)
*
* Return: none
*/
@@ -1566,12 +1572,13 @@ static void hdd_ndp_responder_rsp_handler(hdd_adapter_t *adapter,
rsp->transaction_id))
goto ndp_responder_rsp_nla_failed;
- if (nla_put_u32(vendor_event, QCA_WLAN_VENDOR_ATTR_NDP_DRV_RETURN_TYPE,
+ if (nla_put_u32(vendor_event,
+ QCA_WLAN_VENDOR_ATTR_NDP_DRV_RESPONSE_STATUS_TYPE,
rsp->status))
goto ndp_responder_rsp_nla_failed;
if (nla_put_u32(vendor_event,
- QCA_WLAN_VENDOR_ATTR_NDP_RESPONSE_CODE,
+ QCA_WLAN_VENDOR_ATTR_NDP_DRV_RETURN_VALUE,
rsp->reason))
goto ndp_responder_rsp_nla_failed;
@@ -1592,7 +1599,7 @@ ndp_responder_rsp_nla_failed:
* Following vendor event is sent to cfg80211:
* QCA_WLAN_VENDOR_ATTR_NDP_SUBCMD =
* QCA_WLAN_VENDOR_ATTR_NDP_END_RESPONSE(4 bytest)
- * QCA_WLAN_VENDOR_ATTR_NDP_DRV_RETURN_TYPE (4 bytes)
+ * QCA_WLAN_VENDOR_ATTR_NDP_DRV_RESPONSE_STATUS_TYPE (4 bytes)
* QCA_WLAN_VENDOR_ATTR_NDP_DRV_RETURN_VALUE (4 bytes)
* QCA_WLAN_VENDOR_ATTR_NDP_TRANSACTION_ID (2 bytes)
*
@@ -1630,7 +1637,8 @@ static void hdd_ndp_end_rsp_handler(hdd_adapter_t *adapter, void *rsp_params)
QCA_WLAN_VENDOR_ATTR_NDP_END_RESPONSE))
goto ndp_end_rsp_nla_failed;
- if (nla_put_u32(vendor_event, QCA_WLAN_VENDOR_ATTR_NDP_DRV_RETURN_TYPE,
+ if (nla_put_u32(vendor_event,
+ QCA_WLAN_VENDOR_ATTR_NDP_DRV_RESPONSE_STATUS_TYPE,
rsp->status))
goto ndp_end_rsp_nla_failed;
diff --git a/core/hdd/src/wlan_hdd_nan_datapath.h b/core/hdd/src/wlan_hdd_nan_datapath.h
index a4b07409e6db..4f29c3089ead 100644
--- a/core/hdd/src/wlan_hdd_nan_datapath.h
+++ b/core/hdd/src/wlan_hdd_nan_datapath.h
@@ -72,7 +72,7 @@ struct wireless_dev;
* @QCA_WLAN_VENDOR_ATTR_NDP_INSTANCE_ID_ARRAY: NDP instance id array
* @QCA_WLAN_VENDOR_ATTR_NDP_RESPONSE_CODE: Schedule response
* @QCA_WLAN_VENDOR_ATTR_NDP_NDI_MAC_ADDR: NDI mac address
- * @QCA_WLAN_VENDOR_ATTR_NDP_DRV_RETURN_TYPE: Driver return status
+ * @QCA_WLAN_VENDOR_ATTR_NDP_DRV_RESPONSE_STATUS_TYPE: Driver return status
* @QCA_WLAN_VENDOR_ATTR_NDP_DRV_RETURN_VALUE: Driver return value
* @QCA_WLAN_VENDOR_ATTR_NDP_CHANNEL_CONFIG: Channel config request type
* @QCA_WLAN_VENDOR_ATTR_NDP_NCS_SK_TYPE: Cipher Suit ID
@@ -95,7 +95,7 @@ enum qca_wlan_vendor_attr_ndp_params {
QCA_WLAN_VENDOR_ATTR_NDP_INSTANCE_ID_ARRAY,
QCA_WLAN_VENDOR_ATTR_NDP_RESPONSE_CODE,
QCA_WLAN_VENDOR_ATTR_NDP_NDI_MAC_ADDR,
- QCA_WLAN_VENDOR_ATTR_NDP_DRV_RETURN_TYPE,
+ QCA_WLAN_VENDOR_ATTR_NDP_DRV_RESPONSE_STATUS_TYPE,
QCA_WLAN_VENDOR_ATTR_NDP_DRV_RETURN_VALUE,
QCA_WLAN_VENDOR_ATTR_NDP_CHANNEL_CONFIG,
QCA_WLAN_VENDOR_ATTR_NDP_NCS_SK_TYPE,
diff --git a/core/mac/inc/sir_api.h b/core/mac/inc/sir_api.h
index 6f352fa8dbc0..d92dcf726474 100644
--- a/core/mac/inc/sir_api.h
+++ b/core/mac/inc/sir_api.h
@@ -6552,6 +6552,7 @@ struct ndp_responder_rsp_event {
uint32_t status;
uint32_t reason;
struct qdf_mac_addr peer_mac_addr;
+ bool create_peer;
};
/**
diff --git a/core/mac/src/pe/nan/nan_datapath.c b/core/mac/src/pe/nan/nan_datapath.c
index ebe5c28279f8..0b1950105b5e 100644
--- a/core/mac/src/pe/nan/nan_datapath.c
+++ b/core/mac/src/pe/nan/nan_datapath.c
@@ -197,7 +197,8 @@ static QDF_STATUS lim_ndp_responder_rsp_handler(tpAniSirGlobal mac_ctx,
goto responder_rsp;
}
- if (QDF_STATUS_SUCCESS == rsp_ind->status) {
+ if (QDF_STATUS_SUCCESS == rsp_ind->status &&
+ rsp_ind->create_peer == true) {
ret_val = lim_add_ndi_peer(mac_ctx, rsp_ind->vdev_id,
rsp_ind->peer_mac_addr);
if (QDF_STATUS_SUCCESS != ret_val) {
diff --git a/core/wma/src/wma_nan_datapath.c b/core/wma/src/wma_nan_datapath.c
index 23ed4bea348e..55833f3ab762 100644
--- a/core/wma/src/wma_nan_datapath.c
+++ b/core/wma/src/wma_nan_datapath.c
@@ -520,8 +520,15 @@ static int wma_ndp_responder_rsp_event_handler(void *handle,
rsp.transaction_id = fixed_params->transaction_id;
rsp.reason = fixed_params->reason_code;
rsp.status = fixed_params->rsp_status;
+ rsp.create_peer = fixed_params->create_peer;
WMI_MAC_ADDR_TO_CHAR_ARRAY(&fixed_params->peer_ndi_mac_addr,
rsp.peer_mac_addr.bytes);
+
+ WMA_LOGE(FL("WMI_NDP_RESPONDER_RSP_EVENTID(0x%X) received. vdev_id: %d, peer_mac_addr: %pM,transaction_id: %d, status_code %d, reason_code: %d, create_peer: %d"),
+ WMI_NDP_RESPONDER_RSP_EVENTID, rsp.vdev_id,
+ rsp.peer_mac_addr.bytes, rsp.transaction_id,
+ rsp.status, rsp.reason, rsp.create_peer);
+
pe_msg.bodyptr = &rsp;
pe_msg.type = SIR_HAL_NDP_RESPONDER_RSP;
return wma_handle->pe_ndp_event_handler(wma_handle->mac_context,