|
|
@@ -1471,8 +1471,8 @@ static struct iwl_mvm_phy_ctxt *iwl_mvm_get_free_phy_ctxt(struct iwl_mvm *mvm)
|
|
|
return NULL;
|
|
|
}
|
|
|
|
|
|
-static int iwl_mvm_set_tx_power(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
|
|
|
- s8 tx_power)
|
|
|
+static int iwl_mvm_set_tx_power_old(struct iwl_mvm *mvm,
|
|
|
+ struct ieee80211_vif *vif, s8 tx_power)
|
|
|
{
|
|
|
/* FW is in charge of regulatory enforcement */
|
|
|
struct iwl_reduce_tx_power_cmd reduce_txpwr_cmd = {
|
|
|
@@ -1485,6 +1485,26 @@ static int iwl_mvm_set_tx_power(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
|
|
|
&reduce_txpwr_cmd);
|
|
|
}
|
|
|
|
|
|
+static int iwl_mvm_set_tx_power(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
|
|
|
+ s16 tx_power)
|
|
|
+{
|
|
|
+ struct iwl_dev_tx_power_cmd cmd = {
|
|
|
+ .set_mode = 0,
|
|
|
+ .mac_context_id =
|
|
|
+ cpu_to_le32(iwl_mvm_vif_from_mac80211(vif)->id),
|
|
|
+ .pwr_restriction = cpu_to_le16(8 * tx_power),
|
|
|
+ };
|
|
|
+
|
|
|
+ if (!(mvm->fw->ucode_capa.api[0] & IWL_UCODE_TLV_API_TX_POWER_DEV))
|
|
|
+ return iwl_mvm_set_tx_power_old(mvm, vif, tx_power);
|
|
|
+
|
|
|
+ if (tx_power == IWL_DEFAULT_MAX_TX_POWER)
|
|
|
+ cmd.pwr_restriction = cpu_to_le16(IWL_DEV_MAX_TX_POWER);
|
|
|
+
|
|
|
+ return iwl_mvm_send_cmd_pdu(mvm, REDUCE_TX_POWER_CMD, 0,
|
|
|
+ sizeof(cmd), &cmd);
|
|
|
+}
|
|
|
+
|
|
|
static int iwl_mvm_mac_add_interface(struct ieee80211_hw *hw,
|
|
|
struct ieee80211_vif *vif)
|
|
|
{
|