aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath9k/xmit.c
diff options
context:
space:
mode:
authorSujith <Sujith.Manoharan@atheros.com>2009-02-03 21:40:19 -0500
committerJohn W. Linville <linville@tuxdriver.com>2009-02-11 11:44:22 -0500
commit254ad0ff9387d1c0a2f975ff40b2f4d1302ccc3a (patch)
tree8152a4a429eb9fbcd281cbe60f99bd15dfcf7ffe /drivers/net/wireless/ath9k/xmit.c
parent141b38b6bc6db69348a9eaed87137451240bc55f (diff)
ath9k: Remove all the redundant internal buffer types
Use mac80211's primitives for identifying the frame type, and cleanup the driver-specific macros. Signed-off-by: Sujith <Sujith.Manoharan@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath9k/xmit.c')
-rw-r--r--drivers/net/wireless/ath9k/xmit.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/drivers/net/wireless/ath9k/xmit.c b/drivers/net/wireless/ath9k/xmit.c
index e14bceaef125..d5f15e74854f 100644
--- a/drivers/net/wireless/ath9k/xmit.c
+++ b/drivers/net/wireless/ath9k/xmit.c
@@ -1436,14 +1436,18 @@ static void ath_buf_set_rate(struct ath_softc *sc, struct ath_buf *bf)
1436 struct sk_buff *skb; 1436 struct sk_buff *skb;
1437 struct ieee80211_tx_info *tx_info; 1437 struct ieee80211_tx_info *tx_info;
1438 struct ieee80211_tx_rate *rates; 1438 struct ieee80211_tx_rate *rates;
1439 struct ieee80211_hdr *hdr;
1439 int i, flags = 0; 1440 int i, flags = 0;
1440 u8 rix = 0, ctsrate = 0; 1441 u8 rix = 0, ctsrate = 0;
1442 bool is_pspoll;
1441 1443
1442 memset(series, 0, sizeof(struct ath9k_11n_rate_series) * 4); 1444 memset(series, 0, sizeof(struct ath9k_11n_rate_series) * 4);
1443 1445
1444 skb = (struct sk_buff *)bf->bf_mpdu; 1446 skb = (struct sk_buff *)bf->bf_mpdu;
1445 tx_info = IEEE80211_SKB_CB(skb); 1447 tx_info = IEEE80211_SKB_CB(skb);
1446 rates = tx_info->control.rates; 1448 rates = tx_info->control.rates;
1449 hdr = (struct ieee80211_hdr *)skb->data;
1450 is_pspoll = ieee80211_is_pspoll(hdr->frame_control);
1447 1451
1448 /* 1452 /*
1449 * We check if Short Preamble is needed for the CTS rate by 1453 * We check if Short Preamble is needed for the CTS rate by
@@ -1506,7 +1510,7 @@ static void ath_buf_set_rate(struct ath_softc *sc, struct ath_buf *bf)
1506 /* set dur_update_en for l-sig computation except for PS-Poll frames */ 1510 /* set dur_update_en for l-sig computation except for PS-Poll frames */
1507 ath9k_hw_set11n_ratescenario(sc->sc_ah, bf->bf_desc, 1511 ath9k_hw_set11n_ratescenario(sc->sc_ah, bf->bf_desc,
1508 bf->bf_lastbf->bf_desc, 1512 bf->bf_lastbf->bf_desc,
1509 !bf_ispspoll(bf), ctsrate, 1513 !is_pspoll, ctsrate,
1510 0, series, 4, flags); 1514 0, series, 4, flags);
1511 1515
1512 if (sc->sc_config.ath_aggr_prot && flags) 1516 if (sc->sc_config.ath_aggr_prot && flags)
@@ -1534,12 +1538,6 @@ static int ath_tx_setup_buffer(struct ath_softc *sc, struct ath_buf *bf,
1534 1538
1535 bf->bf_frmlen = skb->len + FCS_LEN - (hdrlen & 3); 1539 bf->bf_frmlen = skb->len + FCS_LEN - (hdrlen & 3);
1536 1540
1537 if (ieee80211_is_data(fc))
1538 bf->bf_state.bf_type |= BUF_DATA;
1539 if (ieee80211_is_back_req(fc))
1540 bf->bf_state.bf_type |= BUF_BAR;
1541 if (ieee80211_is_pspoll(fc))
1542 bf->bf_state.bf_type |= BUF_PSPOLL;
1543 if ((conf_is_ht(&sc->hw->conf) && !is_pae(skb) && 1541 if ((conf_is_ht(&sc->hw->conf) && !is_pae(skb) &&
1544 (tx_info->flags & IEEE80211_TX_CTL_AMPDU))) 1542 (tx_info->flags & IEEE80211_TX_CTL_AMPDU)))
1545 bf->bf_state.bf_type |= BUF_HT; 1543 bf->bf_state.bf_type |= BUF_HT;
@@ -1843,6 +1841,7 @@ static int ath_tx_num_badfrms(struct ath_softc *sc, struct ath_buf *bf,
1843static void ath_tx_rc_status(struct ath_buf *bf, struct ath_desc *ds, int nbad) 1841static void ath_tx_rc_status(struct ath_buf *bf, struct ath_desc *ds, int nbad)
1844{ 1842{
1845 struct sk_buff *skb = (struct sk_buff *)bf->bf_mpdu; 1843 struct sk_buff *skb = (struct sk_buff *)bf->bf_mpdu;
1844 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data;
1846 struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(skb); 1845 struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(skb);
1847 struct ath_tx_info_priv *tx_info_priv = ATH_TX_INFO_PRIV(tx_info); 1846 struct ath_tx_info_priv *tx_info_priv = ATH_TX_INFO_PRIV(tx_info);
1848 1847
@@ -1852,7 +1851,7 @@ static void ath_tx_rc_status(struct ath_buf *bf, struct ath_desc *ds, int nbad)
1852 1851
1853 if ((ds->ds_txstat.ts_status & ATH9K_TXERR_FILT) == 0 && 1852 if ((ds->ds_txstat.ts_status & ATH9K_TXERR_FILT) == 0 &&
1854 (bf->bf_flags & ATH9K_TXDESC_NOACK) == 0) { 1853 (bf->bf_flags & ATH9K_TXDESC_NOACK) == 0) {
1855 if (bf_isdata(bf)) { 1854 if (ieee80211_is_data(hdr->frame_control)) {
1856 memcpy(&tx_info_priv->tx, &ds->ds_txstat, 1855 memcpy(&tx_info_priv->tx, &ds->ds_txstat,
1857 sizeof(tx_info_priv->tx)); 1856 sizeof(tx_info_priv->tx));
1858 tx_info_priv->n_frames = bf->bf_nframes; 1857 tx_info_priv->n_frames = bf->bf_nframes;