aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2012-10-03 15:07:52 -0400
committerJohn W. Linville <linville@tuxdriver.com>2012-10-05 16:26:17 -0400
commit249ee72249140fe5b9adc988f97298f0aa5db2fc (patch)
tree1a41de8e6a279ee930511874b4ed6ed06271043b /drivers/net
parentceb26a6013b962b82f644189ea29d802490fc8fc (diff)
ath9k: use ieee80211_free_txskb
Using ieee80211_free_txskb for tx frames is required, since mac80211 clones skbs for which socket tx status is requested. Signed-off-by: Felix Fietkau <nbd@openwrt.org> Cc: stable@vger.kernel.org Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/wireless/ath/ath9k/beacon.c2
-rw-r--r--drivers/net/wireless/ath/ath9k/main.c2
-rw-r--r--drivers/net/wireless/ath/ath9k/xmit.c53
3 files changed, 31 insertions, 26 deletions
diff --git a/drivers/net/wireless/ath/ath9k/beacon.c b/drivers/net/wireless/ath/ath9k/beacon.c
index 76f07d8c272d..1b48414dca95 100644
--- a/drivers/net/wireless/ath/ath9k/beacon.c
+++ b/drivers/net/wireless/ath/ath9k/beacon.c
@@ -120,7 +120,7 @@ static void ath9k_tx_cabq(struct ieee80211_hw *hw, struct sk_buff *skb)
120 120
121 if (ath_tx_start(hw, skb, &txctl) != 0) { 121 if (ath_tx_start(hw, skb, &txctl) != 0) {
122 ath_dbg(common, XMIT, "CABQ TX failed\n"); 122 ath_dbg(common, XMIT, "CABQ TX failed\n");
123 dev_kfree_skb_any(skb); 123 ieee80211_free_txskb(hw, skb);
124 } 124 }
125} 125}
126 126
diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c
index e2fe713235dc..dd45edfa6bae 100644
--- a/drivers/net/wireless/ath/ath9k/main.c
+++ b/drivers/net/wireless/ath/ath9k/main.c
@@ -765,7 +765,7 @@ static void ath9k_tx(struct ieee80211_hw *hw,
765 765
766 return; 766 return;
767exit: 767exit:
768 dev_kfree_skb_any(skb); 768 ieee80211_free_txskb(hw, skb);
769} 769}
770 770
771static void ath9k_stop(struct ieee80211_hw *hw) 771static void ath9k_stop(struct ieee80211_hw *hw)
diff --git a/drivers/net/wireless/ath/ath9k/xmit.c b/drivers/net/wireless/ath/ath9k/xmit.c
index 36618e3a5e60..378bd70256b2 100644
--- a/drivers/net/wireless/ath/ath9k/xmit.c
+++ b/drivers/net/wireless/ath/ath9k/xmit.c
@@ -66,8 +66,7 @@ static void ath_tx_update_baw(struct ath_softc *sc, struct ath_atx_tid *tid,
66static struct ath_buf *ath_tx_setup_buffer(struct ath_softc *sc, 66static struct ath_buf *ath_tx_setup_buffer(struct ath_softc *sc,
67 struct ath_txq *txq, 67 struct ath_txq *txq,
68 struct ath_atx_tid *tid, 68 struct ath_atx_tid *tid,
69 struct sk_buff *skb, 69 struct sk_buff *skb);
70 bool dequeue);
71 70
72enum { 71enum {
73 MCS_HT20, 72 MCS_HT20,
@@ -176,7 +175,15 @@ static void ath_tx_flush_tid(struct ath_softc *sc, struct ath_atx_tid *tid)
176 fi = get_frame_info(skb); 175 fi = get_frame_info(skb);
177 bf = fi->bf; 176 bf = fi->bf;
178 177
179 if (bf && fi->retries) { 178 if (!bf) {
179 bf = ath_tx_setup_buffer(sc, txq, tid, skb);
180 if (!bf) {
181 ieee80211_free_txskb(sc->hw, skb);
182 continue;
183 }
184 }
185
186 if (fi->retries) {
180 list_add_tail(&bf->list, &bf_head); 187 list_add_tail(&bf->list, &bf_head);
181 ath_tx_update_baw(sc, tid, bf->bf_state.seqno); 188 ath_tx_update_baw(sc, tid, bf->bf_state.seqno);
182 ath_tx_complete_buf(sc, bf, txq, &bf_head, &ts, 0); 189 ath_tx_complete_buf(sc, bf, txq, &bf_head, &ts, 0);
@@ -785,10 +792,13 @@ static enum ATH_AGGR_STATUS ath_tx_form_aggr(struct ath_softc *sc,
785 fi = get_frame_info(skb); 792 fi = get_frame_info(skb);
786 bf = fi->bf; 793 bf = fi->bf;
787 if (!fi->bf) 794 if (!fi->bf)
788 bf = ath_tx_setup_buffer(sc, txq, tid, skb, true); 795 bf = ath_tx_setup_buffer(sc, txq, tid, skb);
789 796
790 if (!bf) 797 if (!bf) {
798 __skb_unlink(skb, &tid->buf_q);
799 ieee80211_free_txskb(sc->hw, skb);
791 continue; 800 continue;
801 }
792 802
793 bf->bf_state.bf_type = BUF_AMPDU | BUF_AGGR; 803 bf->bf_state.bf_type = BUF_AMPDU | BUF_AGGR;
794 seqno = bf->bf_state.seqno; 804 seqno = bf->bf_state.seqno;
@@ -1731,9 +1741,11 @@ static void ath_tx_send_ampdu(struct ath_softc *sc, struct ath_atx_tid *tid,
1731 return; 1741 return;
1732 } 1742 }
1733 1743
1734 bf = ath_tx_setup_buffer(sc, txctl->txq, tid, skb, false); 1744 bf = ath_tx_setup_buffer(sc, txctl->txq, tid, skb);
1735 if (!bf) 1745 if (!bf) {
1746 ieee80211_free_txskb(sc->hw, skb);
1736 return; 1747 return;
1748 }
1737 1749
1738 bf->bf_state.bf_type = BUF_AMPDU; 1750 bf->bf_state.bf_type = BUF_AMPDU;
1739 INIT_LIST_HEAD(&bf_head); 1751 INIT_LIST_HEAD(&bf_head);
@@ -1757,11 +1769,6 @@ static void ath_tx_send_normal(struct ath_softc *sc, struct ath_txq *txq,
1757 struct ath_buf *bf; 1769 struct ath_buf *bf;
1758 1770
1759 bf = fi->bf; 1771 bf = fi->bf;
1760 if (!bf)
1761 bf = ath_tx_setup_buffer(sc, txq, tid, skb, false);
1762
1763 if (!bf)
1764 return;
1765 1772
1766 INIT_LIST_HEAD(&bf_head); 1773 INIT_LIST_HEAD(&bf_head);
1767 list_add_tail(&bf->list, &bf_head); 1774 list_add_tail(&bf->list, &bf_head);
@@ -1839,8 +1846,7 @@ u8 ath_txchainmask_reduction(struct ath_softc *sc, u8 chainmask, u32 rate)
1839static struct ath_buf *ath_tx_setup_buffer(struct ath_softc *sc, 1846static struct ath_buf *ath_tx_setup_buffer(struct ath_softc *sc,
1840 struct ath_txq *txq, 1847 struct ath_txq *txq,
1841 struct ath_atx_tid *tid, 1848 struct ath_atx_tid *tid,
1842 struct sk_buff *skb, 1849 struct sk_buff *skb)
1843 bool dequeue)
1844{ 1850{
1845 struct ath_common *common = ath9k_hw_common(sc->sc_ah); 1851 struct ath_common *common = ath9k_hw_common(sc->sc_ah);
1846 struct ath_frame_info *fi = get_frame_info(skb); 1852 struct ath_frame_info *fi = get_frame_info(skb);
@@ -1852,7 +1858,7 @@ static struct ath_buf *ath_tx_setup_buffer(struct ath_softc *sc,
1852 bf = ath_tx_get_buffer(sc); 1858 bf = ath_tx_get_buffer(sc);
1853 if (!bf) { 1859 if (!bf) {
1854 ath_dbg(common, XMIT, "TX buffers are full\n"); 1860 ath_dbg(common, XMIT, "TX buffers are full\n");
1855 goto error; 1861 return NULL;
1856 } 1862 }
1857 1863
1858 ATH_TXBUF_RESET(bf); 1864 ATH_TXBUF_RESET(bf);
@@ -1881,18 +1887,12 @@ static struct ath_buf *ath_tx_setup_buffer(struct ath_softc *sc,
1881 ath_err(ath9k_hw_common(sc->sc_ah), 1887 ath_err(ath9k_hw_common(sc->sc_ah),
1882 "dma_mapping_error() on TX\n"); 1888 "dma_mapping_error() on TX\n");
1883 ath_tx_return_buffer(sc, bf); 1889 ath_tx_return_buffer(sc, bf);
1884 goto error; 1890 return NULL;
1885 } 1891 }
1886 1892
1887 fi->bf = bf; 1893 fi->bf = bf;
1888 1894
1889 return bf; 1895 return bf;
1890
1891error:
1892 if (dequeue)
1893 __skb_unlink(skb, &tid->buf_q);
1894 dev_kfree_skb_any(skb);
1895 return NULL;
1896} 1896}
1897 1897
1898/* FIXME: tx power */ 1898/* FIXME: tx power */
@@ -1921,9 +1921,14 @@ static void ath_tx_start_dma(struct ath_softc *sc, struct sk_buff *skb,
1921 */ 1921 */
1922 ath_tx_send_ampdu(sc, tid, skb, txctl); 1922 ath_tx_send_ampdu(sc, tid, skb, txctl);
1923 } else { 1923 } else {
1924 bf = ath_tx_setup_buffer(sc, txctl->txq, tid, skb, false); 1924 bf = ath_tx_setup_buffer(sc, txctl->txq, tid, skb);
1925 if (!bf) 1925 if (!bf) {
1926 if (txctl->paprd)
1927 dev_kfree_skb_any(skb);
1928 else
1929 ieee80211_free_txskb(sc->hw, skb);
1926 return; 1930 return;
1931 }
1927 1932
1928 bf->bf_state.bfs_paprd = txctl->paprd; 1933 bf->bf_state.bfs_paprd = txctl->paprd;
1929 1934