+static int nl80211_get_protocol_features_cb(struct nl_msg *msg, void *arg)
+{
+ uint32_t *features = arg;
+ struct nlattr **attr = nl80211_parse(msg);
+
+ if (attr[NL80211_ATTR_PROTOCOL_FEATURES])
+ *features = nla_get_u32(attr[NL80211_ATTR_PROTOCOL_FEATURES]);
+
+ return NL_SKIP;
+}
+
+static int nl80211_get_protocol_features(const char *ifname)
+{
+ struct nl80211_msg_conveyor *req;
+ uint32_t features = 0;
+
+ req = nl80211_msg(ifname, NL80211_CMD_GET_PROTOCOL_FEATURES, 0);
+ if (req) {
+ nl80211_send(req, nl80211_get_protocol_features_cb, &features);
+ nl80211_free(req);
+ }
+
+ return features;
+}