Skip to content

Commit fe1abaf

Browse files
committed
nl80211: re-add channel width and extended capa advertising
Add back the channel width and extended capability data to wiphy information if split information is supported. Signed-off-by: Johannes Berg <[email protected]>
1 parent b8a31c9 commit fe1abaf

File tree

1 file changed

+33
-3
lines changed

1 file changed

+33
-3
lines changed

net/wireless/nl80211.c

Lines changed: 33 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -573,6 +573,21 @@ static int nl80211_msg_put_channel(struct sk_buff *msg,
573573
}
574574
}
575575

576+
if (large) {
577+
if ((chan->flags & IEEE80211_CHAN_NO_HT40MINUS) &&
578+
nla_put_flag(msg, NL80211_FREQUENCY_ATTR_NO_HT40_MINUS))
579+
goto nla_put_failure;
580+
if ((chan->flags & IEEE80211_CHAN_NO_HT40PLUS) &&
581+
nla_put_flag(msg, NL80211_FREQUENCY_ATTR_NO_HT40_PLUS))
582+
goto nla_put_failure;
583+
if ((chan->flags & IEEE80211_CHAN_NO_80MHZ) &&
584+
nla_put_flag(msg, NL80211_FREQUENCY_ATTR_NO_80MHZ))
585+
goto nla_put_failure;
586+
if ((chan->flags & IEEE80211_CHAN_NO_160MHZ) &&
587+
nla_put_flag(msg, NL80211_FREQUENCY_ATTR_NO_160MHZ))
588+
goto nla_put_failure;
589+
}
590+
576591
if (nla_put_u32(msg, NL80211_FREQUENCY_ATTR_MAX_TX_POWER,
577592
DBM_TO_MBM(chan->max_power)))
578593
goto nla_put_failure;
@@ -1137,6 +1152,7 @@ static int nl80211_send_wiphy(struct cfg80211_registered_device *dev,
11371152
const struct ieee80211_txrx_stypes *mgmt_stypes =
11381153
dev->wiphy.mgmt_stypes;
11391154
long start = 0, start_chan = 0, start_band = 0;
1155+
u32 features;
11401156

11411157
hdr = nl80211hdr_put(msg, portid, seq, flags, NL80211_CMD_NEW_WIPHY);
11421158
if (!hdr)
@@ -1461,8 +1477,15 @@ static int nl80211_send_wiphy(struct cfg80211_registered_device *dev,
14611477
dev->wiphy.ap_sme_capa))
14621478
goto nla_put_failure;
14631479

1464-
if (nla_put_u32(msg, NL80211_ATTR_FEATURE_FLAGS,
1465-
dev->wiphy.features))
1480+
features = dev->wiphy.features;
1481+
/*
1482+
* We can only add the per-channel limit information if the
1483+
* dump is split, otherwise it makes it too big. Therefore
1484+
* only advertise it in that case.
1485+
*/
1486+
if (split)
1487+
features |= NL80211_FEATURE_ADVERTISE_CHAN_LIMITS;
1488+
if (nla_put_u32(msg, NL80211_ATTR_FEATURE_FLAGS, features))
14661489
goto nla_put_failure;
14671490

14681491
if (dev->wiphy.ht_capa_mod_mask &&
@@ -1490,7 +1513,14 @@ static int nl80211_send_wiphy(struct cfg80211_registered_device *dev,
14901513
(*split_start)++;
14911514
break;
14921515
case 9:
1493-
/* placeholder */
1516+
if (dev->wiphy.extended_capabilities &&
1517+
(nla_put(msg, NL80211_ATTR_EXT_CAPA,
1518+
dev->wiphy.extended_capabilities_len,
1519+
dev->wiphy.extended_capabilities) ||
1520+
nla_put(msg, NL80211_ATTR_EXT_CAPA_MASK,
1521+
dev->wiphy.extended_capabilities_len,
1522+
dev->wiphy.extended_capabilities_mask)))
1523+
goto nla_put_failure;
14941524

14951525
/* done */
14961526
*split_start = 0;

0 commit comments

Comments
 (0)