Commit b74947b4 authored by Roopni Devanathan's avatar Roopni Devanathan Committed by Johannes Berg
Browse files

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.

Signed-off-by: default avatarRoopni Devanathan <quic_rdevanat@quicinc.com>
Link: https://patch.msgid.link/20250615082312.619639-2-quic_rdevanat@quicinc.com


Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent 4cb1ce7e
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1293,7 +1293,7 @@ static void adm8211_set_bssid(struct ieee80211_hw *dev, const u8 *bssid)
	ADM8211_CSR_WRITE(ABDA1, reg);
}

static int adm8211_config(struct ieee80211_hw *dev, u32 changed)
static int adm8211_config(struct ieee80211_hw *dev, int radio_idx, u32 changed)
{
	struct adm8211_priv *priv = dev->priv;
	struct ieee80211_conf *conf = &dev->conf;
+3 −2
Original line number Diff line number Diff line
@@ -1083,7 +1083,8 @@ static void ar5523_stop(struct ieee80211_hw *hw, bool suspend)
	mutex_unlock(&ar->mutex);
}

static int ar5523_set_rts_threshold(struct ieee80211_hw *hw, u32 value)
static int ar5523_set_rts_threshold(struct ieee80211_hw *hw, int radio_idx,
				    u32 value)
{
	struct ar5523 *ar = hw->priv;
	int ret;
@@ -1137,7 +1138,7 @@ static void ar5523_remove_interface(struct ieee80211_hw *hw,
	ar->vif = NULL;
}

static int ar5523_hwconfig(struct ieee80211_hw *hw, u32 changed)
static int ar5523_hwconfig(struct ieee80211_hw *hw, int radio_idx, u32 changed)
{
	struct ar5523 *ar = hw->priv;

+1 −1
Original line number Diff line number Diff line
@@ -2606,7 +2606,7 @@ static void ath10k_core_set_coverage_class_work(struct work_struct *work)
					 set_coverage_class_work);

	if (ar->hw_params.hw_ops->set_coverage_class)
		ar->hw_params.hw_ops->set_coverage_class(ar, -1);
		ar->hw_params.hw_ops->set_coverage_class(ar, -1, -1);
}

static int ath10k_core_init_firmware_features(struct ath10k *ar)
+1 −0
Original line number Diff line number Diff line
@@ -590,6 +590,7 @@ void ath10k_hw_fill_survey_time(struct ath10k *ar, struct survey_info *survey,
 * function monitors and modifies the corresponding MAC registers.
 */
static void ath10k_hw_qca988x_set_coverage_class(struct ath10k *ar,
						 int radio_idx,
						 s16 value)
{
	u32 slottime_reg;
+1 −1
Original line number Diff line number Diff line
@@ -646,7 +646,7 @@ struct htt_rx_ring_rx_desc_offsets;

/* Defines needed for Rx descriptor abstraction */
struct ath10k_hw_ops {
	void (*set_coverage_class)(struct ath10k *ar, s16 value);
	void (*set_coverage_class)(struct ath10k *ar, int radio_idx, s16 value);
	int (*enable_pll_clk)(struct ath10k *ar);
	int (*tx_data_rssi_pad_bytes)(struct htt_resp *htt);
	int (*is_rssi_enable)(struct htt_resp *resp);
Loading