On 01/09/2008 10:16 AM, Bruno Randolf wrote:
make ath5k_beacon_config() clearer and move timer configuration into a seperate
function. it will be needed later when we can detect HW merges.
Changes-licensed-under: 3-clause-BSD
Signed-off-by: Bruno Randolf <bruno@xxxxxxxxxxxxx>
---
drivers/net/wireless/ath5k/base.c | 105 +++++++++++++++++-------------------
1 files changed, 50 insertions(+), 55 deletions(-)
diff --git a/drivers/net/wireless/ath5k/base.c b/drivers/net/wireless/ath5k/base.c
index 92361df..4f1ff1a 100644
--- a/drivers/net/wireless/ath5k/base.c
+++ b/drivers/net/wireless/ath5k/base.c
[...]
+/*
+ * Configure the beacon timers and interrupts based on the operating mode
+ *
+ * When operating in station mode we want to receive a BMISS interrupt when we
+ * stop seeing beacons from the AP we've associated with so we can look for
+ * another AP to associate with.
+ *
+ * In IBSS mode we need to configure the beacon timers and use a self-linked tx
+ * descriptor if possible. If the hardware cannot deal with that we enable SWBA
+ * interrupts to send the beacons from the interrupt handler.
+ */
+static void
+ath5k_beacon_config(struct ath5k_softc *sc)
+{
+ struct ath5k_hw *ah = sc->ah;
- sc->bmisscount = 0;
- ath5k_hw_set_intr(ah, sc->imask);
+ ath5k_hw_set_intr(ah, 0);
+ sc->bmisscount = 0;
+
+ if (sc->opmode == IEEE80211_IF_TYPE_STA) {
+ sc->imask |= AR5K_INT_BMISS;
+ }
+ else if (sc->opmode == IEEE80211_IF_TYPE_IBSS) {
checkpatch doesn't like this, please put the else path next time on the same
line as } is.
the output:
WARNING: braces {} are not necessary for single statement blocks
#144: FILE: drivers/net/wireless/ath5k/base.c:2026:
+ if (sc->opmode == IEEE80211_IF_TYPE_STA) {
+ sc->imask |= AR5K_INT_BMISS;
+ }
ERROR: else should follow close brace '}'
#147: FILE: drivers/net/wireless/ath5k/base.c:2029:
+ }
+ else if (sc->opmode == IEEE80211_IF_TYPE_IBSS) {
total: 1 errors, 1 warnings, 130 lines checked
Your patch has style problems, please review. If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
-
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html