BACKPORT: wifi: nl80211: add EML/MLD capabilities to per-iftype capabilities
We have the per-interface type capabilities, currently for extended capabilities, add the EML/MLD capabilities there to have this advertised by the driver. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Bug: 253289327 Change-Id: I41b8b95feea270a7e0803f613c8f11ce3af235a0 (cherry picked from commit 4e9c3af398207d95957ae6c25290891574f2d7e8) [Kiran Kumar Lokere: Resolved conflicts in include/uapi/linux/nl80211.h] [vjakkam: Use kabi backport reserved space to avoid KMI issue] Signed-off-by: Kiran Kumar Lokere <quic_klokere@quicinc.com> Signed-off-by: Veerendranath Jakkam <quic_vjakkam@quicinc.com>
This commit is contained in:
@@ -5282,6 +5282,19 @@ struct wiphy_iftype_ext_capab {
|
||||
const struct wiphy_iftype_ext_capab *
|
||||
cfg80211_get_iftype_ext_capa(struct wiphy *wiphy, enum nl80211_iftype type);
|
||||
|
||||
/**
|
||||
* struct wiphy_iftype_ext_capab2 - backported extended capabilities per
|
||||
* interface type
|
||||
* @iftype: interface type
|
||||
* @eml_capabilities: EML capabilities (for MLO)
|
||||
* @mld_capa_and_ops: MLD capabilities and operations (for MLO)
|
||||
*/
|
||||
struct wiphy_iftype_ext_capab2 {
|
||||
enum nl80211_iftype iftype;
|
||||
u16 eml_capabilities;
|
||||
u16 mld_capa_and_ops;
|
||||
};
|
||||
|
||||
/**
|
||||
* struct cfg80211_pmsr_capabilities - cfg80211 peer measurement capabilities
|
||||
* @max_peers: maximum number of peers in a single measurement
|
||||
@@ -5338,6 +5351,19 @@ struct wiphy_iftype_akm_suites {
|
||||
int n_akm_suites;
|
||||
};
|
||||
|
||||
/**
|
||||
* struct wiphy_backport - backported wireless hardware description
|
||||
* @iftype_ext_capab2: extension to @wiphy.iftype_ext_capab. Backported array of
|
||||
* extended capabilities per interface type. Driver should allocate array
|
||||
* of size @wiphy.num_iftype_ext_capab same as @wiphy.iftype_ext_capab.
|
||||
* @num_iftype_ext_capab2: number of interface types for which extended. must be
|
||||
* be same as @wiphy.num_iftype_ext_capab.
|
||||
*/
|
||||
struct wiphy_backport {
|
||||
const struct wiphy_iftype_ext_capab2 *iftype_ext_capab2;
|
||||
unsigned int num_iftype_ext_capab2;
|
||||
};
|
||||
|
||||
/**
|
||||
* struct wiphy - wireless hardware description
|
||||
* @mtx: mutex for the data (structures) of this device
|
||||
@@ -5547,6 +5573,7 @@ struct wiphy_iftype_akm_suites {
|
||||
* NL80211_MAX_NR_AKM_SUITES in order to avoid compatibility issues with
|
||||
* legacy userspace and maximum allowed value is
|
||||
* CFG80211_MAX_NUM_AKM_SUITES.
|
||||
* @backport: backported wiphy information.
|
||||
*/
|
||||
struct wiphy {
|
||||
struct mutex mtx;
|
||||
@@ -5695,7 +5722,8 @@ struct wiphy {
|
||||
u8 ema_max_profile_periodicity;
|
||||
u16 max_num_akm_suites;
|
||||
|
||||
ANDROID_BACKPORT_RESERVED(1);
|
||||
/* Enabled with bug 253289327 */
|
||||
ANDROID_BACKPORT_RESERVED_USE(1, const struct wiphy_backport *backport);
|
||||
ANDROID_BACKPORT_RESERVED(2);
|
||||
ANDROID_BACKPORT_RESERVED(3);
|
||||
ANDROID_BACKPORT_RESERVED(4);
|
||||
|
||||
@@ -2392,8 +2392,10 @@ enum nl80211_commands {
|
||||
*
|
||||
* @NL80211_ATTR_IFTYPE_EXT_CAPA: Nested attribute of the following attributes:
|
||||
* %NL80211_ATTR_IFTYPE, %NL80211_ATTR_EXT_CAPA,
|
||||
* %NL80211_ATTR_EXT_CAPA_MASK, to specify the extended capabilities per
|
||||
* interface type.
|
||||
* %NL80211_ATTR_EXT_CAPA_MASK, to specify the extended capabilities and
|
||||
* other interface-type specific capabilities per interface type. For MLO,
|
||||
* %NL80211_ATTR_EML_CAPABILITY and %NL80211_ATTR_MLD_CAPA_AND_OPS are
|
||||
* present.
|
||||
*
|
||||
* @NL80211_ATTR_MU_MIMO_GROUP_DATA: array of 24 bytes that defines a MU-MIMO
|
||||
* groupID for monitor mode.
|
||||
@@ -2733,6 +2735,9 @@ enum nl80211_commands {
|
||||
* connection. Used with %NL80211_CMD_CONNECT. If this attribute is not
|
||||
* included in NL80211_CMD_CONNECT drivers must not perform MLO connection.
|
||||
*
|
||||
* @NL80211_ATTR_EML_CAPABILITY: EML Capability information (u16)
|
||||
* @NL80211_ATTR_MLD_CAPA_AND_OPS: MLD Capabilities and Operations (u16)
|
||||
*
|
||||
* @NUM_NL80211_ATTR: total number of nl80211_attrs available
|
||||
* @NL80211_ATTR_MAX: highest attribute number currently defined
|
||||
* @__NL80211_ATTR_AFTER_LAST: internal use
|
||||
@@ -3255,8 +3260,9 @@ enum nl80211_attrs {
|
||||
|
||||
NL80211_ATTR_MAX_NUM_AKM_SUITES,
|
||||
|
||||
NL80211_ATTR_RESERVED_DO_NOT_USE_6 = 317,
|
||||
NL80211_ATTR_RESERVED_DO_NOT_USE_7 = 318,
|
||||
NL80211_ATTR_EML_CAPABILITY,
|
||||
NL80211_ATTR_MLD_CAPA_AND_OPS,
|
||||
|
||||
NL80211_ATTR_RESERVED_DO_NOT_USE_8 = 319,
|
||||
NL80211_ATTR_RESERVED_DO_NOT_USE_9 = 320,
|
||||
NL80211_ATTR_RESERVED_DO_NOT_USE_10 = 321,
|
||||
|
||||
@@ -934,6 +934,23 @@ int wiphy_register(struct wiphy *wiphy)
|
||||
wiphy->max_num_akm_suites > CFG80211_MAX_NUM_AKM_SUITES)
|
||||
return -EINVAL;
|
||||
|
||||
/* check backport information when indicated */
|
||||
if (wiphy->backport) {
|
||||
int i;
|
||||
const struct wiphy_backport *backport = wiphy->backport;
|
||||
|
||||
/* should implement num_iftype_ext_capab2 */
|
||||
if (WARN_ON(wiphy->num_iftype_ext_capab !=
|
||||
backport->num_iftype_ext_capab2))
|
||||
return -EINVAL;
|
||||
|
||||
for (i = 0; i < wiphy->num_iftype_ext_capab; i++) {
|
||||
if (WARN_ON(wiphy->iftype_ext_capab[i].iftype !=
|
||||
backport->iftype_ext_capab2[i].iftype))
|
||||
return -EINVAL;
|
||||
}
|
||||
}
|
||||
|
||||
/* check and set up bitrates */
|
||||
ieee80211_set_bitrate_flags(wiphy);
|
||||
|
||||
|
||||
@@ -2861,8 +2861,14 @@ static int nl80211_send_wiphy(struct cfg80211_registered_device *rdev,
|
||||
for (i = state->capa_start;
|
||||
i < rdev->wiphy.num_iftype_ext_capab; i++) {
|
||||
const struct wiphy_iftype_ext_capab *capab;
|
||||
const struct wiphy_backport *backport;
|
||||
const struct wiphy_iftype_ext_capab2 *capab2;
|
||||
|
||||
|
||||
capab = &rdev->wiphy.iftype_ext_capab[i];
|
||||
backport = rdev->wiphy.backport;
|
||||
capab2 = backport ?
|
||||
&backport->iftype_ext_capab2[i] : NULL;
|
||||
|
||||
nested_ext_capab = nla_nest_start_noflag(msg,
|
||||
i);
|
||||
@@ -2877,6 +2883,16 @@ static int nl80211_send_wiphy(struct cfg80211_registered_device *rdev,
|
||||
capab->extended_capabilities_mask))
|
||||
goto nla_put_failure;
|
||||
|
||||
if ((rdev->wiphy.flags &
|
||||
WIPHY_FLAG_SUPPORTS_MLO) && capab2 &&
|
||||
(nla_put_u16(msg,
|
||||
NL80211_ATTR_EML_CAPABILITY,
|
||||
capab2->eml_capabilities) ||
|
||||
nla_put_u16(msg,
|
||||
NL80211_ATTR_MLD_CAPA_AND_OPS,
|
||||
capab2->mld_capa_and_ops)))
|
||||
goto nla_put_failure;
|
||||
|
||||
nla_nest_end(msg, nested_ext_capab);
|
||||
if (state->split)
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user