All of lore.kernel.org
 help / color / mirror / Atom feed
* [WIP PATCH v2] iwd: Fix disabling tethering not working for brcmfmac
@ 2022-02-15 10:26 Jonathan Liu
  2022-02-15 10:36 ` Jonathan Liu
  2022-02-27 17:45 ` Daniel Wagner
  0 siblings, 2 replies; 6+ messages in thread
From: Jonathan Liu @ 2022-02-15 10:26 UTC (permalink / raw)
  To: connman; +Cc: Jonathan Liu

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


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

end of thread, other threads:[~2022-02-27 17:47 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-02-15 10:26 [WIP PATCH v2] iwd: Fix disabling tethering not working for brcmfmac Jonathan Liu
2022-02-15 10:36 ` 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

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.