iwlwifi: move iwl_enable_{rx,tx}_ampdu to iwl-modparams.h
These inlines just check the module parameters, so they don't need a configuration parameter and can move to a better place. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
This commit is contained in:
parent
da0df827cd
commit
e78da25e19
@ -1,6 +1,7 @@
|
|||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
*
|
*
|
||||||
* Copyright(c) 2003 - 2014 Intel Corporation. All rights reserved.
|
* Copyright(c) 2003 - 2014 Intel Corporation. All rights reserved.
|
||||||
|
* Copyright (C) 2018 Intel Corporation
|
||||||
*
|
*
|
||||||
* Portions of this file are derived from the ipw3945 project, as well
|
* Portions of this file are derived from the ipw3945 project, as well
|
||||||
* as portions of the ieee80211 subsystem header files.
|
* as portions of the ieee80211 subsystem header files.
|
||||||
@ -710,24 +711,6 @@ static int iwlagn_mac_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline bool iwl_enable_rx_ampdu(const struct iwl_cfg *cfg)
|
|
||||||
{
|
|
||||||
if (iwlwifi_mod_params.disable_11n & IWL_DISABLE_HT_RXAGG)
|
|
||||||
return false;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline bool iwl_enable_tx_ampdu(const struct iwl_cfg *cfg)
|
|
||||||
{
|
|
||||||
if (iwlwifi_mod_params.disable_11n & IWL_DISABLE_HT_TXAGG)
|
|
||||||
return false;
|
|
||||||
if (iwlwifi_mod_params.disable_11n & IWL_ENABLE_HT_TXAGG)
|
|
||||||
return true;
|
|
||||||
|
|
||||||
/* disabled by default */
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int iwlagn_mac_ampdu_action(struct ieee80211_hw *hw,
|
static int iwlagn_mac_ampdu_action(struct ieee80211_hw *hw,
|
||||||
struct ieee80211_vif *vif,
|
struct ieee80211_vif *vif,
|
||||||
struct ieee80211_ampdu_params *params)
|
struct ieee80211_ampdu_params *params)
|
||||||
@ -752,7 +735,7 @@ static int iwlagn_mac_ampdu_action(struct ieee80211_hw *hw,
|
|||||||
|
|
||||||
switch (action) {
|
switch (action) {
|
||||||
case IEEE80211_AMPDU_RX_START:
|
case IEEE80211_AMPDU_RX_START:
|
||||||
if (!iwl_enable_rx_ampdu(priv->cfg))
|
if (!iwl_enable_rx_ampdu())
|
||||||
break;
|
break;
|
||||||
IWL_DEBUG_HT(priv, "start Rx\n");
|
IWL_DEBUG_HT(priv, "start Rx\n");
|
||||||
ret = iwl_sta_rx_agg_start(priv, sta, tid, *ssn);
|
ret = iwl_sta_rx_agg_start(priv, sta, tid, *ssn);
|
||||||
@ -764,7 +747,7 @@ static int iwlagn_mac_ampdu_action(struct ieee80211_hw *hw,
|
|||||||
case IEEE80211_AMPDU_TX_START:
|
case IEEE80211_AMPDU_TX_START:
|
||||||
if (!priv->trans->ops->txq_enable)
|
if (!priv->trans->ops->txq_enable)
|
||||||
break;
|
break;
|
||||||
if (!iwl_enable_tx_ampdu(priv->cfg))
|
if (!iwl_enable_tx_ampdu())
|
||||||
break;
|
break;
|
||||||
IWL_DEBUG_HT(priv, "start Tx\n");
|
IWL_DEBUG_HT(priv, "start Tx\n");
|
||||||
ret = iwlagn_tx_agg_start(priv, vif, sta, tid, ssn);
|
ret = iwlagn_tx_agg_start(priv, vif, sta, tid, ssn);
|
||||||
|
@ -152,4 +152,22 @@ struct iwl_mod_params {
|
|||||||
bool enable_ini;
|
bool enable_ini;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static inline bool iwl_enable_rx_ampdu(void)
|
||||||
|
{
|
||||||
|
if (iwlwifi_mod_params.disable_11n & IWL_DISABLE_HT_RXAGG)
|
||||||
|
return false;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline bool iwl_enable_tx_ampdu(void)
|
||||||
|
{
|
||||||
|
if (iwlwifi_mod_params.disable_11n & IWL_DISABLE_HT_TXAGG)
|
||||||
|
return false;
|
||||||
|
if (iwlwifi_mod_params.disable_11n & IWL_ENABLE_HT_TXAGG)
|
||||||
|
return true;
|
||||||
|
|
||||||
|
/* enabled by default */
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
#endif /* #__iwl_modparams_h__ */
|
#endif /* #__iwl_modparams_h__ */
|
||||||
|
@ -943,24 +943,6 @@ static void iwl_mvm_mac_wake_tx_queue(struct ieee80211_hw *hw,
|
|||||||
schedule_work(&mvm->add_stream_wk);
|
schedule_work(&mvm->add_stream_wk);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline bool iwl_enable_rx_ampdu(const struct iwl_cfg *cfg)
|
|
||||||
{
|
|
||||||
if (iwlwifi_mod_params.disable_11n & IWL_DISABLE_HT_RXAGG)
|
|
||||||
return false;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline bool iwl_enable_tx_ampdu(const struct iwl_cfg *cfg)
|
|
||||||
{
|
|
||||||
if (iwlwifi_mod_params.disable_11n & IWL_DISABLE_HT_TXAGG)
|
|
||||||
return false;
|
|
||||||
if (iwlwifi_mod_params.disable_11n & IWL_ENABLE_HT_TXAGG)
|
|
||||||
return true;
|
|
||||||
|
|
||||||
/* enabled by default */
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
#define CHECK_BA_TRIGGER(_mvm, _trig, _tid_bm, _tid, _fmt...) \
|
#define CHECK_BA_TRIGGER(_mvm, _trig, _tid_bm, _tid, _fmt...) \
|
||||||
do { \
|
do { \
|
||||||
if (!(le16_to_cpu(_tid_bm) & BIT(_tid))) \
|
if (!(le16_to_cpu(_tid_bm) & BIT(_tid))) \
|
||||||
@ -1073,7 +1055,7 @@ static int iwl_mvm_mac_ampdu_action(struct ieee80211_hw *hw,
|
|||||||
mvmvif = iwl_mvm_vif_from_mac80211(vif);
|
mvmvif = iwl_mvm_vif_from_mac80211(vif);
|
||||||
cancel_delayed_work(&mvmvif->uapsd_nonagg_detected_wk);
|
cancel_delayed_work(&mvmvif->uapsd_nonagg_detected_wk);
|
||||||
}
|
}
|
||||||
if (!iwl_enable_rx_ampdu(mvm->cfg)) {
|
if (!iwl_enable_rx_ampdu()) {
|
||||||
ret = -EINVAL;
|
ret = -EINVAL;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -1085,7 +1067,7 @@ static int iwl_mvm_mac_ampdu_action(struct ieee80211_hw *hw,
|
|||||||
timeout);
|
timeout);
|
||||||
break;
|
break;
|
||||||
case IEEE80211_AMPDU_TX_START:
|
case IEEE80211_AMPDU_TX_START:
|
||||||
if (!iwl_enable_tx_ampdu(mvm->cfg)) {
|
if (!iwl_enable_tx_ampdu()) {
|
||||||
ret = -EINVAL;
|
ret = -EINVAL;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user