linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] brcmsmac: ap mode: update beacon when TIM changes
@ 2018-09-11 17:26 Ali MJ Al-Nasrawy
  2018-09-20 12:04 ` Kalle Valo
                   ` (4 more replies)
  0 siblings, 5 replies; 11+ messages in thread
From: Ali MJ Al-Nasrawy @ 2018-09-11 17:26 UTC (permalink / raw)
  To: Arend van Spriel
  Cc: linux-wireless, brcm80211-dev-list.pdl, brcm80211-dev-list,
	Ali MJ Al-Nasrawy

Beacons+TIM are created/updated for fw beaconing only when BSS_CHANGED_BEACON.
This is not compliant with power-saving stations. 
Fix it by updating beacon templates on mac80211 set_tim callback.
Adresses the issue in:
https://marc.info/?i=20180911163534.21312d08%20()%20manjaro

Signed-off-by: Ali MJ Al-Nasrawy <alimjalnasrawy@gmail.com>
---
 .../broadcom/brcm80211/brcmsmac/mac80211_if.c | 23 +++++++++++++++++++
 .../broadcom/brcm80211/brcmsmac/main.h        |  2 ++
 2 files changed, 25 insertions(+)

diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmsmac/mac80211_if.c b/drivers/net/wireless/broadcom/brcm80211/brcmsmac/mac80211_if.c
index ddfdfe1..ee92bb5 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmsmac/mac80211_if.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmsmac/mac80211_if.c
@@ -502,6 +502,7 @@ brcms_ops_add_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif)
 	}
 
 	spin_lock_bh(&wl->lock);
+	wl->wlc->vif = vif;
 	wl->mute_tx = false;
 	brcms_c_mute(wl->wlc, false);
 	if (vif->type == NL80211_IFTYPE_STATION)
@@ -937,6 +938,27 @@ static void brcms_ops_set_tsf(struct ieee80211_hw *hw,
 	spin_unlock_bh(&wl->lock);
 }
 
+static int brcms_ops_beacon_set_tim(struct ieee80211_hw *hw,
+				 struct ieee80211_sta *sta, bool set)
+{
+	/*FIXME: this may be more efficiently handled by delegating
+	 beacon upload to the beacon interrupt handler*/
+	struct brcms_info *wl = hw->priv;
+	struct sk_buff *beacon;
+	u16 tim_offset = 0;
+	
+	beacon = ieee80211_beacon_get_tim(hw, wl->wlc->vif,
+					  &tim_offset, NULL);
+	if (beacon){
+		spin_lock_bh(&wl->lock);
+		brcms_c_set_new_beacon(wl->wlc, beacon, tim_offset,
+				       wl->wlc->vif->bss_conf.dtim_period);
+		spin_unlock_bh(&wl->lock);
+	}
+	
+	return 0;
+}
+
 static const struct ieee80211_ops brcms_ops = {
 	.tx = brcms_ops_tx,
 	.start = brcms_ops_start,
@@ -955,6 +977,7 @@ static const struct ieee80211_ops brcms_ops = {
 	.flush = brcms_ops_flush,
 	.get_tsf = brcms_ops_get_tsf,
 	.set_tsf = brcms_ops_set_tsf,
+	.set_tim = brcms_ops_beacon_set_tim,
 };
 
 void brcms_dpc(unsigned long data)
diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmsmac/main.h b/drivers/net/wireless/broadcom/brcm80211/brcmsmac/main.h
index c4d135c..e3939fc 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmsmac/main.h
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmsmac/main.h
@@ -568,6 +568,8 @@ struct brcms_c_info {
 	u16 beacon_tim_offset;
 	u16 beacon_dtim_period;
 	struct sk_buff *probe_resp;
+	
+	struct ieee80211_vif *vif;
 };
 
 /* antsel module specific state */
-- 
2.18.0

^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2018-10-13 17:01 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-09-11 17:26 [PATCH] brcmsmac: ap mode: update beacon when TIM changes Ali MJ Al-Nasrawy
2018-09-20 12:04 ` Kalle Valo
2018-09-22  9:07 ` Arend van Spriel
2018-09-22 13:17   ` Ali MJ Al-Nasrawy
2018-09-22 13:41 ` [PATCH v2] brcmsmac: AP " Ali MJ Al-Nasrawy
2018-09-23  9:54 ` [PATCH v3] " Ali MJ Al-Nasrawy
2018-09-24  8:15   ` Arend van Spriel
2018-09-24 10:24     ` Ali MJ Al-Nasrawy
2018-09-26  9:04   ` Ali MJ Al-Nasrawy
2018-10-03 16:21 ` [PATCH v4] " Ali MJ Al-Nasrawy
2018-10-13 17:01   ` Kalle Valo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).