if (str == NULL) {
/* Default to enabling methods based on build configuration */
methods |= WPS_CONFIG_DISPLAY | WPS_CONFIG_KEYPAD;
+ methods |= WPS_CONFIG_VIRT_DISPLAY;
#ifdef CONFIG_WPS_UFD
methods |= WPS_CONFIG_USBA;
#endif /* CONFIG_WPS_UFD */
methods |= WPS_CONFIG_PUSHBUTTON;
if (os_strstr(str, "keypad"))
methods |= WPS_CONFIG_KEYPAD;
+ if (os_strstr(str, "virtual_display"))
+ methods |= WPS_CONFIG_VIRT_DISPLAY;
+ if (os_strstr(str, "physical_display"))
+ methods |= WPS_CONFIG_PHY_DISPLAY;
+ if (os_strstr(str, "virtual_push_button"))
+ methods |= WPS_CONFIG_VIRT_PUSHBUTTON;
+ if (os_strstr(str, "physical_push_button"))
+ methods |= WPS_CONFIG_PHY_PUSHBUTTON;
}
return methods;
u16 methods;
if (!reg->sel_reg_union)
return 0;
- methods = reg->wps->config_methods & ~WPS_CONFIG_PUSHBUTTON;
- if (reg->pbc)
+ methods = reg->wps->config_methods &
+ ~(WPS_CONFIG_PUSHBUTTON | WPS_CONFIG_VIRT_PUSHBUTTON |
+ WPS_CONFIG_PHY_PUSHBUTTON);
+ if (reg->pbc) {
methods |= WPS_CONFIG_PUSHBUTTON;
+ if (reg->wps->config_methods & WPS_CONFIG_VIRT_PUSHBUTTON)
+ methods |= WPS_CONFIG_VIRT_PUSHBUTTON;
+ if (reg->wps->config_methods & WPS_CONFIG_PHY_PUSHBUTTON)
+ methods |= WPS_CONFIG_PHY_PUSHBUTTON;
+ }
if (reg->sel_reg_config_methods_override >= 0)
methods = reg->sel_reg_config_methods_override;
wpa_printf(MSG_DEBUG, "WPS: * Selected Registrar Config Methods (%x)",
* These are the methods that the AP supports as an Enrollee for adding
* external Registrars.
*/
- methods = reg->wps->config_methods & ~WPS_CONFIG_PUSHBUTTON;
+ methods = reg->wps->config_methods &
+ ~(WPS_CONFIG_PUSHBUTTON | WPS_CONFIG_VIRT_PUSHBUTTON |
+ WPS_CONFIG_PHY_PUSHBUTTON);
wpa_printf(MSG_DEBUG, "WPS: * Config Methods (%x)", methods);
wpabuf_put_be16(msg, ATTR_CONFIG_METHODS);
wpabuf_put_be16(msg, 2);
struct wpabuf *msg)
{
u16 methods;
- methods = reg->wps->config_methods & ~WPS_CONFIG_PUSHBUTTON;
- if (reg->pbc)
+ methods = reg->wps->config_methods &
+ ~(WPS_CONFIG_PUSHBUTTON | WPS_CONFIG_VIRT_PUSHBUTTON |
+ WPS_CONFIG_PHY_PUSHBUTTON);
+ if (reg->pbc) {
methods |= WPS_CONFIG_PUSHBUTTON;
+ if (reg->wps->config_methods & WPS_CONFIG_VIRT_PUSHBUTTON)
+ methods |= WPS_CONFIG_VIRT_PUSHBUTTON;
+ if (reg->wps->config_methods & WPS_CONFIG_PHY_PUSHBUTTON)
+ methods |= WPS_CONFIG_PHY_PUSHBUTTON;
+ }
return wps_build_config_methods(msg, methods);
}
return;
if (reg->selected_registrar) {
- methods = reg->wps->config_methods & ~WPS_CONFIG_PUSHBUTTON;
- if (reg->pbc)
+ methods = reg->wps->config_methods &
+ ~(WPS_CONFIG_PUSHBUTTON | WPS_CONFIG_VIRT_PUSHBUTTON |
+ WPS_CONFIG_PHY_PUSHBUTTON);
+ if (reg->pbc) {
methods |= WPS_CONFIG_PUSHBUTTON;
+ if (reg->wps->config_methods &
+ WPS_CONFIG_VIRT_PUSHBUTTON)
+ methods |= WPS_CONFIG_VIRT_PUSHBUTTON;
+ if (reg->wps->config_methods &
+ WPS_CONFIG_PHY_PUSHBUTTON)
+ methods |= WPS_CONFIG_PHY_PUSHBUTTON;
+ }
}
reg->set_sel_reg_cb(reg->cb_ctx, reg->selected_registrar,
WPS_MAX_AUTHORIZED_MACS * ETH_ALEN);
if (reg->selected_registrar) {
reg->sel_reg_config_methods_override =
- reg->wps->config_methods & ~WPS_CONFIG_PUSHBUTTON;
+ reg->wps->config_methods &
+ ~(WPS_CONFIG_PUSHBUTTON | WPS_CONFIG_VIRT_PUSHBUTTON |
+ WPS_CONFIG_PHY_PUSHBUTTON);
if (reg->pbc) {
reg->sel_reg_dev_password_id_override =
DEV_PW_PUSHBUTTON;
reg->sel_reg_config_methods_override |=
WPS_CONFIG_PUSHBUTTON;
+ if (reg->wps->config_methods &
+ WPS_CONFIG_VIRT_PUSHBUTTON)
+ reg->sel_reg_config_methods_override |=
+ WPS_CONFIG_VIRT_PUSHBUTTON;
+ if (reg->wps->config_methods &
+ WPS_CONFIG_PHY_PUSHBUTTON)
+ reg->sel_reg_config_methods_override |=
+ WPS_CONFIG_PHY_PUSHBUTTON;
}
wpa_printf(MSG_DEBUG, "WPS: Internal Registrar selected "
"(pbc=%d)", reg->pbc);