From 981db2f065cbba810c39290ac8906c2ae68f3b6b Mon Sep 17 00:00:00 2001 From: Dmitry Tarnyagin Date: Tue, 4 Oct 2011 18:17:07 +0200 Subject: cw1200: cw1200_sta_notify implementation was removed by mistake. Asleep map in the driver was not updated. Bug was introduced by following commit: "cw1200: Adaptation to U-APSD/AP support as on Thu, Sep 22, 2011". ST-Ericsson ID: 360749 Change-Id: I5005a91f20ebc182e92f13f94510fa16fd7846ae Signed-off-by: Dmitry Tarnyagin Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/33539 Reviewed-by: Bartosz MARKOWSKI Reviewed-by: Philippe LANGLAIS --- drivers/staging/cw1200/ap.c | 33 +++++++++++++++++++++++++++++---- drivers/staging/cw1200/ap.h | 3 --- drivers/staging/cw1200/main.c | 1 - 3 files changed, 29 insertions(+), 8 deletions(-) diff --git a/drivers/staging/cw1200/ap.c b/drivers/staging/cw1200/ap.c index 0e0947a4482..5e7177f85cf 100755 --- a/drivers/staging/cw1200/ap.c +++ b/drivers/staging/cw1200/ap.c @@ -80,10 +80,35 @@ int cw1200_sta_remove(struct ieee80211_hw *hw, struct ieee80211_vif *vif, return 0; } -void cw1200_sta_notify(struct ieee80211_hw *dev, struct ieee80211_vif *vif, - enum sta_notify_cmd notify_cmd, - struct ieee80211_sta *sta) +static void __cw1200_sta_notify(struct ieee80211_hw *dev, + struct ieee80211_vif *vif, + enum sta_notify_cmd notify_cmd, + struct ieee80211_sta *sta) { + struct cw1200_common *priv = dev->priv; + struct cw1200_sta_priv *sta_priv = + (struct cw1200_sta_priv *)&sta->drv_priv; + u32 bit = BIT(sta_priv->link_id); + + spin_lock_bh(&priv->buffered_multicasts_lock); + switch (notify_cmd) { + case STA_NOTIFY_SLEEP: + if (priv->buffered_multicasts && + !priv->sta_asleep_mask) + queue_work(priv->workqueue, + &priv->multicast_start_work); + priv->sta_asleep_mask |= bit; + break; + case STA_NOTIFY_AWAKE: + priv->sta_asleep_mask &= ~bit; + if (priv->tx_multicast && + !priv->sta_asleep_mask) + queue_work(priv->workqueue, + &priv->multicast_stop_work); + cw1200_bh_wakeup(priv); + break; + } + spin_unlock_bh(&priv->buffered_multicasts_lock); } static void __cw1200_ps_notify(struct cw1200_common *priv, @@ -96,7 +121,7 @@ static void __cw1200_ps_notify(struct cw1200_common *priv, priv->link_id_db[link_id - 1].ps = ps; if (sta) { - cw1200_sta_notify(priv->hw, priv->vif, + __cw1200_sta_notify(priv->hw, priv->vif, ps ? STA_NOTIFY_SLEEP : STA_NOTIFY_AWAKE, sta); ieee80211_sta_ps_transition_ni(sta, ps); } diff --git a/drivers/staging/cw1200/ap.h b/drivers/staging/cw1200/ap.h index 032f631a656..698c01d05ca 100644 --- a/drivers/staging/cw1200/ap.h +++ b/drivers/staging/cw1200/ap.h @@ -18,9 +18,6 @@ int cw1200_sta_add(struct ieee80211_hw *hw, struct ieee80211_vif *vif, struct ieee80211_sta *sta); int cw1200_sta_remove(struct ieee80211_hw *hw, struct ieee80211_vif *vif, struct ieee80211_sta *sta); -void cw1200_sta_notify(struct ieee80211_hw *dev, struct ieee80211_vif *vif, - enum sta_notify_cmd notify_cmd, - struct ieee80211_sta *sta); void cw1200_bss_info_changed(struct ieee80211_hw *dev, struct ieee80211_vif *vif, struct ieee80211_bss_conf *info, diff --git a/drivers/staging/cw1200/main.c b/drivers/staging/cw1200/main.c index a931a059f6f..c09b44fb367 100644 --- a/drivers/staging/cw1200/main.c +++ b/drivers/staging/cw1200/main.c @@ -207,7 +207,6 @@ static const struct ieee80211_ops cw1200_ops = { .tx = cw1200_tx, .hw_scan = cw1200_hw_scan, .set_tim = cw1200_set_tim, - .sta_notify = cw1200_sta_notify, .sta_add = cw1200_sta_add, .sta_remove = cw1200_sta_remove, .set_key = cw1200_set_key, -- cgit v1.2.3