From: Jonathan Liu <net147@gmail.com>
To: connman@lists.linux.dev
Cc: Jonathan Liu <net147@gmail.com>
Subject: [WIP PATCH v2] iwd: Fix disabling tethering not working for brcmfmac
Date: Tue, 15 Feb 2022 21:26:38 +1100 [thread overview]
Message-ID: <20220215102638.599189-1-net147@gmail.com> (raw)
For Broadcom BCM4356 chipset with brcmfmac driver, changing from AP mode
to station mode returns -EBUSY if the wireless interface is a member of
a bridge.
To resolve the issue, the wireless interface is removed from the tether
bridge before changing the mode rather than after.
Fixes: 648ed549f0ac ("iwd: Add support for tethering")
---
plugins/iwd.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/plugins/iwd.c b/plugins/iwd.c
index ac3d1e17..25b9544d 100644
--- a/plugins/iwd.c
+++ b/plugins/iwd.c
@@ -745,6 +745,7 @@ static void tech_disable_tethering_cb(const DBusError *error, void *user_data)
goto out;
}
+ connman_technology_tethering_notify(cbd->tech, false);
iwdap = g_hash_table_lookup(access_points, iwdd->path);
if (!iwdap) {
DBG("%s no ap object found", iwdd->path);
@@ -756,11 +757,6 @@ static void tech_disable_tethering_cb(const DBusError *error, void *user_data)
iwdap->bridge = NULL;
iwdap->tech = NULL;
- if (!connman_inet_remove_from_bridge(cbd->index, cbd->bridge))
- goto out;
-
- connman_technology_tethering_notify(cbd->tech, false);
-
if (!g_dbus_proxy_method_call(iwdap->proxy, "Stop",
NULL, tech_ap_stop_cb, cbd, NULL)) {
connman_warn("iwd ap %s could not stop AccessPoint mode: %s",
@@ -787,6 +783,9 @@ static int cm_change_tethering(struct iwd_device *iwdd,
if (index < 0)
return -ENODEV;
+ if (!enabled && connman_inet_remove_from_bridge(index, bridge))
+ return -EIO;
+
cbd = g_new(struct tech_cb_data, 1);
cbd->iwdd = iwdd;
cbd->path = g_strdup(iwdd->path);
--
2.35.1
next reply other threads:[~2022-02-15 10:27 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-15 10:26 Jonathan Liu [this message]
2022-02-15 10:36 ` [WIP PATCH v2] iwd: Fix disabling tethering not working for brcmfmac Jonathan Liu
2022-02-21 8:32 ` Daniel Wagner
2022-02-25 8:33 ` Jonathan Liu
2022-02-27 17:47 ` Daniel Wagner
2022-02-27 17:45 ` Daniel Wagner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220215102638.599189-1-net147@gmail.com \
--to=net147@gmail.com \
--cc=connman@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.