linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bruno Randolf <br1@einfach.org>
To: linville@tuxdriver.com
Cc: linux-wireless@vger.kernel.org, bob@bobcopeland.com,
	ath5k-devel@lists.ath5k.org, lrodriguez@atheros.com,
	mickflemm@gmail.com
Subject: [PATCH 02/10] ath5k: remove the use of SWI interrupt
Date: Thu, 25 Mar 2010 14:49:09 +0900	[thread overview]
Message-ID: <20100325054909.10697.16867.stgit@tt-desk> (raw)
In-Reply-To: <20100325054603.10697.48915.stgit@tt-desk>

We don't need to generate a software interrupt (SWI) just to schedule a tasklet
- we can just schedule the tasklet directly.

Rename constants, names, etc to reflect the fact that we don't use SWI any more.

Also move the flag handling into the tasklet and prepare it to behave correctly
when there are multiple flags present.

Signed-off-by: Bruno Randolf <br1@einfach.org>
---
 drivers/net/wireless/ath/ath5k/ath5k.h |   12 ++++++------
 drivers/net/wireless/ath/ath5k/base.c  |   11 +++--------
 drivers/net/wireless/ath/ath5k/phy.c   |    3 +--
 3 files changed, 10 insertions(+), 16 deletions(-)

diff --git a/drivers/net/wireless/ath/ath5k/ath5k.h b/drivers/net/wireless/ath/ath5k/ath5k.h
index a3019ee..d84ccde 100644
--- a/drivers/net/wireless/ath/ath5k/ath5k.h
+++ b/drivers/net/wireless/ath/ath5k/ath5k.h
@@ -890,10 +890,10 @@ enum ath5k_int {
 	AR5K_INT_NOCARD	= 0xffffffff
 };
 
-/* Software interrupts used for calibration */
-enum ath5k_software_interrupt {
-	AR5K_SWI_FULL_CALIBRATION = 0x01,
-	AR5K_SWI_SHORT_CALIBRATION = 0x02,
+/* mask which calibration is active at the moment */
+enum ath5k_calibration_mask {
+	AR5K_CALIBRATION_FULL = 0x01,
+	AR5K_CALIBRATION_SHORT = 0x02,
 };
 
 /*
@@ -1102,8 +1102,8 @@ struct ath5k_hw {
 	/* Calibration timestamp */
 	unsigned long		ah_cal_tstamp;
 
-	/* Software interrupt mask */
-	u8			ah_swi_mask;
+	/* Calibration mask */
+	u8			ah_cal_mask;
 
 	/*
 	 * Function pointers
diff --git a/drivers/net/wireless/ath/ath5k/base.c b/drivers/net/wireless/ath/ath5k/base.c
index 39d5800..539a6d5 100644
--- a/drivers/net/wireless/ath/ath5k/base.c
+++ b/drivers/net/wireless/ath/ath5k/base.c
@@ -2507,7 +2507,7 @@ ath5k_init(struct ath5k_softc *sc)
 	sc->curband = &sc->sbands[sc->curchan->band];
 	sc->imask = AR5K_INT_RXOK | AR5K_INT_RXERR | AR5K_INT_RXEOL |
 		AR5K_INT_RXORN | AR5K_INT_TXDESC | AR5K_INT_TXEOL |
-		AR5K_INT_FATAL | AR5K_INT_GLOBAL | AR5K_INT_SWI;
+		AR5K_INT_FATAL | AR5K_INT_GLOBAL;
 	ret = ath5k_reset(sc, NULL);
 	if (ret)
 		goto done;
@@ -2673,9 +2673,6 @@ ath5k_intr(int irq, void *dev_id)
 			if (status & AR5K_INT_BMISS) {
 				/* TODO */
 			}
-			if (status & AR5K_INT_SWI) {
-				tasklet_schedule(&sc->calib);
-			}
 			if (status & AR5K_INT_MIB) {
 				/*
 				 * These stats are also used for ANI i think
@@ -2716,8 +2713,7 @@ ath5k_tasklet_calibrate(unsigned long data)
 	struct ath5k_hw *ah = sc->ah;
 
 	/* Only full calibration for now */
-	if (ah->ah_swi_mask != AR5K_SWI_FULL_CALIBRATION)
-		return;
+	ah->ah_cal_mask |= AR5K_CALIBRATION_FULL;
 
 	/* Stop queues so that calibration
 	 * doesn't interfere with tx */
@@ -2740,11 +2736,10 @@ ath5k_tasklet_calibrate(unsigned long data)
 			ieee80211_frequency_to_channel(
 				sc->curchan->center_freq));
 
