diff options
author | Michal Kazior <michal.kazior@tieto.com> | 2013-10-02 05:03:39 -0400 |
---|---|---|
committer | Kalle Valo <kvalo@qca.qualcomm.com> | 2013-10-07 08:28:02 -0400 |
commit | ddb6ad77b4ecfb832982be69f2169165e6a43f0b (patch) | |
tree | 202d04240669e039beed98276bec8d1581a741ec /drivers/net/wireless/ath/ath10k/mac.c | |
parent | 42c3aa6f6ae7de082b7413321e67e3424cc0c002 (diff) |
ath10k: split vdev_id calculation from tx function
Tidy up ath10k_tx().
Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Diffstat (limited to 'drivers/net/wireless/ath/ath10k/mac.c')
-rw-r--r-- | drivers/net/wireless/ath/ath10k/mac.c | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c index 7415a6045d30..4b7c9494890c 100644 --- a/drivers/net/wireless/ath/ath10k/mac.c +++ b/drivers/net/wireless/ath/ath10k/mac.c | |||
@@ -1421,6 +1421,19 @@ static u8 ath10k_tx_h_get_tid(struct ieee80211_hdr *hdr) | |||
1421 | return ieee80211_get_qos_ctl(hdr)[0] & IEEE80211_QOS_CTL_TID_MASK; | 1421 | return ieee80211_get_qos_ctl(hdr)[0] & IEEE80211_QOS_CTL_TID_MASK; |
1422 | } | 1422 | } |
1423 | 1423 | ||
1424 | static u8 ath10k_tx_h_get_vdev_id(struct ath10k *ar, | ||
1425 | struct ieee80211_tx_info *info) | ||
1426 | { | ||
1427 | if (info->control.vif) | ||
1428 | return ath10k_vif_to_arvif(info->control.vif)->vdev_id; | ||
1429 | |||
1430 | if (ar->monitor_enabled) | ||
1431 | return ar->monitor_vdev_id; | ||
1432 | |||
1433 | ath10k_warn("could not resolve vdev id\n"); | ||
1434 | return 0; | ||
1435 | } | ||
1436 | |||
1424 | /* | 1437 | /* |
1425 | * Frames sent to the FW have to be in "Native Wifi" format. | 1438 | * Frames sent to the FW have to be in "Native Wifi" format. |
1426 | * Strip the QoS field from the 802.11 header. | 1439 | * Strip the QoS field from the 802.11 header. |
@@ -1785,16 +1798,7 @@ static void ath10k_tx(struct ieee80211_hw *hw, | |||
1785 | struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); | 1798 | struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); |
1786 | struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data; | 1799 | struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data; |
1787 | struct ath10k *ar = hw->priv; | 1800 | struct ath10k *ar = hw->priv; |
1788 | struct ath10k_vif *arvif = NULL; | 1801 | u8 tid, vdev_id; |
1789 | u32 vdev_id = 0; | ||
1790 | u8 tid; | ||
1791 | |||
1792 | if (info->control.vif) { | ||
1793 | arvif = ath10k_vif_to_arvif(info->control.vif); | ||
1794 | vdev_id = arvif->vdev_id; | ||
1795 | } else if (ar->monitor_enabled) { | ||
1796 | vdev_id = ar->monitor_vdev_id; | ||
1797 | } | ||
1798 | 1802 | ||
1799 | /* We should disable CCK RATE due to P2P */ | 1803 | /* We should disable CCK RATE due to P2P */ |
1800 | if (info->flags & IEEE80211_TX_CTL_NO_CCK_RATE) | 1804 | if (info->flags & IEEE80211_TX_CTL_NO_CCK_RATE) |
@@ -1803,6 +1807,7 @@ static void ath10k_tx(struct ieee80211_hw *hw, | |||
1803 | /* we must calculate tid before we apply qos workaround | 1807 | /* we must calculate tid before we apply qos workaround |
1804 | * as we'd lose the qos control field */ | 1808 | * as we'd lose the qos control field */ |
1805 | tid = ath10k_tx_h_get_tid(hdr); | 1809 | tid = ath10k_tx_h_get_tid(hdr); |
1810 | vdev_id = ath10k_tx_h_get_vdev_id(ar, info); | ||
1806 | 1811 | ||
1807 | /* it makes no sense to process injected frames like that */ | 1812 | /* it makes no sense to process injected frames like that */ |
1808 | if (info->control.vif && | 1813 | if (info->control.vif && |