linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ath10k: update antenna configuration after setting in fw
@ 2015-10-26  9:22 manikanta.pubbisetty
  2015-10-26 10:05 ` Albino B Neto
  0 siblings, 1 reply; 4+ messages in thread
From: manikanta.pubbisetty @ 2015-10-26  9:22 UTC (permalink / raw)
  To: ath10k; +Cc: linux-wireless, Manikanta Pubbisetty

From: Manikanta Pubbisetty <manikanta.pubbisetty@gmail.com>

Updating tx/rx antenna configuration in ath10k is done even before
it is set in target. If setting of the tx/rx antenna config fails then
we will maintain incorrect configuration in ath10k and APIs like
get_antenna will provide incorrect information.

This patch updates the antenna configuration in ath10k after it is set
successfully in target.

Signed-off-by: Manikanta Pubbisetty <manikanta.pubbisetty@gmail.com>
---
 drivers/net/wireless/ath/ath10k/mac.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c
index 484c1a1..8d0ce37 100644
--- a/drivers/net/wireless/ath/ath10k/mac.c
+++ b/drivers/net/wireless/ath/ath10k/mac.c
@@ -3771,9 +3771,6 @@ static int __ath10k_set_antenna(struct ath10k *ar, u32 tx_ant, u32 rx_ant)
 	ath10k_check_chain_mask(ar, tx_ant, "tx");
 	ath10k_check_chain_mask(ar, rx_ant, "rx");
 
-	ar->cfg_tx_chainmask = tx_ant;
-	ar->cfg_rx_chainmask = rx_ant;
-
 	if ((ar->state != ATH10K_STATE_ON) &&
 	    (ar->state != ATH10K_STATE_RESTARTED))
 		return 0;
@@ -3794,6 +3791,9 @@ static int __ath10k_set_antenna(struct ath10k *ar, u32 tx_ant, u32 rx_ant)
 		return ret;
 	}
 
+	ar->cfg_tx_chainmask = tx_ant;
+	ar->cfg_rx_chainmask = rx_ant;
+
 	return 0;
 }
 
-- 
1.9.1


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

* Re: [PATCH] ath10k: update antenna configuration after setting in fw
  2015-10-26  9:22 [PATCH] ath10k: update antenna configuration after setting in fw manikanta.pubbisetty
@ 2015-10-26 10:05 ` Albino B Neto
  2015-10-26 10:11   ` Manikanta
  0 siblings, 1 reply; 4+ messages in thread
From: Albino B Neto @ 2015-10-26 10:05 UTC (permalink / raw)
  To: manikanta.pubbisetty; +Cc: ath10k, linux-wireless

2015-10-26 7:22 GMT-02:00  <manikanta.pubbisetty@gmail.com>:
> Signed-off-by: Manikanta Pubbisetty <manikanta.pubbisetty@gmail.com>
> ---
>  drivers/net/wireless/ath/ath10k/mac.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c
> index 484c1a1..8d0ce37 100644
> --- a/drivers/net/wireless/ath/ath10k/mac.c
> +++ b/drivers/net/wireless/ath/ath10k/mac.c
> @@ -3771,9 +3771,6 @@ static int __ath10k_set_antenna(struct ath10k *ar, u32 tx_ant, u32 rx_ant)
>         ath10k_check_chain_mask(ar, tx_ant, "tx");
>         ath10k_check_chain_mask(ar, rx_ant, "rx");
>
> -       ar->cfg_tx_chainmask = tx_ant;
> -       ar->cfg_rx_chainmask = rx_ant;
> -
>         if ((ar->state != ATH10K_STATE_ON) &&
>             (ar->state != ATH10K_STATE_RESTARTED))
>                 return 0;
> @@ -3794,6 +3791,9 @@ static int __ath10k_set_antenna(struct ath10k *ar, u32 tx_ant, u32 rx_ant)
>                 return ret;
>         }
>
> +       ar->cfg_tx_chainmask = tx_ant;
> +       ar->cfg_rx_chainmask = rx_ant;
> +
>         return 0;
>  }

Sorry, I see no change in the code. script checkpatch.pl ?

    Albino

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

* Re: [PATCH] ath10k: update antenna configuration after setting in fw
  2015-10-26 10:05 ` Albino B Neto
@ 2015-10-26 10:11   ` Manikanta
  2015-10-26 15:14     ` Ben Greear
  0 siblings, 1 reply; 4+ messages in thread
From: Manikanta @ 2015-10-26 10:11 UTC (permalink / raw)
  To: Albino B Neto; +Cc: ath10k, linux-wireless


