diff options
author | Jouni Malinen <jouni.malinen@atheros.com> | 2008-08-11 07:01:50 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-08-29 16:24:03 -0400 |
commit | 147583c057c43095925b5f331fe304f2d5b997ba (patch) | |
tree | a7fc21673b4090ce371e5fd130b934131ab3b0f0 /drivers | |
parent | 580f0b8a6dc1cb4d32c351a507d1c1d319bdc1eb (diff) |
ath9k: Assign seq# when mac80211 requests this
Use TX control flag IEEE80211_TX_CTL_ASSIGN_SEQ as a request to update
the seq# for the frames. This will likely require some further cleanup
to get seq# correctly for Beacons vs. other frames and also potentially
for multiple BSSes. Anyway, this is better than ending up sending out
most frames with seq# 0.
Signed-off-by: Jouni Malinen <jouni.malinen@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/wireless/ath9k/beacon.c | 12 | ||||
-rw-r--r-- | drivers/net/wireless/ath9k/core.h | 1 | ||||
-rw-r--r-- | drivers/net/wireless/ath9k/main.c | 14 |
3 files changed, 27 insertions, 0 deletions
diff --git a/drivers/net/wireless/ath9k/beacon.c b/drivers/net/wireless/ath9k/beacon.c index 8abcd3e8a301..a020f9a21544 100644 --- a/drivers/net/wireless/ath9k/beacon.c +++ b/drivers/net/wireless/ath9k/beacon.c | |||
@@ -209,6 +209,7 @@ static struct ath_buf *ath_beacon_generate(struct ath_softc *sc, int if_id) | |||
209 | int is_beacon_dtim = 0; | 209 | int is_beacon_dtim = 0; |
210 | struct ath_txq *cabq; | 210 | struct ath_txq *cabq; |
211 | struct ath_txq *mcastq; | 211 | struct ath_txq *mcastq; |
212 | struct ieee80211_tx_info *info; | ||
212 | avp = sc->sc_vaps[if_id]; | 213 | avp = sc->sc_vaps[if_id]; |
213 | 214 | ||
214 | mcastq = &avp->av_mcastq; | 215 | mcastq = &avp->av_mcastq; |
@@ -233,6 +234,17 @@ static struct ath_buf *ath_beacon_generate(struct ath_softc *sc, int if_id) | |||
233 | bf->bf_mpdu = skb; | 234 | bf->bf_mpdu = skb; |
234 | if (skb == NULL) | 235 | if (skb == NULL) |
235 | return NULL; | 236 | return NULL; |
237 | info = IEEE80211_SKB_CB(skb); | ||
238 | if (info->flags & IEEE80211_TX_CTL_ASSIGN_SEQ) { | ||
239 | /* | ||
240 | * TODO: make sure the seq# gets assigned properly (vs. other | ||
241 | * TX frames) | ||
242 | */ | ||
243 | struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data; | ||
244 | sc->seq_no += 0x10; | ||
245 | hdr->seq_ctrl &= cpu_to_le16(IEEE80211_SCTL_FRAG); | ||
246 | hdr->seq_ctrl |= cpu_to_le16(sc->seq_no); | ||
247 | } | ||
236 | bf->bf_buf_addr = bf->bf_dmacontext = | 248 | bf->bf_buf_addr = bf->bf_dmacontext = |
237 | pci_map_single(sc->pdev, skb->data, | 249 | pci_map_single(sc->pdev, skb->data, |
238 | skb_end_pointer(skb) - skb->head, | 250 | skb_end_pointer(skb) - skb->head, |
diff --git a/drivers/net/wireless/ath9k/core.h b/drivers/net/wireless/ath9k/core.h index bf7319401889..c242942bbc18 100644 --- a/drivers/net/wireless/ath9k/core.h +++ b/drivers/net/wireless/ath9k/core.h | |||
@@ -965,6 +965,7 @@ struct ath_softc { | |||
965 | u32 sc_txqsetup; | 965 | u32 sc_txqsetup; |
966 | u32 sc_txintrperiod; /* tx interrupt batching */ | 966 | u32 sc_txintrperiod; /* tx interrupt batching */ |
967 | int sc_haltype2q[ATH9K_WME_AC_VO+1]; /* HAL WME AC -> h/w qnum */ | 967 | int sc_haltype2q[ATH9K_WME_AC_VO+1]; /* HAL WME AC -> h/w qnum */ |
968 | u16 seq_no; /* TX sequence number */ | ||
968 | 969 | ||
969 | /* Beacon */ | 970 | /* Beacon */ |
970 | struct ath9k_tx_queue_info sc_beacon_qi; | 971 | struct ath9k_tx_queue_info sc_beacon_qi; |
diff --git a/drivers/net/wireless/ath9k/main.c b/drivers/net/wireless/ath9k/main.c index 4b61666261e3..8fbde897406e 100644 --- a/drivers/net/wireless/ath9k/main.c +++ b/drivers/net/wireless/ath9k/main.c | |||
@@ -368,6 +368,20 @@ static int ath9k_tx(struct ieee80211_hw *hw, | |||
368 | { | 368 | { |
369 | struct ath_softc *sc = hw->priv; | 369 | struct ath_softc *sc = hw->priv; |
370 | int hdrlen, padsize; | 370 | int hdrlen, padsize; |
371 | struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); | ||
372 | |||
373 | /* | ||
374 | * As a temporary workaround, assign seq# here; this will likely need | ||
375 | * to be cleaned up to work better with Beacon transmission and virtual | ||
376 | * BSSes. | ||
377 | */ | ||
378 | if (info->flags & IEEE80211_TX_CTL_ASSIGN_SEQ) { | ||
379 | struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data; | ||
380 | if (info->flags & IEEE80211_TX_CTL_FIRST_FRAGMENT) | ||
381 | sc->seq_no += 0x10; | ||
382 | hdr->seq_ctrl &= cpu_to_le16(IEEE80211_SCTL_FRAG); | ||
383 | hdr->seq_ctrl |= cpu_to_le16(sc->seq_no); | ||
384 | } | ||
371 | 385 | ||
372 | /* Add the padding after the header if this is not already done */ | 386 | /* Add the padding after the header if this is not already done */ |
373 | hdrlen = ieee80211_get_hdrlen_from_skb(skb); | 387 | hdrlen = ieee80211_get_hdrlen_from_skb(skb); |