All of lore.kernel.org
 help / color / mirror / Atom feed
* Question on "ath10k: document ofdm/5ghz rate offset with a macro"
@ 2016-06-06 21:25 Ben Greear
  2016-06-07  6:23 ` Michal Kazior
  0 siblings, 1 reply; 5+ messages in thread
From: Ben Greear @ 2016-06-06 21:25 UTC (permalink / raw)
  To: ath10k, Michal Kazior

While porting some patches forward, I notice the change below
that renamed the method to "ath10k_mac_sta_has_ofdm_only".  But,
that is not really what that is checking, since it just throws
away the CCK rates (and they might have been there).

Maybe it should just be "ath10k_mac_sta_has_ofdm()" ?

Thanks,
Ben



  ath10k: document ofdm/5ghz rate offset with a macro

     Don't use literal values for offsets. While at it
     rename a function so it is more clear what it
     checks for.

     This finally takes care of the last magic
     5GHz/OFDM offset.

     Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
     Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>

-------------------- drivers/net/wireless/ath/ath10k/mac.c --------------------
index e62b587..ec26d96 100644
@@ -61,8 +61,11 @@ static struct ieee80211_rate ath10k_rates[] = {
  	{ .bitrate = 540, .hw_value = ATH10K_HW_RATE_OFDM_54M },
  };

-#define ath10k_a_rates (ath10k_rates + 4)
-#define ath10k_a_rates_size (ARRAY_SIZE(ath10k_rates) - 4)
+#define ATH10K_MAC_FIRST_OFDM_RATE_IDX 4
+
+#define ath10k_a_rates (ath10k_rates + ATH10K_MAC_FIRST_OFDM_RATE_IDX)
+#define ath10k_a_rates_size (ARRAY_SIZE(ath10k_rates) - \
+			     ATH10K_MAC_FIRST_OFDM_RATE_IDX)
  #define ath10k_g_rates (ath10k_rates + 0)
  #define ath10k_g_rates_size (ARRAY_SIZE(ath10k_rates))

@@ -2038,10 +2041,10 @@ static void ath10k_peer_assoc_h_qos(struct ath10k *ar,
  		   sta->addr, !!(arg->peer_flags & WMI_PEER_QOS));
  }

-static bool ath10k_mac_sta_has_11g_rates(struct ieee80211_sta *sta)
+static bool ath10k_mac_sta_has_ofdm_only(struct ieee80211_sta *sta)
  {
-	/* First 4 rates in ath10k_rates are CCK (11b) rates. */
-	return sta->supp_rates[IEEE80211_BAND_2GHZ] >> 4;
+	return sta->supp_rates[IEEE80211_BAND_2GHZ] >>
+	       ATH10K_MAC_FIRST_OFDM_RATE_IDX;
  }


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


_______________________________________________
ath10k mailing list
ath10k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath10k

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

* Re: Question on "ath10k: document ofdm/5ghz rate offset with a macro"
  2016-06-06 21:25 Question on "ath10k: document ofdm/5ghz rate offset with a macro" Ben Greear
@ 2016-06-07  6:23 ` Michal Kazior
  2016-06-07 12:57   ` Ben Greear
  0 siblings, 1 reply; 5+ messages in thread
From: Michal Kazior @ 2016-06-07  6:23 UTC (permalink / raw)
  To: Ben Greear; +Cc: ath10k

On 6 June 2016 at 23:25, Ben Greear <greearb@candelatech.com> wrote:
> While porting some patches forward, I notice the change below
> that renamed the method to "ath10k_mac_sta_has_ofdm_only".  But,
> that is not really what that is checking, since it just throws
> away the CCK rates (and they might have been there).
>
> Maybe it should just be "ath10k_mac_sta_has_ofdm()" ?

Yes, this seems like an unfortunate name pick on my side. The MODE_11G
phymode is for mixed b/g.


Michał

_______________________________________________
ath10k mailing list
ath10k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath10k

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

* Re: Question on "ath10k: document ofdm/5ghz rate offset with a macro"
  2016-06-07  6:23 ` Michal Kazior
@ 2016-06-07 12:57   ` Ben Greear
  2016-06-07 13:16     ` Michal Kazior
  0 siblings, 1 reply; 5+ messages in thread
From: Ben Greear @ 2016-06-07 12:57 UTC (permalink / raw)
  To: Michal Kazior; +Cc: ath10k



