Home | History | Annotate | Download | only in p2p

Lines Matching refs:cfg

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