Lines Matching refs:cfg

73 		if (p2p->cfg->go_connected &&  in p2p_expire_peers()
74 p2p->cfg->go_connected(p2p->cfg->cb_ctx, in p2p_expire_peers()
205 p2p->cfg->reg_class = p2p->pending_reg_class; in p2p_set_state()
206 p2p->cfg->channel = p2p->pending_channel; in p2p_set_state()
258 p2p->cfg->go_neg_completed(p2p->cfg->cb_ctx, &res); in p2p_go_neg_failed()
277 freq = p2p_channel_to_freq(p2p->cfg->reg_class, p2p->cfg->channel); in p2p_listen_in_find()
291 if (p2p->cfg->max_listen && 1024 * tu / 1000 > p2p->cfg->max_listen) in p2p_listen_in_find()
292 tu = p2p->cfg->max_listen * 1000 / 1024; in p2p_listen_in_find()
308 if (p2p->cfg->start_listen(p2p->cfg->cb_ctx, freq, 1024 * tu / 1000, in p2p_listen_in_find()
330 freq = p2p_channel_to_freq(p2p->cfg->reg_class, p2p->cfg->channel); in p2p_listen()
355 if (p2p->cfg->start_listen(p2p->cfg->cb_ctx, freq, timeout, ies) < 0) { in p2p_listen()
439 if (count + 1 > p2p->cfg->max_peers && oldest) { in p2p_create_device()
498 if (os_memcmp(cli->p2p_device_addr, p2p->cfg->dev_addr, in p2p_add_group_clients()
532 p2p->cfg->dev_found(p2p->cfg->cb_ctx, in p2p_add_group_clients()
899 p2p->cfg->dev_found(p2p->cfg->cb_ctx, addr, &dev->info, in p2p_add_device()
929 p2p->cfg->dev_lost(p2p->cfg->cb_ctx, in p2p_device_free()
956 c = &p2p->cfg->channels; in p2p_get_next_prog_freq()
1011 p2p->cfg->stop_listen(p2p->cfg->cb_ctx); in p2p_search()
1022 res = p2p->cfg->p2p_scan(p2p->cfg->cb_ctx, type, freq, in p2p_search()
1064 p2p->cfg->send_action(p2p->cfg->cb_ctx, in p2p_run_after_scan()
1233 p2p->cfg->stop_listen(p2p->cfg->cb_ctx); in p2p_find()
1251 res = p2p->cfg->p2p_scan(p2p->cfg->cb_ctx, in p2p_find()
1260 res = p2p->cfg->p2p_scan(p2p->cfg->cb_ctx, P2P_SCAN_FULL, 0, in p2p_find()
1266 res = p2p->cfg->p2p_scan(p2p->cfg->cb_ctx, P2P_SCAN_SOCIAL, 0, in p2p_find()
1295 p2p->cfg->find_stopped(p2p->cfg->cb_ctx); in p2p_stop_find_for_freq()
1331 p2p->cfg->stop_listen(p2p->cfg->cb_ctx); in p2p_stop_listen_for_freq()
1368 if (!p2p_channels_includes(&p2p->cfg->channels, op_class, op_channel) && in p2p_prepare_channel_pref()
1369 (go || !p2p_channels_includes(&p2p->cfg->cli_channels, op_class, in p2p_prepare_channel_pref()
1385 os_memcpy(&p2p->channels, &p2p->cfg->channels, in p2p_prepare_channel_pref()
1402 if (!p2p->cfg->cfg_op_channel && p2p->best_freq_overall > 0 && in p2p_prepare_channel_best()
1409 } else if (!p2p->cfg->cfg_op_channel && p2p->best_freq_5 > 0 && in p2p_prepare_channel_best()
1416 } else if (!p2p->cfg->cfg_op_channel && p2p->best_freq_24 > 0 && in p2p_prepare_channel_best()
1423 } else if (p2p->cfg->num_pref_chan > 0 && in p2p_prepare_channel_best()
1424 p2p_channels_includes(&p2p->cfg->channels, in p2p_prepare_channel_best()
1425 p2p->cfg->pref_chan[0].op_class, in p2p_prepare_channel_best()
1426 p2p->cfg->pref_chan[0].chan)) { in p2p_prepare_channel_best()
1428 p2p->op_reg_class = p2p->cfg->pref_chan[0].op_class; in p2p_prepare_channel_best()
1429 p2p->op_channel = p2p->cfg->pref_chan[0].chan; in p2p_prepare_channel_best()
1430 } else if (p2p_channel_select(&p2p->cfg->channels, op_classes_vht, in p2p_prepare_channel_best()
1435 } else if (p2p_channel_select(&p2p->cfg->channels, op_classes_ht40, in p2p_prepare_channel_best()
1440 } else if (p2p_channel_select(&p2p->cfg->channels, op_classes_5ghz, in p2p_prepare_channel_best()
1445 } else if (p2p_channels_includes(&p2p->cfg->channels, in p2p_prepare_channel_best()
1446 p2p->cfg->op_reg_class, in p2p_prepare_channel_best()
1447 p2p->cfg->op_channel)) { in p2p_prepare_channel_best()
1449 p2p->op_reg_class = p2p->cfg->op_reg_class; in p2p_prepare_channel_best()
1450 p2p->op_channel = p2p->cfg->op_channel; in p2p_prepare_channel_best()
1451 } else if (p2p_channel_random_social(&p2p->cfg->channels, in p2p_prepare_channel_best()
1459 p2p_channel_select(&p2p->cfg->channels, NULL, in p2p_prepare_channel_best()
1466 os_memcpy(&p2p->channels, &p2p->cfg->channels, in p2p_prepare_channel_best()
1502 &p2p->cfg->cli_channels); in p2p_prepare_channel()
1754 p2p->cfg->dev_found(p2p->cfg->cb_ctx, addr, &dev->info, in p2p_add_dev_info()
1765 p2p->cfg->ssid_postfix, p2p->cfg->ssid_postfix_len); in p2p_build_ssid()
1766 *ssid_len = P2P_WILDCARD_SSID_LEN + 2 + p2p->cfg->ssid_postfix_len; in p2p_build_ssid()
1780 p2p_random(params->passphrase, p2p->cfg->passphrase_len); in p2p_go_params()
1812 p2p_random(res.passphrase, p2p->cfg->passphrase_len); in p2p_go_complete()
1845 p2p->cfg->go_neg_completed(p2p->cfg->cb_ctx, &res); in p2p_go_complete()
1988 p2p->cfg->stop_listen(p2p->cfg->cb_ctx); in p2p_go_neg_start()
2008 p2p->cfg->stop_listen(p2p->cfg->cb_ctx); in p2p_invite_start()
2147 if (dev_type_list_match(p2p->cfg->pri_dev_type, attr.req_dev_type, in p2p_match_dev_type()
2151 for (i = 0; i < p2p->cfg->num_sec_dev_types; i++) { in p2p_match_dev_type()
2152 if (dev_type_list_match(p2p->cfg->sec_dev_type[i], in p2p_match_dev_type()
2277 os_memcmp(dst, p2p->cfg->dev_addr, ETH_ALEN) != 0) { in p2p_reply_probe()
2320 p2p->cfg->channel, p2p->pending_listen_freq); in p2p_reply_probe()
2361 os_memcmp(msg.device_id, p2p->cfg->dev_addr, ETH_ALEN) != 0) { in p2p_reply_probe()
2378 if (!p2p->cfg->send_probe_resp) { in p2p_reply_probe()
2411 os_memcpy(resp->sa, p2p->cfg->dev_addr, ETH_ALEN); in p2p_reply_probe()
2412 os_memcpy(resp->bssid, p2p->cfg->dev_addr, ETH_ALEN); in p2p_reply_probe()
2436 channel = p2p->cfg->channel; in p2p_reply_probe()
2450 p2p->cfg->send_probe_resp(p2p->cfg->cb_ctx, buf, rx_freq); in p2p_reply_probe()
2701 if (!(config_methods & p2p->cfg->config_methods)) { in p2p_service_add_asp()
2703 config_methods, p2p->cfg->config_methods); in p2p_service_add_asp()
2723 adv_data->config_methods = config_methods & p2p->cfg->config_methods; in p2p_service_add_asp()
2870 struct p2p_data * p2p_init(const struct p2p_config *cfg) in p2p_init() argument
2874 if (cfg->max_peers < 1 || in p2p_init()
2875 cfg->passphrase_len < 8 || cfg->passphrase_len > 63) in p2p_init()
2878 p2p = os_zalloc(sizeof(*p2p) + sizeof(*cfg)); in p2p_init()
2881 p2p->cfg = (struct p2p_config *) (p2p + 1); in p2p_init()
2882 os_memcpy(p2p->cfg, cfg, sizeof(*cfg)); in p2p_init()
2883 if (cfg->dev_name) in p2p_init()
2884 p2p->cfg->dev_name = os_strdup(cfg->dev_name); in p2p_init()
2885 if (cfg->manufacturer) in p2p_init()
2886 p2p->cfg->manufacturer = os_strdup(cfg->manufacturer); in p2p_init()
2887 if (cfg->model_name) in p2p_init()
2888 p2p->cfg->model_name = os_strdup(cfg->model_name); in p2p_init()
2889 if (cfg->model_number) in p2p_init()
2890 p2p->cfg->model_number = os_strdup(cfg->model_number); in p2p_init()
2891 if (cfg->serial_number) in p2p_init()
2892 p2p->cfg->serial_number = os_strdup(cfg->serial_number); in p2p_init()
2893 if (cfg->pref_chan) { in p2p_init()
2894 p2p->cfg->pref_chan = os_malloc(cfg->num_pref_chan * in p2p_init()
2896 if (p2p->cfg->pref_chan) { in p2p_init()
2897 os_memcpy(p2p->cfg->pref_chan, cfg->pref_chan, in p2p_init()
2898 cfg->num_pref_chan * in p2p_init()
2901 p2p->cfg->num_pref_chan = 0; in p2p_init()
2913 if (cfg->sd_request) in p2p_init()
2916 if (cfg->concurrent_operations) in p2p_init()
2930 p2p_channels_dump(p2p, "channels", &p2p->cfg->channels); in p2p_init()
2931 p2p_channels_dump(p2p, "cli_channels", &p2p->cfg->cli_channels); in p2p_init()
2960 os_free(p2p->cfg->dev_name); in p2p_deinit()
2961 os_free(p2p->cfg->manufacturer); in p2p_deinit()
2962 os_free(p2p->cfg->model_name); in p2p_deinit()
2963 os_free(p2p->cfg->model_number); in p2p_deinit()
2964 os_free(p2p->cfg->serial_number); in p2p_deinit()
2965 os_free(p2p->cfg->pref_chan); in p2p_deinit()
3026 os_free(p2p->cfg->dev_name); in p2p_set_dev_name()
3028 p2p->cfg->dev_name = os_strdup(dev_name); in p2p_set_dev_name()
3029 if (p2p->cfg->dev_name == NULL) in p2p_set_dev_name()
3032 p2p->cfg->dev_name = NULL; in p2p_set_dev_name()
3039 os_free(p2p->cfg->manufacturer); in p2p_set_manufacturer()
3040 p2p->cfg->manufacturer = NULL; in p2p_set_manufacturer()
3042 p2p->cfg->manufacturer = os_strdup(manufacturer); in p2p_set_manufacturer()
3043 if (p2p->cfg->manufacturer == NULL) in p2p_set_manufacturer()
3053 os_free(p2p->cfg->model_name); in p2p_set_model_name()
3054 p2p->cfg->model_name = NULL; in p2p_set_model_name()
3056 p2p->cfg->model_name = os_strdup(model_name); in p2p_set_model_name()
3057 if (p2p->cfg->model_name == NULL) in p2p_set_model_name()
3067 os_free(p2p->cfg->model_number); in p2p_set_model_number()
3068 p2p->cfg->model_number = NULL; in p2p_set_model_number()
3070 p2p->cfg->model_number = os_strdup(model_number); in p2p_set_model_number()
3071 if (p2p->cfg->model_number == NULL) in p2p_set_model_number()
3081 os_free(p2p->cfg->serial_number); in p2p_set_serial_number()
3082 p2p->cfg->serial_number = NULL; in p2p_set_serial_number()
3084 p2p->cfg->serial_number = os_strdup(serial_number); in p2p_set_serial_number()
3085 if (p2p->cfg->serial_number == NULL) in p2p_set_serial_number()
3095 p2p->cfg->config_methods = config_methods; in p2p_set_config_methods()
3101 os_memcpy(p2p->cfg->uuid, uuid, 16); in p2p_set_uuid()
3107 os_memcpy(p2p->cfg->pri_dev_type, pri_dev_type, 8); in p2p_set_pri_dev_type()
3117 p2p->cfg->num_sec_dev_types = num_dev_types; in p2p_set_sec_dev_types()
3118 os_memcpy(p2p->cfg->sec_dev_type, dev_types, num_dev_types * 8); in p2p_set_sec_dev_types()
3159 os_memcpy(p2p->cfg->country, country, 3); in p2p_set_country()
3236 p2p->cfg->send_action_done(p2p->cfg->cb_ctx); in p2p_sd_cb()
3374 p2p->cfg->send_action_done(p2p->cfg->cb_ctx); in p2p_prov_disc_resp_cb()
3382 if (!p2p->cfg->prov_disc_resp_cb || in p2p_prov_disc_resp_cb()
3383 p2p->cfg->prov_disc_resp_cb(p2p->cfg->cb_ctx) < 1) in p2p_prov_disc_resp_cb()
3461 if (p2p->cfg->reg_class && p2p->cfg->channel) in p2p_scan_ie()
3462 p2p_buf_add_listen_channel(ies, p2p->cfg->country, in p2p_scan_ie()
3463 p2p->cfg->reg_class, in p2p_scan_ie()
3464 p2p->cfg->channel); in p2p_scan_ie()
3527 p2p->cfg->send_action_done(p2p->cfg->cb_ctx); in p2p_go_neg_req_cb()
3597 p2p->cfg->send_action_done(p2p->cfg->cb_ctx); in p2p_go_neg_conf_cb()
3617 p2p->cfg->dev_addr, in p2p_go_neg_conf_cb()
3646 p2p->cfg->send_action_done(p2p->cfg->cb_ctx); in p2p_go_neg_conf_cb()
3673 p2p->cfg->send_action_done(p2p->cfg->cb_ctx); in p2p_send_action_cb()
3810 p2p->cfg->send_action_done(p2p->cfg->cb_ctx); in p2p_timeout_connect()
3860 if (p2p->cfg->is_concurrent_session_active && in p2p_timeout_wait_peer_connect()
3861 p2p->cfg->is_concurrent_session_active(p2p->cfg->cb_ctx)) in p2p_timeout_wait_peer_connect()
3887 p2p->cfg->send_action_done(p2p->cfg->cb_ctx); in p2p_timeout_sd_during_find()
3897 p2p->cfg->send_action_done(p2p->cfg->cb_ctx); in p2p_timeout_prov_disc_during_find()
3940 if (p2p->cfg->prov_disc_fail) in p2p_timeout_prov_disc_req()
3941 p2p->cfg->prov_disc_fail(p2p->cfg->cb_ctx, in p2p_timeout_prov_disc_req()
3954 p2p->cfg->send_action_done(p2p->cfg->cb_ctx); in p2p_timeout_invite()
3978 if (p2p->cfg->invitation_result) in p2p_timeout_invite_listen()
3979 p2p->cfg->invitation_result( in p2p_timeout_invite_listen()
3980 p2p->cfg->cb_ctx, -1, NULL, NULL, in p2p_timeout_invite_listen()
3998 p2p->cfg->stop_listen(p2p->cfg->cb_ctx); in p2p_state_timeout()
4421 if (p2p->cfg->get_noa) in p2p_process_presence_req()
4422 noa_len = p2p->cfg->get_noa(p2p->cfg->cb_ctx, da, noa, in p2p_process_presence_req()
4461 if (p2p->cfg->presence_resp) { in p2p_process_presence_resp()
4462 p2p->cfg->presence_resp(p2p->cfg->cb_ctx, sa, *msg.status, in p2p_process_presence_resp()
4492 if ((p2p->cfg->is_p2p_in_progress && in p2p_ext_listen_timeout()
4493 p2p->cfg->is_p2p_in_progress(p2p->cfg->cb_ctx)) || in p2p_ext_listen_timeout()
4638 if (p2p->cfg->channel_forced && forced == 0) { in p2p_set_listen_channel()
4648 p2p->cfg->reg_class = reg_class; in p2p_set_listen_channel()
4649 p2p->cfg->channel = channel; in p2p_set_listen_channel()
4650 p2p->cfg->channel_forced = forced; in p2p_set_listen_channel()
4664 return p2p->cfg->channel; in p2p_get_listen_channel()
4672 p2p->cfg->ssid_postfix_len = 0; in p2p_set_ssid_postfix()
4675 if (len > sizeof(p2p->cfg->ssid_postfix)) in p2p_set_ssid_postfix()
4677 os_memcpy(p2p->cfg->ssid_postfix, postfix, len); in p2p_set_ssid_postfix()
4678 p2p->cfg->ssid_postfix_len = len; in p2p_set_ssid_postfix()
4691 p2p->cfg->op_reg_class = op_reg_class; in p2p_set_oper_channel()
4692 p2p->cfg->op_channel = op_channel; in p2p_set_oper_channel()
4693 p2p->cfg->cfg_op_channel = cfg_op_channel; in p2p_set_oper_channel()
4712 os_free(p2p->cfg->pref_chan); in p2p_set_pref_chan()
4713 p2p->cfg->pref_chan = n; in p2p_set_pref_chan()
4714 p2p->cfg->num_pref_chan = num_pref_chan; in p2p_set_pref_chan()
4803 p2p->cfg->p2p_intra_bss = enabled; in p2p_set_intra_bss_dist()
4812 os_memcpy(&p2p->cfg->channels, chan, sizeof(struct p2p_channels)); in p2p_update_channel_list()
4813 p2p_channels_dump(p2p, "channels", &p2p->cfg->channels); in p2p_update_channel_list()
4814 os_memcpy(&p2p->cfg->cli_channels, cli_chan, in p2p_update_channel_list()
4816 p2p_channels_dump(p2p, "cli_channels", &p2p->cfg->cli_channels); in p2p_update_channel_list()
4844 return p2p->cfg->send_action(p2p->cfg->cb_ctx, freq, dst, src, bssid, in p2p_send_action()
5082 if (!p2p->cfg->debug_print) in p2p_dbg()
5089 p2p->cfg->debug_print(p2p->cfg->cb_ctx, MSG_DEBUG, buf); in p2p_dbg()
5098 if (!p2p->cfg->debug_print) in p2p_info()
5105 p2p->cfg->debug_print(p2p->cfg->cb_ctx, MSG_INFO, buf); in p2p_info()
5114 if (!p2p->cfg->debug_print) in p2p_err()
5121 p2p->cfg->debug_print(p2p->cfg->cb_ctx, MSG_ERROR, buf); in p2p_err()
5153 op_class = p2p->cfg->reg_class; in p2p_build_nfc_handover()
5154 channel = p2p->cfg->channel; in p2p_build_nfc_handover()
5181 p2p_buf_add_oob_go_neg_channel(buf, p2p->cfg->country, op_class, in p2p_build_nfc_handover()
5299 freq = p2p_channel_to_freq(p2p->cfg->reg_class, in p2p_process_nfc_connection_handover()
5300 p2p->cfg->channel); in p2p_process_nfc_connection_handover()
5324 p2p->cfg->dev_found(p2p->cfg->cb_ctx, p2p_dev_addr, &dev->info, in p2p_process_nfc_connection_handover()
5373 p2p->cfg->passphrase_len = len; in p2p_set_passphrase_len()