|
@@ -410,6 +410,34 @@ static int rsi_channel_change(struct ieee80211_hw *hw)
|
|
return status;
|
|
return status;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+/**
|
|
|
|
+ * rsi_config_power() - This function configures tx power to device
|
|
|
|
+ * @hw: Pointer to the ieee80211_hw structure.
|
|
|
|
+ *
|
|
|
|
+ * Return: 0 on success, negative error code on failure.
|
|
|
|
+ */
|
|
|
|
+static int rsi_config_power(struct ieee80211_hw *hw)
|
|
|
|
+{
|
|
|
|
+ struct rsi_hw *adapter = hw->priv;
|
|
|
|
+ struct rsi_common *common = adapter->priv;
|
|
|
|
+ struct ieee80211_conf *conf = &hw->conf;
|
|
|
|
+
|
|
|
|
+ if (adapter->sc_nvifs <= 0) {
|
|
|
|
+ rsi_dbg(ERR_ZONE, "%s: No virtual interface found\n", __func__);
|
|
|
|
+ return -EINVAL;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ rsi_dbg(INFO_ZONE,
|
|
|
|
+ "%s: Set tx power: %d dBM\n", __func__, conf->power_level);
|
|
|
|
+
|
|
|
|
+ if (conf->power_level == common->tx_power)
|
|
|
|
+ return 0;
|
|
|
|
+
|
|
|
|
+ common->tx_power = conf->power_level;
|
|
|
|
+
|
|
|
|
+ return rsi_send_radio_params_update(common);
|
|
|
|
+}
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* rsi_mac80211_config() - This function is a handler for configuration
|
|
* rsi_mac80211_config() - This function is a handler for configuration
|
|
* requests. The stack calls this function to
|
|
* requests. The stack calls this function to
|
|
@@ -431,6 +459,12 @@ static int rsi_mac80211_config(struct ieee80211_hw *hw,
|
|
if (changed & IEEE80211_CONF_CHANGE_CHANNEL)
|
|
if (changed & IEEE80211_CONF_CHANGE_CHANNEL)
|
|
status = rsi_channel_change(hw);
|
|
status = rsi_channel_change(hw);
|
|
|
|
|
|
|
|
+ /* tx power */
|
|
|
|
+ if (changed & IEEE80211_CONF_CHANGE_POWER) {
|
|
|
|
+ rsi_dbg(INFO_ZONE, "%s: Configuring Power\n", __func__);
|
|
|
|
+ status = rsi_config_power(hw);
|
|
|
|
+ }
|
|
|
|
+
|
|
mutex_unlock(&common->mutex);
|
|
mutex_unlock(&common->mutex);
|
|
|
|
|
|
return status;
|
|
return status;
|