diff options
Diffstat (limited to 'drivers/net/wireless/ath9k')
-rw-r--r-- | drivers/net/wireless/ath9k/main.c | 18 | ||||
-rw-r--r-- | drivers/net/wireless/ath9k/rc.c | 40 | ||||
-rw-r--r-- | drivers/net/wireless/ath9k/xmit.c | 28 |
3 files changed, 46 insertions, 40 deletions
diff --git a/drivers/net/wireless/ath9k/main.c b/drivers/net/wireless/ath9k/main.c index 32acaf7ff622..a7656a3ea1b0 100644 --- a/drivers/net/wireless/ath9k/main.c +++ b/drivers/net/wireless/ath9k/main.c | |||
@@ -457,12 +457,13 @@ void ath_tx_complete(struct ath_softc *sc, struct sk_buff *skb, | |||
457 | DPRINTF(sc, ATH_DBG_XMIT, | 457 | DPRINTF(sc, ATH_DBG_XMIT, |
458 | "%s: TX complete: skb: %p\n", __func__, skb); | 458 | "%s: TX complete: skb: %p\n", __func__, skb); |
459 | 459 | ||
460 | ieee80211_tx_info_clear_status(tx_info); | ||
460 | if (tx_info->flags & IEEE80211_TX_CTL_NO_ACK || | 461 | if (tx_info->flags & IEEE80211_TX_CTL_NO_ACK || |
461 | tx_info->flags & IEEE80211_TX_STAT_TX_FILTERED) { | 462 | tx_info->flags & IEEE80211_TX_STAT_TX_FILTERED) { |
462 | /* free driver's private data area of tx_info */ | 463 | /* free driver's private data area of tx_info, XXX: HACK! */ |
463 | if (tx_info->driver_data[0] != NULL) | 464 | if (tx_info->control.vif != NULL) |
464 | kfree(tx_info->driver_data[0]); | 465 | kfree(tx_info->control.vif); |
465 | tx_info->driver_data[0] = NULL; | 466 | tx_info->control.vif = NULL; |
466 | } | 467 | } |
467 | 468 | ||
468 | if (tx_status->flags & ATH_TX_BAR) { | 469 | if (tx_status->flags & ATH_TX_BAR) { |
@@ -470,17 +471,12 @@ void ath_tx_complete(struct ath_softc *sc, struct sk_buff *skb, | |||
470 | tx_status->flags &= ~ATH_TX_BAR; | 471 | tx_status->flags &= ~ATH_TX_BAR; |
471 | } | 472 | } |
472 | 473 | ||
473 | if (tx_status->flags & (ATH_TX_ERROR | ATH_TX_XRETRY)) { | 474 | if (!(tx_status->flags & (ATH_TX_ERROR | ATH_TX_XRETRY))) { |
474 | if (!(tx_info->flags & IEEE80211_TX_CTL_NO_ACK)) { | ||
475 | /* Frame was not ACKed, but an ACK was expected */ | ||
476 | tx_info->status.excessive_retries = 1; | ||
477 | } | ||
478 | } else { | ||
479 | /* Frame was ACKed */ | 475 | /* Frame was ACKed */ |
480 | tx_info->flags |= IEEE80211_TX_STAT_ACK; | 476 | tx_info->flags |= IEEE80211_TX_STAT_ACK; |
481 | } | 477 | } |
482 | 478 | ||
483 | tx_info->status.retry_count = tx_status->retries; | 479 | tx_info->status.rates[0].count = tx_status->retries + 1; |
484 | 480 | ||
485 | ieee80211_tx_status(hw, skb); | 481 | ieee80211_tx_status(hw, skb); |
486 | if (an) | 482 | if (an) |
diff --git a/drivers/net/wireless/ath9k/rc.c b/drivers/net/wireless/ath9k/rc.c index 9b2526030965..6afafeddeda2 100644 --- a/drivers/net/wireless/ath9k/rc.c +++ b/drivers/net/wireless/ath9k/rc.c | |||
@@ -1864,24 +1864,21 @@ static void ath_tx_status(void *priv, struct ieee80211_supported_band *sband, | |||
1864 | 1864 | ||
1865 | hdr = (struct ieee80211_hdr *)skb->data; | 1865 | hdr = (struct ieee80211_hdr *)skb->data; |
1866 | fc = hdr->frame_control; | 1866 | fc = hdr->frame_control; |
1867 | tx_info_priv = (struct ath_tx_info_priv *)tx_info->driver_data[0]; | 1867 | /* XXX: UGLY HACK!! */ |
1868 | tx_info_priv = (struct ath_tx_info_priv *)tx_info->control.vif; | ||
1868 | 1869 | ||
1869 | spin_lock_bh(&sc->node_lock); | 1870 | spin_lock_bh(&sc->node_lock); |
1870 | an = ath_node_find(sc, hdr->addr1); | 1871 | an = ath_node_find(sc, hdr->addr1); |
1871 | spin_unlock_bh(&sc->node_lock); | 1872 | spin_unlock_bh(&sc->node_lock); |
1872 | 1873 | ||
1873 | if (!an || !priv_sta || !ieee80211_is_data(fc)) { | 1874 | if (tx_info_priv == NULL) |
1874 | if (tx_info->driver_data[0] != NULL) { | ||
1875 | kfree(tx_info->driver_data[0]); | ||
1876 | tx_info->driver_data[0] = NULL; | ||
1877 | } | ||
1878 | return; | 1875 | return; |
1879 | } | 1876 | |
1880 | if (tx_info->driver_data[0] != NULL) { | 1877 | if (an && priv_sta && ieee80211_is_data(fc)) |
1881 | ath_rate_tx_complete(sc, an, priv_sta, tx_info_priv); | 1878 | ath_rate_tx_complete(sc, an, priv_sta, tx_info_priv); |
1882 | kfree(tx_info->driver_data[0]); | 1879 | |
1883 | tx_info->driver_data[0] = NULL; | 1880 | kfree(tx_info_priv); |
1884 | } | 1881 | tx_info->control.vif = NULL; |
1885 | } | 1882 | } |
1886 | 1883 | ||
1887 | static void ath_tx_aggr_resp(struct ath_softc *sc, | 1884 | static void ath_tx_aggr_resp(struct ath_softc *sc, |
@@ -1927,10 +1924,11 @@ static void ath_tx_aggr_resp(struct ath_softc *sc, | |||
1927 | } | 1924 | } |
1928 | } | 1925 | } |
1929 | 1926 | ||
1930 | static void ath_get_rate(void *priv, struct ieee80211_supported_band *sband, | 1927 | static void ath_get_rate(void *priv, struct ieee80211_sta *sta, void *priv_sta, |
1931 | struct ieee80211_sta *sta, void *priv_sta, | 1928 | struct ieee80211_tx_rate_control *txrc) |
1932 | struct sk_buff *skb, struct rate_selection *sel) | ||
1933 | { | 1929 | { |
1930 | struct ieee80211_supported_band *sband = txrc->sband; | ||
1931 | struct sk_buff *skb = txrc->skb; | ||
1934 | struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data; | 1932 | struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data; |
1935 | struct ath_softc *sc = priv; | 1933 | struct ath_softc *sc = priv; |
1936 | struct ieee80211_hw *hw = sc->hw; | 1934 | struct ieee80211_hw *hw = sc->hw; |
@@ -1945,17 +1943,17 @@ static void ath_get_rate(void *priv, struct ieee80211_supported_band *sband, | |||
1945 | 1943 | ||
1946 | DPRINTF(sc, ATH_DBG_RATE, "%s\n", __func__); | 1944 | DPRINTF(sc, ATH_DBG_RATE, "%s\n", __func__); |
1947 | 1945 | ||
1948 | /* allocate driver private area of tx_info */ | 1946 | /* allocate driver private area of tx_info, XXX: UGLY HACK! */ |
1949 | tx_info->driver_data[0] = kzalloc(sizeof(*tx_info_priv), GFP_ATOMIC); | 1947 | tx_info->control.vif = kzalloc(sizeof(*tx_info_priv), GFP_ATOMIC); |
1950 | ASSERT(tx_info->driver_data[0] != NULL); | 1948 | tx_info_priv = (struct ath_tx_info_priv *)tx_info->control.vif; |
1951 | tx_info_priv = (struct ath_tx_info_priv *)tx_info->driver_data[0]; | 1949 | ASSERT(tx_info_priv != NULL); |
1952 | 1950 | ||
1953 | lowest_idx = rate_lowest_index(sband, sta); | 1951 | lowest_idx = rate_lowest_index(sband, sta); |
1954 | tx_info_priv->min_rate = (sband->bitrates[lowest_idx].bitrate * 2) / 10; | 1952 | tx_info_priv->min_rate = (sband->bitrates[lowest_idx].bitrate * 2) / 10; |
1955 | /* lowest rate for management and multicast/broadcast frames */ | 1953 | /* lowest rate for management and multicast/broadcast frames */ |
1956 | if (!ieee80211_is_data(fc) || | 1954 | if (!ieee80211_is_data(fc) || |
1957 | is_multicast_ether_addr(hdr->addr1) || !sta) { | 1955 | is_multicast_ether_addr(hdr->addr1) || !sta) { |
1958 | sel->rate_idx = lowest_idx; | 1956 | tx_info->control.rates[0].idx = lowest_idx; |
1959 | return; | 1957 | return; |
1960 | } | 1958 | } |
1961 | 1959 | ||
@@ -1966,8 +1964,10 @@ static void ath_get_rate(void *priv, struct ieee80211_supported_band *sband, | |||
1966 | tx_info_priv->rcs, | 1964 | tx_info_priv->rcs, |
1967 | &is_probe, | 1965 | &is_probe, |
1968 | false); | 1966 | false); |
1967 | #if 0 | ||
1969 | if (is_probe) | 1968 | if (is_probe) |
1970 | sel->probe_idx = ath_rc_priv->tx_ratectrl.probe_rate; | 1969 | sel->probe_idx = ath_rc_priv->tx_ratectrl.probe_rate; |
1970 | #endif | ||
1971 | 1971 | ||
1972 | /* Ratecontrol sometimes returns invalid rate index */ | 1972 | /* Ratecontrol sometimes returns invalid rate index */ |
1973 | if (tx_info_priv->rcs[0].rix != 0xff) | 1973 | if (tx_info_priv->rcs[0].rix != 0xff) |
@@ -1975,7 +1975,7 @@ static void ath_get_rate(void *priv, struct ieee80211_supported_band *sband, | |||
1975 | else | 1975 | else |
1976 | tx_info_priv->rcs[0].rix = ath_rc_priv->prev_data_rix; | 1976 | tx_info_priv->rcs[0].rix = ath_rc_priv->prev_data_rix; |
1977 | 1977 | ||
1978 | sel->rate_idx = tx_info_priv->rcs[0].rix; | 1978 | tx_info->control.rates[0].idx = tx_info_priv->rcs[0].rix; |
1979 | 1979 | ||
1980 | /* Check if aggregation has to be enabled for this tid */ | 1980 | /* Check if aggregation has to be enabled for this tid */ |
1981 | 1981 | ||
diff --git a/drivers/net/wireless/ath9k/xmit.c b/drivers/net/wireless/ath9k/xmit.c index ba818cc2fb5c..9fa395418a6c 100644 --- a/drivers/net/wireless/ath9k/xmit.c +++ b/drivers/net/wireless/ath9k/xmit.c | |||
@@ -168,7 +168,9 @@ static void fill_min_rates(struct sk_buff *skb, struct ath_tx_control *txctl) | |||
168 | 168 | ||
169 | hdr = (struct ieee80211_hdr *)skb->data; | 169 | hdr = (struct ieee80211_hdr *)skb->data; |
170 | fc = hdr->frame_control; | 170 | fc = hdr->frame_control; |
171 | tx_info_priv = (struct ath_tx_info_priv *)tx_info->driver_data[0]; | 171 | |
172 | /* XXX: HACK! */ | ||
173 | tx_info_priv = (struct ath_tx_info_priv *)tx_info->control.vif; | ||
172 | 174 | ||
173 | if (ieee80211_is_mgmt(fc) || ieee80211_is_ctl(fc)) { | 175 | if (ieee80211_is_mgmt(fc) || ieee80211_is_ctl(fc)) { |
174 | txctl->use_minrate = 1; | 176 | txctl->use_minrate = 1; |
@@ -288,13 +290,16 @@ static int ath_tx_prepare(struct ath_softc *sc, | |||
288 | 290 | ||
289 | if (tx_info->flags & IEEE80211_TX_CTL_NO_ACK) | 291 | if (tx_info->flags & IEEE80211_TX_CTL_NO_ACK) |
290 | txctl->flags |= ATH9K_TXDESC_NOACK; | 292 | txctl->flags |= ATH9K_TXDESC_NOACK; |
291 | if (tx_info->flags & IEEE80211_TX_CTL_USE_RTS_CTS) | 293 | |
294 | if (tx_info->control.rates[0].flags & IEEE80211_TX_RC_USE_RTS_CTS) | ||
292 | txctl->flags |= ATH9K_TXDESC_RTSENA; | 295 | txctl->flags |= ATH9K_TXDESC_RTSENA; |
293 | 296 | ||
294 | /* | 297 | /* |
295 | * Setup for rate calculations. | 298 | * Setup for rate calculations. |
296 | */ | 299 | */ |
297 | tx_info_priv = (struct ath_tx_info_priv *)tx_info->driver_data[0]; | 300 | |
301 | /* XXX: HACK! */ | ||
302 | tx_info_priv = (struct ath_tx_info_priv *)tx_info->control.vif; | ||
298 | rcs = tx_info_priv->rcs; | 303 | rcs = tx_info_priv->rcs; |
299 | 304 | ||
300 | if (ieee80211_is_data(fc) && !txctl->use_minrate) { | 305 | if (ieee80211_is_data(fc) && !txctl->use_minrate) { |
@@ -855,7 +860,9 @@ static int ath_tx_send_normal(struct ath_softc *sc, | |||
855 | 860 | ||
856 | skb = (struct sk_buff *)bf->bf_mpdu; | 861 | skb = (struct sk_buff *)bf->bf_mpdu; |
857 | tx_info = IEEE80211_SKB_CB(skb); | 862 | tx_info = IEEE80211_SKB_CB(skb); |
858 | tx_info_priv = (struct ath_tx_info_priv *)tx_info->driver_data[0]; | 863 | |
864 | /* XXX: HACK! */ | ||
865 | tx_info_priv = (struct ath_tx_info_priv *)tx_info->control.vif; | ||
859 | memcpy(bf->bf_rcs, tx_info_priv->rcs, 4 * sizeof(tx_info_priv->rcs[0])); | 866 | memcpy(bf->bf_rcs, tx_info_priv->rcs, 4 * sizeof(tx_info_priv->rcs[0])); |
860 | 867 | ||
861 | /* update starting sequence number for subsequent ADDBA request */ | 868 | /* update starting sequence number for subsequent ADDBA request */ |
@@ -1249,8 +1256,9 @@ static int ath_tx_processq(struct ath_softc *sc, struct ath_txq *txq) | |||
1249 | } | 1256 | } |
1250 | skb = bf->bf_mpdu; | 1257 | skb = bf->bf_mpdu; |
1251 | tx_info = IEEE80211_SKB_CB(skb); | 1258 | tx_info = IEEE80211_SKB_CB(skb); |
1252 | tx_info_priv = (struct ath_tx_info_priv *) | 1259 | |
1253 | tx_info->driver_data[0]; | 1260 | /* XXX: HACK! */ |
1261 | tx_info_priv = (struct ath_tx_info_priv *) tx_info->control.vif; | ||
1254 | if (ds->ds_txstat.ts_status & ATH9K_TXERR_FILT) | 1262 | if (ds->ds_txstat.ts_status & ATH9K_TXERR_FILT) |
1255 | tx_info->flags |= IEEE80211_TX_STAT_TX_FILTERED; | 1263 | tx_info->flags |= IEEE80211_TX_STAT_TX_FILTERED; |
1256 | if ((ds->ds_txstat.ts_status & ATH9K_TXERR_FILT) == 0 && | 1264 | if ((ds->ds_txstat.ts_status & ATH9K_TXERR_FILT) == 0 && |
@@ -1431,7 +1439,8 @@ static int ath_tx_send_ampdu(struct ath_softc *sc, | |||
1431 | 1439 | ||
1432 | skb = (struct sk_buff *)bf->bf_mpdu; | 1440 | skb = (struct sk_buff *)bf->bf_mpdu; |
1433 | tx_info = IEEE80211_SKB_CB(skb); | 1441 | tx_info = IEEE80211_SKB_CB(skb); |
1434 | tx_info_priv = (struct ath_tx_info_priv *)tx_info->driver_data[0]; | 1442 | /* XXX: HACK! */ |
1443 | tx_info_priv = (struct ath_tx_info_priv *)tx_info->control.vif; | ||
1435 | memcpy(bf->bf_rcs, tx_info_priv->rcs, 4 * sizeof(tx_info_priv->rcs[0])); | 1444 | memcpy(bf->bf_rcs, tx_info_priv->rcs, 4 * sizeof(tx_info_priv->rcs[0])); |
1436 | 1445 | ||
1437 | /* Add sub-frame to BAW */ | 1446 | /* Add sub-frame to BAW */ |
@@ -1466,7 +1475,7 @@ static u32 ath_lookup_rate(struct ath_softc *sc, | |||
1466 | skb = (struct sk_buff *)bf->bf_mpdu; | 1475 | skb = (struct sk_buff *)bf->bf_mpdu; |
1467 | tx_info = IEEE80211_SKB_CB(skb); | 1476 | tx_info = IEEE80211_SKB_CB(skb); |
1468 | tx_info_priv = (struct ath_tx_info_priv *) | 1477 | tx_info_priv = (struct ath_tx_info_priv *) |
1469 | tx_info->driver_data[0]; | 1478 | tx_info->control.vif; /* XXX: HACK! */ |
1470 | memcpy(bf->bf_rcs, | 1479 | memcpy(bf->bf_rcs, |
1471 | tx_info_priv->rcs, 4 * sizeof(tx_info_priv->rcs[0])); | 1480 | tx_info_priv->rcs, 4 * sizeof(tx_info_priv->rcs[0])); |
1472 | 1481 | ||
@@ -1927,7 +1936,8 @@ static int ath_tx_start_dma(struct ath_softc *sc, | |||
1927 | 1936 | ||
1928 | bf->bf_flags = txctl->flags; | 1937 | bf->bf_flags = txctl->flags; |
1929 | bf->bf_keytype = txctl->keytype; | 1938 | bf->bf_keytype = txctl->keytype; |
1930 | tx_info_priv = (struct ath_tx_info_priv *)tx_info->driver_data[0]; | 1939 | /* XXX: HACK! */ |
1940 | tx_info_priv = (struct ath_tx_info_priv *)tx_info->control.vif; | ||
1931 | rcs = tx_info_priv->rcs; | 1941 | rcs = tx_info_priv->rcs; |
1932 | bf->bf_rcs[0] = rcs[0]; | 1942 | bf->bf_rcs[0] = rcs[0]; |
1933 | bf->bf_rcs[1] = rcs[1]; | 1943 | bf->bf_rcs[1] = rcs[1]; |