History

wifi: cfg80211: report per wiphy radio antenna mask

With multi-radio devices, each radio typically gets a fixed set of antennas. In order to be able to disable specific antennas for some radios, user space needs to know which antenna mask bits are assigned to which radio.

Felix Fietkau committed 2 years ago

Commit ebda7161 parent 7b68f633 files · +12 −0Browse files

Unified · Split

3 files
  1. include/net/cfg80211.h +4 −0
  2. include/uapi/linux/nl80211.h +3 −0
  3. net/wireless/nl80211.c +5 −0
include/net/cfg80211.h+4−0
@@ -5434,6 +5434,8 @@ struct wiphy_radio_freq_range { · 5433 unmodified lines
5434 * @iface_combinations: Valid interface combinations array, should not5434 * @iface_combinations: Valid interface combinations array, should not
5435 * list single interface types.5435 * list single interface types.
5436 * @n_iface_combinations: number of entries in @iface_combinations array.5436 * @n_iface_combinations: number of entries in @iface_combinations array.
5437 *
5438 * @antenna_mask: bitmask of antennas connected to this radio.
5437 */5439 */
5438struct wiphy_radio {5440struct wiphy_radio {
5439 const struct wiphy_radio_freq_range *freq_range;5441 const struct wiphy_radio_freq_range *freq_range;
@@ -5441,6 +5443,8 @@ struct wiphy_radio { · 1 unmodified line
5441 5443
5442 const struct ieee80211_iface_combination *iface_combinations;5444 const struct ieee80211_iface_combination *iface_combinations;
5443 int n_iface_combinations;5445 int n_iface_combinations;
5446
5447 u32 antenna_mask;
5444};5448};
5445 5449
5446#define CFG80211_HW_TIMESTAMP_ALL_PEERS 0xffff5450#define CFG80211_HW_TIMESTAMP_ALL_PEERS 0xffff
include/uapi/linux/nl80211.h+3−0
@@ -8036,6 +8036,8 @@ enum nl80211_ap_settings_flags { · 8035 unmodified lines
8036 * @NL80211_WIPHY_RADIO_ATTR_INTERFACE_COMBINATION: Supported interface8036 * @NL80211_WIPHY_RADIO_ATTR_INTERFACE_COMBINATION: Supported interface
8037 * combination for this radio. Attribute may be present multiple times8037 * combination for this radio. Attribute may be present multiple times
8038 * and contains attributes defined in &enum nl80211_if_combination_attrs.8038 * and contains attributes defined in &enum nl80211_if_combination_attrs.
8039 * @NL80211_WIPHY_RADIO_ATTR_ANTENNA_MASK: bitmask (u32) of antennas
8040 * connected to this radio.
8039 *8041 *
8040 * @__NL80211_WIPHY_RADIO_ATTR_LAST: Internal8042 * @__NL80211_WIPHY_RADIO_ATTR_LAST: Internal
8041 * @NL80211_WIPHY_RADIO_ATTR_MAX: Highest attribute8043 * @NL80211_WIPHY_RADIO_ATTR_MAX: Highest attribute
@@ -8046,6 +8048,7 @@ enum nl80211_wiphy_radio_attrs { · 4 unmodified lines
8046 NL80211_WIPHY_RADIO_ATTR_INDEX,8048 NL80211_WIPHY_RADIO_ATTR_INDEX,
8047 NL80211_WIPHY_RADIO_ATTR_FREQ_RANGE,8049 NL80211_WIPHY_RADIO_ATTR_FREQ_RANGE,
8048 NL80211_WIPHY_RADIO_ATTR_INTERFACE_COMBINATION,8050 NL80211_WIPHY_RADIO_ATTR_INTERFACE_COMBINATION,
8051 NL80211_WIPHY_RADIO_ATTR_ANTENNA_MASK,
8049 8052
8050 /* keep last */8053 /* keep last */
8051 __NL80211_WIPHY_RADIO_ATTR_LAST,8054 __NL80211_WIPHY_RADIO_ATTR_LAST,
net/wireless/nl80211.c+5−0
@@ -2431,6 +2431,11 @@ static int nl80211_put_radio(struct wiphy *wiphy, struct sk_buff *msg, int idx) · 2430 unmodified lines
2431 if (nla_put_u32(msg, NL80211_WIPHY_RADIO_ATTR_INDEX, idx))2431 if (nla_put_u32(msg, NL80211_WIPHY_RADIO_ATTR_INDEX, idx))
2432 goto nla_put_failure;2432 goto nla_put_failure;
2433 2433
2434 if (r->antenna_mask &&
2435 nla_put_u32(msg, NL80211_WIPHY_RADIO_ATTR_ANTENNA_MASK,
2436 r->antenna_mask))
2437 goto nla_put_failure;
2438
2434 for (i = 0; i < r->n_freq_range; i++) {2439 for (i = 0; i < r->n_freq_range; i++) {
2435 const struct wiphy_radio_freq_range *range = &r->freq_range[i];2440 const struct wiphy_radio_freq_range *range = &r->freq_range[i];
2436 2441