All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stanislaw Gruszka <sgruszka@redhat.com>
To: Oleksij Rempel <linux@rempel-privat.de>
Cc: ath9k-devel@venema.h4ckr.net, linux-wireless@vger.kernel.org
Subject: Re: [RFC/RFT] ath9k_htc: avoid scheduling while atomic on sta_rc_update
Date: Fri, 31 Jan 2014 20:38:50 +0100	[thread overview]
Message-ID: <20140131193850.GC7648@redhat.com> (raw)
In-Reply-To: <52EBEA45.5090606@rempel-privat.de>

On Fri, Jan 31, 2014 at 07:24:05PM +0100, Oleksij Rempel wrote:
> I have different HW. How can trigger sta_rc_update?

Below patch should trigger it when any management frame is received
from know sta and print information about it. 

Thanks
Stanislaw

diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_main.c b/drivers/net/wireless/ath/ath9k/htc_drv_main.c
index c9254a6..5cfc98c 100644
--- a/drivers/net/wireless/ath/ath9k/htc_drv_main.c
+++ b/drivers/net/wireless/ath/ath9k/htc_drv_main.c
@@ -1346,9 +1346,7 @@ static void ath9k_htc_sta_rc_update(struct ieee80211_hw *hw,
 {
 	struct ath9k_htc_sta *ista = (struct ath9k_htc_sta *) sta->drv_priv;
 
-	if (!(changed & IEEE80211_RC_SUPP_RATES_CHANGED))
-		return;
-
+	printk("%s: schedule work\n", __func__);
 	schedule_work(&ista->rc_update_work);
 }
 
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
index c24ca0d..642b326 100644
--- a/net/mac80211/rx.c
+++ b/net/mac80211/rx.c
@@ -2847,8 +2847,10 @@ ieee80211_rx_h_mgmt(struct ieee80211_rx_data *rx)
 	rx->skb->pkt_type = IEEE80211_SDATA_QUEUE_TYPE_FRAME;
 	skb_queue_tail(&sdata->skb_queue, rx->skb);
 	ieee80211_queue_work(&rx->local->hw, &sdata->work);
-	if (rx->sta)
+	if (rx->sta) {
 		rx->sta->rx_packets++;
+		drv_sta_rc_update(rx->local, rx->sta->sdata, &rx->sta->sta, 0);
+	}
 
 	return RX_QUEUED;
 }


WARNING: multiple messages have this Message-ID (diff)
From: Stanislaw Gruszka <sgruszka@redhat.com>
To: ath9k-devel@lists.ath9k.org
Subject: [ath9k-devel] [RFC/RFT] ath9k_htc: avoid scheduling while atomic on sta_rc_update
Date: Fri, 31 Jan 2014 20:38:50 +0100	[thread overview]
Message-ID: <20140131193850.GC7648@redhat.com> (raw)
In-Reply-To: <52EBEA45.5090606@rempel-privat.de>

On Fri, Jan 31, 2014 at 07:24:05PM +0100, Oleksij Rempel wrote:
> I have different HW. How can trigger sta_rc_update?

Below patch should trigger it when any management frame is received
from know sta and print information about it. 

Thanks
Stanislaw

diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_main.c b/drivers/net/wireless/ath/ath9k/htc_drv_main.c
index c9254a6..5cfc98c 100644
--- a/drivers/net/wireless/ath/ath9k/htc_drv_main.c
+++ b/drivers/net/wireless/ath/ath9k/htc_drv_main.c
@@ -1346,9 +1346,7 @@ static void ath9k_htc_sta_rc_update(struct ieee80211_hw *hw,
 {
 	struct ath9k_htc_sta *ista = (struct ath9k_htc_sta *) sta->drv_priv;
 
-	if (!(changed & IEEE80211_RC_SUPP_RATES_CHANGED))
-		return;
-
+	printk("%s: schedule work\n", __func__);
 	schedule_work(&ista->rc_update_work);
 }
 
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
index c24ca0d..642b326 100644
--- a/net/mac80211/rx.c
+++ b/net/mac80211/rx.c
@@ -2847,8 +2847,10 @@ ieee80211_rx_h_mgmt(struct ieee80211_rx_data *rx)
 	rx->skb->pkt_type = IEEE80211_SDATA_QUEUE_TYPE_FRAME;
 	skb_queue_tail(&sdata->skb_queue, rx->skb);
 	ieee80211_queue_work(&rx->local->hw, &sdata->work);
-	if (rx->sta)
+	if (rx->sta) {
 		rx->sta->rx_packets++;
+		drv_sta_rc_update(rx->local, rx->sta->sdata, &rx->sta->sta, 0);
+	}
 
 	return RX_QUEUED;
 }

  reply	other threads:[~2014-01-31 19:37 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-31 13:37 [RFC/RFT] ath9k_htc: avoid scheduling while atomic on sta_rc_update Stanislaw Gruszka
2014-01-31 13:37 ` [ath9k-devel] " Stanislaw Gruszka
2014-01-31 18:24 ` Oleksij Rempel
2014-01-31 18:24   ` [ath9k-devel] " Oleksij Rempel
2014-01-31 19:38   ` Stanislaw Gruszka [this message]
2014-01-31 19:38     ` Stanislaw Gruszka
2014-02-02  9:02     ` Oleksij Rempel
2014-02-02  9:02       ` [ath9k-devel] " Oleksij Rempel
2014-02-03 10:39       ` Stanislaw Gruszka
2014-02-03 10:39         ` [ath9k-devel] " Stanislaw Gruszka

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140131193850.GC7648@redhat.com \
    --to=sgruszka@redhat.com \
    --cc=ath9k-devel@venema.h4ckr.net \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linux@rempel-privat.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.