On Sat, 12 Oct 2019 05:02:22 +0000
Belgin ?tirbu <[email protected]> wrote:

> With this patch, if the nonfree firmware is found, the internal WiFi
> is used, otherwise the WiFi state machine tries to use the external
> WiFi adapter.

Sorry, I forgot to do the research for the bluetooth coexistance, so I
did it now. As some people may be interested on how to do that research
I also included a log of what I did below.

First I tried to understand if the bluetooth coexistance parameter was
enabled by default. Since I didn't find anything obvious in the source
code, I ended up trying on my laptop:
> $ sudo modprobe ath9k_htc
The parameters names are in modinfo:
> $ modinfo ath9k_htc
[...]
> parm:           btcoex_enable:Enable wifi-BT coexistence (int)
but it doesn't contain the actual values. The values can be found with:
> $ grep . /sys/module/ath9k_htc/parameters/*
> /sys/module/ath9k_htc/parameters/blink:1
> /sys/module/ath9k_htc/parameters/btcoex_enable:0
> /sys/module/ath9k_htc/parameters/nohwcrypt:0
> /sys/module/ath9k_htc/parameters/ps_enable:0
> /sys/module/ath9k_htc/parameters/use_dev_fw:0
I also verified that I don't have overrides in /etc/modprobe.d to set
kernel parameters before doing that test.

Now I want to know why it's disabled by default.

Since the ath9k_htc driver is in drivers/net/wireless/ath/ath9k, so I
did that:
> $ cd drivers/net/wireless/ath/ath9k
> $ git grep module_param
> htc_drv_init.c:module_param_named(debug, ath9k_debug, uint, 0);
> htc_drv_init.c:module_param_named(nohwcrypt, htc_modparam_nohwcrypt, int, 
> 0444);
> htc_drv_init.c:module_param_named(btcoex_enable, ath9k_htc_btcoex_enable, 
> int, 0444);
> htc_drv_init.c:module_param_named(ps_enable, ath9k_ps_enable, int, 0444);
> htc_drv_init.c:module_param_named(use_dev_fw, htc_use_dev_fw, int, 0444);
> htc_drv_init.c:module_param_named(blink, ath9k_htc_led_blink, int, 0444);
> init.c:module_param_named(debug, ath9k_debug, uint, 0);
> init.c:module_param_named(nohwcrypt, ath9k_modparam_nohwcrypt, int, 0444);
> init.c:module_param_named(blink, ath9k_led_blink, int, 0444);
> init.c:module_param_named(led_active_high, ath9k_led_active_high, int, 0444);
> init.c:module_param_named(btcoex_enable, ath9k_btcoex_enable, int, 0444);
> init.c:module_param_named(bt_ant_diversity, ath9k_bt_ant_diversity, int, 
> 0444);
> init.c:module_param_named(ps_enable, ath9k_ps_enable, int, 0444);
> init.c:module_param_named(use_chanctx, ath9k_use_chanctx, int, 0444);
> init.c:module_param_named(use_msi, ath9k_use_msi, int, 0444);

Now I know that htc_drv_init.c (which is for ath9k_htc) is the file
that defines the btcoex_enable parameter.

I can then  try to find the last commit related to that:
> $ git blame -- htc_drv_init.c
Among the multiples lines I could see that:
> fb9987d0f748c (Sujith                       2010-03-17 14:25:25 +0530   32) 
> 7f34778e79048 (Mohammed Shafi Shajakhan     2012-09-04 19:33:38 +0530   33) 
> static int ath9k_htc_btcoex_enable;
> 7f34778e79048 (Mohammed Shafi Shajakhan     2012-09-04 19:33:38 +0530   34) 
> module_param_named(btcoex_enable, ath9k_htc_btcoex_enable, int, 0444);
> 7f34778e79048 (Mohammed Shafi Shajakhan     2012-09-04 19:33:38 +0530   35) 
> MODULE_PARM_DESC(btcoex_enable, "Enable wifi-BT coexistence");
> 7f34778e79048 (Mohammed Shafi Shajakhan     2012-09-04 19:33:38 +0530   36) 
> 6bca610d97b61 (Oleksij Rempel               2014-01-30 09:14:53 +0100   37) 
> static int ath9k_ps_enable;

This gives the following commit:
> commit 7f34778e79048fae1a88100de917277375466de0
> Author: Mohammed Shafi Shajakhan <[email protected]>
> Date:   Tue Sep 4 19:33:38 2012 +0530
> 
>     ath9k_htc: Add a modparam to enable BTCOEX rather than default
>     
>     Enable BTCOEX for WB193(which seems to be the only supported
>     ath9k_htc BTCOEX chipset)only when it is enabled via modparam,
>     rather than enabling it by default.
>     
>     Cc: Vivek Natarajan <[email protected]>
>     Signed-off-by: Mohammed Shafi Shajakhan <[email protected]>
>     Signed-off-by: John W. Linville <[email protected]>

Since we rather support all ath9k_htc chipsets, it's probably a good
idea to either disable btcoex or selectively enable it.

Disabling it is good enough for now. If there is some interest we could
still enable it selectively in a later patch.

Denis.> 

Attachment: pgp4EoaIKhYsl.pgp
Description: OpenPGP digital signature

_______________________________________________
Replicant mailing list
[email protected]
https://lists.osuosl.org/mailman/listinfo/replicant

Reply via email to