Re: [PATCH 03/16] wl1251: add sysfs interface for bluetooth coexistence mode configuration
On Sun, 2013-12-08 at 08:55 +0100, Pali Rohár wrote: > On Tuesday 29 October 2013 00:39:47 Ben Hutchings wrote: > > On Sat, 2013-10-26 at 22:34 +0200, Pali Rohár wrote: > > > From: David Gnedt > > > > > > Port the bt_coex_mode sysfs interface from wl1251 driver > > > version included in the Maemo Fremantle kernel to allow > > > bt-coexistence mode configuration. This enables userspace > > > applications to set one of the modes WL1251_BT_COEX_OFF, > > > WL1251_BT_COEX_ENABLE and WL1251_BT_COEX_MONOAUDIO. The > > > default mode is WL1251_BT_COEX_OFF. > > > It should be noted that this driver always enabled > > > bt-coexistence before and enabled bt-coexistence directly > > > affects the receiving performance, rendering it unusable in > > > some low-signal situations. Especially monitor mode is > > > affected very badly with bt-coexistence enabled. > > > > [...] > > > > This should be implemented consistently with other drivers: > > > > drivers/net/wireless/ath/ath9k/htc_drv_init.c:module_param_nam > > ed(btcoex_enable, ath9k_htc_btcoex_enable, int, 0444); > > drivers/net/wireless/ath/ath9k/init.c:module_param_named(btco > > ex_enable, ath9k_btcoex_enable, int, 0444); > > drivers/net/wireless/b43/main.c:module_param_named(btcoex, > > modparam_btcoex, int, 0444); > > drivers/net/wireless/ipw2x00/ipw2200.c:module_param(bt_coexis > > t, int, 0444); > > drivers/net/wireless/iwlegacy/common.c:module_param(bt_coex_a > > ctive, bool, S_IRUGO); > > drivers/net/wireless/iwlwifi/iwl-drv.c:module_param_named(bt_ > > coex_active, iwlwifi_mod_params.bt_coex_active, > > drivers/net/wireless/ti/wlcore/sysfs.c:static > > DEVICE_ATTR(bt_coex_state, S_IRUGO | S_IWUSR, > > > > Oh, hmm, I see a problem here. > > > > Ben. > > So where is consitency? Each driver doing this in different way: > btcoex_enable, btcoex, bt_coexist, bt_coex_active Indeed, it's a bigger problem than one driver and this isn't really an objection to your patch. I suppose there should be an nl80211 attribute to control this behaviour per-interface. You or any other wireless networking developer could work on that. Ben. > Reason for this usage in wl1251 is to not break existing > userspace applications. -- Ben Hutchings, Staff Engineer, Solarflare Not speaking for my employer; that's the marketing department's job. They asked us to note that Solarflare product names are trademarked. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 03/16] wl1251: add sysfs interface for bluetooth coexistence mode configuration
On Sun, 2013-12-08 at 08:55 +0100, Pali Rohár wrote: On Tuesday 29 October 2013 00:39:47 Ben Hutchings wrote: On Sat, 2013-10-26 at 22:34 +0200, Pali Rohár wrote: From: David Gnedt david.gn...@davizone.at Port the bt_coex_mode sysfs interface from wl1251 driver version included in the Maemo Fremantle kernel to allow bt-coexistence mode configuration. This enables userspace applications to set one of the modes WL1251_BT_COEX_OFF, WL1251_BT_COEX_ENABLE and WL1251_BT_COEX_MONOAUDIO. The default mode is WL1251_BT_COEX_OFF. It should be noted that this driver always enabled bt-coexistence before and enabled bt-coexistence directly affects the receiving performance, rendering it unusable in some low-signal situations. Especially monitor mode is affected very badly with bt-coexistence enabled. [...] This should be implemented consistently with other drivers: drivers/net/wireless/ath/ath9k/htc_drv_init.c:module_param_nam ed(btcoex_enable, ath9k_htc_btcoex_enable, int, 0444); drivers/net/wireless/ath/ath9k/init.c:module_param_named(btco ex_enable, ath9k_btcoex_enable, int, 0444); drivers/net/wireless/b43/main.c:module_param_named(btcoex, modparam_btcoex, int, 0444); drivers/net/wireless/ipw2x00/ipw2200.c:module_param(bt_coexis t, int, 0444); drivers/net/wireless/iwlegacy/common.c:module_param(bt_coex_a ctive, bool, S_IRUGO); drivers/net/wireless/iwlwifi/iwl-drv.c:module_param_named(bt_ coex_active, iwlwifi_mod_params.bt_coex_active, drivers/net/wireless/ti/wlcore/sysfs.c:static DEVICE_ATTR(bt_coex_state, S_IRUGO | S_IWUSR, Oh, hmm, I see a problem here. Ben. So where is consitency? Each driver doing this in different way: btcoex_enable, btcoex, bt_coexist, bt_coex_active Indeed, it's a bigger problem than one driver and this isn't really an objection to your patch. I suppose there should be an nl80211 attribute to control this behaviour per-interface. You or any other wireless networking developer could work on that. Ben. Reason for this usage in wl1251 is to not break existing userspace applications. -- Ben Hutchings, Staff Engineer, Solarflare Not speaking for my employer; that's the marketing department's job. They asked us to note that Solarflare product names are trademarked. -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 03/16] wl1251: add sysfs interface for bluetooth coexistence mode configuration
On Tuesday 29 October 2013 00:39:47 Ben Hutchings wrote: > On Sat, 2013-10-26 at 22:34 +0200, Pali Rohár wrote: > > From: David Gnedt > > > > Port the bt_coex_mode sysfs interface from wl1251 driver > > version included in the Maemo Fremantle kernel to allow > > bt-coexistence mode configuration. This enables userspace > > applications to set one of the modes WL1251_BT_COEX_OFF, > > WL1251_BT_COEX_ENABLE and WL1251_BT_COEX_MONOAUDIO. The > > default mode is WL1251_BT_COEX_OFF. > > It should be noted that this driver always enabled > > bt-coexistence before and enabled bt-coexistence directly > > affects the receiving performance, rendering it unusable in > > some low-signal situations. Especially monitor mode is > > affected very badly with bt-coexistence enabled. > > [...] > > This should be implemented consistently with other drivers: > > drivers/net/wireless/ath/ath9k/htc_drv_init.c:module_param_nam > ed(btcoex_enable, ath9k_htc_btcoex_enable, int, 0444); > drivers/net/wireless/ath/ath9k/init.c:module_param_named(btco > ex_enable, ath9k_btcoex_enable, int, 0444); > drivers/net/wireless/b43/main.c:module_param_named(btcoex, > modparam_btcoex, int, 0444); > drivers/net/wireless/ipw2x00/ipw2200.c:module_param(bt_coexis > t, int, 0444); > drivers/net/wireless/iwlegacy/common.c:module_param(bt_coex_a > ctive, bool, S_IRUGO); > drivers/net/wireless/iwlwifi/iwl-drv.c:module_param_named(bt_ > coex_active, iwlwifi_mod_params.bt_coex_active, > drivers/net/wireless/ti/wlcore/sysfs.c:static > DEVICE_ATTR(bt_coex_state, S_IRUGO | S_IWUSR, > > Oh, hmm, I see a problem here. > > Ben. So where is consitency? Each driver doing this in different way: btcoex_enable, btcoex, bt_coexist, bt_coex_active Reason for this usage in wl1251 is to not break existing userspace applications. -- Pali Rohár pali.ro...@gmail.com signature.asc Description: This is a digitally signed message part.
Re: [PATCH 03/16] wl1251: add sysfs interface for bluetooth coexistence mode configuration
On Tuesday 29 October 2013 00:39:47 Ben Hutchings wrote: On Sat, 2013-10-26 at 22:34 +0200, Pali Rohár wrote: From: David Gnedt david.gn...@davizone.at Port the bt_coex_mode sysfs interface from wl1251 driver version included in the Maemo Fremantle kernel to allow bt-coexistence mode configuration. This enables userspace applications to set one of the modes WL1251_BT_COEX_OFF, WL1251_BT_COEX_ENABLE and WL1251_BT_COEX_MONOAUDIO. The default mode is WL1251_BT_COEX_OFF. It should be noted that this driver always enabled bt-coexistence before and enabled bt-coexistence directly affects the receiving performance, rendering it unusable in some low-signal situations. Especially monitor mode is affected very badly with bt-coexistence enabled. [...] This should be implemented consistently with other drivers: drivers/net/wireless/ath/ath9k/htc_drv_init.c:module_param_nam ed(btcoex_enable, ath9k_htc_btcoex_enable, int, 0444); drivers/net/wireless/ath/ath9k/init.c:module_param_named(btco ex_enable, ath9k_btcoex_enable, int, 0444); drivers/net/wireless/b43/main.c:module_param_named(btcoex, modparam_btcoex, int, 0444); drivers/net/wireless/ipw2x00/ipw2200.c:module_param(bt_coexis t, int, 0444); drivers/net/wireless/iwlegacy/common.c:module_param(bt_coex_a ctive, bool, S_IRUGO); drivers/net/wireless/iwlwifi/iwl-drv.c:module_param_named(bt_ coex_active, iwlwifi_mod_params.bt_coex_active, drivers/net/wireless/ti/wlcore/sysfs.c:static DEVICE_ATTR(bt_coex_state, S_IRUGO | S_IWUSR, Oh, hmm, I see a problem here. Ben. So where is consitency? Each driver doing this in different way: btcoex_enable, btcoex, bt_coexist, bt_coex_active Reason for this usage in wl1251 is to not break existing userspace applications. -- Pali Rohár pali.ro...@gmail.com signature.asc Description: This is a digitally signed message part.
Re: [PATCH 03/16] wl1251: add sysfs interface for bluetooth coexistence mode configuration
Luca Coelho writes: > On Mon, 2013-10-28 at 23:39 +, Ben Hutchings wrote: >> On Sat, 2013-10-26 at 22:34 +0200, Pali Rohár wrote: >> > From: David Gnedt >> > >> > Port the bt_coex_mode sysfs interface from wl1251 driver version included >> > in the Maemo Fremantle kernel to allow bt-coexistence mode configuration. >> > This enables userspace applications to set one of the modes >> > WL1251_BT_COEX_OFF, WL1251_BT_COEX_ENABLE and WL1251_BT_COEX_MONOAUDIO. >> > The default mode is WL1251_BT_COEX_OFF. >> > It should be noted that this driver always enabled bt-coexistence before >> > and enabled bt-coexistence directly affects the receiving performance, >> > rendering it unusable in some low-signal situations. Especially monitor >> > mode is affected very badly with bt-coexistence enabled. >> [...] >> >> This should be implemented consistently with other drivers: >> >> drivers/net/wireless/ath/ath9k/htc_drv_init.c:module_param_named(btcoex_enable, >> ath9k_htc_btcoex_enable, int, 0444); >> drivers/net/wireless/ath/ath9k/init.c:module_param_named(btcoex_enable, >> ath9k_btcoex_enable, int, 0444); >> drivers/net/wireless/b43/main.c:module_param_named(btcoex, modparam_btcoex, >> int, 0444); >> drivers/net/wireless/ipw2x00/ipw2200.c:module_param(bt_coexist, int, 0444); >> drivers/net/wireless/iwlegacy/common.c:module_param(bt_coex_active, bool, >> S_IRUGO); >> drivers/net/wireless/iwlwifi/iwl-drv.c:module_param_named(bt_coex_active, >> iwlwifi_mod_params.bt_coex_active, >> drivers/net/wireless/ti/wlcore/sysfs.c:static DEVICE_ATTR(bt_coex_state, >> S_IRUGO | S_IWUSR, >> >> Oh, hmm, I see a problem here. > > With so many drivers doing the same thing, isn't it about time to add > this to nl80211? Yes, this really needs to be in nl80211. I even suggested this years ago but was turned down at the time. Can't remember the reason anymore. -- Kalle Valo -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 03/16] wl1251: add sysfs interface for bluetooth coexistence mode configuration
On Mon, 2013-10-28 at 23:39 +, Ben Hutchings wrote: > On Sat, 2013-10-26 at 22:34 +0200, Pali Rohár wrote: > > From: David Gnedt > > > > Port the bt_coex_mode sysfs interface from wl1251 driver version included > > in the Maemo Fremantle kernel to allow bt-coexistence mode configuration. > > This enables userspace applications to set one of the modes > > WL1251_BT_COEX_OFF, WL1251_BT_COEX_ENABLE and WL1251_BT_COEX_MONOAUDIO. > > The default mode is WL1251_BT_COEX_OFF. > > It should be noted that this driver always enabled bt-coexistence before > > and enabled bt-coexistence directly affects the receiving performance, > > rendering it unusable in some low-signal situations. Especially monitor > > mode is affected very badly with bt-coexistence enabled. > [...] > > This should be implemented consistently with other drivers: > > drivers/net/wireless/ath/ath9k/htc_drv_init.c:module_param_named(btcoex_enable, > ath9k_htc_btcoex_enable, int, 0444); > drivers/net/wireless/ath/ath9k/init.c:module_param_named(btcoex_enable, > ath9k_btcoex_enable, int, 0444); > drivers/net/wireless/b43/main.c:module_param_named(btcoex, modparam_btcoex, > int, 0444); > drivers/net/wireless/ipw2x00/ipw2200.c:module_param(bt_coexist, int, 0444); > drivers/net/wireless/iwlegacy/common.c:module_param(bt_coex_active, bool, > S_IRUGO); > drivers/net/wireless/iwlwifi/iwl-drv.c:module_param_named(bt_coex_active, > iwlwifi_mod_params.bt_coex_active, > drivers/net/wireless/ti/wlcore/sysfs.c:static DEVICE_ATTR(bt_coex_state, > S_IRUGO | S_IWUSR, > > Oh, hmm, I see a problem here. With so many drivers doing the same thing, isn't it about time to add this to nl80211? -- Luca. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 03/16] wl1251: add sysfs interface for bluetooth coexistence mode configuration
On Mon, 2013-10-28 at 23:39 +, Ben Hutchings wrote: On Sat, 2013-10-26 at 22:34 +0200, Pali Rohár wrote: From: David Gnedt david.gn...@davizone.at Port the bt_coex_mode sysfs interface from wl1251 driver version included in the Maemo Fremantle kernel to allow bt-coexistence mode configuration. This enables userspace applications to set one of the modes WL1251_BT_COEX_OFF, WL1251_BT_COEX_ENABLE and WL1251_BT_COEX_MONOAUDIO. The default mode is WL1251_BT_COEX_OFF. It should be noted that this driver always enabled bt-coexistence before and enabled bt-coexistence directly affects the receiving performance, rendering it unusable in some low-signal situations. Especially monitor mode is affected very badly with bt-coexistence enabled. [...] This should be implemented consistently with other drivers: drivers/net/wireless/ath/ath9k/htc_drv_init.c:module_param_named(btcoex_enable, ath9k_htc_btcoex_enable, int, 0444); drivers/net/wireless/ath/ath9k/init.c:module_param_named(btcoex_enable, ath9k_btcoex_enable, int, 0444); drivers/net/wireless/b43/main.c:module_param_named(btcoex, modparam_btcoex, int, 0444); drivers/net/wireless/ipw2x00/ipw2200.c:module_param(bt_coexist, int, 0444); drivers/net/wireless/iwlegacy/common.c:module_param(bt_coex_active, bool, S_IRUGO); drivers/net/wireless/iwlwifi/iwl-drv.c:module_param_named(bt_coex_active, iwlwifi_mod_params.bt_coex_active, drivers/net/wireless/ti/wlcore/sysfs.c:static DEVICE_ATTR(bt_coex_state, S_IRUGO | S_IWUSR, Oh, hmm, I see a problem here. With so many drivers doing the same thing, isn't it about time to add this to nl80211? -- Luca. -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 03/16] wl1251: add sysfs interface for bluetooth coexistence mode configuration
Luca Coelho l...@coelho.fi writes: On Mon, 2013-10-28 at 23:39 +, Ben Hutchings wrote: On Sat, 2013-10-26 at 22:34 +0200, Pali Rohár wrote: From: David Gnedt david.gn...@davizone.at Port the bt_coex_mode sysfs interface from wl1251 driver version included in the Maemo Fremantle kernel to allow bt-coexistence mode configuration. This enables userspace applications to set one of the modes WL1251_BT_COEX_OFF, WL1251_BT_COEX_ENABLE and WL1251_BT_COEX_MONOAUDIO. The default mode is WL1251_BT_COEX_OFF. It should be noted that this driver always enabled bt-coexistence before and enabled bt-coexistence directly affects the receiving performance, rendering it unusable in some low-signal situations. Especially monitor mode is affected very badly with bt-coexistence enabled. [...] This should be implemented consistently with other drivers: drivers/net/wireless/ath/ath9k/htc_drv_init.c:module_param_named(btcoex_enable, ath9k_htc_btcoex_enable, int, 0444); drivers/net/wireless/ath/ath9k/init.c:module_param_named(btcoex_enable, ath9k_btcoex_enable, int, 0444); drivers/net/wireless/b43/main.c:module_param_named(btcoex, modparam_btcoex, int, 0444); drivers/net/wireless/ipw2x00/ipw2200.c:module_param(bt_coexist, int, 0444); drivers/net/wireless/iwlegacy/common.c:module_param(bt_coex_active, bool, S_IRUGO); drivers/net/wireless/iwlwifi/iwl-drv.c:module_param_named(bt_coex_active, iwlwifi_mod_params.bt_coex_active, drivers/net/wireless/ti/wlcore/sysfs.c:static DEVICE_ATTR(bt_coex_state, S_IRUGO | S_IWUSR, Oh, hmm, I see a problem here. With so many drivers doing the same thing, isn't it about time to add this to nl80211? Yes, this really needs to be in nl80211. I even suggested this years ago but was turned down at the time. Can't remember the reason anymore. -- Kalle Valo -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 03/16] wl1251: add sysfs interface for bluetooth coexistence mode configuration
On Sat, 2013-10-26 at 22:34 +0200, Pali Rohár wrote: > From: David Gnedt > > Port the bt_coex_mode sysfs interface from wl1251 driver version included > in the Maemo Fremantle kernel to allow bt-coexistence mode configuration. > This enables userspace applications to set one of the modes > WL1251_BT_COEX_OFF, WL1251_BT_COEX_ENABLE and WL1251_BT_COEX_MONOAUDIO. > The default mode is WL1251_BT_COEX_OFF. > It should be noted that this driver always enabled bt-coexistence before > and enabled bt-coexistence directly affects the receiving performance, > rendering it unusable in some low-signal situations. Especially monitor > mode is affected very badly with bt-coexistence enabled. [...] This should be implemented consistently with other drivers: drivers/net/wireless/ath/ath9k/htc_drv_init.c:module_param_named(btcoex_enable, ath9k_htc_btcoex_enable, int, 0444); drivers/net/wireless/ath/ath9k/init.c:module_param_named(btcoex_enable, ath9k_btcoex_enable, int, 0444); drivers/net/wireless/b43/main.c:module_param_named(btcoex, modparam_btcoex, int, 0444); drivers/net/wireless/ipw2x00/ipw2200.c:module_param(bt_coexist, int, 0444); drivers/net/wireless/iwlegacy/common.c:module_param(bt_coex_active, bool, S_IRUGO); drivers/net/wireless/iwlwifi/iwl-drv.c:module_param_named(bt_coex_active, iwlwifi_mod_params.bt_coex_active, drivers/net/wireless/ti/wlcore/sysfs.c:static DEVICE_ATTR(bt_coex_state, S_IRUGO | S_IWUSR, Oh, hmm, I see a problem here. Ben. -- Ben Hutchings, Staff Engineer, Solarflare Not speaking for my employer; that's the marketing department's job. They asked us to note that Solarflare product names are trademarked. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 03/16] wl1251: add sysfs interface for bluetooth coexistence mode configuration
On Sat, 2013-10-26 at 22:34 +0200, Pali Rohár wrote: From: David Gnedt david.gn...@davizone.at Port the bt_coex_mode sysfs interface from wl1251 driver version included in the Maemo Fremantle kernel to allow bt-coexistence mode configuration. This enables userspace applications to set one of the modes WL1251_BT_COEX_OFF, WL1251_BT_COEX_ENABLE and WL1251_BT_COEX_MONOAUDIO. The default mode is WL1251_BT_COEX_OFF. It should be noted that this driver always enabled bt-coexistence before and enabled bt-coexistence directly affects the receiving performance, rendering it unusable in some low-signal situations. Especially monitor mode is affected very badly with bt-coexistence enabled. [...] This should be implemented consistently with other drivers: drivers/net/wireless/ath/ath9k/htc_drv_init.c:module_param_named(btcoex_enable, ath9k_htc_btcoex_enable, int, 0444); drivers/net/wireless/ath/ath9k/init.c:module_param_named(btcoex_enable, ath9k_btcoex_enable, int, 0444); drivers/net/wireless/b43/main.c:module_param_named(btcoex, modparam_btcoex, int, 0444); drivers/net/wireless/ipw2x00/ipw2200.c:module_param(bt_coexist, int, 0444); drivers/net/wireless/iwlegacy/common.c:module_param(bt_coex_active, bool, S_IRUGO); drivers/net/wireless/iwlwifi/iwl-drv.c:module_param_named(bt_coex_active, iwlwifi_mod_params.bt_coex_active, drivers/net/wireless/ti/wlcore/sysfs.c:static DEVICE_ATTR(bt_coex_state, S_IRUGO | S_IWUSR, Oh, hmm, I see a problem here. Ben. -- Ben Hutchings, Staff Engineer, Solarflare Not speaking for my employer; that's the marketing department's job. They asked us to note that Solarflare product names are trademarked. -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 03/16] wl1251: add sysfs interface for bluetooth coexistence mode configuration
From: David Gnedt Port the bt_coex_mode sysfs interface from wl1251 driver version included in the Maemo Fremantle kernel to allow bt-coexistence mode configuration. This enables userspace applications to set one of the modes WL1251_BT_COEX_OFF, WL1251_BT_COEX_ENABLE and WL1251_BT_COEX_MONOAUDIO. The default mode is WL1251_BT_COEX_OFF. It should be noted that this driver always enabled bt-coexistence before and enabled bt-coexistence directly affects the receiving performance, rendering it unusable in some low-signal situations. Especially monitor mode is affected very badly with bt-coexistence enabled. Signed-off-by: David Gnedt --- drivers/net/wireless/ti/wl1251/acx.c| 43 ++-- drivers/net/wireless/ti/wl1251/acx.h|8 ++- drivers/net/wireless/ti/wl1251/init.c |6 +- drivers/net/wireless/ti/wl1251/main.c | 108 +++ drivers/net/wireless/ti/wl1251/wl1251.h |8 +++ 5 files changed, 161 insertions(+), 12 deletions(-) diff --git a/drivers/net/wireless/ti/wl1251/acx.c b/drivers/net/wireless/ti/wl1251/acx.c index db6430c..cce50e2 100644 --- a/drivers/net/wireless/ti/wl1251/acx.c +++ b/drivers/net/wireless/ti/wl1251/acx.c @@ -581,7 +581,7 @@ out: return ret; } -int wl1251_acx_sg_enable(struct wl1251 *wl) +int wl1251_acx_sg_enable(struct wl1251 *wl, u8 mode) { struct acx_bt_wlan_coex *pta; int ret; @@ -594,7 +594,7 @@ int wl1251_acx_sg_enable(struct wl1251 *wl) goto out; } - pta->enable = SG_ENABLE; + pta->enable = mode; ret = wl1251_cmd_configure(wl, ACX_SG_ENABLE, pta, sizeof(*pta)); if (ret < 0) { @@ -607,7 +607,7 @@ out: return ret; } -int wl1251_acx_sg_cfg(struct wl1251 *wl) +int wl1251_acx_sg_cfg(struct wl1251 *wl, u16 wake_up_beacon) { struct acx_bt_wlan_coex_param *param; int ret; @@ -632,7 +632,7 @@ int wl1251_acx_sg_cfg(struct wl1251 *wl) param->wlan_cycle_fast = PTA_CYCLE_TIME_FAST_DEF; param->bt_anti_starvation_period = PTA_ANTI_STARVE_PERIOD_DEF; param->next_bt_lp_packet = PTA_TIMEOUT_NEXT_BT_LP_PACKET_DEF; - param->wake_up_beacon = PTA_TIME_BEFORE_BEACON_DEF; + param->wake_up_beacon = wake_up_beacon; param->hp_dm_max_guard_time = PTA_HPDM_MAX_TIME_DEF; param->next_wlan_packet = PTA_TIME_OUT_NEXT_WLAN_DEF; param->antenna_type = PTA_ANTENNA_TYPE_DEF; @@ -661,6 +661,41 @@ out: return ret; } +int wl1251_acx_sg_configure(struct wl1251 *wl, bool force) +{ + int ret; + + if (wl->state == WL1251_STATE_OFF && !force) + return 0; + + switch (wl->bt_coex_mode) { + case WL1251_BT_COEX_OFF: + ret = wl1251_acx_sg_enable(wl, SG_DISABLE); + if (ret) + break; + ret = wl1251_acx_sg_cfg(wl, 0); + break; + case WL1251_BT_COEX_ENABLE: + ret = wl1251_acx_sg_enable(wl, SG_ENABLE); + if (ret) + break; + ret = wl1251_acx_sg_cfg(wl, PTA_TIME_BEFORE_BEACON_DEF); + break; + case WL1251_BT_COEX_MONOAUDIO: + ret = wl1251_acx_sg_enable(wl, SG_ENABLE); + if (ret) + break; + ret = wl1251_acx_sg_cfg(wl, PTA_TIME_BEFORE_BEACON_MONO_AUDIO); + break; + default: + wl1251_error("Invalid BT co-ex mode!"); + ret = -EOPNOTSUPP; + break; + } + + return ret; +} + int wl1251_acx_cca_threshold(struct wl1251 *wl) { struct acx_energy_detection *detection; diff --git a/drivers/net/wireless/ti/wl1251/acx.h b/drivers/net/wireless/ti/wl1251/acx.h index c2ba100..99ea80e 100644 --- a/drivers/net/wireless/ti/wl1251/acx.h +++ b/drivers/net/wireless/ti/wl1251/acx.h @@ -558,7 +558,8 @@ struct acx_bt_wlan_coex { #define PTA_ANTI_STARVE_PERIOD_DEF (500) #define PTA_ANTI_STARVE_NUM_CYCLE_DEF(4) #define PTA_ALLOW_PA_SD_DEF (1) -#define PTA_TIME_BEFORE_BEACON_DEF (6300) +#define PTA_TIME_BEFORE_BEACON_DEF (500) +#define PTA_TIME_BEFORE_BEACON_MONO_AUDIO (6300) #define PTA_HPDM_MAX_TIME_DEF(1600) #define PTA_TIME_OUT_NEXT_WLAN_DEF (2550) #define PTA_AUTO_MODE_NO_CTS_DEF (0) @@ -1455,8 +1456,9 @@ int wl1251_acx_rts_threshold(struct wl1251 *wl, u16 rts_threshold); int wl1251_acx_beacon_filter_opt(struct wl1251 *wl, bool enable_filter); int wl1251_acx_beacon_filter_table(struct wl1251 *wl); int wl1251_acx_conn_monit_params(struct wl1251 *wl); -int wl1251_acx_sg_enable(struct wl1251 *wl); -int wl1251_acx_sg_cfg(struct wl1251 *wl); +int wl1251_acx_sg_enable(struct wl1251 *wl, u8 mode); +int wl1251_acx_sg_cfg(struct wl1251 *wl, u16 wake_up_beacon); +int wl1251_acx_sg_configure(struct wl1251 *wl, bool force); int wl1251_acx_cca_threshold(struct wl1251 *wl); int wl1251_acx_bcn_dtim_options(struct wl1251
[PATCH 03/16] wl1251: add sysfs interface for bluetooth coexistence mode configuration
From: David Gnedt david.gn...@davizone.at Port the bt_coex_mode sysfs interface from wl1251 driver version included in the Maemo Fremantle kernel to allow bt-coexistence mode configuration. This enables userspace applications to set one of the modes WL1251_BT_COEX_OFF, WL1251_BT_COEX_ENABLE and WL1251_BT_COEX_MONOAUDIO. The default mode is WL1251_BT_COEX_OFF. It should be noted that this driver always enabled bt-coexistence before and enabled bt-coexistence directly affects the receiving performance, rendering it unusable in some low-signal situations. Especially monitor mode is affected very badly with bt-coexistence enabled. Signed-off-by: David Gnedt david.gn...@davizone.at --- drivers/net/wireless/ti/wl1251/acx.c| 43 ++-- drivers/net/wireless/ti/wl1251/acx.h|8 ++- drivers/net/wireless/ti/wl1251/init.c |6 +- drivers/net/wireless/ti/wl1251/main.c | 108 +++ drivers/net/wireless/ti/wl1251/wl1251.h |8 +++ 5 files changed, 161 insertions(+), 12 deletions(-) diff --git a/drivers/net/wireless/ti/wl1251/acx.c b/drivers/net/wireless/ti/wl1251/acx.c index db6430c..cce50e2 100644 --- a/drivers/net/wireless/ti/wl1251/acx.c +++ b/drivers/net/wireless/ti/wl1251/acx.c @@ -581,7 +581,7 @@ out: return ret; } -int wl1251_acx_sg_enable(struct wl1251 *wl) +int wl1251_acx_sg_enable(struct wl1251 *wl, u8 mode) { struct acx_bt_wlan_coex *pta; int ret; @@ -594,7 +594,7 @@ int wl1251_acx_sg_enable(struct wl1251 *wl) goto out; } - pta-enable = SG_ENABLE; + pta-enable = mode; ret = wl1251_cmd_configure(wl, ACX_SG_ENABLE, pta, sizeof(*pta)); if (ret 0) { @@ -607,7 +607,7 @@ out: return ret; } -int wl1251_acx_sg_cfg(struct wl1251 *wl) +int wl1251_acx_sg_cfg(struct wl1251 *wl, u16 wake_up_beacon) { struct acx_bt_wlan_coex_param *param; int ret; @@ -632,7 +632,7 @@ int wl1251_acx_sg_cfg(struct wl1251 *wl) param-wlan_cycle_fast = PTA_CYCLE_TIME_FAST_DEF; param-bt_anti_starvation_period = PTA_ANTI_STARVE_PERIOD_DEF; param-next_bt_lp_packet = PTA_TIMEOUT_NEXT_BT_LP_PACKET_DEF; - param-wake_up_beacon = PTA_TIME_BEFORE_BEACON_DEF; + param-wake_up_beacon = wake_up_beacon; param-hp_dm_max_guard_time = PTA_HPDM_MAX_TIME_DEF; param-next_wlan_packet = PTA_TIME_OUT_NEXT_WLAN_DEF; param-antenna_type = PTA_ANTENNA_TYPE_DEF; @@ -661,6 +661,41 @@ out: return ret; } +int wl1251_acx_sg_configure(struct wl1251 *wl, bool force) +{ + int ret; + + if (wl-state == WL1251_STATE_OFF !force) + return 0; + + switch (wl-bt_coex_mode) { + case WL1251_BT_COEX_OFF: + ret = wl1251_acx_sg_enable(wl, SG_DISABLE); + if (ret) + break; + ret = wl1251_acx_sg_cfg(wl, 0); + break; + case WL1251_BT_COEX_ENABLE: + ret = wl1251_acx_sg_enable(wl, SG_ENABLE); + if (ret) + break; + ret = wl1251_acx_sg_cfg(wl, PTA_TIME_BEFORE_BEACON_DEF); + break; + case WL1251_BT_COEX_MONOAUDIO: + ret = wl1251_acx_sg_enable(wl, SG_ENABLE); + if (ret) + break; + ret = wl1251_acx_sg_cfg(wl, PTA_TIME_BEFORE_BEACON_MONO_AUDIO); + break; + default: + wl1251_error(Invalid BT co-ex mode!); + ret = -EOPNOTSUPP; + break; + } + + return ret; +} + int wl1251_acx_cca_threshold(struct wl1251 *wl) { struct acx_energy_detection *detection; diff --git a/drivers/net/wireless/ti/wl1251/acx.h b/drivers/net/wireless/ti/wl1251/acx.h index c2ba100..99ea80e 100644 --- a/drivers/net/wireless/ti/wl1251/acx.h +++ b/drivers/net/wireless/ti/wl1251/acx.h @@ -558,7 +558,8 @@ struct acx_bt_wlan_coex { #define PTA_ANTI_STARVE_PERIOD_DEF (500) #define PTA_ANTI_STARVE_NUM_CYCLE_DEF(4) #define PTA_ALLOW_PA_SD_DEF (1) -#define PTA_TIME_BEFORE_BEACON_DEF (6300) +#define PTA_TIME_BEFORE_BEACON_DEF (500) +#define PTA_TIME_BEFORE_BEACON_MONO_AUDIO (6300) #define PTA_HPDM_MAX_TIME_DEF(1600) #define PTA_TIME_OUT_NEXT_WLAN_DEF (2550) #define PTA_AUTO_MODE_NO_CTS_DEF (0) @@ -1455,8 +1456,9 @@ int wl1251_acx_rts_threshold(struct wl1251 *wl, u16 rts_threshold); int wl1251_acx_beacon_filter_opt(struct wl1251 *wl, bool enable_filter); int wl1251_acx_beacon_filter_table(struct wl1251 *wl); int wl1251_acx_conn_monit_params(struct wl1251 *wl); -int wl1251_acx_sg_enable(struct wl1251 *wl); -int wl1251_acx_sg_cfg(struct wl1251 *wl); +int wl1251_acx_sg_enable(struct wl1251 *wl, u8 mode); +int wl1251_acx_sg_cfg(struct wl1251 *wl, u16 wake_up_beacon); +int wl1251_acx_sg_configure(struct wl1251 *wl, bool force); int wl1251_acx_cca_threshold(struct wl1251 *wl); int