Skip to content

Commit

Permalink
mac80211: invoke set_tim() callback after setting own TIM info
Browse files Browse the repository at this point in the history
Drivers should be allowed to simply get a complete new beacon when
set_tim() is invoked (and set_tim() is required for drivers that
just want a beacon template!), so we need to update our own TIM
bitmap before calling set_tim() so that getting the beacon will
now get an already updated beacon.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
  • Loading branch information
Johannes Berg authored and John W. Linville committed Feb 29, 2008
1 parent 013b73f commit d225924
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions net/mac80211/rx.c
Original file line number Diff line number Diff line change
Expand Up @@ -600,10 +600,10 @@ static int ap_sta_ps_end(struct net_device *dev, struct sta_info *sta)
atomic_dec(&sdata->bss->num_sta_ps);
sta->flags &= ~(WLAN_STA_PS | WLAN_STA_TIM | WLAN_STA_PSPOLL);
if (!skb_queue_empty(&sta->ps_tx_buf)) {
if (local->ops->set_tim)
local->ops->set_tim(local_to_hw(local), sta->aid, 0);
if (sdata->bss)
bss_tim_clear(local, sdata->bss, sta->aid);
if (local->ops->set_tim)
local->ops->set_tim(local_to_hw(local), sta->aid, 0);
}
#ifdef CONFIG_MAC80211_VERBOSE_PS_DEBUG
printk(KERN_DEBUG "%s: STA %s aid %d exits power save mode\n",
Expand Down Expand Up @@ -947,11 +947,11 @@ ieee80211_rx_h_ps_poll(struct ieee80211_txrx_data *rx)
dev_queue_xmit(skb);

if (no_pending_pkts) {
if (rx->sdata->bss)
bss_tim_clear(rx->local, rx->sdata->bss, rx->sta->aid);
if (rx->local->ops->set_tim)
rx->local->ops->set_tim(local_to_hw(rx->local),
rx->sta->aid, 0);
if (rx->sdata->bss)
bss_tim_clear(rx->local, rx->sdata->bss, rx->sta->aid);
}
#ifdef CONFIG_MAC80211_VERBOSE_PS_DEBUG
} else if (!rx->u.rx.sent_ps_buffered) {
Expand Down
4 changes: 2 additions & 2 deletions net/mac80211/sta_info.c
Original file line number Diff line number Diff line change
Expand Up @@ -396,11 +396,11 @@ void sta_info_remove_aid_ptr(struct sta_info *sta)

sdata = IEEE80211_DEV_TO_SUB_IF(sta->dev);

if (sdata->bss)
__bss_tim_clear(sdata->bss, sta->aid);
if (sdata->local->ops->set_tim)
sdata->local->ops->set_tim(local_to_hw(sdata->local),
sta->aid, 0);
if (sdata->bss)
__bss_tim_clear(sdata->bss, sta->aid);
}


Expand Down
4 changes: 2 additions & 2 deletions net/mac80211/tx.c
Original file line number Diff line number Diff line change
Expand Up @@ -419,11 +419,11 @@ ieee80211_tx_h_unicast_ps_buf(struct ieee80211_txrx_data *tx)
tx->local->total_ps_buffered++;
/* Queue frame to be sent after STA sends an PS Poll frame */
if (skb_queue_empty(&sta->ps_tx_buf)) {
if (tx->sdata->bss)
bss_tim_set(tx->local, tx->sdata->bss, sta->aid);
if (tx->local->ops->set_tim)
tx->local->ops->set_tim(local_to_hw(tx->local),
sta->aid, 1);
if (tx->sdata->bss)
bss_tim_set(tx->local, tx->sdata->bss, sta->aid);
}
pkt_data = (struct ieee80211_tx_packet_data *)tx->skb->cb;
pkt_data->jiffies = jiffies;
Expand Down

0 comments on commit d225924

Please sign in to comment.