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()
196 p2p->cfg->reg_class = p2p->pending_reg_class; in p2p_set_state()
197 p2p->cfg->channel = p2p->pending_channel; in p2p_set_state()
249 p2p->cfg->go_neg_completed(p2p->cfg->cb_ctx, &res); in p2p_go_neg_failed()
268 freq = p2p_channel_to_freq(p2p->cfg->reg_class, p2p->cfg->channel); in p2p_listen_in_find()
282 if (p2p->cfg->max_listen && 1024 * tu / 1000 > p2p->cfg->max_listen) in p2p_listen_in_find()
283 tu = p2p->cfg->max_listen * 1000 / 1024; in p2p_listen_in_find()
299 if (p2p->cfg->start_listen(p2p->cfg->cb_ctx, freq, 1024 * tu / 1000, in p2p_listen_in_find()
321 freq = p2p_channel_to_freq(p2p->cfg->reg_class, p2p->cfg->channel); in p2p_listen()
346 if (p2p->cfg->start_listen(p2p->cfg->cb_ctx, freq, timeout, ies) < 0) { in p2p_listen()
430 if (count + 1 > p2p->cfg->max_peers && oldest) { in p2p_create_device()
490 if (os_memcmp(cli->p2p_device_addr, p2p->cfg->dev_addr, in p2p_add_group_clients()
524 p2p->cfg->dev_found(p2p->cfg->cb_ctx, in p2p_add_group_clients()
891 p2p->cfg->dev_found(p2p->cfg->cb_ctx, addr, &dev->info, in p2p_add_device()
921 p2p->cfg->dev_lost(p2p->cfg->cb_ctx, in p2p_device_free()
948 c = &p2p->cfg->channels; in p2p_get_next_prog_freq()
1003 p2p->cfg->stop_listen(p2p->cfg->cb_ctx); in p2p_search()
1014 res = p2p->cfg->p2p_scan(p2p->cfg->cb_ctx, type, freq, in p2p_search()
1056 p2p->cfg->send_action(p2p->cfg->cb_ctx, in p2p_run_after_scan()
1229 p2p->cfg->stop_listen(p2p->cfg->cb_ctx); in p2p_find()
1248 res = p2p->cfg->p2p_scan(p2p->cfg->cb_ctx, in p2p_find()
1257 res = p2p->cfg->p2p_scan(p2p->cfg->cb_ctx, P2P_SCAN_FULL, 0, in p2p_find()
1263 res = p2p->cfg->p2p_scan(p2p->cfg->cb_ctx, P2P_SCAN_SOCIAL, 0, in p2p_find()
1292 p2p->cfg->find_stopped(p2p->cfg->cb_ctx); in p2p_stop_find_for_freq()
1328 p2p->cfg->stop_listen(p2p->cfg->cb_ctx); in p2p_stop_listen_for_freq()
1365 if (!p2p_channels_includes(&p2p->cfg->channels, op_class, op_channel) && in p2p_prepare_channel_pref()
1366 (go || !p2p_channels_includes(&p2p->cfg->cli_channels, op_class, in p2p_prepare_channel_pref()
1382 os_memcpy(&p2p->channels, &p2p->cfg->channels, in p2p_prepare_channel_pref()
1399 if (!p2p->cfg->cfg_op_channel && p2p->best_freq_overall > 0 && in p2p_prepare_channel_best()
1406 } else if (!p2p->cfg->cfg_op_channel && p2p->best_freq_5 > 0 && in p2p_prepare_channel_best()
1413 } else if (!p2p->cfg->cfg_op_channel && p2p->best_freq_24 > 0 && in p2p_prepare_channel_best()
1420 } else if (p2p->cfg->num_pref_chan > 0 && in p2p_prepare_channel_best()
1421 p2p_channels_includes(&p2p->cfg->channels, in p2p_prepare_channel_best()
1422 p2p->cfg->pref_chan[0].op_class, in p2p_prepare_channel_best()
1423 p2p->cfg->pref_chan[0].chan)) { in p2p_prepare_channel_best()
1425 p2p->op_reg_class = p2p->cfg->pref_chan[0].op_class; in p2p_prepare_channel_best()
1426 p2p->op_channel = p2p->cfg->pref_chan[0].chan; in p2p_prepare_channel_best()
1427 } else if (p2p_channel_select(&p2p->cfg->channels, op_classes_vht, in p2p_prepare_channel_best()
1432 } else if (p2p_channel_select(&p2p->cfg->channels, op_classes_ht40, in p2p_prepare_channel_best()
1437 } else if (p2p_channel_select(&p2p->cfg->channels, op_classes_5ghz, in p2p_prepare_channel_best()
1442 } else if (p2p_channels_includes(&p2p->cfg->channels, in p2p_prepare_channel_best()
1443 p2p->cfg->op_reg_class, in p2p_prepare_channel_best()
1444 p2p->cfg->op_channel)) { in p2p_prepare_channel_best()
1446 p2p->op_reg_class = p2p->cfg->op_reg_class; in p2p_prepare_channel_best()
1447 p2p->op_channel = p2p->cfg->op_channel; in p2p_prepare_channel_best()
1448 } else if (p2p_channel_random_social(&p2p->cfg->channels, in p2p_prepare_channel_best()
1456 p2p_channel_select(&p2p->cfg->channels, NULL, in p2p_prepare_channel_best()
1463 os_memcpy(&p2p->channels, &p2p->cfg->channels, in p2p_prepare_channel_best()
1499 &p2p->cfg->cli_channels); in p2p_prepare_channel()
1751 p2p->cfg->dev_found(p2p->cfg->cb_ctx, addr, &dev->info, in p2p_add_dev_info()
1762 p2p->cfg->ssid_postfix, p2p->cfg->ssid_postfix_len); in p2p_build_ssid()
1763 *ssid_len = P2P_WILDCARD_SSID_LEN + 2 + p2p->cfg->ssid_postfix_len; in p2p_build_ssid()
1777 p2p_random(params->passphrase, p2p->cfg->passphrase_len); in p2p_go_params()
1809 p2p_random(res.passphrase, p2p->cfg->passphrase_len); in p2p_go_complete()
1842 p2p->cfg->go_neg_completed(p2p->cfg->cb_ctx, &res); in p2p_go_complete()
1985 p2p->cfg->stop_listen(p2p->cfg->cb_ctx); in p2p_go_neg_start()
2005 p2p->cfg->stop_listen(p2p->cfg->cb_ctx); in p2p_invite_start()
2159 if (dev_type_list_match(p2p->cfg->pri_dev_type, attr.req_dev_type, in p2p_match_dev_type()
2163 for (i = 0; i < p2p->cfg->num_sec_dev_types; i++) { in p2p_match_dev_type()
2164 if (dev_type_list_match(p2p->cfg->sec_dev_type[i], in p2p_match_dev_type()
2289 os_memcmp(dst, p2p->cfg->dev_addr, ETH_ALEN) != 0) { in p2p_reply_probe()
2332 p2p->cfg->channel, p2p->pending_listen_freq); in p2p_reply_probe()
2373 os_memcmp(msg.device_id, p2p->cfg->dev_addr, ETH_ALEN) != 0) { in p2p_reply_probe()
2390 if (!p2p->cfg->send_probe_resp) { in p2p_reply_probe()
2423 os_memcpy(resp->sa, p2p->cfg->dev_addr, ETH_ALEN); in p2p_reply_probe()
2424 os_memcpy(resp->bssid, p2p->cfg->dev_addr, ETH_ALEN); in p2p_reply_probe()
2448 channel = p2p->cfg->channel; in p2p_reply_probe()
2462 p2p->cfg->send_probe_resp(p2p->cfg->cb_ctx, buf, rx_freq); in p2p_reply_probe()
2714 if (!(config_methods & p2p->cfg->config_methods)) { in p2p_service_add_asp()
2716 config_methods, p2p->cfg->config_methods); in p2p_service_add_asp()
2736 adv_data->config_methods = config_methods & p2p->cfg->config_methods; in p2p_service_add_asp()
2889 struct p2p_data * p2p_init(const struct p2p_config *cfg) in p2p_init() argument
2893 if (cfg->max_peers < 1 || in p2p_init()
2894 cfg->passphrase_len < 8 || cfg->passphrase_len > 63) in p2p_init()
2897 p2p = os_zalloc(sizeof(*p2p) + sizeof(*cfg)); in p2p_init()
2900 p2p->cfg = (struct p2p_config *) (p2p + 1); in p2p_init()
2901 os_memcpy(p2p->cfg, cfg, sizeof(*cfg)); in p2p_init()
2902 if (cfg->dev_name) in p2p_init()
2903 p2p->cfg->dev_name = os_strdup(cfg->dev_name); in p2p_init()
2904 if (cfg->manufacturer) in p2p_init()
2905 p2p->cfg->manufacturer = os_strdup(cfg->manufacturer); in p2p_init()
2906 if (cfg->model_name) in p2p_init()
2907 p2p->cfg->model_name = os_strdup(cfg->model_name); in p2p_init()
2908 if (cfg->model_number) in p2p_init()
2909 p2p->cfg->model_number = os_strdup(cfg->model_number); in p2p_init()
2910 if (cfg->serial_number) in p2p_init()
2911 p2p->cfg->serial_number = os_strdup(cfg->serial_number); in p2p_init()
2912 if (cfg->pref_chan) { in p2p_init()
2913 p2p->cfg->pref_chan = os_malloc(cfg->num_pref_chan * in p2p_init()
2915 if (p2p->cfg->pref_chan) { in p2p_init()
2916 os_memcpy(p2p->cfg->pref_chan, cfg->pref_chan, in p2p_init()
2917 cfg->num_pref_chan * in p2p_init()
2920 p2p->cfg->num_pref_chan = 0; in p2p_init()
2932 if (cfg->sd_request) in p2p_init()
2935 if (cfg->concurrent_operations) in p2p_init()
2946 p2p_channels_dump(p2p, "channels", &p2p->cfg->channels); in p2p_init()
2947 p2p_channels_dump(p2p, "cli_channels", &p2p->cfg->cli_channels); in p2p_init()
2974 os_free(p2p->cfg->dev_name); in p2p_deinit()
2975 os_free(p2p->cfg->manufacturer); in p2p_deinit()
2976 os_free(p2p->cfg->model_name); in p2p_deinit()
2977 os_free(p2p->cfg->model_number); in p2p_deinit()
2978 os_free(p2p->cfg->serial_number); in p2p_deinit()
2979 os_free(p2p->cfg->pref_chan); in p2p_deinit()
3043 os_free(p2p->cfg->dev_name); in p2p_set_dev_name()
3045 p2p->cfg->dev_name = os_strdup(dev_name); in p2p_set_dev_name()
3046 if (p2p->cfg->dev_name == NULL) in p2p_set_dev_name()
3049 p2p->cfg->dev_name = NULL; in p2p_set_dev_name()
3056 os_free(p2p->cfg->manufacturer); in p2p_set_manufacturer()
3057 p2p->cfg->manufacturer = NULL; in p2p_set_manufacturer()
3059 p2p->cfg->manufacturer = os_strdup(manufacturer); in p2p_set_manufacturer()
3060 if (p2p->cfg->manufacturer == NULL) in p2p_set_manufacturer()
3070 os_free(p2p->cfg->model_name); in p2p_set_model_name()
3071 p2p->cfg->model_name = NULL; in p2p_set_model_name()
3073 p2p->cfg->model_name = os_strdup(model_name); in p2p_set_model_name()
3074 if (p2p->cfg->model_name == NULL) in p2p_set_model_name()
3084 os_free(p2p->cfg->model_number); in p2p_set_model_number()
3085 p2p->cfg->model_number = NULL; in p2p_set_model_number()
3087 p2p->cfg->model_number = os_strdup(model_number); in p2p_set_model_number()
3088 if (p2p->cfg->model_number == NULL) in p2p_set_model_number()
3098 os_free(p2p->cfg->serial_number); in p2p_set_serial_number()
3099 p2p->cfg->serial_number = NULL; in p2p_set_serial_number()
3101 p2p->cfg->serial_number = os_strdup(serial_number); in p2p_set_serial_number()
3102 if (p2p->cfg->serial_number == NULL) in p2p_set_serial_number()
3112 p2p->cfg->config_methods = config_methods; in p2p_set_config_methods()
3118 os_memcpy(p2p->cfg->uuid, uuid, 16); in p2p_set_uuid()
3124 os_memcpy(p2p->cfg->pri_dev_type, pri_dev_type, 8); in p2p_set_pri_dev_type()
3134 p2p->cfg->num_sec_dev_types = num_dev_types; in p2p_set_sec_dev_types()
3135 os_memcpy(p2p->cfg->sec_dev_type, dev_types, num_dev_types * 8); in p2p_set_sec_dev_types()
3176 os_memcpy(p2p->cfg->country, country, 3); in p2p_set_country()
3274 p2p->cfg->send_action_done(p2p->cfg->cb_ctx); in p2p_sd_cb()
3385 p2p->cfg->send_action_done(p2p->cfg->cb_ctx); in p2p_prov_disc_cb()
3390 if (p2p->cfg->p2ps_prov_complete) { in p2p_prov_disc_cb()
3391 p2p->cfg->p2ps_prov_complete( in p2p_prov_disc_cb()
3392 p2p->cfg->cb_ctx, in p2p_prov_disc_cb()
3450 p2p->cfg->send_action_done(p2p->cfg->cb_ctx); in p2p_prov_disc_resp_cb()
3458 if (!p2p->cfg->prov_disc_resp_cb || in p2p_prov_disc_resp_cb()
3459 p2p->cfg->prov_disc_resp_cb(p2p->cfg->cb_ctx) < 1) in p2p_prov_disc_resp_cb()
3540 if (p2p->cfg->reg_class && p2p->cfg->channel) in p2p_scan_ie()
3541 p2p_buf_add_listen_channel(ies, p2p->cfg->country, in p2p_scan_ie()
3542 p2p->cfg->reg_class, in p2p_scan_ie()
3543 p2p->cfg->channel); in p2p_scan_ie()
3609 p2p->cfg->send_action_done(p2p->cfg->cb_ctx); in p2p_go_neg_req_cb()
3679 p2p->cfg->send_action_done(p2p->cfg->cb_ctx); in p2p_go_neg_conf_cb()
3699 p2p->cfg->dev_addr, in p2p_go_neg_conf_cb()
3728 p2p->cfg->send_action_done(p2p->cfg->cb_ctx); in p2p_go_neg_conf_cb()
3755 p2p->cfg->send_action_done(p2p->cfg->cb_ctx); in p2p_send_action_cb()
3892 p2p->cfg->send_action_done(p2p->cfg->cb_ctx); in p2p_timeout_connect()
3942 if (p2p->cfg->is_concurrent_session_active && in p2p_timeout_wait_peer_connect()
3943 p2p->cfg->is_concurrent_session_active(p2p->cfg->cb_ctx)) in p2p_timeout_wait_peer_connect()
3969 p2p->cfg->send_action_done(p2p->cfg->cb_ctx); in p2p_timeout_sd_during_find()
3979 p2p->cfg->send_action_done(p2p->cfg->cb_ctx); in p2p_timeout_prov_disc_during_find()
4022 if (p2p->cfg->prov_disc_fail) in p2p_timeout_prov_disc_req()
4023 p2p->cfg->prov_disc_fail(p2p->cfg->cb_ctx, in p2p_timeout_prov_disc_req()
4036 p2p->cfg->send_action_done(p2p->cfg->cb_ctx); in p2p_timeout_invite()
4060 if (p2p->cfg->invitation_result) in p2p_timeout_invite_listen()
4061 p2p->cfg->invitation_result( in p2p_timeout_invite_listen()
4062 p2p->cfg->cb_ctx, -1, NULL, NULL, in p2p_timeout_invite_listen()
4080 p2p->cfg->stop_listen(p2p->cfg->cb_ctx); in p2p_state_timeout()
4503 if (p2p->cfg->get_noa) in p2p_process_presence_req()
4504 noa_len = p2p->cfg->get_noa(p2p->cfg->cb_ctx, da, noa, in p2p_process_presence_req()
4543 if (p2p->cfg->presence_resp) { in p2p_process_presence_resp()
4544 p2p->cfg->presence_resp(p2p->cfg->cb_ctx, sa, *msg.status, in p2p_process_presence_resp()
4574 if ((p2p->cfg->is_p2p_in_progress && in p2p_ext_listen_timeout()
4575 p2p->cfg->is_p2p_in_progress(p2p->cfg->cb_ctx)) || in p2p_ext_listen_timeout()
4720 if (p2p->cfg->channel_forced && forced == 0) { in p2p_set_listen_channel()
4730 p2p->cfg->reg_class = reg_class; in p2p_set_listen_channel()
4731 p2p->cfg->channel = channel; in p2p_set_listen_channel()
4732 p2p->cfg->channel_forced = forced; in p2p_set_listen_channel()
4746 return p2p->cfg->channel; in p2p_get_listen_channel()
4754 p2p->cfg->ssid_postfix_len = 0; in p2p_set_ssid_postfix()
4757 if (len > sizeof(p2p->cfg->ssid_postfix)) in p2p_set_ssid_postfix()
4759 os_memcpy(p2p->cfg->ssid_postfix, postfix, len); in p2p_set_ssid_postfix()
4760 p2p->cfg->ssid_postfix_len = len; in p2p_set_ssid_postfix()
4773 p2p->cfg->op_reg_class = op_reg_class; in p2p_set_oper_channel()
4774 p2p->cfg->op_channel = op_channel; in p2p_set_oper_channel()
4775 p2p->cfg->cfg_op_channel = cfg_op_channel; in p2p_set_oper_channel()
4794 os_free(p2p->cfg->pref_chan); in p2p_set_pref_chan()
4795 p2p->cfg->pref_chan = n; in p2p_set_pref_chan()
4796 p2p->cfg->num_pref_chan = num_pref_chan; in p2p_set_pref_chan()
4885 p2p->cfg->p2p_intra_bss = enabled; in p2p_set_intra_bss_dist()
4894 os_memcpy(&p2p->cfg->channels, chan, sizeof(struct p2p_channels)); in p2p_update_channel_list()
4895 p2p_channels_dump(p2p, "channels", &p2p->cfg->channels); in p2p_update_channel_list()
4896 os_memcpy(&p2p->cfg->cli_channels, cli_chan, in p2p_update_channel_list()
4898 p2p_channels_dump(p2p, "cli_channels", &p2p->cfg->cli_channels); in p2p_update_channel_list()
4926 return p2p->cfg->send_action(p2p->cfg->cb_ctx, freq, dst, src, bssid, in p2p_send_action()
5164 if (!p2p->cfg->debug_print) in p2p_dbg()
5171 p2p->cfg->debug_print(p2p->cfg->cb_ctx, MSG_DEBUG, buf); in p2p_dbg()
5180 if (!p2p->cfg->debug_print) in p2p_info()
5187 p2p->cfg->debug_print(p2p->cfg->cb_ctx, MSG_INFO, buf); in p2p_info()
5196 if (!p2p->cfg->debug_print) in p2p_err()
5203 p2p->cfg->debug_print(p2p->cfg->cb_ctx, MSG_ERROR, buf); in p2p_err()
5235 op_class = p2p->cfg->reg_class; in p2p_build_nfc_handover()
5236 channel = p2p->cfg->channel; in p2p_build_nfc_handover()
5263 p2p_buf_add_oob_go_neg_channel(buf, p2p->cfg->country, op_class, in p2p_build_nfc_handover()
5381 freq = p2p_channel_to_freq(p2p->cfg->reg_class, in p2p_process_nfc_connection_handover()
5382 p2p->cfg->channel); in p2p_process_nfc_connection_handover()
5406 p2p->cfg->dev_found(p2p->cfg->cb_ctx, p2p_dev_addr, &dev->info, in p2p_process_nfc_connection_handover()
5455 p2p->cfg->passphrase_len = len; in p2p_set_passphrase_len()