On 06/06/2016 11:23 PM, Michal Kazior wrote:
> On 6 June 2016 at 23:25, Ben Greear <greearb@candelatech.com> wrote:
>> While porting some patches forward, I notice the change below
>> that renamed the method to "ath10k_mac_sta_has_ofdm_only".  But,
>> that is not really what that is checking, since it just throws
>> away the CCK rates (and they might have been there).
>>
>> Maybe it should just be "ath10k_mac_sta_has_ofdm()" ?
>
> Yes, this seems like an unfortunate name pick on my side. The MODE_11G
> phymode is for mixed b/g.

I think the actual code behaviour is right.  I have some patches to
support G-only mode and such, and will change the name of your method
in those patches to be more clear.

Lots of other pending patches of mine before I will get to trying to push
that one upstream though.

Thanks,
Ben


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

_______________________________________________
ath10k mailing list
ath10k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath10k

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

* Re: Question on "ath10k: document ofdm/5ghz rate offset with a macro"
  2016-06-07 12:57   ` Ben Greear
@ 2016-06-07 13:16     ` Michal Kazior
  2016-06-07 13:19       ` Ben Greear
  0 siblings, 1 reply; 5+ messages in thread
From: Michal Kazior @ 2016-06-07 13:16 UTC (permalink / raw)
  To: Ben Greear; +Cc: ath10k

On 7 June 2016 at 14:57, Ben Greear <greearb@candelatech.com> wrote:
> On 06/06/2016 11:23 PM, Michal Kazior wrote:
>> On 6 June 2016 at 23:25, Ben Greear <greearb@candelatech.com> wrote:
>>>
>>> While porting some patches forward, I notice the change below
>>> that renamed the method to "ath10k_mac_sta_has_ofdm_only".  But,
>>> that is not really what that is checking, since it just throws
>>> away the CCK rates (and they might have been there).
>>>
>>> Maybe it should just be "ath10k_mac_sta_has_ofdm()" ?
>>
>> Yes, this seems like an unfortunate name pick on my side. The MODE_11G
>> phymode is for mixed b/g.
>
> I think the actual code behaviour is right.  I have some patches to
> support G-only mode and such, and will change the name of your method
> in those patches to be more clear.
>
> Lots of other pending patches of mine before I will get to trying to push
> that one upstream though.

Hmm.. I do recall 11G_ONLY phymode didn't play out well with 11B
coexistance in AP mode. I can't remember the details though..


Michał

_______________________________________________
ath10k mailing list
ath10k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath10k

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

* Re: Question on "ath10k: document ofdm/5ghz rate offset with a macro"
  2016-06-07 13:16     ` Michal Kazior
@ 2016-06-07 13:19       ` Ben Greear
  0 siblings, 0 replies; 5+ messages in thread
From: Ben Greear @ 2016-06-07 13:19 UTC (permalink / raw)
  To: Michal Kazior; +Cc: ath10k



On 06/07/2016 06:16 AM, Michal Kazior wrote:
> On 7 June 2016 at 14:57, Ben Greear <greearb@candelatech.com> wrote:
>> On 06/06/2016 11:23 PM, Michal Kazior wrote:
>>> On 6 June 2016 at 23:25, Ben Greear <greearb@candelatech.com> wrote:
>>>>
>>>> While porting some patches forward, I notice the change below
>>>> that renamed the method to "ath10k_mac_sta_has_ofdm_only".  But,
>>>> that is not really what that is checking, since it just throws
>>>> away the CCK rates (and they might have been there).
>>>>
>>>> Maybe it should just be "ath10k_mac_sta_has_ofdm()" ?
>>>
>>> Yes, this seems like an unfortunate name pick on my side. The MODE_11G
>>> phymode is for mixed b/g.
>>
>> I think the actual code behaviour is right.  I have some patches to
>> support G-only mode and such, and will change the name of your method
>> in those patches to be more clear.
>>
>> Lots of other pending patches of mine before I will get to trying to push
>> that one upstream though.
>
> Hmm.. I do recall 11G_ONLY phymode didn't play out well with 11B
> coexistance in AP mode. I can't remember the details though..

If you remember a test case for this, let me know.

Thanks,
Ben


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

_______________________________________________
ath10k mailing list
ath10k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath10k

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

end of thread, other threads:[~2016-06-07 13:47 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-06 21:25 Question on "ath10k: document ofdm/5ghz rate offset with a macro" Ben Greear
2016-06-07  6:23 ` Michal Kazior
2016-06-07 12:57   ` Ben Greear
2016-06-07 13:16     ` Michal Kazior
2016-06-07 13:19       ` Ben Greear

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.