[PATCH V4] ath10k: Debugfs entry to enable/disable WLAN&Blutooth Coexist feature
Kalle Valo
kvalo at qca.qualcomm.com
Fri Oct 30 08:04:17 PDT 2015
Yanbo Li <yanbol at qca.qualcomm.com> writes:
> As some radio have no connection with BT modules, enable the WLAN/Bluetooth
> coexist(BTC) feature will has some side effect if the radio's GPIO connect
> with any other HW modules. Add the control switcher "btc_feature" at
> debugfs and set the feature as disable by default to avoid such case.
>
> The FW support this feature since 10.2.4.54 on 2G-only board, dual band
> or 5G boards don't support the feature
>
> To enable this feature, execute:
> echo 1 > /sys/kernel/debug/ieee80211/phyX/ath10k/btc_feature
> To disable:
> echo 0 > /sys/kernel/debug/ieee80211/phyX/ath10k/btc_feature
>
> Signed-off-by: Yanbo Li <yanbol at qca.qualcomm.com>
You missed some of my comments from v1, especially about the file name.
Let me send v5.
https://patchwork.kernel.org/patch/6313091/
> +static ssize_t ath10k_write_btc_feature(struct file *file,
> + const char __user *ubuf,
> + size_t count, loff_t *ppos)
> +{
> + struct ath10k *ar = file->private_data;
> + char buf[32];
> + size_t buf_size;
> + bool val;
> + int ret;
> +
> + buf_size = min(count, (sizeof(buf) - 1));
> + if (copy_from_user(buf, ubuf, buf_size))
> + return -EFAULT;
> +
> + buf[buf_size] = '\0';
> + if (strtobool(buf, &val) != 0) {
> + ath10k_warn(ar, "Wrong BTcoex feature setting\n");
> + return -EINVAL;
> + }
> +
> + mutex_lock(&ar->conf_mutex);
> +
> + if (ar->state != ATH10K_STATE_ON) {
> + ret = -ENETDOWN;
> + goto err_unlock;
> + }
> +
> + if (val != test_bit(ATH10K_FLAG_BTCOEX_ENABLE, &ar->dev_flags)) {
> + if (val)
> + set_bit(ATH10K_FLAG_BTCOEX_ENABLE, &ar->dev_flags);
> + else
> + clear_bit(ATH10K_FLAG_BTCOEX_ENABLE, &ar->dev_flags);
> + queue_work(ar->workqueue, &ar->restart_work);
> + }
I don't think this is a good idea, now you cannot change the value while
interface is down. I think it would be more user friendly to allow
changing the value but obviously not reboot the firmware as it's not
running.
--
Kalle Valo
More information about the ath10k
mailing list