Lines Matching refs:cfg
39 struct wps_data * wps_init(const struct wps_config *cfg) in wps_init() argument
44 data->wps = cfg->wps; in wps_init()
45 data->registrar = cfg->registrar; in wps_init()
46 if (cfg->registrar) { in wps_init()
47 os_memcpy(data->uuid_r, cfg->wps->uuid, WPS_UUID_LEN); in wps_init()
49 os_memcpy(data->mac_addr_e, cfg->wps->dev.mac_addr, ETH_ALEN); in wps_init()
50 os_memcpy(data->uuid_e, cfg->wps->uuid, WPS_UUID_LEN); in wps_init()
52 if (cfg->pin) { in wps_init()
53 data->dev_pw_id = cfg->dev_pw_id; in wps_init()
54 data->dev_password = os_malloc(cfg->pin_len); in wps_init()
59 os_memcpy(data->dev_password, cfg->pin, cfg->pin_len); in wps_init()
60 data->dev_password_len = cfg->pin_len; in wps_init()
66 if (cfg->pin == NULL && in wps_init()
67 cfg->dev_pw_id == DEV_PW_NFC_CONNECTION_HANDOVER) in wps_init()
68 data->dev_pw_id = cfg->dev_pw_id; in wps_init()
70 if (cfg->wps->ap && !cfg->registrar && cfg->wps->ap_nfc_dev_pw_id) { in wps_init()
76 data->dev_pw_id = cfg->wps->ap_nfc_dev_pw_id; in wps_init()
78 os_malloc(wpabuf_len(cfg->wps->ap_nfc_dev_pw)); in wps_init()
84 wpabuf_head(cfg->wps->ap_nfc_dev_pw), in wps_init()
85 wpabuf_len(cfg->wps->ap_nfc_dev_pw)); in wps_init()
86 data->dev_password_len = wpabuf_len(cfg->wps->ap_nfc_dev_pw); in wps_init()
92 data->pbc = cfg->pbc; in wps_init()
93 if (cfg->pbc) { in wps_init()
107 if (cfg->assoc_wps_ie) { in wps_init()
110 cfg->assoc_wps_ie); in wps_init()
111 if (wps_parse_msg(cfg->assoc_wps_ie, &attr) < 0) { in wps_init()
125 if (cfg->new_ap_settings) { in wps_init()
134 os_memcpy(data->new_ap_settings, cfg->new_ap_settings, in wps_init()
138 if (cfg->peer_addr) in wps_init()
139 os_memcpy(data->peer_dev.mac_addr, cfg->peer_addr, ETH_ALEN); in wps_init()
140 if (cfg->p2p_dev_addr) in wps_init()
141 os_memcpy(data->p2p_dev_addr, cfg->p2p_dev_addr, ETH_ALEN); in wps_init()
143 data->use_psk_key = cfg->use_psk_key; in wps_init()
144 data->pbc_in_m1 = cfg->pbc_in_m1; in wps_init()
146 if (cfg->peer_pubkey_hash) { in wps_init()
147 os_memcpy(data->peer_pubkey_hash, cfg->peer_pubkey_hash, in wps_init()