提交 a30c7d00 编写于 作者: M Michal Kazior 提交者: Kalle Valo

ath10k: unify txpath decision

Some future changes will need to determine final
tx method early on. Prepare the code.
Signed-off-by: NMichal Kazior <michal.kazior@tieto.com>
Signed-off-by: NKalle Valo <kvalo@qca.qualcomm.com>
上级 f2f6ecab
......@@ -2994,6 +2994,13 @@ static void ath10k_reg_notifier(struct wiphy *wiphy,
/* TX handlers */
/***************/
enum ath10k_mac_tx_path {
ATH10K_MAC_TX_HTT,
ATH10K_MAC_TX_HTT_MGMT,
ATH10K_MAC_TX_WMI_MGMT,
ATH10K_MAC_TX_UNKNOWN,
};
void ath10k_mac_tx_lock(struct ath10k *ar, int reason)
{
lockdep_assert_held(&ar->htt.tx_lock);
......@@ -3326,27 +3333,52 @@ static int ath10k_mac_tx_wmi_mgmt(struct ath10k *ar, struct sk_buff *skb)
return ret;
}
static int ath10k_mac_tx_submit(struct ath10k *ar,
enum ath10k_hw_txrx_mode txmode,
struct sk_buff *skb)
static enum ath10k_mac_tx_path
ath10k_mac_tx_h_get_txpath(struct ath10k *ar,
struct sk_buff *skb,
enum ath10k_hw_txrx_mode txmode)
{
struct ath10k_htt *htt = &ar->htt;
int ret = 0;
switch (txmode) {
case ATH10K_HW_TXRX_RAW:
case ATH10K_HW_TXRX_NATIVE_WIFI:
case ATH10K_HW_TXRX_ETHERNET:
ret = ath10k_htt_tx(htt, txmode, skb);
break;
return ATH10K_MAC_TX_HTT;
case ATH10K_HW_TXRX_MGMT:
if (test_bit(ATH10K_FW_FEATURE_HAS_WMI_MGMT_TX,
ar->fw_features))
ret = ath10k_mac_tx_wmi_mgmt(ar, skb);
return ATH10K_MAC_TX_WMI_MGMT;
else if (ar->htt.target_version_major >= 3)
ret = ath10k_htt_tx(htt, txmode, skb);
return ATH10K_MAC_TX_HTT;
else
ret = ath10k_htt_mgmt_tx(htt, skb);
return ATH10K_MAC_TX_HTT_MGMT;
}
return ATH10K_MAC_TX_UNKNOWN;
}
static int ath10k_mac_tx_submit(struct ath10k *ar,
enum ath10k_hw_txrx_mode txmode,
struct sk_buff *skb)
{
struct ath10k_htt *htt = &ar->htt;
enum ath10k_mac_tx_path txpath;
int ret;
txpath = ath10k_mac_tx_h_get_txpath(ar, skb, txmode);
switch (txpath) {
case ATH10K_MAC_TX_HTT:
ret = ath10k_htt_tx(htt, txmode, skb);
break;
case ATH10K_MAC_TX_HTT_MGMT:
ret = ath10k_htt_mgmt_tx(htt, skb);
break;
case ATH10K_MAC_TX_WMI_MGMT:
ret = ath10k_mac_tx_wmi_mgmt(ar, skb);
break;
case ATH10K_MAC_TX_UNKNOWN:
WARN_ON_ONCE(1);
ret = -EINVAL;
break;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册