diff options
author | Sujith <Sujith.Manoharan@atheros.com> | 2008-10-29 00:48:14 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-11-10 15:17:31 -0500 |
commit | ccc75c526611e62c4c9adcb4a62bf4a164478d2c (patch) | |
tree | fe7222c8c0281f8c6bd507cbdd98673b66e3855d /drivers/net/wireless | |
parent | 05a1e2d111c98340fb17ec702cf09450eec3a947 (diff) |
ath9k: Remove ath_tx_aggr_resp()
Accessing mac80211's internal state machine is wrong.
Will add resumption of a TID in a later patch.
Signed-off-by: Sujith <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r-- | drivers/net/wireless/ath9k/core.h | 11 | ||||
-rw-r--r-- | drivers/net/wireless/ath9k/rc.c | 65 | ||||
-rw-r--r-- | drivers/net/wireless/ath9k/xmit.c | 12 |
3 files changed, 8 insertions, 80 deletions
diff --git a/drivers/net/wireless/ath9k/core.h b/drivers/net/wireless/ath9k/core.h index 49d2f894b9dc..dd33cb7f2ca6 100644 --- a/drivers/net/wireless/ath9k/core.h +++ b/drivers/net/wireless/ath9k/core.h | |||
@@ -588,14 +588,6 @@ enum ATH_AGGR_STATUS { | |||
588 | ATH_AGGR_8K_LIMITED, | 588 | ATH_AGGR_8K_LIMITED, |
589 | }; | 589 | }; |
590 | 590 | ||
591 | enum ATH_AGGR_CHECK { | ||
592 | AGGR_NOT_REQUIRED, | ||
593 | AGGR_REQUIRED, | ||
594 | AGGR_CLEANUP_PROGRESS, | ||
595 | AGGR_EXCHANGE_PROGRESS, | ||
596 | AGGR_EXCHANGE_DONE | ||
597 | }; | ||
598 | |||
599 | struct aggr_rifs_param { | 591 | struct aggr_rifs_param { |
600 | int param_max_frames; | 592 | int param_max_frames; |
601 | int param_max_len; | 593 | int param_max_len; |
@@ -621,8 +613,7 @@ struct ath_node { | |||
621 | 613 | ||
622 | void ath_tx_resume_tid(struct ath_softc *sc, | 614 | void ath_tx_resume_tid(struct ath_softc *sc, |
623 | struct ath_atx_tid *tid); | 615 | struct ath_atx_tid *tid); |
624 | enum ATH_AGGR_CHECK ath_tx_aggr_check(struct ath_softc *sc, | 616 | bool ath_tx_aggr_check(struct ath_softc *sc, struct ath_node *an, u8 tidno); |
625 | struct ath_node *an, u8 tidno); | ||
626 | void ath_tx_aggr_teardown(struct ath_softc *sc, | 617 | void ath_tx_aggr_teardown(struct ath_softc *sc, |
627 | struct ath_node *an, u8 tidno); | 618 | struct ath_node *an, u8 tidno); |
628 | void ath_rx_aggr_teardown(struct ath_softc *sc, | 619 | void ath_rx_aggr_teardown(struct ath_softc *sc, |
diff --git a/drivers/net/wireless/ath9k/rc.c b/drivers/net/wireless/ath9k/rc.c index fecc8390d4d8..aa6bfd717c20 100644 --- a/drivers/net/wireless/ath9k/rc.c +++ b/drivers/net/wireless/ath9k/rc.c | |||
@@ -1879,49 +1879,6 @@ static void ath_tx_status(void *priv, struct ieee80211_supported_band *sband, | |||
1879 | tx_info->control.vif = NULL; | 1879 | tx_info->control.vif = NULL; |
1880 | } | 1880 | } |
1881 | 1881 | ||
1882 | static void ath_tx_aggr_resp(struct ath_softc *sc, | ||
1883 | struct ieee80211_supported_band *sband, | ||
1884 | struct ieee80211_sta *sta, | ||
1885 | struct ath_node *an, | ||
1886 | u8 tidno) | ||
1887 | { | ||
1888 | struct ath_atx_tid *txtid; | ||
1889 | u16 buffersize = 0; | ||
1890 | int state; | ||
1891 | struct sta_info *si; | ||
1892 | |||
1893 | if (!(sc->sc_flags & SC_OP_TXAGGR)) | ||
1894 | return; | ||
1895 | |||
1896 | txtid = ATH_AN_2_TID(an, tidno); | ||
1897 | if (!txtid->paused) | ||
1898 | return; | ||
1899 | |||
1900 | /* | ||
1901 | * XXX: This is entirely busted, we aren't supposed to | ||
1902 | * access the sta from here because it's internal | ||
1903 | * to mac80211, and looking at the state without | ||
1904 | * locking is wrong too. | ||
1905 | */ | ||
1906 | si = container_of(sta, struct sta_info, sta); | ||
1907 | buffersize = IEEE80211_MIN_AMPDU_BUF << | ||
1908 | sband->ht_cap.ampdu_factor; /* FIXME */ | ||
1909 | state = si->ampdu_mlme.tid_state_tx[tidno]; | ||
1910 | |||
1911 | if (state & HT_ADDBA_RECEIVED_MSK) { | ||
1912 | txtid->state |= AGGR_ADDBA_COMPLETE; | ||
1913 | txtid->state &= ~AGGR_ADDBA_PROGRESS; | ||
1914 | txtid->baw_size = buffersize; | ||
1915 | |||
1916 | DPRINTF(sc, ATH_DBG_AGGR, | ||
1917 | "%s: Resuming tid, buffersize: %d\n", | ||
1918 | __func__, | ||
1919 | buffersize); | ||
1920 | |||
1921 | ath_tx_resume_tid(sc, txtid); | ||
1922 | } | ||
1923 | } | ||
1924 | |||
1925 | static void ath_get_rate(void *priv, struct ieee80211_sta *sta, void *priv_sta, | 1882 | static void ath_get_rate(void *priv, struct ieee80211_sta *sta, void *priv_sta, |
1926 | struct ieee80211_tx_rate_control *txrc) | 1883 | struct ieee80211_tx_rate_control *txrc) |
1927 | { | 1884 | { |
@@ -1934,7 +1891,7 @@ static void ath_get_rate(void *priv, struct ieee80211_sta *sta, void *priv_sta, | |||
1934 | struct ath_rate_node *ath_rc_priv = priv_sta; | 1891 | struct ath_rate_node *ath_rc_priv = priv_sta; |
1935 | struct ath_node *an; | 1892 | struct ath_node *an; |
1936 | struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(skb); | 1893 | struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(skb); |
1937 | int is_probe = FALSE, chk, ret; | 1894 | int is_probe = FALSE; |
1938 | s8 lowest_idx; | 1895 | s8 lowest_idx; |
1939 | __le16 fc = hdr->frame_control; | 1896 | __le16 fc = hdr->frame_control; |
1940 | u8 *qc, tid; | 1897 | u8 *qc, tid; |
@@ -1981,26 +1938,10 @@ static void ath_get_rate(void *priv, struct ieee80211_sta *sta, void *priv_sta, | |||
1981 | if (ieee80211_is_data_qos(fc)) { | 1938 | if (ieee80211_is_data_qos(fc)) { |
1982 | qc = ieee80211_get_qos_ctl(hdr); | 1939 | qc = ieee80211_get_qos_ctl(hdr); |
1983 | tid = qc[0] & 0xf; | 1940 | tid = qc[0] & 0xf; |
1984 | |||
1985 | an = (struct ath_node *)sta->drv_priv; | 1941 | an = (struct ath_node *)sta->drv_priv; |
1986 | 1942 | ||
1987 | chk = ath_tx_aggr_check(sc, an, tid); | 1943 | if(ath_tx_aggr_check(sc, an, tid)) |
1988 | if (chk == AGGR_REQUIRED) { | 1944 | ieee80211_start_tx_ba_session(hw, hdr->addr1, tid); |
1989 | ret = ieee80211_start_tx_ba_session(hw, | ||
1990 | hdr->addr1, tid); | ||
1991 | if (ret) | ||
1992 | DPRINTF(sc, ATH_DBG_AGGR, | ||
1993 | "%s: Unable to start tx " | ||
1994 | "aggr for: %pM\n", | ||
1995 | __func__, | ||
1996 | hdr->addr1); | ||
1997 | else | ||
1998 | DPRINTF(sc, ATH_DBG_AGGR, | ||
1999 | "%s: Started tx aggr for: %pM\n", | ||
2000 | __func__, | ||
2001 | hdr->addr1); | ||
2002 | } else if (chk == AGGR_EXCHANGE_PROGRESS) | ||
2003 | ath_tx_aggr_resp(sc, sband, sta, an, tid); | ||
2004 | } | 1945 | } |
2005 | } | 1946 | } |
2006 | } | 1947 | } |
diff --git a/drivers/net/wireless/ath9k/xmit.c b/drivers/net/wireless/ath9k/xmit.c index f41030d1a687..7e6f4e59a5d1 100644 --- a/drivers/net/wireless/ath9k/xmit.c +++ b/drivers/net/wireless/ath9k/xmit.c | |||
@@ -2322,28 +2322,24 @@ u32 ath_txq_aggr_depth(struct ath_softc *sc, int qnum) | |||
2322 | return sc->sc_txq[qnum].axq_aggr_depth; | 2322 | return sc->sc_txq[qnum].axq_aggr_depth; |
2323 | } | 2323 | } |
2324 | 2324 | ||
2325 | /* Check if an ADDBA is required. A valid node must be passed. */ | 2325 | bool ath_tx_aggr_check(struct ath_softc *sc, struct ath_node *an, u8 tidno) |
2326 | enum ATH_AGGR_CHECK ath_tx_aggr_check(struct ath_softc *sc, | ||
2327 | struct ath_node *an, | ||
2328 | u8 tidno) | ||
2329 | { | 2326 | { |
2330 | struct ath_atx_tid *txtid; | 2327 | struct ath_atx_tid *txtid; |
2331 | 2328 | ||
2332 | if (!(sc->sc_flags & SC_OP_TXAGGR)) | 2329 | if (!(sc->sc_flags & SC_OP_TXAGGR)) |
2333 | return AGGR_NOT_REQUIRED; | 2330 | return false; |
2334 | 2331 | ||
2335 | /* ADDBA exchange must be completed before sending aggregates */ | ||
2336 | txtid = ATH_AN_2_TID(an, tidno); | 2332 | txtid = ATH_AN_2_TID(an, tidno); |
2337 | 2333 | ||
2338 | if (!(txtid->state & AGGR_ADDBA_COMPLETE)) { | 2334 | if (!(txtid->state & AGGR_ADDBA_COMPLETE)) { |
2339 | if (!(txtid->state & AGGR_ADDBA_PROGRESS) && | 2335 | if (!(txtid->state & AGGR_ADDBA_PROGRESS) && |
2340 | (txtid->addba_exchangeattempts < ADDBA_EXCHANGE_ATTEMPTS)) { | 2336 | (txtid->addba_exchangeattempts < ADDBA_EXCHANGE_ATTEMPTS)) { |
2341 | txtid->addba_exchangeattempts++; | 2337 | txtid->addba_exchangeattempts++; |
2342 | return AGGR_REQUIRED; | 2338 | return true; |
2343 | } | 2339 | } |
2344 | } | 2340 | } |
2345 | 2341 | ||
2346 | return AGGR_NOT_REQUIRED; | 2342 | return false; |
2347 | } | 2343 | } |
2348 | 2344 | ||
2349 | /* Start TX aggregation */ | 2345 | /* Start TX aggregation */ |