-	ah->ah_swi_mask = 0;
-
 	/* Wake queues */
 	ieee80211_wake_queues(sc->hw);
 
+	ah->ah_cal_mask &= ~AR5K_CALIBRATION_FULL;
 }
 
 
diff --git a/drivers/net/wireless/ath/ath5k/phy.c b/drivers/net/wireless/ath/ath5k/phy.c
index 07f59b1..cbdc511 100644
--- a/drivers/net/wireless/ath/ath5k/phy.c
+++ b/drivers/net/wireless/ath/ath5k/phy.c
@@ -1119,8 +1119,7 @@ ath5k_hw_calibration_poll(struct ath5k_hw *ah)
 	 * interrupt (bit gets auto-cleared) */
 	if (time_is_before_eq_jiffies(ah->ah_cal_tstamp + cal_intval)) {
 		ah->ah_cal_tstamp = jiffies;
-		ah->ah_swi_mask = AR5K_SWI_FULL_CALIBRATION;
-		AR5K_REG_ENABLE_BITS(ah, AR5K_CR, AR5K_CR_SWI);
+		tasklet_schedule(&ah->ah_sc->calib);
 	}
 }
 


  parent reply	other threads:[~2010-03-25  5:49 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-25  5:48 [PATCH 00/10] ANI for ath5k Bruno Randolf
2010-03-25  5:49 ` [PATCH 01/10] ath5k: remove static calibration interval variable Bruno Randolf
2010-03-25  5:49 ` Bruno Randolf [this message]
2010-03-25  5:49 ` [PATCH 03/10] ath5k: optimize ath5k_hw_calibration_poll Bruno Randolf
2010-03-25  5:49 ` [PATCH 04/10] ath5k: move ath5k_hw_calibration_poll to base.c Bruno Randolf
2010-03-25  5:49 ` [PATCH 05/10] ath5k: keep beacon RSSI average Bruno Randolf
2010-03-25  5:49 ` [PATCH 06/10] ath5k: initialize default noise floor Bruno Randolf
2010-03-25  5:49 ` [PATCH 07/10] ath5k: simplify MIB counters Bruno Randolf
2010-03-25  5:49 ` [PATCH 08/10] ath5k: update phy errors codes Bruno Randolf
2010-03-25  5:49 ` [PATCH 09/10] ath5k: add capability flag for phyerror counters Bruno Randolf
2010-03-25  5:49 ` [PATCH 10/10] ath5k: Adaptive Noise Immunity (ANI) Implementation Bruno Randolf
2010-03-25 10:59   ` Joerg Pommnitz
2010-03-26  0:18     ` Bruno Randolf
2010-03-29  2:02   ` [ath5k-devel] " Bob Copeland
2010-03-29  2:26     ` Bruno Randolf
2010-03-25 21:10 ` [ath5k-devel] [PATCH 00/10] ANI for ath5k Derek Smithies
2010-03-25 21:13   ` Luis R. Rodriguez
2010-03-26  0:27     ` Bruno Randolf
2010-03-26  0:44       ` Luis R. Rodriguez
2010-03-26  0:53         ` Bruno Randolf
2010-03-26  1:06           ` Luis R. Rodriguez
2010-03-26  1:21       ` Derek Smithies
2010-03-26  1:32         ` Luis R. Rodriguez
2010-03-26  1:46         ` Bruno Randolf
2010-03-26 20:34           ` Derek Smithies
2010-03-27  5:18             ` Bruno Randolf

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=20100325054909.10697.16867.stgit@tt-desk \
    --to=br1@einfach.org \
    --cc=ath5k-devel@lists.ath5k.org \
    --cc=bob@bobcopeland.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    --cc=lrodriguez@atheros.com \
    --cc=mickflemm@gmail.com \
    /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 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).