Lines Matching refs:params

487 int process_cipher_config(struct wifi_connect_req_params *params,  in process_cipher_config()  argument
494 if (params->suiteb_type == WIFI_SUITEB) { in process_cipher_config()
500 } else if (params->suiteb_type == WIFI_SUITEB_192) { in process_cipher_config()
503 if (params->ft_used) { in process_cipher_config()
513 if (params->ft_used) { in process_cipher_config()
520 if (params->security == WIFI_SECURITY_TYPE_EAP_TLS_SHA256) { in process_cipher_config()
589 static int hapd_get_eap_config(struct wifi_connect_req_params *params, in hapd_get_eap_config() argument
595 if (params->security == eap_config[index].type) { in hapd_get_eap_config()
603 params->security); in hapd_get_eap_config()
611 struct wifi_connect_req_params *params, struct hostapd_eap_user **pnew_user) in hostapd_process_eap_user_phase1() argument
623 if (params->eap_ver >= 0) { in hostapd_process_eap_user_phase1()
624 user->force_version = params->eap_ver; in hostapd_process_eap_user_phase1()
627 if (hapd_get_eap_config(params, &eap_cfg)) { in hostapd_process_eap_user_phase1()
653 static int hostapd_process_eap_user(struct wifi_connect_req_params *params, in hostapd_process_eap_user() argument
657 int i, nusers = params->nusers; in hostapd_process_eap_user()
662 if (hapd_get_eap_config(params, &eap_cfg)) { in hostapd_process_eap_user()
667 tail = hostapd_process_eap_user_phase1(params, &user_list); in hostapd_process_eap_user()
683 if (params->eap_ver >= 0) { in hostapd_process_eap_user()
684 user->force_version = params->eap_ver; in hostapd_process_eap_user()
687 identity = params->identities[i]; in hostapd_process_eap_user()
688 password = params->passwords[i]; in hostapd_process_eap_user()
716 if (params->security == WIFI_SECURITY_TYPE_EAP_TTLS_MSCHAPV2) { in hostapd_process_eap_user()
749 struct wifi_connect_req_params *params) in hapd_process_enterprise_config() argument
755 if (process_cipher_config(params, &cipher_config)) { in hapd_process_enterprise_config()
821 if (!hostapd_cli_cmd_v("set private_key_passwd %s", params->key_passwd)) { in hapd_process_enterprise_config()
825 if (hostapd_process_eap_user(params, iface->bss[0]->conf)) { in hapd_process_enterprise_config()
848 struct wifi_connect_req_params *params, in wpas_add_and_config_network() argument
887 if (params->ssid_length > WIFI_SSID_MAX_LEN) { in wpas_add_and_config_network()
892 strncpy(ssid_null_terminated, params->ssid, WIFI_SSID_MAX_LEN); in wpas_add_and_config_network()
893 ssid_null_terminated[params->ssid_length] = '\0'; in wpas_add_and_config_network()
912 if (params->band != WIFI_FREQ_BAND_UNKNOWN) { in wpas_add_and_config_network()
913 ret = wpa_supp_supported_channels(wpa_s, params->band, &chan_list); in wpas_add_and_config_network()
929 if (params->security != WIFI_SECURITY_TYPE_NONE) { in wpas_add_and_config_network()
930 if (params->psk) { in wpas_add_and_config_network()
931 if ((params->psk_length < WIFI_PSK_MIN_LEN) || in wpas_add_and_config_network()
932 (params->psk_length > WIFI_PSK_MAX_LEN)) { in wpas_add_and_config_network()
938 strncpy(psk_null_terminated, params->psk, WIFI_PSK_MAX_LEN); in wpas_add_and_config_network()
939 psk_null_terminated[params->psk_length] = '\0'; in wpas_add_and_config_network()
943 if (mode_ap && params->security != WIFI_SECURITY_TYPE_PSK) { in wpas_add_and_config_network()
946 params->security); in wpas_add_and_config_network()
951 if (params->security != WIFI_SECURITY_TYPE_WPA_PSK) { in wpas_add_and_config_network()
958 if (params->security == WIFI_SECURITY_TYPE_SAE_HNP || in wpas_add_and_config_network()
959 params->security == WIFI_SECURITY_TYPE_SAE_H2E || in wpas_add_and_config_network()
960 params->security == WIFI_SECURITY_TYPE_SAE_AUTO) { in wpas_add_and_config_network()
961 if (params->sae_password) { in wpas_add_and_config_network()
962 if ((params->sae_password_length < WIFI_PSK_MIN_LEN) || in wpas_add_and_config_network()
963 (params->sae_password_length > WIFI_SAE_PSWD_MAX_LEN)) { in wpas_add_and_config_network()
969 strncpy(sae_null_terminated, params->sae_password, in wpas_add_and_config_network()
971 sae_null_terminated[params->sae_password_length] = '\0'; in wpas_add_and_config_network()
983 if (params->security == WIFI_SECURITY_TYPE_SAE_H2E || in wpas_add_and_config_network()
984 params->security == WIFI_SECURITY_TYPE_SAE_AUTO) { in wpas_add_and_config_network()
986 (params->security == WIFI_SECURITY_TYPE_SAE_H2E) in wpas_add_and_config_network()
994 params->ft_used ? " FT-SAE" : "")) { in wpas_add_and_config_network()
997 } else if (params->security == WIFI_SECURITY_TYPE_PSK_SHA256) { in wpas_add_and_config_network()
1007 } else if (params->security == WIFI_SECURITY_TYPE_PSK || in wpas_add_and_config_network()
1008 params->security == WIFI_SECURITY_TYPE_WPA_PSK) { in wpas_add_and_config_network()
1015 resp.network_id, params->ft_used ? " FT-PSK" : "")) { in wpas_add_and_config_network()
1019 if (params->security == WIFI_SECURITY_TYPE_WPA_PSK) { in wpas_add_and_config_network()
1025 } else if (params->security == WIFI_SECURITY_TYPE_WPA_AUTO_PERSONAL) { in wpas_add_and_config_network()
1031 if (params->sae_password) { in wpas_add_and_config_network()
1052 } else if (is_eap_valid_security(params->security)) { in wpas_add_and_config_network()
1053 if (process_cipher_config(params, &cipher_config)) { in wpas_add_and_config_network()
1058 if (params->security == eap_config[index].type) { in wpas_add_and_config_network()
1067 params->security); in wpas_add_and_config_network()
1071 if (params->suiteb_type == WIFI_SUITEB_192) { in wpas_add_and_config_network()
1072 if (params->TLS_cipher == WIFI_EAP_TLS_ECC_P384) { in wpas_add_and_config_network()
1077 } else if (params->TLS_cipher == WIFI_EAP_TLS_RSA_3K) { in wpas_add_and_config_network()
1122 if (params->security == WIFI_SECURITY_TYPE_EAP_PEAP_MSCHAPV2 || in wpas_add_and_config_network()
1123 params->security == WIFI_SECURITY_TYPE_EAP_PEAP_GTC || in wpas_add_and_config_network()
1124 params->security == WIFI_SECURITY_TYPE_EAP_PEAP_TLS) { in wpas_add_and_config_network()
1127 params->eap_ver); in wpas_add_and_config_network()
1142 if (params->eap_id_length > 0) { in wpas_add_and_config_network()
1144 resp.network_id, params->eap_identity)) { in wpas_add_and_config_network()
1149 if (params->eap_passwd_length > 0) { in wpas_add_and_config_network()
1151 resp.network_id, params->eap_password)) { in wpas_add_and_config_network()
1157 resp.network_id, params->anon_id)) { in wpas_add_and_config_network()
1195 resp.network_id, params->key_passwd)) { in wpas_add_and_config_network()
1233 resp.network_id, params->key2_passwd)) { in wpas_add_and_config_network()
1240 params->security); in wpas_add_and_config_network()
1244 if (params->mfp) { in wpas_add_and_config_network()
1246 resp.network_id, params->mfp)) { in wpas_add_and_config_network()
1252 if (params->channel != WIFI_CHANNEL_ANY) { in wpas_add_and_config_network()
1255 if (params->band != WIFI_FREQ_BAND_UNKNOWN) { in wpas_add_and_config_network()
1256 freq = wpa_supp_band_chan_compat(wpa_s, params->band, params->channel); in wpas_add_and_config_network()
1261 freq = chan_to_freq(params->channel); in wpas_add_and_config_network()
1265 params->channel); in wpas_add_and_config_network()
1283 memcpy((void *)&mac, params->bssid, WIFI_MAC_ADDR_LEN); in wpas_add_and_config_network()
1296 params->bssid[0], params->bssid[1], params->bssid[2], in wpas_add_and_config_network()
1297 params->bssid[3], params->bssid[4], params->bssid[5]); in wpas_add_and_config_network()
1315 memcpy((void *)&last_wifi_conn_params, params, sizeof(struct wifi_connect_req_params)); in wpas_add_and_config_network()
1400 int supplicant_connect(const struct device *dev, struct wifi_connect_req_params *params) argument
1428 ret = wpas_add_and_config_network(wpa_s, params, false);
1436 wpas_api_ctrl.connection_timeout = params->timeout;
1637 int supplicant_get_version(const struct device *dev, struct wifi_version *params) argument
1646 return wifi_mgmt_api->get_version(dev, params);
1649 int supplicant_scan(const struct device *dev, struct wifi_scan_params *params, argument
1659 return wifi_mgmt_api->scan(dev, params, cb);
1713 int supplicant_11k_cfg(const struct device *dev, struct wifi_11k_params *params) argument
1722 return wifi_mgmt_api->cfg_11k(dev, params);
1725 int supplicant_11k_neighbor_request(const struct device *dev, struct wifi_11k_params *params) argument
1727 int ssid_len = strlen(params->ssid);
1729 if (params != NULL && ssid_len > 0) {
1737 params->ssid)) {
1740 __func__, params->ssid);
1757 int supplicant_candidate_scan(const struct device *dev, struct wifi_scan_params *params) argument
1767 while (params->band_chan[i].channel) {
1771 freq = chan_to_freq(params->band_chan[i].channel);
1820 int supplicant_set_power_save(const struct device *dev, struct wifi_ps_params *params) argument
1829 return wifi_mgmt_api->set_power_save(dev, params);
1832 int supplicant_set_twt(const struct device *dev, struct wifi_twt_params *params) argument
1841 return wifi_mgmt_api->set_twt(dev, params);
1844 int supplicant_set_btwt(const struct device *dev, struct wifi_twt_params *params) argument
1853 return wifi_mgmt_api->set_btwt(dev, params);
2037 struct wifi_connect_req_params *params) argument
2051 memcpy(params, &last_wifi_conn_params, sizeof(struct wifi_connect_req_params));
2086 static int supplicant_wps_pin(const struct device *dev, struct wifi_wps_config_params *params) argument
2101 if (params->oper == WIFI_WPS_PIN_GET) {
2102 if (zephyr_wpa_cli_cmd_resp(get_pin_cmd, params->pin)) {
2105 } else if (params->oper == WIFI_WPS_PIN_SET) {
2106 if (!wpa_cli_cmd_v("wps_check_pin %s", params->pin)) {
2110 if (!wpa_cli_cmd_v("wps_pin any %s", params->pin)) {
2117 wpa_printf(MSG_ERROR, "Error wps pin operation : %d", params->oper);
2129 int supplicant_wps_config(const struct device *dev, struct wifi_wps_config_params *params) argument
2133 if (params->oper == WIFI_WPS_PBC) {
2135 } else if (params->oper == WIFI_WPS_PIN_GET || params->oper == WIFI_WPS_PIN_SET) {
2136 ret = supplicant_wps_pin(dev, params);
2165 static int hapd_config_chan_center_seg0(struct wifi_connect_req_params *params) argument
2179 switch (params->bandwidth) {
2182 center_freq_seg0_idx = params->channel;
2200 if (params->bandwidth != WIFI_FREQ_BANDWIDTH_20MHZ) {
2201 chan_idx = params->channel;
2232 struct wifi_connect_req_params *params) argument
2236 if (!hostapd_cli_cmd_v("set ssid %s", params->ssid)) {
2240 if (params->channel == 0) {
2241 if (params->band == 0) {
2245 } else if (params->band == 1) {
2250 wpa_printf(MSG_ERROR, "Invalid band %d", params->band);
2253 } else if (params->channel > 14) {
2263 if (!hostapd_cli_cmd_v("set channel %d", params->channel)) {
2267 ret = hapd_config_chan_center_seg0(params);
2272 if (params->security != WIFI_SECURITY_TYPE_NONE) {
2273 if (params->security == WIFI_SECURITY_TYPE_WPA_PSK) {
2280 if (!hostapd_cli_cmd_v("set wpa_passphrase %s", params->psk)) {
2286 } else if (params->security == WIFI_SECURITY_TYPE_PSK) {
2293 if (!hostapd_cli_cmd_v("set wpa_passphrase %s", params->psk)) {
2299 } else if (params->security == WIFI_SECURITY_TYPE_PSK_SHA256) {
2306 if (!hostapd_cli_cmd_v("set wpa_passphrase %s", params->psk)) {
2312 } else if (params->security == WIFI_SECURITY_TYPE_SAE_HNP ||
2313 params->security == WIFI_SECURITY_TYPE_SAE_H2E ||
2314 params->security == WIFI_SECURITY_TYPE_SAE_AUTO) {
2322 params->sae_password ? params->sae_password :
2323 params->psk)) {
2329 if (params->security == WIFI_SECURITY_TYPE_SAE_H2E ||
2330 params->security == WIFI_SECURITY_TYPE_SAE_AUTO) {
2332 (params->security == WIFI_SECURITY_TYPE_SAE_H2E)
2338 } else if (params->security == WIFI_SECURITY_TYPE_WPA_AUTO_PERSONAL) {
2347 if (!hostapd_cli_cmd_v("set wpa_passphrase %s", params->psk)) {
2352 params->sae_password ? params->sae_password
2353 : params->psk)) {
2364 } else if (params->security == WIFI_SECURITY_TYPE_DPP) {
2371 if (!hostapd_cli_cmd_v("set wpa_passphrase %s", params->psk)) {
2384 } else if (is_eap_valid_security(params->security)) {
2385 if (hapd_process_enterprise_config(iface, params)) {
2397 if (!hostapd_cli_cmd_v("set ieee80211w %d", params->mfp)) {
2401 if (!hostapd_cli_cmd_v("set ignore_broadcast_ssid %d", params->ignore_broadcast_ssid)) {
2410 static int set_ap_config_params(const struct device *dev, struct wifi_ap_config_params *params) argument
2418 return wifi_mgmt_api->ap_config_params(dev, params);
2421 int supplicant_ap_config_params(const struct device *dev, struct wifi_ap_config_params *params) argument
2426 ret = set_ap_config_params(dev, params);
2447 if (params->type & WIFI_AP_CONFIG_PARAM_MAX_NUM_STA) {
2448 if (!hostapd_cli_cmd_v("set max_num_sta %d", params->max_num_sta)) {
2453 wpa_printf(MSG_INFO, "Set maximum number of stations: %d", params->max_num_sta);
2456 if (params->type & WIFI_AP_CONFIG_PARAM_HT_CAPAB) {
2457 if (!hostapd_cli_cmd_v("set ht_capab %s", params->ht_capab)) {
2462 wpa_printf(MSG_INFO, "Set HT capabilities: %s", params->ht_capab);
2465 if (params->type & WIFI_AP_CONFIG_PARAM_VHT_CAPAB) {
2466 if (!hostapd_cli_cmd_v("set vht_capab %s", params->vht_capab)) {
2471 wpa_printf(MSG_INFO, "Set VHT capabilities: %s", params->vht_capab);
2593 int supplicant_ap_wps_pin(const struct device *dev, struct wifi_wps_config_params *params) argument
2615 if (params->oper == WIFI_WPS_PIN_GET) {
2616 if (zephyr_hostapd_cli_cmd_resp(get_pin_cmd, params->pin)) {
2619 } else if (params->oper == WIFI_WPS_PIN_SET) {
2620 if (!hostapd_cli_cmd_v("wps_check_pin %s", params->pin)) {
2624 if (!hostapd_cli_cmd_v("wps_pin any %s %d", params->pin, WPS_PIN_EXPIRE_TIME)) {
2631 wpa_printf(MSG_ERROR, "Error wps pin operation : %d", params->oper);
2644 int supplicant_ap_wps_config(const struct device *dev, struct wifi_wps_config_params *params) argument
2648 if (params->oper == WIFI_WPS_PBC) {
2650 } else if (params->oper == WIFI_WPS_PIN_GET || params->oper == WIFI_WPS_PIN_SET) {
2651 ret = supplicant_ap_wps_pin(dev, params);
2661 struct wifi_ap_config_params params = {0}; local
2667 params.bandwidth = bandwidth;
2668 params.type = WIFI_AP_CONFIG_PARAM_BANDWIDTH;
2669 return wifi_mgmt_api->ap_config_params(dev, &params);
2673 struct wifi_connect_req_params *params) argument
2691 ret = set_ap_bandwidth(dev, params->bandwidth);
2715 ret = hapd_config_network(iface, params);
2764 ret = wpas_add_and_config_network(wpa_s, params, true);
2970 static int dpp_params_to_cmd(struct wifi_dpp_params *params, char *cmd, size_t max_len) argument
2975 switch (params->action) {
2980 if (params->configurator_add.curve) {
2982 dpp_params_to_args_curve(params->configurator_add.curve));
2986 if (params->configurator_add.net_access_key_curve) {
2989 params->configurator_add.net_access_key_curve));
2996 if (params->auth_init.peer) {
2997 snprintf(pos, end - pos, " peer=%d", params->auth_init.peer);
3001 if (params->auth_init.conf) {
3004 params->auth_init.conf));
3008 if (params->auth_init.ssid[0]) {
3011 dpp_ssid_bin2str(pos, params->auth_init.ssid,
3016 if (params->auth_init.configurator) {
3018 params->auth_init.configurator);
3022 if (params->auth_init.role) {
3025 params->auth_init.role));
3032 if (params->dpp_qr_code[0]) {
3033 snprintf(pos, end - pos, " %s", params->dpp_qr_code);
3040 if (params->chirp.id) {
3041 snprintf(pos, end - pos, " own=%d", params->chirp.id);
3045 if (params->chirp.freq) {
3046 snprintf(pos, end - pos, " listen=%d", params->chirp.freq);
3053 if (params->listen.freq) {
3054 snprintf(pos, end - pos, " %d", params->listen.freq);
3058 if (params->listen.role) {
3061 params->listen.role));
3068 if (params->bootstrap_gen.type) {
3073 if (params->bootstrap_gen.op_class &&
3074 params->bootstrap_gen.chan) {
3076 params->bootstrap_gen.op_class,
3077 params->bootstrap_gen.chan);
3083 params->bootstrap_gen.mac[0], params->bootstrap_gen.mac[1],
3084 params->bootstrap_gen.mac[2], params->bootstrap_gen.mac[3],
3085 params->bootstrap_gen.mac[4], params->bootstrap_gen.mac[5]);
3088 if (params->bootstrap_gen.curve) {
3090 dpp_params_to_args_curve(params->bootstrap_gen.curve));
3094 snprintf(pos, end - pos, "DPP_BOOTSTRAP_GET_URI %d", params->id);
3100 if (params->configurator_set.peer) {
3101 snprintf(pos, end - pos, " peer=%d", params->configurator_set.peer);
3105 if (params->configurator_set.conf) {
3108 params->configurator_set.conf));
3112 if (params->configurator_set.ssid[0]) {
3115 dpp_ssid_bin2str(pos, params->configurator_set.ssid,
3120 if (params->configurator_set.configurator) {
3122 params->configurator_set.configurator);
3126 if (params->configurator_set.role) {
3129 params->configurator_set.role));
3133 if (params->configurator_set.curve) {
3135 dpp_params_to_args_curve(params->configurator_set.curve));
3139 if (params->configurator_set.net_access_key_curve) {
3142 params->configurator_set.net_access_key_curve));
3147 params->dpp_resp_wait_time);
3150 snprintf(pos, end - pos, "DPP_RECONFIG %d", params->network_id);
3160 int supplicant_dpp_dispatch(const struct device *dev, struct wifi_dpp_params *params) argument
3165 if (params == NULL) {
3175 ret = dpp_params_to_cmd(params, cmd, SUPPLICANT_DPP_CMD_BUF_SIZE - 2);
3182 if (zephyr_wpa_cli_cmd_resp(cmd, params->resp)) {
3192 int hapd_dpp_dispatch(const struct device *dev, struct wifi_dpp_params *params) argument
3197 if (params == NULL) {
3207 ret = dpp_params_to_cmd(params, cmd, SUPPLICANT_DPP_CMD_BUF_SIZE - 2);
3214 if (zephyr_hostapd_cli_cmd_resp(cmd, params->resp)) {