History

wifi: cfg80211/mac80211: Add support to get radio index

Currently, per-radio attributes are set on per-phy basis, i.e., all the radios present in a wiphy will take attributes values sent from user. But each radio in a wiphy can get different values from userspace based on its requirement. To extend support to set per-radio attributes, add support to get radio index from userspace. Add an NL attribute - NL80211_ATTR_WIPHY_RADIO_INDEX, to get user specified radio index for which attributes should be changed. Pass this to individual drivers, so that the drivers can use this radio index to change per-radio attributes when necessary. Currently, per-radio attributes identified are: NL80211_ATTR_WIPHY_TX_POWER_LEVEL NL80211_ATTR_WIPHY_ANTENNA_TX NL80211_ATTR_WIPHY_ANTENNA_RX NL80211_ATTR_WIPHY_RETRY_SHORT NL80211_ATTR_WIPHY_RETRY_LONG NL80211_ATTR_WIPHY_FRAG_THRESHOLD NL80211_ATTR_WIPHY_RTS_THRESHOLD NL80211_ATTR_WIPHY_COVERAGE_CLASS NL80211_ATTR_TXQ_LIMIT NL80211_ATTR_TXQ_MEMORY_LIMIT NL80211_ATTR_TXQ_QUANTUM By default, the radio index is set to -1. This means the attribute should be treated as a global configuration. If the user has not specified any index, then the radio index passed to individual drivers would be -1. This would indicate that the attribute applies to all radios in that wiphy.

Roopni Devanathan committed 1 year ago

Commit b74947b1 parent 4cb1ce793 files · +520 −291Browse files

Showing the changes to include/uapi (1 of 93 files). Show all

Unified · Split

include/uapi/linux/nl80211.h+10−0
@@ -2907,6 +2907,14 @@ enum nl80211_commands { · 2906 unmodified lines
29072907 * APs Support". Drivers may set additional flags that they support
29082908 * in the kernel or device.
29092909 *
2910+ * @NL80211_ATTR_WIPHY_RADIO_INDEX: (int) Integer attribute denoting the index
2911+ * of the radio in interest. Internally a value of -1 is used to
2912+ * indicate that the radio id is not given in user-space. This means
2913+ * that all the attributes are applicable to all the radios. If there is
2914+ * a radio index provided in user-space, the attributes will be
2915+ * applicable to that specific radio only. If the radio id is greater
2916+ * thank the number of radios, error denoting invalid value is returned.
2917+ *
29102918 * @NUM_NL80211_ATTR: total number of nl80211_attrs available
29112919 * @NL80211_ATTR_MAX: highest attribute number currently defined
29122920 * @__NL80211_ATTR_AFTER_LAST: internal use
@@ -3464,6 +3472,8 @@ enum nl80211_attrs { · 551 unmodified lines
34643472
34653473 NL80211_ATTR_ASSOC_MLD_EXT_CAPA_OPS,
34663474
3475+ NL80211_ATTR_WIPHY_RADIO_INDEX,
3476+
34673477 /* add attributes here, update the policy in nl80211.c */
34683478
34693479 __NL80211_ATTR_AFTER_LAST,