linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Steve Brown <sbrown@cortland.com>
To: Bob Copeland <me@bobcopeland.com>
Cc: ath5k-devel@venema.h4ckr.net, linux-wireless@vger.kernel.org
Subject: Re: OOPS in ath5k when setting coverage class
Date: Thu, 17 Jun 2010 12:49:51 -0600	[thread overview]
Message-ID: <4C1A6E4F.6000708@cortland.com> (raw)
In-Reply-To: <AANLkTil-qhJ7fO3RNm4xwG1fA6uKeTkrD352ICU-z8Ab@mail.gmail.com>

On 06/17/2010 11:39 AM, Bob Copeland wrote:
> On Wed, Jun 16, 2010 at 3:32 PM, Steve Brown<sbrown@cortland.com>  wrote:
>    
>>  From the printk's, it appears that ah->ah_current_channel isn't set at the
>> time of the callback.
>>
>> The following produces the oops with compat-wireless-2010-06-10.
>>      
> Thanks for the report - your analysis looks spot on.
> I'll take a look tonight.
>
>    
I went a little further and tested the following patch.

If it makes sense to you, I'll submit it.

Steve

---

--- a/drivers/net/wireless/ath/ath5k/pcu.c.orig    2010-06-17 
10:41:29.070150186 -0600
+++ b/drivers/net/wireless/ath/ath5k/pcu.c    2010-06-17 
10:56:27.529275091 -0600
@@ -251,7 +251,6 @@
  static unsigned int ath5k_hw_get_default_slottime(struct ath5k_hw *ah)
  {
      struct ieee80211_channel *channel = ah->ah_current_channel;
-
      if (channel->hw_value & CHANNEL_TURBO)
          return 6; /* both turbo modes */

@@ -846,13 +845,23 @@
  void ath5k_hw_set_coverage_class(struct ath5k_hw *ah, u8 coverage_class)
  {
      /* As defined by IEEE 802.11-2007 17.3.8.6 */
-    int slot_time = ath5k_hw_get_default_slottime(ah) + 3 * coverage_class;
-    int ack_timeout = ath5k_hw_get_default_sifs(ah) + slot_time;
-    int cts_timeout = ack_timeout;
+    int slot_time, ack_timeout, cts_timeout;
+
+    ah->ah_coverage_class = coverage_class;

+    /*
+     * If channel isn't set, just exit.
+     * We will be called again on a channel change.
+     */
+    if (ah->ah_current_channel == NULL)
+        return;
+
+    slot_time = ath5k_hw_get_default_slottime(ah) + 3 * coverage_class;
      ath5k_hw_set_slot_time(ah, slot_time);
+
+    ack_timeout = ath5k_hw_get_default_sifs(ah) + slot_time;
      ath5k_hw_set_ack_timeout(ah, ack_timeout);
-    ath5k_hw_set_cts_timeout(ah, cts_timeout);

-    ah->ah_coverage_class = coverage_class;
+    cts_timeout = ack_timeout;
+    ath5k_hw_set_cts_timeout(ah, cts_timeout);
  }

  reply	other threads:[~2010-06-17 18:49 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-16 19:32 OOPS in ath5k when setting coverage class Steve Brown
2010-06-17 17:39 ` Bob Copeland
2010-06-17 18:49   ` Steve Brown [this message]
2010-06-17 19:24     ` Bob Copeland
2010-06-18  3:16     ` Bob Copeland
2010-06-18 10:48       ` Steve Brown

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=4C1A6E4F.6000708@cortland.com \
    --to=sbrown@cortland.com \
    --cc=ath5k-devel@venema.h4ckr.net \
    --cc=linux-wireless@vger.kernel.org \
    --cc=me@bobcopeland.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).