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.
Unified · Split
| @@ -5434,6 +5434,8 @@ struct wiphy_radio_freq_range { · 5433 unmodified lines | |||
| 5434 | * @iface_combinations: Valid interface combinations array, should not | 5434 | * @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 | */ |
| 5438 | struct wiphy_radio { | 5440 | struct 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 0xffff | 5450 | #define CFG80211_HW_TIMESTAMP_ALL_PEERS 0xffff |
| @@ -8036,6 +8036,8 @@ enum nl80211_ap_settings_flags { · 8035 unmodified lines | |||
| 8036 | * @NL80211_WIPHY_RADIO_ATTR_INTERFACE_COMBINATION: Supported interface | 8036 | * @NL80211_WIPHY_RADIO_ATTR_INTERFACE_COMBINATION: Supported interface |
| 8037 | * combination for this radio. Attribute may be present multiple times | 8037 | * 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: Internal | 8042 | * @__NL80211_WIPHY_RADIO_ATTR_LAST: Internal |
| 8041 | * @NL80211_WIPHY_RADIO_ATTR_MAX: Highest attribute | 8043 | * @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, |
| @@ -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 | ||