mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2024-12-22 13:02:44 +01:00
wiphy: Add wiphy_get_ext_feature
Save the extended features reported by the wiphy in the NEW_WIPHY event or GET_WIPHY dump and allow netdev to query it with wiphy_get_ext_feature()
This commit is contained in:
parent
a2b9cd0726
commit
fd4ab5d3df
14
src/wiphy.c
14
src/wiphy.c
@ -43,6 +43,7 @@
|
|||||||
#include "src/rfkill.h"
|
#include "src/rfkill.h"
|
||||||
#include "src/wiphy.h"
|
#include "src/wiphy.h"
|
||||||
#include "src/storage.h"
|
#include "src/storage.h"
|
||||||
|
#include "src/util.h"
|
||||||
|
|
||||||
static struct l_genl_family *nl80211 = NULL;
|
static struct l_genl_family *nl80211 = NULL;
|
||||||
static struct l_hwdb *hwdb;
|
static struct l_hwdb *hwdb;
|
||||||
@ -53,6 +54,7 @@ struct wiphy {
|
|||||||
uint32_t id;
|
uint32_t id;
|
||||||
char name[20];
|
char name[20];
|
||||||
uint32_t feature_flags;
|
uint32_t feature_flags;
|
||||||
|
uint8_t ext_features[2];
|
||||||
bool support_scheduled_scan:1;
|
bool support_scheduled_scan:1;
|
||||||
bool support_rekey_offload:1;
|
bool support_rekey_offload:1;
|
||||||
uint16_t supported_ciphers;
|
uint16_t supported_ciphers;
|
||||||
@ -179,6 +181,12 @@ bool wiphy_can_connect(struct wiphy *wiphy, struct scan_bss *bss)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool wiphy_get_ext_feature(struct wiphy *wiphy, unsigned int idx)
|
||||||
|
{
|
||||||
|
return idx < sizeof(wiphy->ext_features) * 8 &&
|
||||||
|
util_is_bit_set(wiphy->ext_features[idx >> 3], idx & 7);
|
||||||
|
}
|
||||||
|
|
||||||
static void wiphy_print_basic_info(struct wiphy *wiphy)
|
static void wiphy_print_basic_info(struct wiphy *wiphy)
|
||||||
{
|
{
|
||||||
uint32_t bands;
|
uint32_t bands;
|
||||||
@ -339,6 +347,12 @@ static void wiphy_parse_attributes(struct wiphy *wiphy,
|
|||||||
else
|
else
|
||||||
wiphy->feature_flags = *((uint32_t *) data);
|
wiphy->feature_flags = *((uint32_t *) data);
|
||||||
|
|
||||||
|
break;
|
||||||
|
case NL80211_ATTR_EXT_FEATURES:
|
||||||
|
if (len > sizeof(wiphy->ext_features))
|
||||||
|
len = sizeof(wiphy->ext_features);
|
||||||
|
|
||||||
|
memcpy(wiphy->ext_features, data, len);
|
||||||
break;
|
break;
|
||||||
case NL80211_ATTR_SUPPORTED_COMMANDS:
|
case NL80211_ATTR_SUPPORTED_COMMANDS:
|
||||||
if (l_genl_attr_recurse(attr, &nested))
|
if (l_genl_attr_recurse(attr, &nested))
|
||||||
|
@ -34,6 +34,7 @@ struct wiphy *wiphy_find(int wiphy_id);
|
|||||||
const char *wiphy_get_path(struct wiphy *wiphy);
|
const char *wiphy_get_path(struct wiphy *wiphy);
|
||||||
uint32_t wiphy_get_supported_bands(struct wiphy *wiphy);
|
uint32_t wiphy_get_supported_bands(struct wiphy *wiphy);
|
||||||
bool wiphy_can_connect(struct wiphy *wiphy, struct scan_bss *bss);
|
bool wiphy_can_connect(struct wiphy *wiphy, struct scan_bss *bss);
|
||||||
|
bool wiphy_get_ext_feature(struct wiphy *wiphy, unsigned int idx);
|
||||||
|
|
||||||
bool wiphy_init(struct l_genl_family *in, const char *whitelist,
|
bool wiphy_init(struct l_genl_family *in, const char *whitelist,
|
||||||
const char *blacklist);
|
const char *blacklist);
|
||||||
|
Loading…
Reference in New Issue
Block a user