On Monday 26 October 2015 03:35 PM, Albino B Neto wrote:
> 2015-10-26 7:22 GMT-02:00  <manikanta.pubbisetty@gmail.com>:
>> Signed-off-by: Manikanta Pubbisetty <manikanta.pubbisetty@gmail.com>
>> ---
>>   drivers/net/wireless/ath/ath10k/mac.c | 6 +++---
>>   1 file changed, 3 insertions(+), 3 deletions(-)
>>
>> diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c
>> index 484c1a1..8d0ce37 100644
>> --- a/drivers/net/wireless/ath/ath10k/mac.c
>> +++ b/drivers/net/wireless/ath/ath10k/mac.c
>> @@ -3771,9 +3771,6 @@ static int __ath10k_set_antenna(struct ath10k *ar, u32 tx_ant, u32 rx_ant)
>>          ath10k_check_chain_mask(ar, tx_ant, "tx");
>>          ath10k_check_chain_mask(ar, rx_ant, "rx");
>>
>> -       ar->cfg_tx_chainmask = tx_ant;
>> -       ar->cfg_rx_chainmask = rx_ant;
>> -
>>          if ((ar->state != ATH10K_STATE_ON) &&
>>              (ar->state != ATH10K_STATE_RESTARTED))
>>                  return 0;
>> @@ -3794,6 +3791,9 @@ static int __ath10k_set_antenna(struct ath10k *ar, u32 tx_ant, u32 rx_ant)
>>                  return ret;
>>          }
>>
>> +       ar->cfg_tx_chainmask = tx_ant;
>> +       ar->cfg_rx_chainmask = rx_ant;
>> +
>>          return 0;
>>   }
> Sorry, I see no change in the code. script checkpatch.pl ?
I have moved these two lines of code from the start of the function to 
the end, in between there is code for setting the antenna config in 
firmware. You can find in commit log why I have moved the code down in 
the function.

-Manikanta


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

* Re: [PATCH] ath10k: update antenna configuration after setting in fw
  2015-10-26 10:11   ` Manikanta
@ 2015-10-26 15:14     ` Ben Greear
  0 siblings, 0 replies; 4+ messages in thread
From: Ben Greear @ 2015-10-26 15:14 UTC (permalink / raw)
  To: Manikanta, Albino B Neto; +Cc: ath10k, linux-wireless



On 10/26/2015 03:11 AM, Manikanta wrote:
>
> On Monday 26 October 2015 03:35 PM, Albino B Neto wrote:
>> 2015-10-26 7:22 GMT-02:00  <manikanta.pubbisetty@gmail.com>:
>>> Signed-off-by: Manikanta Pubbisetty <manikanta.pubbisetty@gmail.com>
>>> ---
>>>   drivers/net/wireless/ath/ath10k/mac.c | 6 +++---
>>>   1 file changed, 3 insertions(+), 3 deletions(-)
>>>
>>> diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c
>>> index 484c1a1..8d0ce37 100644
>>> --- a/drivers/net/wireless/ath/ath10k/mac.c
>>> +++ b/drivers/net/wireless/ath/ath10k/mac.c
>>> @@ -3771,9 +3771,6 @@ static int __ath10k_set_antenna(struct ath10k *ar, u32 tx_ant, u32 rx_ant)
>>>          ath10k_check_chain_mask(ar, tx_ant, "tx");
>>>          ath10k_check_chain_mask(ar, rx_ant, "rx");
>>>
>>> -       ar->cfg_tx_chainmask = tx_ant;
>>> -       ar->cfg_rx_chainmask = rx_ant;
>>> -
>>>          if ((ar->state != ATH10K_STATE_ON) &&
>>>              (ar->state != ATH10K_STATE_RESTARTED))
>>>                  return 0;
>>> @@ -3794,6 +3791,9 @@ static int __ath10k_set_antenna(struct ath10k *ar, u32 tx_ant, u32 rx_ant)
>>>                  return ret;
>>>          }
>>>
>>> +       ar->cfg_tx_chainmask = tx_ant;
>>> +       ar->cfg_rx_chainmask = rx_ant;
>>> +
>>>          return 0;
>>>   }
>> Sorry, I see no change in the code. script checkpatch.pl ?
> I have moved these two lines of code from the start of the function to the end, in between there is code for setting the antenna config in firmware. You can find in commit log why I have moved the code down in the function.

I think you should leave it as it was.  That way, you can reliably set the mask
before the hardware is started, and as soon as it _is_ started, then the value is
flushed to the hardware as expected.

Thanks,
Ben


>
> -Manikanta
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>

-- 
Ben Greear <greearb@candelatech.com>
Candela Technologies Inc  http://www.candelatech.com

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

end of thread, other threads:[~2015-10-26 15:14 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-26  9:22 [PATCH] ath10k: update antenna configuration after setting in fw manikanta.pubbisetty
2015-10-26 10:05 ` Albino B Neto
2015-10-26 10:11   ` Manikanta
2015-10-26 15:14     ` Ben Greear

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