Lines Matching refs:cfg
35 struct wps_data * wps_init(const struct wps_config *cfg) in wps_init() argument
40 data->wps = cfg->wps; in wps_init()
41 data->registrar = cfg->registrar; in wps_init()
42 if (cfg->registrar) { in wps_init()
43 os_memcpy(data->uuid_r, cfg->wps->uuid, WPS_UUID_LEN); in wps_init()
45 os_memcpy(data->mac_addr_e, cfg->wps->dev.mac_addr, ETH_ALEN); in wps_init()
46 os_memcpy(data->uuid_e, cfg->wps->uuid, WPS_UUID_LEN); in wps_init()
48 if (cfg->pin) { in wps_init()
49 data->dev_pw_id = cfg->dev_pw_id; in wps_init()
50 data->dev_password = os_malloc(cfg->pin_len); in wps_init()
55 os_memcpy(data->dev_password, cfg->pin, cfg->pin_len); in wps_init()
56 data->dev_password_len = cfg->pin_len; in wps_init()
62 if (cfg->pin == NULL && in wps_init()
63 cfg->dev_pw_id == DEV_PW_NFC_CONNECTION_HANDOVER) in wps_init()
64 data->dev_pw_id = cfg->dev_pw_id; in wps_init()
66 if (cfg->wps->ap && !cfg->registrar && cfg->wps->ap_nfc_dev_pw_id) { in wps_init()
72 data->dev_pw_id = cfg->wps->ap_nfc_dev_pw_id; in wps_init()
74 os_malloc(wpabuf_len(cfg->wps->ap_nfc_dev_pw)); in wps_init()
80 wpabuf_head(cfg->wps->ap_nfc_dev_pw), in wps_init()
81 wpabuf_len(cfg->wps->ap_nfc_dev_pw)); in wps_init()
82 data->dev_password_len = wpabuf_len(cfg->wps->ap_nfc_dev_pw); in wps_init()
88 data->pbc = cfg->pbc; in wps_init()
89 if (cfg->pbc) { in wps_init()
103 if (cfg->assoc_wps_ie) { in wps_init()
106 cfg->assoc_wps_ie); in wps_init()
107 if (wps_parse_msg(cfg->assoc_wps_ie, &attr) < 0) { in wps_init()
121 if (cfg->new_ap_settings) { in wps_init()
130 os_memcpy(data->new_ap_settings, cfg->new_ap_settings, in wps_init()
134 if (cfg->peer_addr) in wps_init()
135 os_memcpy(data->peer_dev.mac_addr, cfg->peer_addr, ETH_ALEN); in wps_init()
136 if (cfg->p2p_dev_addr) in wps_init()
137 os_memcpy(data->p2p_dev_addr, cfg->p2p_dev_addr, ETH_ALEN); in wps_init()
139 data->use_psk_key = cfg->use_psk_key; in wps_init()
140 data->pbc_in_m1 = cfg->pbc_in_m1; in wps_init()
142 if (cfg->peer_pubkey_hash) { in wps_init()
143 os_memcpy(data->peer_pubkey_hash, cfg->peer_pubkey_hash, in wps_init()