ath9k-devel.lists.ath9k.org archive mirror
 help / color / mirror / Atom feed
From: Mathieu Slabbinck <matty.slabbinck@gmail.com>
To: ath9k-devel@lists.ath9k.org
Subject: [ath9k-devel] TX99 unreliable start sequence
Date: Wed, 7 Sep 2016 22:07:47 +0200	[thread overview]
Message-ID: <CAOFH_kF1Oz9cP-Bt=NOcKDbiwsefA+RGQGtHGJZaauvW0cyQhw@mail.gmail.com> (raw)

Hi,

I was looking into the TX99 module recently and found that it was not
always starting properly.
If for example echo 1 > tx99 is done, the wireless module would not start
transmitting in all attempts. Even though a cat of tx99 is responding with
1.
Do the same command again (without modifying anything else) and the odds
increase of the module starting to transmit...

Since this was something annoying, I was investigating the write_file_tx99
function which seems to be the cause of the improper handling.
I've created the patch below and it responds much more reliable. Each
request is properly sending out RF waves.

--- a/drivers/net/wireless/ath/ath9k/tx99.c
+++ b/drivers/net/wireless/ath/ath9k/tx99.c
@@ -191,23 +191,14 @@ static ssize_t write_file_tx99(struct file *file,
const char __user *user_buf,
     if (strtobool(buf, &start))
         return -EINVAL;

-    if (start == sc->tx99_state) {
-        if (!start)
-            return count;
-        ath_dbg(common, XMIT, "Resetting TX99\n");
-        ath9k_tx99_deinit(sc);
-    }
-
-    if (!start) {
-        ath9k_tx99_deinit(sc);
-        return count;
-    }
-
-    r = ath9k_tx99_init(sc);
-    if (r)
-        return r;
-
-    return count;
+    if (start) {
+        ath9k_tx99_deinit(sc);
+        r = ath9k_tx99_init(sc);
+    }
+    else {
+        ath9k_tx99_deinit(sc);
+    }
+    return count;
 }

I'm now just wondering if anyone knows why this piece of code was made this
way the first place, as I'm sure it had a purpose...

Kr

Mathieu
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ath9k.org/pipermail/ath9k-devel/attachments/20160907/570e8528/attachment.htm 

             reply	other threads:[~2016-09-07 20:07 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-07 20:07 Mathieu Slabbinck [this message]
2016-09-08 13:08 ` [ath9k-devel] TX99 unreliable start sequence Eduardo Abinader
2016-09-08 13:11   ` Eduardo Abinader
2016-09-08 18:49     ` Mathieu Slabbinck

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='CAOFH_kF1Oz9cP-Bt=NOcKDbiwsefA+RGQGtHGJZaauvW0cyQhw@mail.gmail.com' \
    --to=matty.slabbinck@gmail.com \
    --cc=ath9k-devel@lists.ath9k.org \
    /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).