From 51f68ff7dffed81d8c44b939e1bcdfee87e1dba5 Mon Sep 17 00:00:00 2001 From: Naveen Rawat Date: Thu, 31 May 2018 15:04:59 -0700 Subject: [PATCH] qcacmn: Add support for NDP TCP/IP params Add support for NDP TCP/IP params in ndp initiator request, responder request, indication and confirm. Change-Id: I5d60af154ea4a2f33d18d9b86049f316e7fbc524 CRs-Fixed: 2252227 --- os_if/linux/nan/src/os_if_nan.c | 92 ++++++++++++++++++- umac/nan/core/inc/nan_public_structs.h | 32 +++++++ wmi/src/wmi_unified_tlv.c | 117 +++++++++++++++++++++---- 3 files changed, 224 insertions(+), 17 deletions(-) diff --git a/os_if/linux/nan/src/os_if_nan.c b/os_if/linux/nan/src/os_if_nan.c index 06edb07f4b0f..95ab8154df7f 100644 --- a/os_if/linux/nan/src/os_if_nan.c +++ b/os_if/linux/nan/src/os_if_nan.c @@ -130,6 +130,18 @@ vendor_attr_policy[QCA_WLAN_VENDOR_ATTR_NDP_PARAMS_MAX + 1] = { .type = NLA_U32, .len = sizeof(uint32_t) }, + [QCA_WLAN_VENDOR_ATTR_NDP_IPV6_ADDR] = { + .type = NLA_UNSPEC, + .len = QDF_IPV6_ADDR_SIZE + }, + [QCA_WLAN_VENDOR_ATTR_NDP_TRANSPORT_PORT] = { + .type = NLA_U16, + .len = sizeof(uint16_t) + }, + [QCA_WLAN_VENDOR_ATTR_NDP_TRANSPORT_PROTOCOL] = { + .type = NLA_U8, + .len = sizeof(uint8_t) + }, }; static int os_if_nan_process_ndi_create(struct wlan_objmgr_psoc *psoc, @@ -411,6 +423,15 @@ static int os_if_nan_process_ndp_initiator_req(struct wlan_objmgr_psoc *psoc, nla_get_u32(tb[QCA_WLAN_VENDOR_ATTR_NDP_CONFIG_QOS]); } + if (tb[QCA_WLAN_VENDOR_ATTR_NDP_IPV6_ADDR]) { + req.is_ipv6_addr_present = true; + qdf_mem_copy(req.ipv6_addr, + nla_data(tb[QCA_WLAN_VENDOR_ATTR_NDP_IPV6_ADDR]), + QDF_IPV6_ADDR_SIZE); + } + cfg80211_debug("ipv6 addr present: %d, addr: %pI6", + req.is_ipv6_addr_present, req.ipv6_addr); + if (os_if_nan_parse_security_params(tb, &req.ncs_sk_type, &req.pmk, &req.passphrase, &req.service_name)) { cfg80211_err("inconsistent security params in request."); @@ -490,7 +511,6 @@ static int os_if_nan_process_ndp_responder_req(struct wlan_objmgr_psoc *psoc, goto responder_req_failed; } } else { - /* * If the data indication is rejected, the userspace * may not send the iface name. Use the first NDI @@ -551,6 +571,28 @@ static int os_if_nan_process_ndp_responder_req(struct wlan_objmgr_psoc *psoc, cfg80211_debug("NDP config data is unavailable"); } + if (tb[QCA_WLAN_VENDOR_ATTR_NDP_IPV6_ADDR]) { + req.is_ipv6_addr_present = true; + qdf_mem_copy(req.ipv6_addr, + nla_data(tb[QCA_WLAN_VENDOR_ATTR_NDP_IPV6_ADDR]), + QDF_IPV6_ADDR_SIZE); + } + if (tb[QCA_WLAN_VENDOR_ATTR_NDP_TRANSPORT_PORT]) { + req.is_port_present = true; + req.port = nla_get_u16( + tb[QCA_WLAN_VENDOR_ATTR_NDP_TRANSPORT_PORT]); + } + if (tb[QCA_WLAN_VENDOR_ATTR_NDP_TRANSPORT_PROTOCOL]) { + req.is_protocol_present = true; + req.protocol = nla_get_u8( + tb[QCA_WLAN_VENDOR_ATTR_NDP_TRANSPORT_PROTOCOL]); + } + cfg80211_debug("ipv6 addr present: %d, addr: %pI6", + req.is_ipv6_addr_present, req.ipv6_addr); + cfg80211_debug("port %d, present: %d", req.port, req.is_port_present); + cfg80211_debug("protocol %d, present: %d", + req.protocol, req.is_protocol_present); + if (os_if_nan_parse_security_params(tb, &req.ncs_sk_type, &req.pmk, &req.passphrase, &req.service_name)) { cfg80211_err("inconsistent security params in request."); @@ -881,6 +923,9 @@ static inline uint32_t osif_ndp_get_ndp_req_ind_len( QCA_WLAN_VENDOR_ATTR_NDP_NDI_MAC_ADDR].len); data_len += nla_total_size(vendor_attr_policy[ QCA_WLAN_VENDOR_ATTR_NDP_PEER_DISCOVERY_MAC_ADDR].len); + if (event->is_ipv6_addr_present) + data_len += nla_total_size(vendor_attr_policy[ + QCA_WLAN_VENDOR_ATTR_NDP_IPV6_ADDR].len); if (event->scid.scid_len) data_len += nla_total_size(event->scid.scid_len); if (event->ndp_info.ndp_app_info_len) @@ -906,6 +951,7 @@ static inline uint32_t osif_ndp_get_ndp_req_ind_len( * QCA_WLAN_VENDOR_ATTR_NDP_CONFIG_QOS (4 bytes) * QCA_WLAN_VENDOR_ATTR_NDP_CSID(4 bytes) * QCA_WLAN_VENDOR_ATTR_NDP_SCID(scid_len in size) + * QCA_WLAN_VENDOR_ATTR_NDP_IPV6_ADDR (16 bytes) * * Return: none */ @@ -1020,6 +1066,14 @@ static void os_if_ndp_indication_handler(struct wlan_objmgr_vdev *vdev, event->scid.scid, event->scid.scid_len); } + if (event->is_ipv6_addr_present) { + if (nla_put(vendor_event, QCA_WLAN_VENDOR_ATTR_NDP_IPV6_ADDR, + QDF_IPV6_ADDR_SIZE, event->ipv6_addr)) + goto ndp_indication_nla_failed; + } + cfg80211_debug("ipv6 addr present: %d, addr: %pI6", + event->is_ipv6_addr_present, event->ipv6_addr); + cfg80211_vendor_event(vendor_event, GFP_ATOMIC); return; ndp_indication_nla_failed: @@ -1050,6 +1104,16 @@ static inline uint32_t osif_ndp_get_ndp_confirm_ind_len( data_len += nla_total_size(ndp_confirm->ndp_info.ndp_app_info_len); + if (ndp_confirm->is_ipv6_addr_present) + data_len += nla_total_size(vendor_attr_policy[ + QCA_WLAN_VENDOR_ATTR_NDP_IPV6_ADDR].len); + if (ndp_confirm->is_port_present) + data_len += nla_total_size(vendor_attr_policy[ + QCA_WLAN_VENDOR_ATTR_NDP_TRANSPORT_PORT].len); + if (ndp_confirm->is_protocol_present) + data_len += nla_total_size(vendor_attr_policy[ + QCA_WLAN_VENDOR_ATTR_NDP_TRANSPORT_PROTOCOL].len); + /* ch_info is a nested array of following attributes */ ch_info_len += nla_total_size( vendor_attr_policy[QCA_WLAN_VENDOR_ATTR_NDP_CHANNEL].len); @@ -1120,6 +1184,9 @@ static QDF_STATUS os_if_ndp_confirm_pack_ch_info(struct sk_buff *event, * QCA_WLAN_VENDOR_ATTR_NDP_APP_INFO (ndp_app_info_len size) * QCA_WLAN_VENDOR_ATTR_NDP_RESPONSE_CODE (4 bytes) * QCA_WLAN_VENDOR_ATTR_NDP_DRV_RETURN_VALUE (4 bytes) + * QCA_WLAN_VENDOR_ATTR_NDP_IPV6_ADDR (16 bytes) + * QCA_WLAN_VENDOR_ATTR_NDP_TRANSPORT_PORT (2 bytes) + * QCA_WLAN_VENDOR_ATTR_NDP_TRANSPORT_PROTOCOL (1 byte) * * Return: none */ @@ -1225,6 +1292,29 @@ os_if_ndp_confirm_ind_handler(struct wlan_objmgr_vdev *vdev, if (QDF_IS_STATUS_ERROR(status)) goto ndp_confirm_nla_failed; + if (ndp_confirm->is_ipv6_addr_present) { + if (nla_put(vendor_event, QCA_WLAN_VENDOR_ATTR_NDP_IPV6_ADDR, + QDF_IPV6_ADDR_SIZE, ndp_confirm->ipv6_addr)) + goto ndp_confirm_nla_failed; + } + if (ndp_confirm->is_port_present) + if (nla_put_u16(vendor_event, + QCA_WLAN_VENDOR_ATTR_NDP_TRANSPORT_PORT, + ndp_confirm->port)) + goto ndp_confirm_nla_failed; + if (ndp_confirm->is_protocol_present) + if (nla_put_u8(vendor_event, + QCA_WLAN_VENDOR_ATTR_NDP_TRANSPORT_PROTOCOL, + ndp_confirm->protocol)) + goto ndp_confirm_nla_failed; + cfg80211_debug("ipv6 addr present: %d, addr: %pI6", + ndp_confirm->is_ipv6_addr_present, + ndp_confirm->ipv6_addr); + cfg80211_debug("port %d, present: %d", + ndp_confirm->port, ndp_confirm->is_port_present); + cfg80211_debug("protocol %d, present: %d", + ndp_confirm->protocol, ndp_confirm->is_protocol_present); + cfg80211_vendor_event(vendor_event, GFP_ATOMIC); cfg80211_debug("NDP confim sent, ndp instance id: %d, peer addr: %pM rsp_code: %d, reason_code: %d", ndp_confirm->ndp_instance_id, diff --git a/umac/nan/core/inc/nan_public_structs.h b/umac/nan/core/inc/nan_public_structs.h index 1ac7483a7c1e..615b124ee9ff 100644 --- a/umac/nan/core/inc/nan_public_structs.h +++ b/umac/nan/core/inc/nan_public_structs.h @@ -366,6 +366,8 @@ struct nan_datapath_inf_delete_rsp { * @pmk: pairwise master key * @passphrase: passphrase * @service_name: service name + * @is_ipv6_addr_present: indicates if following ipv6 address is valid + * @ipv6_addr: ipv6 address address used by ndp */ struct nan_datapath_initiator_req { struct wlan_objmgr_vdev *vdev; @@ -381,6 +383,8 @@ struct nan_datapath_initiator_req { struct nan_datapath_pmk pmk; struct ndp_passphrase passphrase; struct ndp_service_name service_name; + bool is_ipv6_addr_present; + uint8_t ipv6_addr[QDF_IPV6_ADDR_SIZE]; }; /** @@ -413,6 +417,12 @@ struct nan_datapath_initiator_rsp { * @ncs_sk_type: indicates NCS_SK_128 or NCS_SK_256 * @passphrase: passphrase * @service_name: service name + * @is_ipv6_addr_present: indicates if following ipv6 address is valid + * @ipv6_addr: ipv6 address address used by ndp + * @is_port_present: indicates if following port is valid + * @port: port specified by for this NDP + * @is_protocol_present: indicates if following protocol is valid + * @protocol: protocol used by this NDP * */ struct nan_datapath_responder_req { @@ -426,6 +436,12 @@ struct nan_datapath_responder_req { uint32_t ncs_sk_type; struct ndp_passphrase passphrase; struct ndp_service_name service_name; + bool is_ipv6_addr_present; + uint8_t ipv6_addr[QDF_IPV6_ADDR_SIZE]; + bool is_port_present; + uint16_t port; + bool is_protocol_present; + uint8_t protocol; }; /** @@ -501,6 +517,12 @@ struct nan_datapath_end_indication_event { * @num_channels: num channels * @ch: channel info struct array * @ndp_info: ndp application info + * @is_ipv6_addr_present: indicates if following ipv6 address is valid + * @ipv6_addr: ipv6 address address used by ndp + * @is_port_present: indicates if following port is valid + * @port: port specified by for this NDP + * @is_protocol_present: indicates if following protocol is valid + * @protocol: protocol used by this NDP * */ struct nan_datapath_confirm_event { @@ -513,6 +535,12 @@ struct nan_datapath_confirm_event { uint32_t num_channels; struct nan_datapath_channel_info ch[NAN_CH_INFO_MAX_CHANNELS]; struct nan_datapath_app_info ndp_info; + bool is_ipv6_addr_present; + uint8_t ipv6_addr[QDF_IPV6_ADDR_SIZE]; + bool is_port_present; + uint16_t port; + bool is_protocol_present; + uint8_t protocol; }; /** @@ -529,6 +557,8 @@ struct nan_datapath_confirm_event { * @ndp_info: ndp application info * @ncs_sk_type: indicates NCS_SK_128 or NCS_SK_256 * @scid: security context identifier + * @is_ipv6_addr_present: indicates if following ipv6 address is valid + * @ipv6_addr: ipv6 address address used by ndp * */ struct nan_datapath_indication_event { @@ -543,6 +573,8 @@ struct nan_datapath_indication_event { struct nan_datapath_app_info ndp_info; uint32_t ncs_sk_type; struct nan_datapath_scid scid; + bool is_ipv6_addr_present; + uint8_t ipv6_addr[QDF_IPV6_ADDR_SIZE]; }; /** diff --git a/wmi/src/wmi_unified_tlv.c b/wmi/src/wmi_unified_tlv.c index 3141eed8883b..4397b32d4f38 100644 --- a/wmi/src/wmi_unified_tlv.c +++ b/wmi/src/wmi_unified_tlv.c @@ -15098,7 +15098,7 @@ static QDF_STATUS send_roam_invoke_cmd_tlv(wmi_unified_t wmi_handle, roaminvoke->frame_len); WMI_LOGD(FL("bcn/prb_rsp frame, length: %d"), roaminvoke->frame_len); - QDF_TRACE_HEX_DUMP(QDF_MODULE_ID_WMA, QDF_TRACE_LEVEL_DEBUG, + QDF_TRACE_HEX_DUMP(QDF_MODULE_ID_WMI, QDF_TRACE_LEVEL_DEBUG, buf_ptr + WMI_TLV_HDR_SIZE, roaminvoke->frame_len); WMI_LOGD(FL("flag:%d, MODE scn:%d, ap:%d, dly:%d, n_ch:%d, n_bssid:%d"), @@ -16212,6 +16212,7 @@ static QDF_STATUS nan_ndp_initiator_req_tlv(wmi_unified_t wmi_handle, wmi_ndp_initiator_req_fixed_param *cmd; uint32_t passphrase_len, service_name_len; uint32_t ndp_cfg_len, ndp_app_info_len, pmk_len; + wmi_ndp_transport_ip_param *tcp_ip_param; /* * WMI command expects 4 byte alligned len: @@ -16228,6 +16229,9 @@ static QDF_STATUS nan_ndp_initiator_req_tlv(wmi_unified_t wmi_handle, + ndp_cfg_len + ndp_app_info_len + pmk_len + passphrase_len + service_name_len; + if (ndp_req->is_ipv6_addr_present) + len += sizeof(*tcp_ip_param); + buf = wmi_buf_alloc(wmi_handle, len); if (!buf) { WMI_LOGE("wmi_buf_alloc failed"); @@ -16285,6 +16289,19 @@ static QDF_STATUS nan_ndp_initiator_req_tlv(wmi_unified_t wmi_handle, cmd->nan_servicename_len); tlv_ptr = tlv_ptr + WMI_TLV_HDR_SIZE + service_name_len; + if (ndp_req->is_ipv6_addr_present) { + tcp_ip_param = (wmi_ndp_transport_ip_param *)tlv_ptr; + WMITLV_SET_HDR(tcp_ip_param, + WMITLV_TAG_STRUC_wmi_ndp_transport_ip_param, + WMITLV_GET_STRUCT_TLVLEN( + wmi_ndp_transport_ip_param)); + tcp_ip_param->ipv6_addr_present = true; + qdf_mem_copy(tcp_ip_param->ipv6_intf_addr, + ndp_req->ipv6_addr, WMI_NDP_IPV6_INTF_ADDR_LEN); + } + WMI_LOGD(FL("IPv6 addr present: %d, addr: %pI6"), + ndp_req->is_ipv6_addr_present, ndp_req->ipv6_addr); + WMI_LOGD("vdev_id = %d, transaction_id: %d, service_instance_id: %d, ch: %d, ch_cfg: %d, csid: %d", cmd->vdev_id, cmd->transaction_id, cmd->service_instance_id, ch_tlv->mhz, cmd->ndp_channel_cfg, cmd->nan_csid); @@ -16293,26 +16310,26 @@ static QDF_STATUS nan_ndp_initiator_req_tlv(wmi_unified_t wmi_handle, cmd->peer_discovery_mac_addr.mac_addr47to32); WMI_LOGD("ndp_config len: %d", cmd->ndp_cfg_len); - QDF_TRACE_HEX_DUMP(QDF_MODULE_ID_WMA, QDF_TRACE_LEVEL_DEBUG, + QDF_TRACE_HEX_DUMP(QDF_MODULE_ID_WMI, QDF_TRACE_LEVEL_DEBUG, ndp_req->ndp_config.ndp_cfg, ndp_req->ndp_config.ndp_cfg_len); WMI_LOGD("ndp_app_info len: %d", cmd->ndp_app_info_len); - QDF_TRACE_HEX_DUMP(QDF_MODULE_ID_WMA, QDF_TRACE_LEVEL_DEBUG, + QDF_TRACE_HEX_DUMP(QDF_MODULE_ID_WMI, QDF_TRACE_LEVEL_DEBUG, ndp_req->ndp_info.ndp_app_info, ndp_req->ndp_info.ndp_app_info_len); WMI_LOGD("pmk len: %d", cmd->nan_pmk_len); - QDF_TRACE_HEX_DUMP(QDF_MODULE_ID_WMA, QDF_TRACE_LEVEL_DEBUG, + QDF_TRACE_HEX_DUMP(QDF_MODULE_ID_WMI, QDF_TRACE_LEVEL_DEBUG, ndp_req->pmk.pmk, cmd->nan_pmk_len); WMI_LOGD("pass phrase len: %d", cmd->nan_passphrase_len); - QDF_TRACE_HEX_DUMP(QDF_MODULE_ID_WMA, QDF_TRACE_LEVEL_DEBUG, + QDF_TRACE_HEX_DUMP(QDF_MODULE_ID_WMI, QDF_TRACE_LEVEL_DEBUG, ndp_req->passphrase.passphrase, cmd->nan_passphrase_len); WMI_LOGD("service name len: %d", cmd->nan_servicename_len); - QDF_TRACE_HEX_DUMP(QDF_MODULE_ID_WMA, QDF_TRACE_LEVEL_DEBUG, + QDF_TRACE_HEX_DUMP(QDF_MODULE_ID_WMI, QDF_TRACE_LEVEL_DEBUG, ndp_req->service_name.service_name, cmd->nan_servicename_len); @@ -16337,6 +16354,7 @@ static QDF_STATUS nan_ndp_responder_req_tlv(wmi_unified_t wmi_handle, uint8_t *tlv_ptr; QDF_STATUS status; wmi_ndp_responder_req_fixed_param *cmd; + wmi_ndp_transport_ip_param *tcp_ip_param; uint32_t passphrase_len, service_name_len; uint32_t vdev_id = 0, ndp_cfg_len, ndp_app_info_len, pmk_len; @@ -16362,6 +16380,10 @@ static QDF_STATUS nan_ndp_responder_req_tlv(wmi_unified_t wmi_handle, len = sizeof(*cmd) + 5*WMI_TLV_HDR_SIZE + ndp_cfg_len + ndp_app_info_len + pmk_len + passphrase_len + service_name_len; + if (req->is_ipv6_addr_present || req->is_port_present || + req->is_protocol_present) + len += sizeof(*tcp_ip_param); + buf = wmi_buf_alloc(wmi_handle, len); if (!buf) { WMI_LOGE("wmi_buf_alloc failed"); @@ -16413,32 +16435,55 @@ static QDF_STATUS nan_ndp_responder_req_tlv(wmi_unified_t wmi_handle, tlv_ptr = tlv_ptr + WMI_TLV_HDR_SIZE + service_name_len; + if (req->is_ipv6_addr_present || req->is_port_present || + req->is_protocol_present) { + tcp_ip_param = (wmi_ndp_transport_ip_param *)tlv_ptr; + WMITLV_SET_HDR(tcp_ip_param, + WMITLV_TAG_STRUC_wmi_ndp_transport_ip_param, + WMITLV_GET_STRUCT_TLVLEN( + wmi_ndp_transport_ip_param)); + tcp_ip_param->ipv6_addr_present = req->is_ipv6_addr_present; + qdf_mem_copy(tcp_ip_param->ipv6_intf_addr, + req->ipv6_addr, WMI_NDP_IPV6_INTF_ADDR_LEN); + + tcp_ip_param->trans_port_present = req->is_port_present; + tcp_ip_param->transport_port = req->port; + + tcp_ip_param->trans_proto_present = req->is_protocol_present; + tcp_ip_param->transport_protocol = req->protocol; + } + WMI_LOGD(FL("IPv6 addr present: %d, addr: %pI6"), + req->is_ipv6_addr_present, req->ipv6_addr); + WMI_LOGD(FL("port: %d present: %d"), req->is_port_present, req->port); + WMI_LOGD(FL("protocol: %d present: %d"), + req->is_protocol_present, req->protocol); + WMI_LOGD("vdev_id = %d, transaction_id: %d, csid: %d", cmd->vdev_id, cmd->transaction_id, cmd->nan_csid); WMI_LOGD("ndp_config len: %d", req->ndp_config.ndp_cfg_len); - QDF_TRACE_HEX_DUMP(QDF_MODULE_ID_WMA, QDF_TRACE_LEVEL_DEBUG, + QDF_TRACE_HEX_DUMP(QDF_MODULE_ID_WMI, QDF_TRACE_LEVEL_DEBUG, req->ndp_config.ndp_cfg, req->ndp_config.ndp_cfg_len); WMI_LOGD("ndp_app_info len: %d", req->ndp_info.ndp_app_info_len); - QDF_TRACE_HEX_DUMP(QDF_MODULE_ID_WMA, QDF_TRACE_LEVEL_DEBUG, + QDF_TRACE_HEX_DUMP(QDF_MODULE_ID_WMI, QDF_TRACE_LEVEL_DEBUG, req->ndp_info.ndp_app_info, req->ndp_info.ndp_app_info_len); WMI_LOGD("pmk len: %d", cmd->nan_pmk_len); - QDF_TRACE_HEX_DUMP(QDF_MODULE_ID_WMA, QDF_TRACE_LEVEL_DEBUG, + QDF_TRACE_HEX_DUMP(QDF_MODULE_ID_WMI, QDF_TRACE_LEVEL_DEBUG, req->pmk.pmk, cmd->nan_pmk_len); WMI_LOGD("pass phrase len: %d", cmd->nan_passphrase_len); - QDF_TRACE_HEX_DUMP(QDF_MODULE_ID_WMA, QDF_TRACE_LEVEL_DEBUG, + QDF_TRACE_HEX_DUMP(QDF_MODULE_ID_WMI, QDF_TRACE_LEVEL_DEBUG, req->passphrase.passphrase, cmd->nan_passphrase_len); WMI_LOGD("service name len: %d", cmd->nan_servicename_len); - QDF_TRACE_HEX_DUMP(QDF_MODULE_ID_WMA, QDF_TRACE_LEVEL_DEBUG, + QDF_TRACE_HEX_DUMP(QDF_MODULE_ID_WMI, QDF_TRACE_LEVEL_DEBUG, req->service_name.service_name, cmd->nan_servicename_len); @@ -16610,12 +16655,12 @@ static QDF_STATUS extract_ndp_ind_tlv(wmi_unified_t wmi_handle, rsp->peer_discovery_mac_addr.bytes); WMI_LOGD("ndp_cfg - %d bytes", fixed_params->ndp_cfg_len); - QDF_TRACE_HEX_DUMP(QDF_MODULE_ID_WMA, QDF_TRACE_LEVEL_DEBUG, + QDF_TRACE_HEX_DUMP(QDF_MODULE_ID_WMI, QDF_TRACE_LEVEL_DEBUG, &event->ndp_cfg, fixed_params->ndp_cfg_len); WMI_LOGD("ndp_app_info - %d bytes", fixed_params->ndp_app_info_len); - QDF_TRACE_HEX_DUMP(QDF_MODULE_ID_WMA, QDF_TRACE_LEVEL_DEBUG, + QDF_TRACE_HEX_DUMP(QDF_MODULE_ID_WMI, QDF_TRACE_LEVEL_DEBUG, &event->ndp_app_info, fixed_params->ndp_app_info_len); rsp->ndp_config.ndp_cfg_len = fixed_params->ndp_cfg_len; @@ -16627,8 +16672,21 @@ static QDF_STATUS extract_ndp_ind_tlv(wmi_unified_t wmi_handle, qdf_mem_copy(rsp->ndp_info.ndp_app_info, event->ndp_app_info, rsp->ndp_info.ndp_app_info_len); qdf_mem_copy(rsp->scid.scid, event->ndp_scid, rsp->scid.scid_len); + + if (event->ndp_transport_ip_param && + event->num_ndp_transport_ip_param) { + if (event->ndp_transport_ip_param->ipv6_addr_present) { + rsp->is_ipv6_addr_present = true; + qdf_mem_copy(rsp->ipv6_addr, + event->ndp_transport_ip_param->ipv6_intf_addr, + WMI_NDP_IPV6_INTF_ADDR_LEN); + } + } + WMI_LOGD(FL("IPv6 addr present: %d, addr: %pI6"), + rsp->is_ipv6_addr_present, rsp->ipv6_addr); + WMI_LOGD("scid hex dump:"); - QDF_TRACE_HEX_DUMP(QDF_MODULE_ID_WMA, QDF_TRACE_LEVEL_DEBUG, + QDF_TRACE_HEX_DUMP(QDF_MODULE_ID_WMI, QDF_TRACE_LEVEL_DEBUG, rsp->scid.scid, rsp->scid.scid_len); return QDF_STATUS_SUCCESS; @@ -16659,7 +16717,7 @@ static QDF_STATUS extract_ndp_confirm_tlv(wmi_unified_t wmi_handle, } WMI_LOGD("ndp_cfg - %d bytes", fixed_params->ndp_cfg_len); - QDF_TRACE_HEX_DUMP(QDF_MODULE_ID_WMA, QDF_TRACE_LEVEL_DEBUG, + QDF_TRACE_HEX_DUMP(QDF_MODULE_ID_WMI, QDF_TRACE_LEVEL_DEBUG, &event->ndp_cfg, fixed_params->ndp_cfg_len); if (fixed_params->ndp_app_info_len > event->num_ndp_app_info) { @@ -16671,7 +16729,7 @@ static QDF_STATUS extract_ndp_confirm_tlv(wmi_unified_t wmi_handle, WMI_LOGD("ndp_app_info - %d bytes", fixed_params->ndp_app_info_len); - QDF_TRACE_HEX_DUMP(QDF_MODULE_ID_WMA, QDF_TRACE_LEVEL_DEBUG, + QDF_TRACE_HEX_DUMP(QDF_MODULE_ID_WMI, QDF_TRACE_LEVEL_DEBUG, &event->ndp_app_info, fixed_params->ndp_app_info_len); if (fixed_params->ndp_cfg_len > @@ -16727,6 +16785,33 @@ static QDF_STATUS extract_ndp_confirm_tlv(wmi_unified_t wmi_handle, rsp->ch[i].nss); } + if (event->ndp_transport_ip_param && + event->num_ndp_transport_ip_param) { + if (event->ndp_transport_ip_param->ipv6_addr_present) { + rsp->is_ipv6_addr_present = true; + qdf_mem_copy(rsp->ipv6_addr, + event->ndp_transport_ip_param->ipv6_intf_addr, + WMI_NDP_IPV6_INTF_ADDR_LEN); + } + + if (event->ndp_transport_ip_param->trans_port_present) { + rsp->is_port_present = true; + rsp->port = + event->ndp_transport_ip_param->transport_port; + } + + if (event->ndp_transport_ip_param->trans_proto_present) { + rsp->is_protocol_present = true; + rsp->protocol = + event->ndp_transport_ip_param->transport_protocol; + } + } + WMI_LOGD(FL("IPv6 addr present: %d, addr: %pI6"), + rsp->is_ipv6_addr_present, rsp->ipv6_addr); + WMI_LOGD(FL("port: %d present: %d"), rsp->port, rsp->is_port_present); + WMI_LOGD(FL("protocol: %d present: %d"), + rsp->protocol, rsp->is_protocol_present); + return QDF_STATUS_SUCCESS; }