diff options
author | Felix Fietkau <nbd@openwrt.org> | 2013-04-22 17:11:43 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2013-04-23 14:14:52 -0400 |
commit | bdc21457ac2bb75b59e774303edbb623830284ae (patch) | |
tree | 7bf91f7949cfdb86663082089ab21ec9413f9e50 /drivers/net/wireless/ath | |
parent | 7c8f0db0d024efda38976fc2acf7743f458e1d96 (diff) |
ath9k: merge ath_tx_start_dma into ath_tx_start
The split makes no sense and merging the functions makes further changes
easier to implement
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath')
-rw-r--r-- | drivers/net/wireless/ath/ath9k/xmit.c | 80 |
1 files changed, 36 insertions, 44 deletions
diff --git a/drivers/net/wireless/ath/ath9k/xmit.c b/drivers/net/wireless/ath/ath9k/xmit.c index 5bc580276493..108fe5fc1eaa 100644 --- a/drivers/net/wireless/ath/ath9k/xmit.c +++ b/drivers/net/wireless/ath/ath9k/xmit.c | |||
@@ -1892,49 +1892,6 @@ static struct ath_buf *ath_tx_setup_buffer(struct ath_softc *sc, | |||
1892 | return bf; | 1892 | return bf; |
1893 | } | 1893 | } |
1894 | 1894 | ||
1895 | /* FIXME: tx power */ | ||
1896 | static void ath_tx_start_dma(struct ath_softc *sc, struct sk_buff *skb, | ||
1897 | struct ath_tx_control *txctl) | ||
1898 | { | ||
1899 | struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(skb); | ||
1900 | struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data; | ||
1901 | struct ath_atx_tid *tid = NULL; | ||
1902 | struct ath_buf *bf; | ||
1903 | u8 tidno; | ||
1904 | |||
1905 | if (txctl->an && ieee80211_is_data_qos(hdr->frame_control)) { | ||
1906 | tidno = ieee80211_get_qos_ctl(hdr)[0] & | ||
1907 | IEEE80211_QOS_CTL_TID_MASK; | ||
1908 | tid = ATH_AN_2_TID(txctl->an, tidno); | ||
1909 | |||
1910 | WARN_ON(tid->ac->txq != txctl->txq); | ||
1911 | } | ||
1912 | |||
1913 | if ((tx_info->flags & IEEE80211_TX_CTL_AMPDU) && tid) { | ||
1914 | /* | ||
1915 | * Try aggregation if it's a unicast data frame | ||
1916 | * and the destination is HT capable. | ||
1917 | */ | ||
1918 | ath_tx_send_ampdu(sc, tid, skb, txctl); | ||
1919 | } else { | ||
1920 | bf = ath_tx_setup_buffer(sc, txctl->txq, tid, skb); | ||
1921 | if (!bf) { | ||
1922 | if (txctl->paprd) | ||
1923 | dev_kfree_skb_any(skb); | ||
1924 | else | ||
1925 | ieee80211_free_txskb(sc->hw, skb); | ||
1926 | return; | ||
1927 | } | ||
1928 | |||
1929 | bf->bf_state.bfs_paprd = txctl->paprd; | ||
1930 | |||
1931 | if (txctl->paprd) | ||
1932 | bf->bf_state.bfs_paprd_timestamp = jiffies; | ||
1933 | |||
1934 | ath_tx_send_normal(sc, txctl->txq, tid, skb); | ||
1935 | } | ||
1936 | } | ||
1937 | |||
1938 | /* Upon failure caller should free skb */ | 1895 | /* Upon failure caller should free skb */ |
1939 | int ath_tx_start(struct ieee80211_hw *hw, struct sk_buff *skb, | 1896 | int ath_tx_start(struct ieee80211_hw *hw, struct sk_buff *skb, |
1940 | struct ath_tx_control *txctl) | 1897 | struct ath_tx_control *txctl) |
@@ -1945,8 +1902,11 @@ int ath_tx_start(struct ieee80211_hw *hw, struct sk_buff *skb, | |||
1945 | struct ieee80211_vif *vif = info->control.vif; | 1902 | struct ieee80211_vif *vif = info->control.vif; |
1946 | struct ath_softc *sc = hw->priv; | 1903 | struct ath_softc *sc = hw->priv; |
1947 | struct ath_txq *txq = txctl->txq; | 1904 | struct ath_txq *txq = txctl->txq; |
1905 | struct ath_atx_tid *tid = NULL; | ||
1906 | struct ath_buf *bf; | ||
1948 | int padpos, padsize; | 1907 | int padpos, padsize; |
1949 | int frmlen = skb->len + FCS_LEN; | 1908 | int frmlen = skb->len + FCS_LEN; |
1909 | u8 tidno; | ||
1950 | int q; | 1910 | int q; |
1951 | 1911 | ||
1952 | /* NOTE: sta can be NULL according to net/mac80211.h */ | 1912 | /* NOTE: sta can be NULL according to net/mac80211.h */ |
@@ -2002,8 +1962,40 @@ int ath_tx_start(struct ieee80211_hw *hw, struct sk_buff *skb, | |||
2002 | txq->stopped = true; | 1962 | txq->stopped = true; |
2003 | } | 1963 | } |
2004 | 1964 | ||
2005 | ath_tx_start_dma(sc, skb, txctl); | 1965 | if (txctl->an && ieee80211_is_data_qos(hdr->frame_control)) { |
1966 | tidno = ieee80211_get_qos_ctl(hdr)[0] & | ||
1967 | IEEE80211_QOS_CTL_TID_MASK; | ||
1968 | tid = ATH_AN_2_TID(txctl->an, tidno); | ||
1969 | |||
1970 | WARN_ON(tid->ac->txq != txctl->txq); | ||
1971 | } | ||
1972 | |||
1973 | if ((info->flags & IEEE80211_TX_CTL_AMPDU) && tid) { | ||
1974 | /* | ||
1975 | * Try aggregation if it's a unicast data frame | ||
1976 | * and the destination is HT capable. | ||
1977 | */ | ||
1978 | ath_tx_send_ampdu(sc, tid, skb, txctl); | ||
1979 | goto out; | ||
1980 | } | ||
1981 | |||
1982 | bf = ath_tx_setup_buffer(sc, txctl->txq, tid, skb); | ||
1983 | if (!bf) { | ||
1984 | if (txctl->paprd) | ||
1985 | dev_kfree_skb_any(skb); | ||
1986 | else | ||
1987 | ieee80211_free_txskb(sc->hw, skb); | ||
1988 | goto out; | ||
1989 | } | ||
1990 | |||
1991 | bf->bf_state.bfs_paprd = txctl->paprd; | ||
1992 | |||
1993 | if (txctl->paprd) | ||
1994 | bf->bf_state.bfs_paprd_timestamp = jiffies; | ||
1995 | |||
1996 | ath_tx_send_normal(sc, txctl->txq, tid, skb); | ||
2006 | 1997 | ||
1998 | out: | ||
2007 | ath_txq_unlock(sc, txq); | 1999 | ath_txq_unlock(sc, txq); |
2008 | 2000 | ||
2009 | return 0; | 2001 | return 0; |