diff options
Diffstat (limited to 'drivers/net/wireless/ath/ath5k')
-rw-r--r-- | drivers/net/wireless/ath/ath5k/ath5k.h | 1 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath5k/base.c | 44 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath5k/base.h | 1 |
3 files changed, 25 insertions, 21 deletions
diff --git a/drivers/net/wireless/ath/ath5k/ath5k.h b/drivers/net/wireless/ath/ath5k/ath5k.h index ad4d446f0264..ac67f02e26d8 100644 --- a/drivers/net/wireless/ath/ath5k/ath5k.h +++ b/drivers/net/wireless/ath/ath5k/ath5k.h | |||
@@ -541,7 +541,6 @@ struct ath5k_txq_info { | |||
541 | /* | 541 | /* |
542 | * Transmit packet types. | 542 | * Transmit packet types. |
543 | * used on tx control descriptor | 543 | * used on tx control descriptor |
544 | * TODO: Use them inside base.c corectly | ||
545 | */ | 544 | */ |
546 | enum ath5k_pkt_type { | 545 | enum ath5k_pkt_type { |
547 | AR5K_PKT_TYPE_NORMAL = 0, | 546 | AR5K_PKT_TYPE_NORMAL = 0, |
diff --git a/drivers/net/wireless/ath/ath5k/base.c b/drivers/net/wireless/ath/ath5k/base.c index edb6c90e376f..8dce0077b023 100644 --- a/drivers/net/wireless/ath/ath5k/base.c +++ b/drivers/net/wireless/ath/ath5k/base.c | |||
@@ -241,8 +241,6 @@ static int ath5k_set_key(struct ieee80211_hw *hw, | |||
241 | struct ieee80211_key_conf *key); | 241 | struct ieee80211_key_conf *key); |
242 | static int ath5k_get_stats(struct ieee80211_hw *hw, | 242 | static int ath5k_get_stats(struct ieee80211_hw *hw, |
243 | struct ieee80211_low_level_stats *stats); | 243 | struct ieee80211_low_level_stats *stats); |
244 | static int ath5k_get_tx_stats(struct ieee80211_hw *hw, | ||
245 | struct ieee80211_tx_queue_stats *stats); | ||
246 | static u64 ath5k_get_tsf(struct ieee80211_hw *hw); | 244 | static u64 ath5k_get_tsf(struct ieee80211_hw *hw); |
247 | static void ath5k_set_tsf(struct ieee80211_hw *hw, u64 tsf); | 245 | static void ath5k_set_tsf(struct ieee80211_hw *hw, u64 tsf); |
248 | static void ath5k_reset_tsf(struct ieee80211_hw *hw); | 246 | static void ath5k_reset_tsf(struct ieee80211_hw *hw); |
@@ -269,7 +267,6 @@ static const struct ieee80211_ops ath5k_hw_ops = { | |||
269 | .set_key = ath5k_set_key, | 267 | .set_key = ath5k_set_key, |
270 | .get_stats = ath5k_get_stats, | 268 | .get_stats = ath5k_get_stats, |
271 | .conf_tx = NULL, | 269 | .conf_tx = NULL, |
272 | .get_tx_stats = ath5k_get_tx_stats, | ||
273 | .get_tsf = ath5k_get_tsf, | 270 | .get_tsf = ath5k_get_tsf, |
274 | .set_tsf = ath5k_set_tsf, | 271 | .set_tsf = ath5k_set_tsf, |
275 | .reset_tsf = ath5k_reset_tsf, | 272 | .reset_tsf = ath5k_reset_tsf, |
@@ -1249,6 +1246,29 @@ ath5k_rxbuf_setup(struct ath5k_softc *sc, struct ath5k_buf *bf) | |||
1249 | return 0; | 1246 | return 0; |
1250 | } | 1247 | } |
1251 | 1248 | ||
1249 | static enum ath5k_pkt_type get_hw_packet_type(struct sk_buff *skb) | ||
1250 | { | ||
1251 | struct ieee80211_hdr *hdr; | ||
1252 | enum ath5k_pkt_type htype; | ||
1253 | __le16 fc; | ||
1254 | |||
1255 | hdr = (struct ieee80211_hdr *)skb->data; | ||
1256 | fc = hdr->frame_control; | ||
1257 | |||
1258 | if (ieee80211_is_beacon(fc)) | ||
1259 | htype = AR5K_PKT_TYPE_BEACON; | ||
1260 | else if (ieee80211_is_probe_resp(fc)) | ||
1261 | htype = AR5K_PKT_TYPE_PROBE_RESP; | ||
1262 | else if (ieee80211_is_atim(fc)) | ||
1263 | htype = AR5K_PKT_TYPE_ATIM; | ||
1264 | else if (ieee80211_is_pspoll(fc)) | ||
1265 | htype = AR5K_PKT_TYPE_PSPOLL; | ||
1266 | else | ||
1267 | htype = AR5K_PKT_TYPE_NORMAL; | ||
1268 | |||
1269 | return htype; | ||
1270 | } | ||
1271 | |||
1252 | static int | 1272 | static int |
1253 | ath5k_txbuf_setup(struct ath5k_softc *sc, struct ath5k_buf *bf, | 1273 | ath5k_txbuf_setup(struct ath5k_softc *sc, struct ath5k_buf *bf, |
1254 | struct ath5k_txq *txq) | 1274 | struct ath5k_txq *txq) |
@@ -1303,7 +1323,8 @@ ath5k_txbuf_setup(struct ath5k_softc *sc, struct ath5k_buf *bf, | |||
1303 | sc->vif, pktlen, info)); | 1323 | sc->vif, pktlen, info)); |
1304 | } | 1324 | } |
1305 | ret = ah->ah_setup_tx_desc(ah, ds, pktlen, | 1325 | ret = ah->ah_setup_tx_desc(ah, ds, pktlen, |
1306 | ieee80211_get_hdrlen_from_skb(skb), AR5K_PKT_TYPE_NORMAL, | 1326 | ieee80211_get_hdrlen_from_skb(skb), |
1327 | get_hw_packet_type(skb), | ||
1307 | (sc->power_level * 2), | 1328 | (sc->power_level * 2), |
1308 | hw_rate, | 1329 | hw_rate, |
1309 | info->control.rates[0].count, keyidx, ah->ah_tx_ant, flags, | 1330 | info->control.rates[0].count, keyidx, ah->ah_tx_ant, flags, |
@@ -1332,7 +1353,6 @@ ath5k_txbuf_setup(struct ath5k_softc *sc, struct ath5k_buf *bf, | |||
1332 | 1353 | ||
1333 | spin_lock_bh(&txq->lock); | 1354 | spin_lock_bh(&txq->lock); |
1334 | list_add_tail(&bf->list, &txq->q); | 1355 | list_add_tail(&bf->list, &txq->q); |
1335 | sc->tx_stats[txq->qnum].len++; | ||
1336 | if (txq->link == NULL) /* is this first packet? */ | 1356 | if (txq->link == NULL) /* is this first packet? */ |
1337 | ath5k_hw_set_txdp(ah, txq->qnum, bf->daddr); | 1357 | ath5k_hw_set_txdp(ah, txq->qnum, bf->daddr); |
1338 | else /* no, so only link it */ | 1358 | else /* no, so only link it */ |
@@ -1581,7 +1601,6 @@ ath5k_txq_drainq(struct ath5k_softc *sc, struct ath5k_txq *txq) | |||
1581 | ath5k_txbuf_free(sc, bf); | 1601 | ath5k_txbuf_free(sc, bf); |
1582 | 1602 | ||
1583 | spin_lock_bh(&sc->txbuflock); | 1603 | spin_lock_bh(&sc->txbuflock); |
1584 | sc->tx_stats[txq->qnum].len--; | ||
1585 | list_move_tail(&bf->list, &sc->txbuf); | 1604 | list_move_tail(&bf->list, &sc->txbuf); |
1586 | sc->txbuf_len++; | 1605 | sc->txbuf_len++; |
1587 | spin_unlock_bh(&sc->txbuflock); | 1606 | spin_unlock_bh(&sc->txbuflock); |
@@ -2011,10 +2030,8 @@ ath5k_tx_processq(struct ath5k_softc *sc, struct ath5k_txq *txq) | |||
2011 | } | 2030 | } |
2012 | 2031 | ||
2013 | ieee80211_tx_status(sc->hw, skb); | 2032 | ieee80211_tx_status(sc->hw, skb); |
2014 | sc->tx_stats[txq->qnum].count++; | ||
2015 | 2033 | ||
2016 | spin_lock(&sc->txbuflock); | 2034 | spin_lock(&sc->txbuflock); |
2017 | sc->tx_stats[txq->qnum].len--; | ||
2018 | list_move_tail(&bf->list, &sc->txbuf); | 2035 | list_move_tail(&bf->list, &sc->txbuf); |
2019 | sc->txbuf_len++; | 2036 | sc->txbuf_len++; |
2020 | spin_unlock(&sc->txbuflock); | 2037 | spin_unlock(&sc->txbuflock); |
@@ -3116,17 +3133,6 @@ ath5k_get_stats(struct ieee80211_hw *hw, | |||
3116 | return 0; | 3133 | return 0; |
3117 | } | 3134 | } |
3118 | 3135 | ||
3119 | static int | ||
3120 | ath5k_get_tx_stats(struct ieee80211_hw *hw, | ||
3121 | struct ieee80211_tx_queue_stats *stats) | ||
3122 | { | ||
3123 | struct ath5k_softc *sc = hw->priv; | ||
3124 | |||
3125 | memcpy(stats, &sc->tx_stats, sizeof(sc->tx_stats)); | ||
3126 | |||
3127 | return 0; | ||
3128 | } | ||
3129 | |||
3130 | static u64 | 3136 | static u64 |
3131 | ath5k_get_tsf(struct ieee80211_hw *hw) | 3137 | ath5k_get_tsf(struct ieee80211_hw *hw) |
3132 | { | 3138 | { |
diff --git a/drivers/net/wireless/ath/ath5k/base.h b/drivers/net/wireless/ath/ath5k/base.h index 952b3a21bbc3..7e1a88a5abdb 100644 --- a/drivers/net/wireless/ath/ath5k/base.h +++ b/drivers/net/wireless/ath/ath5k/base.h | |||
@@ -117,7 +117,6 @@ struct ath5k_softc { | |||
117 | struct pci_dev *pdev; /* for dma mapping */ | 117 | struct pci_dev *pdev; /* for dma mapping */ |
118 | void __iomem *iobase; /* address of the device */ | 118 | void __iomem *iobase; /* address of the device */ |
119 | struct mutex lock; /* dev-level lock */ | 119 | struct mutex lock; /* dev-level lock */ |
120 | struct ieee80211_tx_queue_stats tx_stats[AR5K_NUM_TX_QUEUES]; | ||
121 | struct ieee80211_low_level_stats ll_stats; | 120 | struct ieee80211_low_level_stats ll_stats; |
122 | struct ieee80211_hw *hw; /* IEEE 802.11 common */ | 121 | struct ieee80211_hw *hw; /* IEEE 802.11 common */ |
123 | struct ieee80211_supported_band sbands[IEEE80211_NUM_BANDS]; | 122 | struct ieee80211_supported_band sbands[IEEE80211_NUM_BANDS]; |