diff options
Diffstat (limited to 'drivers/net/wireless/iwlwifi/mvm/mac80211.c')
-rw-r--r-- | drivers/net/wireless/iwlwifi/mvm/mac80211.c | 26 |
1 files changed, 23 insertions, 3 deletions
diff --git a/drivers/net/wireless/iwlwifi/mvm/mac80211.c b/drivers/net/wireless/iwlwifi/mvm/mac80211.c index 84555170b6f7..40265b9c66ae 100644 --- a/drivers/net/wireless/iwlwifi/mvm/mac80211.c +++ b/drivers/net/wireless/iwlwifi/mvm/mac80211.c | |||
@@ -1322,7 +1322,7 @@ static void iwl_mvm_restart_complete(struct iwl_mvm *mvm) | |||
1322 | 1322 | ||
1323 | clear_bit(IWL_MVM_STATUS_IN_HW_RESTART, &mvm->status); | 1323 | clear_bit(IWL_MVM_STATUS_IN_HW_RESTART, &mvm->status); |
1324 | iwl_mvm_d0i3_enable_tx(mvm, NULL); | 1324 | iwl_mvm_d0i3_enable_tx(mvm, NULL); |
1325 | ret = iwl_mvm_update_quotas(mvm, false, NULL); | 1325 | ret = iwl_mvm_update_quotas(mvm, true, NULL); |
1326 | if (ret) | 1326 | if (ret) |
1327 | IWL_ERR(mvm, "Failed to update quotas after restart (%d)\n", | 1327 | IWL_ERR(mvm, "Failed to update quotas after restart (%d)\n", |
1328 | ret); | 1328 | ret); |
@@ -1471,8 +1471,8 @@ static struct iwl_mvm_phy_ctxt *iwl_mvm_get_free_phy_ctxt(struct iwl_mvm *mvm) | |||
1471 | return NULL; | 1471 | return NULL; |
1472 | } | 1472 | } |
1473 | 1473 | ||
1474 | static int iwl_mvm_set_tx_power(struct iwl_mvm *mvm, struct ieee80211_vif *vif, | 1474 | static int iwl_mvm_set_tx_power_old(struct iwl_mvm *mvm, |
1475 | s8 tx_power) | 1475 | struct ieee80211_vif *vif, s8 tx_power) |
1476 | { | 1476 | { |
1477 | /* FW is in charge of regulatory enforcement */ | 1477 | /* FW is in charge of regulatory enforcement */ |
1478 | struct iwl_reduce_tx_power_cmd reduce_txpwr_cmd = { | 1478 | 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, | |||
1485 | &reduce_txpwr_cmd); | 1485 | &reduce_txpwr_cmd); |
1486 | } | 1486 | } |
1487 | 1487 | ||
1488 | static int iwl_mvm_set_tx_power(struct iwl_mvm *mvm, struct ieee80211_vif *vif, | ||
1489 | s16 tx_power) | ||
1490 | { | ||
1491 | struct iwl_dev_tx_power_cmd cmd = { | ||
1492 | .set_mode = 0, | ||
1493 | .mac_context_id = | ||
1494 | cpu_to_le32(iwl_mvm_vif_from_mac80211(vif)->id), | ||
1495 | .pwr_restriction = cpu_to_le16(8 * tx_power), | ||
1496 | }; | ||
1497 | |||
1498 | if (!(mvm->fw->ucode_capa.api[0] & IWL_UCODE_TLV_API_TX_POWER_DEV)) | ||
1499 | return iwl_mvm_set_tx_power_old(mvm, vif, tx_power); | ||
1500 | |||
1501 | if (tx_power == IWL_DEFAULT_MAX_TX_POWER) | ||
1502 | cmd.pwr_restriction = cpu_to_le16(IWL_DEV_MAX_TX_POWER); | ||
1503 | |||
1504 | return iwl_mvm_send_cmd_pdu(mvm, REDUCE_TX_POWER_CMD, 0, | ||
1505 | sizeof(cmd), &cmd); | ||
1506 | } | ||
1507 | |||
1488 | static int iwl_mvm_mac_add_interface(struct ieee80211_hw *hw, | 1508 | static int iwl_mvm_mac_add_interface(struct ieee80211_hw *hw, |
1489 | struct ieee80211_vif *vif) | 1509 | struct ieee80211_vif *vif) |
1490 | { | 1510 | { |