From 218e38aa877b002c5ebf60f1880a3587eeb23909 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Thu, 7 Aug 2014 15:41:30 -0700 Subject: [PATCH] core: Store feature flags of wiphy devices --- src/wiphy.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/wiphy.c b/src/wiphy.c index fd939d75..774ee1db 100644 --- a/src/wiphy.c +++ b/src/wiphy.c @@ -46,6 +46,7 @@ struct netdev { struct wiphy { uint32_t id; char name[20]; + uint32_t feature_flags; struct l_queue *netdev_list; }; @@ -253,6 +254,20 @@ static void wiphy_dump_callback(struct l_genl_msg *msg, void *user_data) memcpy(wiphy->name, data, len); break; + + case NL80211_ATTR_FEATURE_FLAGS: + if (!wiphy) { + l_warn("No wiphy structure found"); + return; + } + + if (len != sizeof(uint32_t)) { + l_warn("Invalid feature flags attribute"); + return; + } + + wiphy->feature_flags = *((uint32_t *) data); + break; } } }