3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-12-21 11:52:34 +01:00

wsc: extract ATTR_CONFIGURATION_ERROR

This commit is contained in:
Denis Kenzior 2015-09-08 21:09:04 -05:00
parent b0e306b407
commit a1c198ab11

View File

@ -238,6 +238,22 @@ static bool extract_association_state(struct wsc_attr_iter *iter, void *data)
return true; return true;
} }
static bool extract_configuration_error(struct wsc_attr_iter *iter, void *data)
{
enum wsc_configuration_error *out = data;
uint16_t ce;
if (!extract_uint16(iter, &ce))
return false;
/* WSC 2.0.5: Table 34 */
if (ce > 20)
return false;
*out = ce;
return true;
}
static bool extract_device_name(struct wsc_attr_iter *iter, void *data) static bool extract_device_name(struct wsc_attr_iter *iter, void *data)
{ {
return extract_utf8_string(iter, data, 32); return extract_utf8_string(iter, data, 32);
@ -386,6 +402,8 @@ static attr_handler handler_for_type(enum wsc_attr type)
return extract_bool; return extract_bool;
case WSC_ATTR_ASSOCIATION_STATE: case WSC_ATTR_ASSOCIATION_STATE:
return extract_association_state; return extract_association_state;
case WSC_ATTR_CONFIGURATION_ERROR:
return extract_configuration_error;
case WSC_ATTR_CONFIGURATION_METHODS: case WSC_ATTR_CONFIGURATION_METHODS:
return extract_uint16; return extract_uint16;
case WSC_ATTR_DEVICE_NAME: case WSC_ATTR_DEVICE_NAME: