Commit 2ac2927a authored by Bob Copeland's avatar Bob Copeland Committed by John W. Linville

ath5k: use correct packet type when transmitting

The hardware needs to know what type of frames are being
sent in order to fill in various fields, for example the
timestamp in probe responses (before this patch, it was
always 0).  Set it correctly when initializing the TX
descriptor.
Signed-off-by: default avatarBob Copeland <me@bobcopeland.com>
Cc: stable@kernel.org
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 05df4986
...@@ -541,7 +541,6 @@ struct ath5k_txq_info { ...@@ -541,7 +541,6 @@ struct ath5k_txq_info {
/* /*
* Transmit packet types. * Transmit packet types.
* used on tx control descriptor * used on tx control descriptor
* TODO: Use them inside base.c corectly
*/ */
enum ath5k_pkt_type { enum ath5k_pkt_type {
AR5K_PKT_TYPE_NORMAL = 0, AR5K_PKT_TYPE_NORMAL = 0,
......
...@@ -1246,6 +1246,29 @@ ath5k_rxbuf_setup(struct ath5k_softc *sc, struct ath5k_buf *bf) ...@@ -1246,6 +1246,29 @@ ath5k_rxbuf_setup(struct ath5k_softc *sc, struct ath5k_buf *bf)
return 0; return 0;
} }
static enum ath5k_pkt_type get_hw_packet_type(struct sk_buff *skb)
{
struct ieee80211_hdr *hdr;
enum ath5k_pkt_type htype;
__le16 fc;
hdr = (struct ieee80211_hdr *)skb->data;
fc = hdr->frame_control;
if (ieee80211_is_beacon(fc))
htype = AR5K_PKT_TYPE_BEACON;
else if (ieee80211_is_probe_resp(fc))
htype = AR5K_PKT_TYPE_PROBE_RESP;
else if (ieee80211_is_atim(fc))
htype = AR5K_PKT_TYPE_ATIM;
else if (ieee80211_is_pspoll(fc))
htype = AR5K_PKT_TYPE_PSPOLL;
else
htype = AR5K_PKT_TYPE_NORMAL;
return htype;
}
static int static int
ath5k_txbuf_setup(struct ath5k_softc *sc, struct ath5k_buf *bf, ath5k_txbuf_setup(struct ath5k_softc *sc, struct ath5k_buf *bf,
struct ath5k_txq *txq) struct ath5k_txq *txq)
...@@ -1300,7 +1323,8 @@ ath5k_txbuf_setup(struct ath5k_softc *sc, struct ath5k_buf *bf, ...@@ -1300,7 +1323,8 @@ ath5k_txbuf_setup(struct ath5k_softc *sc, struct ath5k_buf *bf,
sc->vif, pktlen, info)); sc->vif, pktlen, info));
} }
ret = ah->ah_setup_tx_desc(ah, ds, pktlen, ret = ah->ah_setup_tx_desc(ah, ds, pktlen,
ieee80211_get_hdrlen_from_skb(skb), AR5K_PKT_TYPE_NORMAL, ieee80211_get_hdrlen_from_skb(skb),
get_hw_packet_type(skb),
(sc->power_level * 2), (sc->power_level * 2),
hw_rate, hw_rate,
info->control.rates[0].count, keyidx, ah->ah_tx_ant, flags, info->control.rates[0].count, keyidx, ah->ah_tx_ant, flags,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment