diff --git a/components/nan/core/inc/nan_public_structs.h b/components/nan/core/inc/nan_public_structs.h index 93169b88f6..5df19b20f6 100644 --- a/components/nan/core/inc/nan_public_structs.h +++ b/components/nan/core/inc/nan_public_structs.h @@ -51,7 +51,7 @@ struct wlan_objmgr_vdev; #define NAN_PSEUDO_VDEV_ID CFG_TGT_NUM_VDEV #define NAN_SER_CMD_TIMEOUT 4000 - +#define NDP_SERVICE_ID_LEN 6 /** * enum nan_discovery_msg_type - NAN msg type * @NAN_GENERIC_REQ: Type for all the NAN requests other than enable/disable @@ -713,6 +713,8 @@ struct nan_datapath_confirm_event { * @scid: security context identifier * @is_ipv6_addr_present: indicates if following ipv6 address is valid * @ipv6_addr: ipv6 address address used by ndp + * @is_service_id_present: indicates if service id is present + * @service_id: NDP service id */ struct nan_datapath_indication_event { struct wlan_objmgr_vdev *vdev; @@ -728,6 +730,8 @@ struct nan_datapath_indication_event { struct nan_datapath_scid scid; bool is_ipv6_addr_present; uint8_t ipv6_addr[QDF_IPV6_ADDR_SIZE]; + bool is_service_id_present; + uint8_t service_id[NDP_SERVICE_ID_LEN]; }; /** diff --git a/os_if/nan/src/os_if_nan.c b/os_if/nan/src/os_if_nan.c index c740d18b4f..a13a404c69 100644 --- a/os_if/nan/src/os_if_nan.c +++ b/os_if/nan/src/os_if_nan.c @@ -164,6 +164,10 @@ const struct nla_policy vendor_attr_policy[ .type = NLA_U8, .len = sizeof(uint8_t) }, + [QCA_WLAN_VENDOR_ATTR_NDP_SERVICE_ID] = { + .type = NLA_U8, + .len = NDP_SERVICE_ID_LEN + }, }; /** @@ -1288,7 +1292,9 @@ static inline uint32_t osif_ndp_get_ndp_req_ind_len( data_len += nla_total_size(event->scid.scid_len); if (event->ndp_info.ndp_app_info_len) data_len += nla_total_size(event->ndp_info.ndp_app_info_len); - + if (event->is_service_id_present) + data_len += nla_total_size(vendor_attr_policy[ + QCA_WLAN_VENDOR_ATTR_NDP_SERVICE_ID].len); return data_len; } @@ -1430,6 +1436,12 @@ static void os_if_ndp_indication_handler(struct wlan_objmgr_vdev *vdev, goto ndp_indication_nla_failed; } + if (event->is_service_id_present) { + if (nla_put(vendor_event, QCA_WLAN_VENDOR_ATTR_NDP_SERVICE_ID, + NDP_SERVICE_ID_LEN, event->service_id)) + goto ndp_indication_nla_failed; + } + cfg80211_vendor_event(vendor_event, GFP_ATOMIC); return; ndp_indication_nla_failed: