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()
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()
1237 p2p->cfg->stop_listen(p2p->cfg->cb_ctx); in p2p_find()
1256 res = p2p->cfg->p2p_scan(p2p->cfg->cb_ctx, in p2p_find()
1265 res = p2p->cfg->p2p_scan(p2p->cfg->cb_ctx, P2P_SCAN_FULL, 0, in p2p_find()
1271 res = p2p->cfg->p2p_scan(p2p->cfg->cb_ctx, P2P_SCAN_SOCIAL, 0, in p2p_find()
1300 p2p->cfg->find_stopped(p2p->cfg->cb_ctx); in p2p_stop_find_for_freq()
1336 p2p->cfg->stop_listen(p2p->cfg->cb_ctx); in p2p_stop_listen_for_freq()
1373 if (!p2p_channels_includes(&p2p->cfg->channels, op_class, op_channel) && in p2p_prepare_channel_pref()
1374 (go || !p2p_channels_includes(&p2p->cfg->cli_channels, op_class, in p2p_prepare_channel_pref()
1390 os_memcpy(&p2p->channels, &p2p->cfg->channels, in p2p_prepare_channel_pref()
1407 if (!p2p->cfg->cfg_op_channel && p2p->best_freq_overall > 0 && in p2p_prepare_channel_best()
1414 } else if (!p2p->cfg->cfg_op_channel && p2p->best_freq_5 > 0 && in p2p_prepare_channel_best()
1421 } else if (!p2p->cfg->cfg_op_channel && p2p->best_freq_24 > 0 && in p2p_prepare_channel_best()
1428 } else if (p2p->cfg->num_pref_chan > 0 && in p2p_prepare_channel_best()
1429 p2p_channels_includes(&p2p->cfg->channels, in p2p_prepare_channel_best()
1430 p2p->cfg->pref_chan[0].op_class, in p2p_prepare_channel_best()
1431 p2p->cfg->pref_chan[0].chan)) { in p2p_prepare_channel_best()
1433 p2p->op_reg_class = p2p->cfg->pref_chan[0].op_class; in p2p_prepare_channel_best()
1434 p2p->op_channel = p2p->cfg->pref_chan[0].chan; in p2p_prepare_channel_best()
1435 } else if (p2p_channel_select(&p2p->cfg->channels, op_classes_vht, in p2p_prepare_channel_best()
1440 } else if (p2p_channel_select(&p2p->cfg->channels, op_classes_ht40, in p2p_prepare_channel_best()
1445 } else if (p2p_channel_select(&p2p->cfg->channels, op_classes_5ghz, in p2p_prepare_channel_best()
1450 } else if (p2p_channels_includes(&p2p->cfg->channels, in p2p_prepare_channel_best()
1451 p2p->cfg->op_reg_class, in p2p_prepare_channel_best()
1452 p2p->cfg->op_channel)) { in p2p_prepare_channel_best()
1454 p2p->op_reg_class = p2p->cfg->op_reg_class; in p2p_prepare_channel_best()
1455 p2p->op_channel = p2p->cfg->op_channel; in p2p_prepare_channel_best()
1456 } else if (p2p_channel_random_social(&p2p->cfg->channels, in p2p_prepare_channel_best()
1464 p2p_channel_select(&p2p->cfg->channels, NULL, in p2p_prepare_channel_best()
1471 os_memcpy(&p2p->channels, &p2p->cfg->channels, in p2p_prepare_channel_best()
1507 &p2p->cfg->cli_channels); in p2p_prepare_channel()
1759 p2p->cfg->dev_found(p2p->cfg->cb_ctx, addr, &dev->info, in p2p_add_dev_info()
1770 p2p->cfg->ssid_postfix, p2p->cfg->ssid_postfix_len); in p2p_build_ssid()
1771 *ssid_len = P2P_WILDCARD_SSID_LEN + 2 + p2p->cfg->ssid_postfix_len; in p2p_build_ssid()
1785 p2p_random(params->passphrase, p2p->cfg->passphrase_len); in p2p_go_params()
1817 p2p_random(res.passphrase, p2p->cfg->passphrase_len); in p2p_go_complete()
1851 p2p->cfg->go_neg_completed(p2p->cfg->cb_ctx, &res); in p2p_go_complete()
1994 p2p->cfg->stop_listen(p2p->cfg->cb_ctx); in p2p_go_neg_start()
2014 p2p->cfg->stop_listen(p2p->cfg->cb_ctx); in p2p_invite_start()
2168 if (dev_type_list_match(p2p->cfg->pri_dev_type, attr.req_dev_type, in p2p_match_dev_type()
2172 for (i = 0; i < p2p->cfg->num_sec_dev_types; i++) { in p2p_match_dev_type()
2173 if (dev_type_list_match(p2p->cfg->sec_dev_type[i], in p2p_match_dev_type()
2259 os_memcpy(resp->sa, p2p->cfg->dev_addr, ETH_ALEN); in p2p_build_probe_resp_buf()
2260 os_memcpy(resp->bssid, p2p->cfg->dev_addr, ETH_ALEN); in p2p_build_probe_resp_buf()
2284 channel = p2p->cfg->channel; in p2p_build_probe_resp_buf()
2348 os_memcmp(dst, p2p->cfg->dev_addr, ETH_ALEN) != 0) { in p2p_reply_probe()
2391 p2p->cfg->channel, p2p->pending_listen_freq); in p2p_reply_probe()
2432 os_memcmp(msg.device_id, p2p->cfg->dev_addr, ETH_ALEN) != 0) { in p2p_reply_probe()
2449 if (!p2p->cfg->send_probe_resp) { in p2p_reply_probe()
2484 p2p->cfg->send_probe_resp(p2p->cfg->cb_ctx, buf, rx_freq); in p2p_reply_probe()
2742 if (!(config_methods & p2p->cfg->config_methods)) { in p2p_service_add_asp()
2744 config_methods, p2p->cfg->config_methods); in p2p_service_add_asp()
2764 adv_data->config_methods = config_methods & p2p->cfg->config_methods; in p2p_service_add_asp()
2918 struct p2p_data * p2p_init(const struct p2p_config *cfg) in p2p_init() argument
2922 if (cfg->max_peers < 1 || in p2p_init()
2923 cfg->passphrase_len < 8 || cfg->passphrase_len > 63) in p2p_init()
2926 p2p = os_zalloc(sizeof(*p2p) + sizeof(*cfg)); in p2p_init()
2929 p2p->cfg = (struct p2p_config *) (p2p + 1); in p2p_init()
2930 os_memcpy(p2p->cfg, cfg, sizeof(*cfg)); in p2p_init()
2931 if (cfg->dev_name) in p2p_init()
2932 p2p->cfg->dev_name = os_strdup(cfg->dev_name); in p2p_init()
2933 if (cfg->manufacturer) in p2p_init()
2934 p2p->cfg->manufacturer = os_strdup(cfg->manufacturer); in p2p_init()
2935 if (cfg->model_name) in p2p_init()
2936 p2p->cfg->model_name = os_strdup(cfg->model_name); in p2p_init()
2937 if (cfg->model_number) in p2p_init()
2938 p2p->cfg->model_number = os_strdup(cfg->model_number); in p2p_init()
2939 if (cfg->serial_number) in p2p_init()
2940 p2p->cfg->serial_number = os_strdup(cfg->serial_number); in p2p_init()
2941 if (cfg->pref_chan) { in p2p_init()
2942 p2p->cfg->pref_chan = os_malloc(cfg->num_pref_chan * in p2p_init()
2944 if (p2p->cfg->pref_chan) { in p2p_init()
2945 os_memcpy(p2p->cfg->pref_chan, cfg->pref_chan, in p2p_init()
2946 cfg->num_pref_chan * in p2p_init()
2949 p2p->cfg->num_pref_chan = 0; in p2p_init()
2961 if (cfg->sd_request) in p2p_init()
2964 if (cfg->concurrent_operations) in p2p_init()
2975 p2p_channels_dump(p2p, "channels", &p2p->cfg->channels); in p2p_init()
2976 p2p_channels_dump(p2p, "cli_channels", &p2p->cfg->cli_channels); in p2p_init()
3003 os_free(p2p->cfg->dev_name); in p2p_deinit()
3004 os_free(p2p->cfg->manufacturer); in p2p_deinit()
3005 os_free(p2p->cfg->model_name); in p2p_deinit()
3006 os_free(p2p->cfg->model_number); in p2p_deinit()
3007 os_free(p2p->cfg->serial_number); in p2p_deinit()
3008 os_free(p2p->cfg->pref_chan); in p2p_deinit()
3075 os_free(p2p->cfg->dev_name); in p2p_set_dev_name()
3077 p2p->cfg->dev_name = os_strdup(dev_name); in p2p_set_dev_name()
3078 if (p2p->cfg->dev_name == NULL) in p2p_set_dev_name()
3081 p2p->cfg->dev_name = NULL; in p2p_set_dev_name()
3088 os_free(p2p->cfg->manufacturer); in p2p_set_manufacturer()
3089 p2p->cfg->manufacturer = NULL; in p2p_set_manufacturer()
3091 p2p->cfg->manufacturer = os_strdup(manufacturer); in p2p_set_manufacturer()
3092 if (p2p->cfg->manufacturer == NULL) in p2p_set_manufacturer()
3102 os_free(p2p->cfg->model_name); in p2p_set_model_name()
3103 p2p->cfg->model_name = NULL; in p2p_set_model_name()
3105 p2p->cfg->model_name = os_strdup(model_name); in p2p_set_model_name()
3106 if (p2p->cfg->model_name == NULL) in p2p_set_model_name()
3116 os_free(p2p->cfg->model_number); in p2p_set_model_number()
3117 p2p->cfg->model_number = NULL; in p2p_set_model_number()
3119 p2p->cfg->model_number = os_strdup(model_number); in p2p_set_model_number()
3120 if (p2p->cfg->model_number == NULL) in p2p_set_model_number()
3130 os_free(p2p->cfg->serial_number); in p2p_set_serial_number()
3131 p2p->cfg->serial_number = NULL; in p2p_set_serial_number()
3133 p2p->cfg->serial_number = os_strdup(serial_number); in p2p_set_serial_number()
3134 if (p2p->cfg->serial_number == NULL) in p2p_set_serial_number()
3144 p2p->cfg->config_methods = config_methods; in p2p_set_config_methods()
3150 os_memcpy(p2p->cfg->uuid, uuid, 16); in p2p_set_uuid()
3156 os_memcpy(p2p->cfg->pri_dev_type, pri_dev_type, 8); in p2p_set_pri_dev_type()
3166 p2p->cfg->num_sec_dev_types = num_dev_types; in p2p_set_sec_dev_types()
3167 os_memcpy(p2p->cfg->sec_dev_type, dev_types, num_dev_types * 8); in p2p_set_sec_dev_types()
3208 os_memcpy(p2p->cfg->country, country, 3); in p2p_set_country()
3306 p2p->cfg->send_action_done(p2p->cfg->cb_ctx); in p2p_sd_cb()
3417 p2p->cfg->send_action_done(p2p->cfg->cb_ctx); in p2p_prov_disc_cb()
3422 if (p2p->cfg->p2ps_prov_complete) { in p2p_prov_disc_cb()
3423 p2p->cfg->p2ps_prov_complete( in p2p_prov_disc_cb()
3424 p2p->cfg->cb_ctx, in p2p_prov_disc_cb()
3482 p2p->cfg->send_action_done(p2p->cfg->cb_ctx); in p2p_prov_disc_resp_cb()
3490 if (!p2p->cfg->prov_disc_resp_cb || in p2p_prov_disc_resp_cb()
3491 p2p->cfg->prov_disc_resp_cb(p2p->cfg->cb_ctx) < 1) in p2p_prov_disc_resp_cb()
3572 if (p2p->cfg->reg_class && p2p->cfg->channel) in p2p_scan_ie()
3573 p2p_buf_add_listen_channel(ies, p2p->cfg->country, in p2p_scan_ie()
3574 p2p->cfg->reg_class, in p2p_scan_ie()
3575 p2p->cfg->channel); in p2p_scan_ie()
3641 p2p->cfg->send_action_done(p2p->cfg->cb_ctx); in p2p_go_neg_req_cb()
3711 p2p->cfg->send_action_done(p2p->cfg->cb_ctx); in p2p_go_neg_conf_cb()
3731 p2p->cfg->dev_addr, in p2p_go_neg_conf_cb()
3760 p2p->cfg->send_action_done(p2p->cfg->cb_ctx); in p2p_go_neg_conf_cb()
3787 p2p->cfg->send_action_done(p2p->cfg->cb_ctx); in p2p_send_action_cb()
3926 p2p->cfg->send_action_done(p2p->cfg->cb_ctx); in p2p_timeout_connect()
3976 if (p2p->cfg->is_concurrent_session_active && in p2p_timeout_wait_peer_connect()
3977 p2p->cfg->is_concurrent_session_active(p2p->cfg->cb_ctx)) in p2p_timeout_wait_peer_connect()
4003 p2p->cfg->send_action_done(p2p->cfg->cb_ctx); in p2p_timeout_sd_during_find()
4013 p2p->cfg->send_action_done(p2p->cfg->cb_ctx); in p2p_timeout_prov_disc_during_find()
4056 if (p2p->cfg->prov_disc_fail) in p2p_timeout_prov_disc_req()
4057 p2p->cfg->prov_disc_fail(p2p->cfg->cb_ctx, in p2p_timeout_prov_disc_req()
4070 p2p->cfg->send_action_done(p2p->cfg->cb_ctx); in p2p_timeout_invite()
4094 if (p2p->cfg->invitation_result) in p2p_timeout_invite_listen()
4095 p2p->cfg->invitation_result( in p2p_timeout_invite_listen()
4096 p2p->cfg->cb_ctx, -1, NULL, NULL, in p2p_timeout_invite_listen()
4114 p2p->cfg->stop_listen(p2p->cfg->cb_ctx); in p2p_state_timeout()
4537 if (p2p->cfg->get_noa) in p2p_process_presence_req()
4538 noa_len = p2p->cfg->get_noa(p2p->cfg->cb_ctx, da, noa, in p2p_process_presence_req()
4577 if (p2p->cfg->presence_resp) { in p2p_process_presence_resp()
4578 p2p->cfg->presence_resp(p2p->cfg->cb_ctx, sa, *msg.status, in p2p_process_presence_resp()
4608 if ((p2p->cfg->is_p2p_in_progress && in p2p_ext_listen_timeout()
4609 p2p->cfg->is_p2p_in_progress(p2p->cfg->cb_ctx)) || in p2p_ext_listen_timeout()
4754 if (p2p->cfg->channel_forced && forced == 0) { in p2p_set_listen_channel()
4764 p2p->cfg->reg_class = reg_class; in p2p_set_listen_channel()
4765 p2p->cfg->channel = channel; in p2p_set_listen_channel()
4766 p2p->cfg->channel_forced = forced; in p2p_set_listen_channel()
4780 return p2p->cfg->channel; in p2p_get_listen_channel()
4788 p2p->cfg->ssid_postfix_len = 0; in p2p_set_ssid_postfix()
4791 if (len > sizeof(p2p->cfg->ssid_postfix)) in p2p_set_ssid_postfix()
4793 os_memcpy(p2p->cfg->ssid_postfix, postfix, len); in p2p_set_ssid_postfix()
4794 p2p->cfg->ssid_postfix_len = len; in p2p_set_ssid_postfix()
4807 p2p->cfg->op_reg_class = op_reg_class; in p2p_set_oper_channel()
4808 p2p->cfg->op_channel = op_channel; in p2p_set_oper_channel()
4809 p2p->cfg->cfg_op_channel = cfg_op_channel; in p2p_set_oper_channel()
4828 os_free(p2p->cfg->pref_chan); in p2p_set_pref_chan()
4829 p2p->cfg->pref_chan = n; in p2p_set_pref_chan()
4830 p2p->cfg->num_pref_chan = num_pref_chan; in p2p_set_pref_chan()
4919 p2p->cfg->p2p_intra_bss = enabled; in p2p_set_intra_bss_dist()
4928 os_memcpy(&p2p->cfg->channels, chan, sizeof(struct p2p_channels)); in p2p_update_channel_list()
4929 p2p_channels_dump(p2p, "channels", &p2p->cfg->channels); in p2p_update_channel_list()
4930 os_memcpy(&p2p->cfg->cli_channels, cli_chan, in p2p_update_channel_list()
4932 p2p_channels_dump(p2p, "cli_channels", &p2p->cfg->cli_channels); in p2p_update_channel_list()
4960 return p2p->cfg->send_action(p2p->cfg->cb_ctx, freq, dst, src, bssid, in p2p_send_action()
5198 if (!p2p->cfg->debug_print) in p2p_dbg()
5205 p2p->cfg->debug_print(p2p->cfg->cb_ctx, MSG_DEBUG, buf); in p2p_dbg()
5214 if (!p2p->cfg->debug_print) in p2p_info()
5221 p2p->cfg->debug_print(p2p->cfg->cb_ctx, MSG_INFO, buf); in p2p_info()
5230 if (!p2p->cfg->debug_print) in p2p_err()
5237 p2p->cfg->debug_print(p2p->cfg->cb_ctx, MSG_ERROR, buf); in p2p_err()
5269 op_class = p2p->cfg->reg_class; in p2p_build_nfc_handover()
5270 channel = p2p->cfg->channel; in p2p_build_nfc_handover()
5297 p2p_buf_add_oob_go_neg_channel(buf, p2p->cfg->country, op_class, in p2p_build_nfc_handover()
5415 freq = p2p_channel_to_freq(p2p->cfg->reg_class, in p2p_process_nfc_connection_handover()
5416 p2p->cfg->channel); in p2p_process_nfc_connection_handover()
5440 p2p->cfg->dev_found(p2p->cfg->cb_ctx, p2p_dev_addr, &dev->info, in p2p_process_nfc_connection_handover()
5489 p2p->cfg->passphrase_len = len; in p2p_set_passphrase_len()