WPS: Fix ifdef use for the new NFC mechanism in wpa_supplicant

Use CONFIG_WPS_NFC instead of CONFIG_WPS_OOB for the NFC specific
new ctrl_iface commands.

Signed-hostap: Jouni Malinen <j@w1.fi>
This commit is contained in:
Jouni Malinen 2012-06-28 14:05:13 +03:00
parent d7645d239d
commit 71892384da
2 changed files with 16 additions and 4 deletions

View file

@ -619,8 +619,11 @@ static int wpa_supplicant_ctrl_iface_wps_oob(struct wpa_supplicant *wpa_s,
return wpas_wps_start_oob(wpa_s, cmd, path, method, name); return wpas_wps_start_oob(wpa_s, cmd, path, method, name);
} }
#endif /* CONFIG_WPS_OOB */
#ifdef CONFIG_WPS_NFC
static int wpa_supplicant_ctrl_iface_wps_nfc(struct wpa_supplicant *wpa_s, static int wpa_supplicant_ctrl_iface_wps_nfc(struct wpa_supplicant *wpa_s,
char *cmd) char *cmd)
{ {
@ -689,7 +692,8 @@ static int wpa_supplicant_ctrl_iface_wps_nfc_tag_read(
return ret; return ret;
} }
#endif /* CONFIG_WPS_OOB */
#endif /* CONFIG_WPS_NFC */
static int wpa_supplicant_ctrl_iface_wps_reg(struct wpa_supplicant *wpa_s, static int wpa_supplicant_ctrl_iface_wps_reg(struct wpa_supplicant *wpa_s,
@ -4118,6 +4122,8 @@ char * wpa_supplicant_ctrl_iface_process(struct wpa_supplicant *wpa_s,
} else if (os_strncmp(buf, "WPS_OOB ", 8) == 0) { } else if (os_strncmp(buf, "WPS_OOB ", 8) == 0) {
if (wpa_supplicant_ctrl_iface_wps_oob(wpa_s, buf + 8)) if (wpa_supplicant_ctrl_iface_wps_oob(wpa_s, buf + 8))
reply_len = -1; reply_len = -1;
#endif /* CONFIG_WPS_OOB */
#ifdef CONFIG_WPS_NFC
} else if (os_strcmp(buf, "WPS_NFC") == 0) { } else if (os_strcmp(buf, "WPS_NFC") == 0) {
if (wpa_supplicant_ctrl_iface_wps_nfc(wpa_s, NULL)) if (wpa_supplicant_ctrl_iface_wps_nfc(wpa_s, NULL))
reply_len = -1; reply_len = -1;
@ -4131,7 +4137,7 @@ char * wpa_supplicant_ctrl_iface_process(struct wpa_supplicant *wpa_s,
if (wpa_supplicant_ctrl_iface_wps_nfc_tag_read(wpa_s, if (wpa_supplicant_ctrl_iface_wps_nfc_tag_read(wpa_s,
buf + 17)) buf + 17))
reply_len = -1; reply_len = -1;
#endif /* CONFIG_WPS_OOB */ #endif /* CONFIG_WPS_NFC */
} else if (os_strncmp(buf, "WPS_REG ", 8) == 0) { } else if (os_strncmp(buf, "WPS_REG ", 8) == 0) {
if (wpa_supplicant_ctrl_iface_wps_reg(wpa_s, buf + 8)) if (wpa_supplicant_ctrl_iface_wps_reg(wpa_s, buf + 8))
reply_len = -1; reply_len = -1;

View file

@ -845,8 +845,11 @@ static int wpa_cli_cmd_wps_oob(struct wpa_ctrl *ctrl, int argc, char *argv[])
} }
return wpa_ctrl_command(ctrl, cmd); return wpa_ctrl_command(ctrl, cmd);
} }
#endif /* CONFIG_WPS_OOB */
#ifdef CONFIG_WPS_NFC
static int wpa_cli_cmd_wps_nfc(struct wpa_ctrl *ctrl, int argc, char *argv[]) static int wpa_cli_cmd_wps_nfc(struct wpa_ctrl *ctrl, int argc, char *argv[])
{ {
char cmd[256]; char cmd[256];
@ -913,7 +916,8 @@ static int wpa_cli_cmd_wps_nfc_tag_read(struct wpa_ctrl *ctrl, int argc,
return ret; return ret;
} }
#endif /* CONFIG_WPS_OOB */
#endif /* CONFIG_WPS_NFC */
static int wpa_cli_cmd_wps_reg(struct wpa_ctrl *ctrl, int argc, char *argv[]) static int wpa_cli_cmd_wps_reg(struct wpa_ctrl *ctrl, int argc, char *argv[])
@ -3109,6 +3113,8 @@ static struct wpa_cli_cmd wpa_cli_commands[] = {
{ "wps_oob", wpa_cli_cmd_wps_oob, { "wps_oob", wpa_cli_cmd_wps_oob,
cli_cmd_flag_sensitive, cli_cmd_flag_sensitive,
"<DEV_TYPE> <PATH> <METHOD> [DEV_NAME] = start WPS OOB" }, "<DEV_TYPE> <PATH> <METHOD> [DEV_NAME] = start WPS OOB" },
#endif /* CONFIG_WPS_OOB */
#ifdef CONFIG_WPS_NFC
{ "wps_nfc", wpa_cli_cmd_wps_nfc, { "wps_nfc", wpa_cli_cmd_wps_nfc,
cli_cmd_flag_none, cli_cmd_flag_none,
"[BSSID] = start Wi-Fi Protected Setup: NFC" }, "[BSSID] = start Wi-Fi Protected Setup: NFC" },
@ -3118,7 +3124,7 @@ static struct wpa_cli_cmd wpa_cli_commands[] = {
{ "wps_nfc_tag_read", wpa_cli_cmd_wps_nfc_tag_read, { "wps_nfc_tag_read", wpa_cli_cmd_wps_nfc_tag_read,
cli_cmd_flag_sensitive, cli_cmd_flag_sensitive,
"<hexdump of payload> = report read NFC tag with WPS data" }, "<hexdump of payload> = report read NFC tag with WPS data" },
#endif /* CONFIG_WPS_OOB */ #endif /* CONFIG_WPS_NFC */
{ "wps_reg", wpa_cli_cmd_wps_reg, { "wps_reg", wpa_cli_cmd_wps_reg,
cli_cmd_flag_sensitive, cli_cmd_flag_sensitive,
"<BSSID> <AP PIN> = start WPS Registrar to configure an AP" }, "<BSSID> <AP PIN> = start WPS Registrar to configure an AP" },