Lines Matching refs:pReq
23 wifi_error NanCommand::putNanEnable(transaction_id id, const NanEnableRequest *pReq) in putNanEnable() argument
29 if (pReq == NULL) { in putNanEnable()
36 pReq->config_support_5g ? (SIZEOF_TLV_HDR + \ in putNanEnable()
37 sizeof(pReq->support_5g_val)) : 0 \ in putNanEnable()
40 pReq->config_sid_beacon ? (SIZEOF_TLV_HDR + \ in putNanEnable()
41 sizeof(pReq->sid_beacon_val)) : 0 \ in putNanEnable()
44 pReq->config_2dot4g_rssi_close ? (SIZEOF_TLV_HDR + \ in putNanEnable()
45 sizeof(pReq->rssi_close_2dot4g_val)) : 0 \ in putNanEnable()
48 pReq->config_2dot4g_rssi_middle ? (SIZEOF_TLV_HDR + \ in putNanEnable()
49 sizeof(pReq->rssi_middle_2dot4g_val)) : 0 \ in putNanEnable()
52 pReq->config_hop_count_limit ? (SIZEOF_TLV_HDR + \ in putNanEnable()
53 sizeof(pReq->hop_count_limit_val)) : 0 \ in putNanEnable()
56 pReq->config_2dot4g_support ? (SIZEOF_TLV_HDR + \ in putNanEnable()
57 sizeof(pReq->support_2dot4g_val)) : 0 \ in putNanEnable()
60 pReq->config_2dot4g_beacons ? (SIZEOF_TLV_HDR + \ in putNanEnable()
61 sizeof(pReq->beacon_2dot4g_val)) : 0 \ in putNanEnable()
64 pReq->config_2dot4g_sdf ? (SIZEOF_TLV_HDR + \ in putNanEnable()
65 sizeof(pReq->sdf_2dot4g_val)) : 0 \ in putNanEnable()
68 pReq->config_5g_beacons ? (SIZEOF_TLV_HDR + \ in putNanEnable()
69 sizeof(pReq->beacon_5g_val)) : 0 \ in putNanEnable()
72 pReq->config_5g_sdf ? (SIZEOF_TLV_HDR + \ in putNanEnable()
73 sizeof(pReq->sdf_5g_val)) : 0 \ in putNanEnable()
76 pReq->config_5g_rssi_close ? (SIZEOF_TLV_HDR + \ in putNanEnable()
77 sizeof(pReq->rssi_close_5g_val)) : 0 \ in putNanEnable()
80 pReq->config_5g_rssi_middle ? (SIZEOF_TLV_HDR + \ in putNanEnable()
81 sizeof(pReq->rssi_middle_5g_val)) : 0 \ in putNanEnable()
84 pReq->config_2dot4g_rssi_proximity ? (SIZEOF_TLV_HDR + \ in putNanEnable()
85 sizeof(pReq->rssi_proximity_2dot4g_val)) : 0 \ in putNanEnable()
88 pReq->config_5g_rssi_close_proximity ? (SIZEOF_TLV_HDR + \ in putNanEnable()
89 sizeof(pReq->rssi_close_proximity_5g_val)) : 0 \ in putNanEnable()
92 pReq->config_rssi_window_size ? (SIZEOF_TLV_HDR + \ in putNanEnable()
93 sizeof(pReq->rssi_window_size_val)) : 0 \ in putNanEnable()
96 pReq->config_oui ? (SIZEOF_TLV_HDR + \ in putNanEnable()
97 sizeof(pReq->oui_val)) : 0 \ in putNanEnable()
100 pReq->config_intf_addr ? (SIZEOF_TLV_HDR + \ in putNanEnable()
101 sizeof(pReq->intf_addr_val)) : 0 \ in putNanEnable()
104 pReq->config_cluster_attribute_val ? (SIZEOF_TLV_HDR + \ in putNanEnable()
105 sizeof(pReq->config_cluster_attribute_val)) : 0 \ in putNanEnable()
108 pReq->config_scan_params ? NAN_MAX_SOCIAL_CHANNELS * in putNanEnable()
112 pReq->config_random_factor_force ? (SIZEOF_TLV_HDR + \ in putNanEnable()
113 sizeof(pReq->random_factor_force_val)) : 0 \ in putNanEnable()
116 pReq->config_hop_count_force ? (SIZEOF_TLV_HDR + \ in putNanEnable()
117 sizeof(pReq->hop_count_force_val)) : 0 \ in putNanEnable()
120 pReq->config_24g_channel ? (SIZEOF_TLV_HDR + \ in putNanEnable()
124 pReq->config_5g_channel ? (SIZEOF_TLV_HDR + \ in putNanEnable()
128 pReq->config_dw.config_2dot4g_dw_band ? (SIZEOF_TLV_HDR + \ in putNanEnable()
132 pReq->config_dw.config_5g_dw_band ? (SIZEOF_TLV_HDR + \ in putNanEnable()
136 pReq->config_disc_mac_addr_randomization ? (SIZEOF_TLV_HDR + \ in putNanEnable()
144 pReq->config_subscribe_sid_beacon ? (SIZEOF_TLV_HDR + \ in putNanEnable()
145 sizeof(pReq->subscribe_sid_beacon_val)) : 0 \ in putNanEnable()
148 pReq->config_discovery_beacon_int ? (SIZEOF_TLV_HDR + \ in putNanEnable()
152 pReq->config_nss ? (SIZEOF_TLV_HDR + \ in putNanEnable()
156 pReq->config_enable_ranging ? (SIZEOF_TLV_HDR + \ in putNanEnable()
160 pReq->config_dw_early_termination ? (SIZEOF_TLV_HDR + \ in putNanEnable()
164 pReq->config_ndpe_attr? (SIZEOF_TLV_HDR + \ in putNanEnable()
185 tlvs = addTlv(NAN_TLV_TYPE_CLUSTER_ID_LOW, sizeof(pReq->cluster_low), in putNanEnable()
186 (const u8*)&pReq->cluster_low, tlvs); in putNanEnable()
187 tlvs = addTlv(NAN_TLV_TYPE_CLUSTER_ID_HIGH, sizeof(pReq->cluster_high), in putNanEnable()
188 (const u8*)&pReq->cluster_high, tlvs); in putNanEnable()
189 tlvs = addTlv(NAN_TLV_TYPE_MASTER_PREFERENCE, sizeof(pReq->master_pref), in putNanEnable()
190 (const u8*)&pReq->master_pref, tlvs); in putNanEnable()
191 if (pReq->config_support_5g) { in putNanEnable()
192 tlvs = addTlv(NAN_TLV_TYPE_5G_SUPPORT, sizeof(pReq->support_5g_val), in putNanEnable()
193 (const u8*)&pReq->support_5g_val, tlvs); in putNanEnable()
195 if (pReq->config_sid_beacon) { in putNanEnable()
196 tlvs = addTlv(NAN_TLV_TYPE_SID_BEACON, sizeof(pReq->sid_beacon_val), in putNanEnable()
197 (const u8*)&pReq->sid_beacon_val, tlvs); in putNanEnable()
199 if (pReq->config_2dot4g_rssi_close) { in putNanEnable()
201 sizeof(pReq->rssi_close_2dot4g_val), in putNanEnable()
202 (const u8*)&pReq->rssi_close_2dot4g_val, tlvs); in putNanEnable()
204 if (pReq->config_2dot4g_rssi_middle) { in putNanEnable()
206 sizeof(pReq->rssi_middle_2dot4g_val), in putNanEnable()
207 (const u8*)&pReq->rssi_middle_2dot4g_val, tlvs); in putNanEnable()
209 if (pReq->config_hop_count_limit) { in putNanEnable()
211 sizeof(pReq->hop_count_limit_val), in putNanEnable()
212 (const u8*)&pReq->hop_count_limit_val, tlvs); in putNanEnable()
214 if (pReq->config_2dot4g_support) { in putNanEnable()
215 tlvs = addTlv(NAN_TLV_TYPE_24G_SUPPORT, sizeof(pReq->support_2dot4g_val), in putNanEnable()
216 (const u8*)&pReq->support_2dot4g_val, tlvs); in putNanEnable()
218 if (pReq->config_2dot4g_beacons) { in putNanEnable()
219 tlvs = addTlv(NAN_TLV_TYPE_24G_BEACON, sizeof(pReq->beacon_2dot4g_val), in putNanEnable()
220 (const u8*)&pReq->beacon_2dot4g_val, tlvs); in putNanEnable()
222 if (pReq->config_2dot4g_sdf) { in putNanEnable()
223 tlvs = addTlv(NAN_TLV_TYPE_24G_SDF, sizeof(pReq->sdf_2dot4g_val), in putNanEnable()
224 (const u8*)&pReq->sdf_2dot4g_val, tlvs); in putNanEnable()
226 if (pReq->config_5g_beacons) { in putNanEnable()
227 tlvs = addTlv(NAN_TLV_TYPE_5G_BEACON, sizeof(pReq->beacon_5g_val), in putNanEnable()
228 (const u8*)&pReq->beacon_5g_val, tlvs); in putNanEnable()
230 if (pReq->config_5g_sdf) { in putNanEnable()
231 tlvs = addTlv(NAN_TLV_TYPE_5G_SDF, sizeof(pReq->sdf_5g_val), in putNanEnable()
232 (const u8*)&pReq->sdf_5g_val, tlvs); in putNanEnable()
234 if (pReq->config_2dot4g_rssi_proximity) { in putNanEnable()
236 sizeof(pReq->rssi_proximity_2dot4g_val), in putNanEnable()
237 (const u8*)&pReq->rssi_proximity_2dot4g_val, tlvs); in putNanEnable()
240 if (pReq->config_5g_rssi_close) { in putNanEnable()
241 tlvs = addTlv(NAN_TLV_TYPE_5G_RSSI_CLOSE, sizeof(pReq->rssi_close_5g_val), in putNanEnable()
242 (const u8*)&pReq->rssi_close_5g_val, tlvs); in putNanEnable()
244 if (pReq->config_5g_rssi_middle) { in putNanEnable()
245 tlvs = addTlv(NAN_TLV_TYPE_5G_RSSI_MIDDLE, sizeof(pReq->rssi_middle_5g_val), in putNanEnable()
246 (const u8*)&pReq->rssi_middle_5g_val, tlvs); in putNanEnable()
248 if (pReq->config_5g_rssi_close_proximity) { in putNanEnable()
250 sizeof(pReq->rssi_close_proximity_5g_val), in putNanEnable()
251 (const u8*)&pReq->rssi_close_proximity_5g_val, tlvs); in putNanEnable()
253 if (pReq->config_rssi_window_size) { in putNanEnable()
254 tlvs = addTlv(NAN_TLV_TYPE_RSSI_AVERAGING_WINDOW_SIZE, sizeof(pReq->rssi_window_size_val), in putNanEnable()
255 (const u8*)&pReq->rssi_window_size_val, tlvs); in putNanEnable()
257 if (pReq->config_oui) { in putNanEnable()
258 tlvs = addTlv(NAN_TLV_TYPE_CLUSTER_OUI_NETWORK_ID, sizeof(pReq->oui_val), in putNanEnable()
259 (const u8*)&pReq->oui_val, tlvs); in putNanEnable()
261 if (pReq->config_intf_addr) { in putNanEnable()
262 tlvs = addTlv(NAN_TLV_TYPE_SOURCE_MAC_ADDRESS, sizeof(pReq->intf_addr_val), in putNanEnable()
263 (const u8*)&pReq->intf_addr_val[0], tlvs); in putNanEnable()
265 if (pReq->config_cluster_attribute_val) { in putNanEnable()
266 … tlvs = addTlv(NAN_TLV_TYPE_CLUSTER_ATTRIBUTE_IN_SDF, sizeof(pReq->config_cluster_attribute_val), in putNanEnable()
267 (const u8*)&pReq->config_cluster_attribute_val, tlvs); in putNanEnable()
269 if (pReq->config_scan_params) { in putNanEnable()
272 fillNanSocialChannelParamVal(&pReq->scan_params_val, in putNanEnable()
281 if (pReq->config_random_factor_force) { in putNanEnable()
283 sizeof(pReq->random_factor_force_val), in putNanEnable()
284 (const u8*)&pReq->random_factor_force_val, tlvs); in putNanEnable()
286 if (pReq->config_hop_count_force) { in putNanEnable()
288 sizeof(pReq->hop_count_force_val), in putNanEnable()
289 (const u8*)&pReq->hop_count_force_val, tlvs); in putNanEnable()
291 if (pReq->config_24g_channel) { in putNanEnable()
294 (const u8*)&pReq->channel_24g_val, tlvs); in putNanEnable()
296 if (pReq->config_5g_channel) { in putNanEnable()
299 (const u8*)&pReq->channel_5g_val, tlvs); in putNanEnable()
301 if (pReq->config_dw.config_2dot4g_dw_band) { in putNanEnable()
303 sizeof(pReq->config_dw.dw_2dot4g_interval_val), in putNanEnable()
304 (const u8*)&pReq->config_dw.dw_2dot4g_interval_val, tlvs); in putNanEnable()
306 if (pReq->config_dw.config_5g_dw_band) { in putNanEnable()
308 sizeof(pReq->config_dw.dw_5g_interval_val), in putNanEnable()
309 (const u8*)&pReq->config_dw.dw_5g_interval_val, tlvs); in putNanEnable()
311 if (pReq->config_disc_mac_addr_randomization) { in putNanEnable()
314 (const u8*)&pReq->disc_mac_addr_rand_interval_sec, tlvs); in putNanEnable()
318 config_discovery_indications = (u32)pReq->discovery_indication_cfg; in putNanEnable()
323 if (pReq->config_subscribe_sid_beacon) { in putNanEnable()
325 sizeof(pReq->subscribe_sid_beacon_val), in putNanEnable()
326 (const u8*)&pReq->subscribe_sid_beacon_val, tlvs); in putNanEnable()
328 if (pReq->config_discovery_beacon_int) { in putNanEnable()
330 (const u8*)&pReq->discovery_beacon_interval, tlvs); in putNanEnable()
332 if (pReq->config_nss) { in putNanEnable()
334 (const u8*)&pReq->nss, tlvs); in putNanEnable()
336 if (pReq->config_enable_ranging) { in putNanEnable()
338 (const u8*)&pReq->enable_ranging, tlvs); in putNanEnable()
340 if (pReq->config_dw_early_termination) { in putNanEnable()
342 (const u8*)&pReq->enable_dw_termination, tlvs); in putNanEnable()
344 if (pReq->config_ndpe_attr) { in putNanEnable()
347 nanDevCapAttr.ndpe_attr_supp = pReq->use_ndpe_attr; in putNanEnable()
398 wifi_error NanCommand::putNanConfig(transaction_id id, const NanConfigRequest *pReq) in putNanConfig() argument
405 if (pReq == NULL || in putNanConfig()
406 pReq->num_config_discovery_attr > NAN_MAX_POSTDISCOVERY_LEN) { in putNanConfig()
415 pReq->config_sid_beacon ? (SIZEOF_TLV_HDR + \ in putNanConfig()
416 sizeof(pReq->sid_beacon)) : 0 \ in putNanConfig()
419 pReq->config_master_pref ? (SIZEOF_TLV_HDR + \ in putNanConfig()
420 sizeof(pReq->master_pref)) : 0 \ in putNanConfig()
423 pReq->config_rssi_proximity ? (SIZEOF_TLV_HDR + \ in putNanConfig()
424 sizeof(pReq->rssi_proximity)) : 0 \ in putNanConfig()
427 pReq->config_5g_rssi_close_proximity ? (SIZEOF_TLV_HDR + \ in putNanConfig()
428 sizeof(pReq->rssi_close_proximity_5g_val)) : 0 \ in putNanConfig()
431 pReq->config_rssi_window_size ? (SIZEOF_TLV_HDR + \ in putNanConfig()
432 sizeof(pReq->rssi_window_size_val)) : 0 \ in putNanConfig()
435 pReq->config_cluster_attribute_val ? (SIZEOF_TLV_HDR + \ in putNanConfig()
436 sizeof(pReq->config_cluster_attribute_val)) : 0 \ in putNanConfig()
439 pReq->config_scan_params ? NAN_MAX_SOCIAL_CHANNELS * in putNanConfig()
443 pReq->config_random_factor_force ? (SIZEOF_TLV_HDR + \ in putNanConfig()
444 sizeof(pReq->random_factor_force_val)) : 0 \ in putNanConfig()
447 pReq->config_hop_count_force ? (SIZEOF_TLV_HDR + \ in putNanConfig()
448 sizeof(pReq->hop_count_force_val)) : 0 \ in putNanConfig()
451 pReq->config_conn_capability ? (SIZEOF_TLV_HDR + \ in putNanConfig()
455 pReq->config_dw.config_2dot4g_dw_band ? (SIZEOF_TLV_HDR + \ in putNanConfig()
459 pReq->config_dw.config_5g_dw_band ? (SIZEOF_TLV_HDR + \ in putNanConfig()
463 pReq->config_disc_mac_addr_randomization ? (SIZEOF_TLV_HDR + \ in putNanConfig()
467 pReq->config_subscribe_sid_beacon ? (SIZEOF_TLV_HDR + \ in putNanConfig()
468 sizeof(pReq->subscribe_sid_beacon_val)) : 0 \ in putNanConfig()
475 pReq->config_discovery_beacon_int ? (SIZEOF_TLV_HDR + \ in putNanConfig()
479 pReq->config_nss ? (SIZEOF_TLV_HDR + \ in putNanConfig()
483 pReq->config_enable_ranging ? (SIZEOF_TLV_HDR + \ in putNanConfig()
487 pReq->config_dw_early_termination ? (SIZEOF_TLV_HDR + \ in putNanConfig()
491 pReq->config_ndpe_attr? (SIZEOF_TLV_HDR + \ in putNanConfig()
495 if (pReq->num_config_discovery_attr) { in putNanConfig()
496 for (idx = 0; idx < pReq->num_config_discovery_attr; idx ++) { in putNanConfig()
498 calcNanTransmitPostDiscoverySize(&pReq->discovery_attr_val[idx]); in putNanConfig()
502 if (pReq->config_fam && \ in putNanConfig()
503 calcNanFurtherAvailabilityMapSize(&pReq->fam_val)) { in putNanConfig()
505 calcNanFurtherAvailabilityMapSize(&pReq->fam_val)); in putNanConfig()
522 if (pReq->config_sid_beacon) { in putNanConfig()
523 tlvs = addTlv(NAN_TLV_TYPE_SID_BEACON, sizeof(pReq->sid_beacon), in putNanConfig()
524 (const u8*)&pReq->sid_beacon, tlvs); in putNanConfig()
526 if (pReq->config_master_pref) { in putNanConfig()
527 tlvs = addTlv(NAN_TLV_TYPE_MASTER_PREFERENCE, sizeof(pReq->master_pref), in putNanConfig()
528 (const u8*)&pReq->master_pref, tlvs); in putNanConfig()
530 if (pReq->config_rssi_window_size) { in putNanConfig()
531 tlvs = addTlv(NAN_TLV_TYPE_RSSI_AVERAGING_WINDOW_SIZE, sizeof(pReq->rssi_window_size_val), in putNanConfig()
532 (const u8*)&pReq->rssi_window_size_val, tlvs); in putNanConfig()
534 if (pReq->config_rssi_proximity) { in putNanConfig()
535 tlvs = addTlv(NAN_TLV_TYPE_24G_RSSI_CLOSE_PROXIMITY, sizeof(pReq->rssi_proximity), in putNanConfig()
536 (const u8*)&pReq->rssi_proximity, tlvs); in putNanConfig()
538 if (pReq->config_5g_rssi_close_proximity) { in putNanConfig()
540 sizeof(pReq->rssi_close_proximity_5g_val), in putNanConfig()
541 (const u8*)&pReq->rssi_close_proximity_5g_val, tlvs); in putNanConfig()
543 if (pReq->config_cluster_attribute_val) { in putNanConfig()
544 … tlvs = addTlv(NAN_TLV_TYPE_CLUSTER_ATTRIBUTE_IN_SDF, sizeof(pReq->config_cluster_attribute_val), in putNanConfig()
545 (const u8*)&pReq->config_cluster_attribute_val, tlvs); in putNanConfig()
547 if (pReq->config_scan_params) { in putNanConfig()
550 fillNanSocialChannelParamVal(&pReq->scan_params_val, in putNanConfig()
559 if (pReq->config_random_factor_force) { in putNanConfig()
561 sizeof(pReq->random_factor_force_val), in putNanConfig()
562 (const u8*)&pReq->random_factor_force_val, tlvs); in putNanConfig()
564 if (pReq->config_hop_count_force) { in putNanConfig()
566 sizeof(pReq->hop_count_force_val), in putNanConfig()
567 (const u8*)&pReq->hop_count_force_val, tlvs); in putNanConfig()
569 if (pReq->config_conn_capability) { in putNanConfig()
571 getNanTransmitPostConnectivityCapabilityVal(&pReq->conn_capability_val); in putNanConfig()
575 if (pReq->num_config_discovery_attr) { in putNanConfig()
576 for (idx = 0; idx < pReq->num_config_discovery_attr; idx ++) { in putNanConfig()
577 fillNanTransmitPostDiscoveryVal(&pReq->discovery_attr_val[idx], in putNanConfig()
581 &pReq->discovery_attr_val[idx]), in putNanConfig()
585 if (pReq->config_fam && \ in putNanConfig()
586 calcNanFurtherAvailabilityMapSize(&pReq->fam_val)) { in putNanConfig()
587 fillNanFurtherAvailabilityMapVal(&pReq->fam_val, in putNanConfig()
590 calcNanFurtherAvailabilityMapSize(&pReq->fam_val), in putNanConfig()
593 if (pReq->config_dw.config_2dot4g_dw_band) { in putNanConfig()
595 sizeof(pReq->config_dw.dw_2dot4g_interval_val), in putNanConfig()
596 (const u8*)&pReq->config_dw.dw_2dot4g_interval_val, tlvs); in putNanConfig()
598 if (pReq->config_dw.config_5g_dw_band) { in putNanConfig()
600 sizeof(pReq->config_dw.dw_5g_interval_val), in putNanConfig()
601 (const u8*)&pReq->config_dw.dw_5g_interval_val, tlvs); in putNanConfig()
603 if (pReq->config_disc_mac_addr_randomization) { in putNanConfig()
606 (const u8*)&pReq->disc_mac_addr_rand_interval_sec, tlvs); in putNanConfig()
608 if (pReq->config_subscribe_sid_beacon) { in putNanConfig()
610 sizeof(pReq->subscribe_sid_beacon_val), in putNanConfig()
611 (const u8*)&pReq->subscribe_sid_beacon_val, tlvs); in putNanConfig()
613 if (pReq->config_discovery_beacon_int) { in putNanConfig()
615 (const u8*)&pReq->discovery_beacon_interval, tlvs); in putNanConfig()
619 config_discovery_indications = (u32)(pReq->discovery_indication_cfg); in putNanConfig()
624 if (pReq->config_nss) { in putNanConfig()
626 (const u8*)&pReq->nss, tlvs); in putNanConfig()
628 if (pReq->config_enable_ranging) { in putNanConfig()
630 (const u8*)&pReq->enable_ranging, tlvs); in putNanConfig()
632 if (pReq->config_dw_early_termination) { in putNanConfig()
634 (const u8*)&pReq->enable_dw_termination, tlvs); in putNanConfig()
636 if (pReq->config_ndpe_attr) { in putNanConfig()
639 nanDevCapAttr.ndpe_attr_supp = pReq->use_ndpe_attr; in putNanConfig()
658 wifi_error NanCommand::putNanPublish(transaction_id id, const NanPublishRequest *pReq) in putNanPublish() argument
662 if (pReq == NULL) { in putNanPublish()
669 (pReq->service_name_len ? SIZEOF_TLV_HDR + pReq->service_name_len : 0) + in putNanPublish()
670 (pReq->service_specific_info_len ? SIZEOF_TLV_HDR + pReq->service_specific_info_len : 0) + in putNanPublish()
671 (pReq->rx_match_filter_len ? SIZEOF_TLV_HDR + pReq->rx_match_filter_len : 0) + in putNanPublish()
672 (pReq->tx_match_filter_len ? SIZEOF_TLV_HDR + pReq->tx_match_filter_len : 0) + in putNanPublish()
674 (pReq->cipher_type ? SIZEOF_TLV_HDR + sizeof(NanCsidType) : 0) + in putNanPublish()
675 ((pReq->sdea_params.config_nan_data_path || pReq->sdea_params.security_cfg || in putNanPublish()
676 pReq->sdea_params.ranging_state || pReq->sdea_params.range_report || in putNanPublish()
677 pReq->sdea_params.qos_cfg) ? in putNanPublish()
679 ((pReq->ranging_cfg.ranging_interval_msec || pReq->ranging_cfg.config_ranging_indications || in putNanPublish()
680 pReq->ranging_cfg.distance_ingress_mm || pReq->ranging_cfg.distance_egress_mm) ? in putNanPublish()
682 ((pReq->range_response_cfg.publish_id || in putNanPublish()
683 pReq->range_response_cfg.ranging_response) ? in putNanPublish()
685 …(pReq->sdea_service_specific_info_len ? SIZEOF_TLV_HDR + pReq->sdea_service_specific_info_len : 0); in putNanPublish()
687 if ((pReq->key_info.key_type == NAN_SECURITY_KEY_INPUT_PMK) && in putNanPublish()
688 (pReq->key_info.body.pmk_info.pmk_len == NAN_PMK_INFO_LEN)) in putNanPublish()
690 else if ((pReq->key_info.key_type == NAN_SECURITY_KEY_INPUT_PASSPHRASE) && in putNanPublish()
691 (pReq->key_info.body.passphrase_info.passphrase_len >= in putNanPublish()
693 (pReq->key_info.body.passphrase_info.passphrase_len <= in putNanPublish()
696 pReq->key_info.body.passphrase_info.passphrase_len; in putNanPublish()
709 if (pReq->publish_id == 0) { in putNanPublish()
712 pFwReq->fwHeader.handle = pReq->publish_id; in putNanPublish()
716 pFwReq->publishServiceReqParams.ttl = pReq->ttl; in putNanPublish()
717 pFwReq->publishServiceReqParams.period = pReq->period; in putNanPublish()
719 (pReq->recv_indication_cfg & BIT_3) ? 0 : 1; in putNanPublish()
720 pFwReq->publishServiceReqParams.publishType = pReq->publish_type; in putNanPublish()
721 pFwReq->publishServiceReqParams.txType = pReq->tx_type; in putNanPublish()
723 pFwReq->publishServiceReqParams.rssiThresholdFlag = pReq->rssi_threshold_flag; in putNanPublish()
724 pFwReq->publishServiceReqParams.matchAlg = pReq->publish_match_indicator; in putNanPublish()
725 pFwReq->publishServiceReqParams.count = pReq->publish_count; in putNanPublish()
726 pFwReq->publishServiceReqParams.connmap = pReq->connmap; in putNanPublish()
728 (pReq->recv_indication_cfg & BIT_0) ? 1 : 0; in putNanPublish()
730 (pReq->recv_indication_cfg & BIT_1) ? 1 : 0; in putNanPublish()
732 (pReq->recv_indication_cfg & BIT_2) ? 1 : 0; in putNanPublish()
737 if (pReq->service_name_len) { in putNanPublish()
738 tlvs = addTlv(NAN_TLV_TYPE_SERVICE_NAME, pReq->service_name_len, in putNanPublish()
739 (const u8*)&pReq->service_name[0], tlvs); in putNanPublish()
741 if (pReq->service_specific_info_len) { in putNanPublish()
742 tlvs = addTlv(NAN_TLV_TYPE_SERVICE_SPECIFIC_INFO, pReq->service_specific_info_len, in putNanPublish()
743 (const u8*)&pReq->service_specific_info[0], tlvs); in putNanPublish()
745 if (pReq->rx_match_filter_len) { in putNanPublish()
746 tlvs = addTlv(NAN_TLV_TYPE_RX_MATCH_FILTER, pReq->rx_match_filter_len, in putNanPublish()
747 (const u8*)&pReq->rx_match_filter[0], tlvs); in putNanPublish()
749 if (pReq->tx_match_filter_len) { in putNanPublish()
750 tlvs = addTlv(NAN_TLV_TYPE_TX_MATCH_FILTER, pReq->tx_match_filter_len, in putNanPublish()
751 (const u8*)&pReq->tx_match_filter[0], tlvs); in putNanPublish()
756 (const u8*)&pReq->service_responder_policy, tlvs); in putNanPublish()
758 if (pReq->cipher_type) { in putNanPublish()
760 pNanCsidType.csid_type = pReq->cipher_type; in putNanPublish()
765 if ((pReq->key_info.key_type == NAN_SECURITY_KEY_INPUT_PMK) && in putNanPublish()
766 (pReq->key_info.body.pmk_info.pmk_len == NAN_PMK_INFO_LEN)) { in putNanPublish()
768 pReq->key_info.body.pmk_info.pmk_len, in putNanPublish()
769 (const u8*)&pReq->key_info.body.pmk_info.pmk[0], tlvs); in putNanPublish()
770 } else if ((pReq->key_info.key_type == NAN_SECURITY_KEY_INPUT_PASSPHRASE) && in putNanPublish()
771 (pReq->key_info.body.passphrase_info.passphrase_len >= in putNanPublish()
773 (pReq->key_info.body.passphrase_info.passphrase_len <= in putNanPublish()
776 pReq->key_info.body.passphrase_info.passphrase_len, in putNanPublish()
777 (const u8*)&pReq->key_info.body.passphrase_info.passphrase[0], in putNanPublish()
781 if (pReq->sdea_params.config_nan_data_path || in putNanPublish()
782 pReq->sdea_params.security_cfg || in putNanPublish()
783 pReq->sdea_params.ranging_state || in putNanPublish()
784 pReq->sdea_params.range_report || in putNanPublish()
785 pReq->sdea_params.qos_cfg) { in putNanPublish()
789 if (pReq->sdea_params.config_nan_data_path) { in putNanPublish()
792 (pReq->sdea_params.ndp_type & BIT_0) ? in putNanPublish()
797 if (pReq->sdea_params.security_cfg) { in putNanPublish()
799 pReq->sdea_params.security_cfg; in putNanPublish()
801 if (pReq->sdea_params.ranging_state) { in putNanPublish()
803 pReq->sdea_params.ranging_state; in putNanPublish()
805 if (pReq->sdea_params.range_report) { in putNanPublish()
807 (((pReq->sdea_params.range_report & NAN_ENABLE_RANGE_REPORT) >> 1) ? 1 : 0); in putNanPublish()
809 if (pReq->sdea_params.qos_cfg) { in putNanPublish()
810 pNanFWSdeaCtrlParams.qos_required = pReq->sdea_params.qos_cfg; in putNanPublish()
816 if (pReq->ranging_cfg.ranging_interval_msec || in putNanPublish()
817 pReq->ranging_cfg.config_ranging_indications || in putNanPublish()
818 pReq->ranging_cfg.distance_ingress_mm || in putNanPublish()
819 pReq->ranging_cfg.distance_egress_mm) { in putNanPublish()
824 pReq->ranging_cfg.ranging_interval_msec; in putNanPublish()
826 ((pReq->ranging_cfg.config_ranging_indications & NAN_RANGING_INDICATE_CONTINUOUS_MASK) | in putNanPublish()
827 (pReq->ranging_cfg.config_ranging_indications & NAN_RANGING_INDICATE_INGRESS_MET_MASK) | in putNanPublish()
828 (pReq->ranging_cfg.config_ranging_indications & NAN_RANGING_INDICATE_EGRESS_MET_MASK)); in putNanPublish()
830 pNanFWRangingCfg.ranging_indication_event = pReq->ranging_cfg.config_ranging_indications; in putNanPublish()
831 if (pReq->ranging_cfg.config_ranging_indications & NAN_RANGING_INDICATE_INGRESS_MET_MASK) in putNanPublish()
833 pReq->ranging_cfg.distance_ingress_mm; in putNanPublish()
834 if (pReq->ranging_cfg.config_ranging_indications & NAN_RANGING_INDICATE_EGRESS_MET_MASK) in putNanPublish()
836 pReq->ranging_cfg.distance_egress_mm; in putNanPublish()
841 if (pReq->sdea_service_specific_info_len) { in putNanPublish()
842 tlvs = addTlv(NAN_TLV_TYPE_SDEA_SERVICE_SPECIFIC_INFO, pReq->sdea_service_specific_info_len, in putNanPublish()
843 (const u8*)&pReq->sdea_service_specific_info[0], tlvs); in putNanPublish()
846 if (pReq->range_response_cfg.publish_id || pReq->range_response_cfg.ranging_response) { in putNanPublish()
851 (u16)pReq->range_response_cfg.publish_id; in putNanPublish()
852 … CHAR_ARRAY_TO_MAC_ADDR(pReq->range_response_cfg.peer_addr, pNanFWRangeReqMsg.range_mac_addr); in putNanPublish()
854 ((pReq->range_response_cfg.ranging_response == NAN_RANGE_REQUEST_ACCEPT) ? 1 : 0); in putNanPublish()
856 ((pReq->range_response_cfg.ranging_response == NAN_RANGE_REQUEST_REJECT) ? 1 : 0); in putNanPublish()
858 ((pReq->range_response_cfg.ranging_response == NAN_RANGE_REQUEST_CANCEL) ? 1 : 0); in putNanPublish()
876 wifi_error NanCommand::putNanPublishCancel(transaction_id id, const NanPublishCancelRequest *pReq) in putNanPublishCancel() argument
880 if (pReq == NULL) { in putNanPublishCancel()
898 pFwReq->fwHeader.handle = pReq->publish_id; in putNanPublishCancel()
915 const NanSubscribeRequest *pReq) in putNanSubscribe() argument
920 if (pReq == NULL) { in putNanSubscribe()
927 (pReq->service_name_len ? SIZEOF_TLV_HDR + pReq->service_name_len : 0) + in putNanSubscribe()
928 (pReq->service_specific_info_len ? SIZEOF_TLV_HDR + pReq->service_specific_info_len : 0) + in putNanSubscribe()
929 (pReq->rx_match_filter_len ? SIZEOF_TLV_HDR + pReq->rx_match_filter_len : 0) + in putNanSubscribe()
930 (pReq->tx_match_filter_len ? SIZEOF_TLV_HDR + pReq->tx_match_filter_len : 0) + in putNanSubscribe()
931 (pReq->cipher_type ? SIZEOF_TLV_HDR + sizeof(NanCsidType) : 0) + in putNanSubscribe()
932 ((pReq->sdea_params.config_nan_data_path || pReq->sdea_params.security_cfg || in putNanSubscribe()
933 pReq->sdea_params.ranging_state || pReq->sdea_params.range_report || in putNanSubscribe()
934 pReq->sdea_params.qos_cfg) ? in putNanSubscribe()
936 ((pReq->ranging_cfg.ranging_interval_msec || pReq->ranging_cfg.config_ranging_indications || in putNanSubscribe()
937 pReq->ranging_cfg.distance_ingress_mm || pReq->ranging_cfg.distance_egress_mm) ? in putNanSubscribe()
939 ((pReq->range_response_cfg.requestor_instance_id || in putNanSubscribe()
940 pReq->range_response_cfg.ranging_response) ? in putNanSubscribe()
942 …(pReq->sdea_service_specific_info_len ? SIZEOF_TLV_HDR + pReq->sdea_service_specific_info_len : 0); in putNanSubscribe()
945 (pReq->num_intf_addr_present * (SIZEOF_TLV_HDR + NAN_MAC_ADDR_LEN)); in putNanSubscribe()
947 if ((pReq->key_info.key_type == NAN_SECURITY_KEY_INPUT_PMK) && in putNanSubscribe()
948 (pReq->key_info.body.pmk_info.pmk_len == NAN_PMK_INFO_LEN)) in putNanSubscribe()
950 else if ((pReq->key_info.key_type == NAN_SECURITY_KEY_INPUT_PASSPHRASE) && in putNanSubscribe()
951 (pReq->key_info.body.passphrase_info.passphrase_len >= in putNanSubscribe()
953 (pReq->key_info.body.passphrase_info.passphrase_len <= in putNanSubscribe()
956 pReq->key_info.body.passphrase_info.passphrase_len; in putNanSubscribe()
969 if (pReq->subscribe_id == 0) { in putNanSubscribe()
972 pFwReq->fwHeader.handle = pReq->subscribe_id; in putNanSubscribe()
976 pFwReq->subscribeServiceReqParams.ttl = pReq->ttl; in putNanSubscribe()
977 pFwReq->subscribeServiceReqParams.period = pReq->period; in putNanSubscribe()
978 pFwReq->subscribeServiceReqParams.subscribeType = pReq->subscribe_type; in putNanSubscribe()
979 pFwReq->subscribeServiceReqParams.srfAttr = pReq->serviceResponseFilter; in putNanSubscribe()
980 pFwReq->subscribeServiceReqParams.srfInclude = pReq->serviceResponseInclude; in putNanSubscribe()
981 pFwReq->subscribeServiceReqParams.srfSend = pReq->useServiceResponseFilter; in putNanSubscribe()
982 pFwReq->subscribeServiceReqParams.ssiRequired = pReq->ssiRequiredForMatchIndication; in putNanSubscribe()
983 pFwReq->subscribeServiceReqParams.matchAlg = pReq->subscribe_match_indicator; in putNanSubscribe()
984 pFwReq->subscribeServiceReqParams.count = pReq->subscribe_count; in putNanSubscribe()
985 pFwReq->subscribeServiceReqParams.rssiThresholdFlag = pReq->rssi_threshold_flag; in putNanSubscribe()
987 (pReq->recv_indication_cfg & BIT_0) ? 1 : 0; in putNanSubscribe()
989 (pReq->recv_indication_cfg & BIT_1) ? 1 : 0; in putNanSubscribe()
991 (pReq->recv_indication_cfg & BIT_2) ? 1 : 0; in putNanSubscribe()
992 pFwReq->subscribeServiceReqParams.connmap = pReq->connmap; in putNanSubscribe()
996 if (pReq->service_name_len) { in putNanSubscribe()
997 tlvs = addTlv(NAN_TLV_TYPE_SERVICE_NAME, pReq->service_name_len, in putNanSubscribe()
998 (const u8*)&pReq->service_name[0], tlvs); in putNanSubscribe()
1000 if (pReq->service_specific_info_len) { in putNanSubscribe()
1001 tlvs = addTlv(NAN_TLV_TYPE_SERVICE_SPECIFIC_INFO, pReq->service_specific_info_len, in putNanSubscribe()
1002 (const u8*)&pReq->service_specific_info[0], tlvs); in putNanSubscribe()
1004 if (pReq->rx_match_filter_len) { in putNanSubscribe()
1005 tlvs = addTlv(NAN_TLV_TYPE_RX_MATCH_FILTER, pReq->rx_match_filter_len, in putNanSubscribe()
1006 (const u8*)&pReq->rx_match_filter[0], tlvs); in putNanSubscribe()
1008 if (pReq->tx_match_filter_len) { in putNanSubscribe()
1009 tlvs = addTlv(NAN_TLV_TYPE_TX_MATCH_FILTER, pReq->tx_match_filter_len, in putNanSubscribe()
1010 (const u8*)&pReq->tx_match_filter[0], tlvs); in putNanSubscribe()
1014 for (i = 0; i < pReq->num_intf_addr_present; i++) in putNanSubscribe()
1018 (const u8*)&pReq->intf_addr[i][0], tlvs); in putNanSubscribe()
1021 if (pReq->cipher_type) { in putNanSubscribe()
1023 pNanCsidType.csid_type = pReq->cipher_type; in putNanSubscribe()
1028 if ((pReq->key_info.key_type == NAN_SECURITY_KEY_INPUT_PMK) && in putNanSubscribe()
1029 (pReq->key_info.body.pmk_info.pmk_len == NAN_PMK_INFO_LEN)) { in putNanSubscribe()
1031 pReq->key_info.body.pmk_info.pmk_len, in putNanSubscribe()
1032 (const u8*)&pReq->key_info.body.pmk_info.pmk[0], tlvs); in putNanSubscribe()
1033 } else if ((pReq->key_info.key_type == NAN_SECURITY_KEY_INPUT_PASSPHRASE) && in putNanSubscribe()
1034 (pReq->key_info.body.passphrase_info.passphrase_len >= in putNanSubscribe()
1036 (pReq->key_info.body.passphrase_info.passphrase_len <= in putNanSubscribe()
1039 pReq->key_info.body.passphrase_info.passphrase_len, in putNanSubscribe()
1040 (const u8*)&pReq->key_info.body.passphrase_info.passphrase[0], in putNanSubscribe()
1044 if (pReq->sdea_params.config_nan_data_path || in putNanSubscribe()
1045 pReq->sdea_params.security_cfg || in putNanSubscribe()
1046 pReq->sdea_params.ranging_state || in putNanSubscribe()
1047 pReq->sdea_params.range_report || in putNanSubscribe()
1048 pReq->sdea_params.qos_cfg) { in putNanSubscribe()
1052 if (pReq->sdea_params.config_nan_data_path) { in putNanSubscribe()
1055 (pReq->sdea_params.ndp_type & BIT_0) ? in putNanSubscribe()
1060 if (pReq->sdea_params.security_cfg) { in putNanSubscribe()
1062 pReq->sdea_params.security_cfg; in putNanSubscribe()
1064 if (pReq->sdea_params.ranging_state) { in putNanSubscribe()
1066 pReq->sdea_params.ranging_state; in putNanSubscribe()
1068 if (pReq->sdea_params.range_report) { in putNanSubscribe()
1070 ((pReq->sdea_params.range_report & NAN_ENABLE_RANGE_REPORT >> 1) ? 1 : 0); in putNanSubscribe()
1072 if (pReq->sdea_params.qos_cfg) { in putNanSubscribe()
1073 pNanFWSdeaCtrlParams.qos_required = pReq->sdea_params.qos_cfg; in putNanSubscribe()
1080 …if (pReq->ranging_cfg.ranging_interval_msec || pReq->ranging_cfg.config_ranging_indications || pRe… in putNanSubscribe()
1081 || pReq->ranging_cfg.distance_egress_mm) { in putNanSubscribe()
1085 pReq->ranging_cfg.ranging_interval_msec; in putNanSubscribe()
1087 ((pReq->ranging_cfg.config_ranging_indications & NAN_RANGING_INDICATE_CONTINUOUS_MASK) | in putNanSubscribe()
1088 (pReq->ranging_cfg.config_ranging_indications & NAN_RANGING_INDICATE_INGRESS_MET_MASK) | in putNanSubscribe()
1089 (pReq->ranging_cfg.config_ranging_indications & NAN_RANGING_INDICATE_EGRESS_MET_MASK)); in putNanSubscribe()
1092 pReq->ranging_cfg.config_ranging_indications; in putNanSubscribe()
1093 if (pReq->ranging_cfg.config_ranging_indications & NAN_RANGING_INDICATE_INGRESS_MET_MASK) in putNanSubscribe()
1095 pReq->ranging_cfg.distance_ingress_mm; in putNanSubscribe()
1096 if (pReq->ranging_cfg.config_ranging_indications & NAN_RANGING_INDICATE_EGRESS_MET_MASK) in putNanSubscribe()
1098 pReq->ranging_cfg.distance_egress_mm; in putNanSubscribe()
1103 if (pReq->sdea_service_specific_info_len) { in putNanSubscribe()
1104 tlvs = addTlv(NAN_TLV_TYPE_SDEA_SERVICE_SPECIFIC_INFO, pReq->sdea_service_specific_info_len, in putNanSubscribe()
1105 (const u8*)&pReq->sdea_service_specific_info[0], tlvs); in putNanSubscribe()
1108 … if (pReq->range_response_cfg.requestor_instance_id || pReq->range_response_cfg.ranging_response) { in putNanSubscribe()
1112 pReq->range_response_cfg.requestor_instance_id; in putNanSubscribe()
1113 … memcpy(&pNanFWRangeReqMsg.range_mac_addr, &pReq->range_response_cfg.peer_addr, NAN_MAC_ADDR_LEN); in putNanSubscribe()
1115 ((pReq->range_response_cfg.ranging_response == NAN_RANGE_REQUEST_ACCEPT) ? 1 : 0); in putNanSubscribe()
1117 ((pReq->range_response_cfg.ranging_response == NAN_RANGE_REQUEST_REJECT) ? 1 : 0); in putNanSubscribe()
1119 ((pReq->range_response_cfg.ranging_response == NAN_RANGE_REQUEST_CANCEL) ? 1 : 0); in putNanSubscribe()
1137 const NanSubscribeCancelRequest *pReq) in putNanSubscribeCancel() argument
1141 if (pReq == NULL) { in putNanSubscribeCancel()
1159 pFwReq->fwHeader.handle = pReq->subscribe_id; in putNanSubscribeCancel()
1175 const NanTransmitFollowupRequest *pReq) in putNanTransmitFollowup() argument
1179 if (pReq == NULL) { in putNanTransmitFollowup()
1186 (pReq->service_specific_info_len ? SIZEOF_TLV_HDR + in putNanTransmitFollowup()
1187 pReq->service_specific_info_len : 0) + in putNanTransmitFollowup()
1188 …(pReq->sdea_service_specific_info_len ? SIZEOF_TLV_HDR + pReq->sdea_service_specific_info_len : 0); in putNanTransmitFollowup()
1191 message_len += (SIZEOF_TLV_HDR + sizeof(pReq->addr)); in putNanTransmitFollowup()
1204 pFwReq->fwHeader.handle = pReq->publish_subscribe_id; in putNanTransmitFollowup()
1207 pFwReq->transmitFollowupReqParams.matchHandle = pReq->requestor_instance_id; in putNanTransmitFollowup()
1208 if (pReq->priority != NAN_TX_PRIORITY_HIGH) { in putNanTransmitFollowup()
1213 pFwReq->transmitFollowupReqParams.window = pReq->dw_or_faw; in putNanTransmitFollowup()
1215 (pReq->recv_indication_cfg & BIT_0) ? 1 : 0; in putNanTransmitFollowup()
1221 tlvs = addTlv(NAN_TLV_TYPE_MAC_ADDRESS, sizeof(pReq->addr), in putNanTransmitFollowup()
1222 (const u8*)&pReq->addr[0], tlvs); in putNanTransmitFollowup()
1225 if (pReq->service_specific_info_len) { in putNanTransmitFollowup()
1226 tlvs = addTlv(tlv_type, pReq->service_specific_info_len, in putNanTransmitFollowup()
1227 (const u8*)&pReq->service_specific_info[0], tlvs); in putNanTransmitFollowup()
1230 if (pReq->sdea_service_specific_info_len) { in putNanTransmitFollowup()
1231 tlvs = addTlv(NAN_TLV_TYPE_SDEA_SERVICE_SPECIFIC_INFO, pReq->sdea_service_specific_info_len, in putNanTransmitFollowup()
1232 (const u8*)&pReq->sdea_service_specific_info[0], tlvs); in putNanTransmitFollowup()
1248 wifi_error NanCommand::putNanStats(transaction_id id, const NanStatsRequest *pReq) in putNanStats() argument
1252 if (pReq == NULL) { in putNanStats()
1272 pFwReq->statsReqParams.statsType = pReq->stats_type; in putNanStats()
1273 pFwReq->statsReqParams.clear = pReq->clear; in putNanStats()
1289 wifi_error NanCommand::putNanTCA(transaction_id id, const NanTCARequest *pReq) in putNanTCA() argument
1293 if (pReq == NULL) { in putNanTCA()
1316 tcaReqParams[0] = (pReq->rising_direction_evt_flag & 0x01); in putNanTCA()
1317 tcaReqParams[0] |= (pReq->falling_direction_evt_flag & 0x01) << 1; in putNanTCA()
1318 tcaReqParams[0] |= (pReq->clear & 0x01) << 2; in putNanTCA()
1319 tcaReqParams[1] = pReq->threshold; in putNanTCA()
1323 if (pReq->tca_type == NAN_TCA_ID_CLUSTER_SIZE) { in putNanTCA()
1327 ALOGE("%s: Unrecognized tca_type:%u", __FUNCTION__, pReq->tca_type); in putNanTCA()
1346 const NanBeaconSdfPayloadRequest *pReq) in putNanBeaconSdfPayload() argument
1350 if (pReq == NULL) { in putNanBeaconSdfPayload()
1356 pReq->vsa.vsa_len; in putNanBeaconSdfPayload()
1374 temp = pReq->vsa.payload_transmit_flag & 0x01; in putNanBeaconSdfPayload()
1375 temp |= (pReq->vsa.tx_in_discovery_beacon & 0x01) << 1; in putNanBeaconSdfPayload()
1376 temp |= (pReq->vsa.tx_in_sync_beacon & 0x01) << 2; in putNanBeaconSdfPayload()
1377 temp |= (pReq->vsa.tx_in_service_discovery & 0x01) << 3; in putNanBeaconSdfPayload()
1378 temp |= (pReq->vsa.vendor_oui & 0x00FFFFFF) << 8; in putNanBeaconSdfPayload()
1380 int tlv_len = sizeof(u32) + pReq->vsa.vsa_len; in putNanBeaconSdfPayload()
1390 memcpy((tempBuf + sizeof(u32)), pReq->vsa.vsa, pReq->vsa.vsa_len); in putNanBeaconSdfPayload()