ath9k-devel.lists.ath9k.org archive mirror
 help / color / mirror / Atom feed
* [ath9k-devel] TX99 unreliable start sequence
@ 2016-09-07 20:07 Mathieu Slabbinck
  2016-09-08 13:08 ` Eduardo Abinader
  0 siblings, 1 reply; 4+ messages in thread
From: Mathieu Slabbinck @ 2016-09-07 20:07 UTC (permalink / raw)
  To: ath9k-devel

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 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [ath9k-devel] TX99 unreliable start sequence
  2016-09-07 20:07 [ath9k-devel] TX99 unreliable start sequence Mathieu Slabbinck
@ 2016-09-08 13:08 ` Eduardo Abinader
  2016-09-08 13:11   ` Eduardo Abinader
  0 siblings, 1 reply; 4+ messages in thread
From: Eduardo Abinader @ 2016-09-08 13:08 UTC (permalink / raw)
  To: ath9k-devel

The reason behind that, I think, is due to the fact that you have to
echo 1 > tx99_power, before setting tx99.

Eduardo

On Wed, Sep 7, 2016 at 10:07 PM, Mathieu Slabbinck
<matty.slabbinck@gmail.com> wrote:
> 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
>
> _______________________________________________
> ath9k-devel mailing list
> ath9k-devel at lists.ath9k.org
> https://lists.ath9k.org/mailman/listinfo/ath9k-devel
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [ath9k-devel] TX99 unreliable start sequence
  2016-09-08 13:08 ` Eduardo Abinader
@ 2016-09-08 13:11   ` Eduardo Abinader
  2016-09-08 18:49     ` Mathieu Slabbinck
  0 siblings, 1 reply; 4+ messages in thread
From: Eduardo Abinader @ 2016-09-08 13:11 UTC (permalink / raw)
  To: ath9k-devel

Actually, echo $power > tx99_power

On Thu, Sep 8, 2016 at 3:08 PM, Eduardo Abinader
<eduardoabinader@gmail.com> wrote:
> The reason behind that, I think, is due to the fact that you have to
> echo 1 > tx99_power, before setting tx99.
>
> Eduardo
>
> On Wed, Sep 7, 2016 at 10:07 PM, Mathieu Slabbinck
> <matty.slabbinck@gmail.com> wrote:
>> 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
>>
>> _______________________________________________
>> ath9k-devel mailing list
>> ath9k-devel at lists.ath9k.org
>> https://lists.ath9k.org/mailman/listinfo/ath9k-devel
>>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [ath9k-devel] TX99 unreliable start sequence
  2016-09-08 13:11   ` Eduardo Abinader
@ 2016-09-08 18:49     ` Mathieu Slabbinck
  0 siblings, 0 replies; 4+ messages in thread
From: Mathieu Slabbinck @ 2016-09-08 18:49 UTC (permalink / raw)
  To: ath9k-devel

Thanks for the feedback Eduardo,

but this is indeed what I do.
Each test sequence consists of setting all values needed (including the
power), and afterwards, trying to echo 1 > tx99.
This still shows the issue.

Kr

Mathieu

On Thu, Sep 8, 2016 at 3:11 PM, Eduardo Abinader <eduardoabinader@gmail.com>
wrote:

> Actually, echo $power > tx99_power
>
> On Thu, Sep 8, 2016 at 3:08 PM, Eduardo Abinader
> <eduardoabinader@gmail.com> wrote:
> > The reason behind that, I think, is due to the fact that you have to
> > echo 1 > tx99_power, before setting tx99.
> >
> > Eduardo
> >
> > On Wed, Sep 7, 2016 at 10:07 PM, Mathieu Slabbinck
> > <matty.slabbinck@gmail.com> wrote:
> >> 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
> >>
> >> _______________________________________________
> >> ath9k-devel mailing list
> >> ath9k-devel at lists.ath9k.org
> >> https://lists.ath9k.org/mailman/listinfo/ath9k-devel
> >>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ath9k.org/pipermail/ath9k-devel/attachments/20160908/268936a5/attachment.htm 

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-09-08 18:49 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-07 20:07 [ath9k-devel] TX99 unreliable start sequence Mathieu Slabbinck
2016-09-08 13:08 ` Eduardo Abinader
2016-09-08 13:11   ` Eduardo Abinader
2016-09-08 18:49     ` Mathieu Slabbinck

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).