diff mbox

[3/3] ath6kl: Unset IFF_LOWER_UP flag on AP mode leave.

Message ID 20160701161005.30341-4-plemagourou@aldebaran.com (mailing list archive)
State Changes Requested
Delegated to: Kalle Valo
Headers show

Commit Message

Pierre Le Magourou July 1, 2016, 4:10 p.m. UTC
When disabling tethering after having enabled it, the ath6kl driver does
not set the IFF_LOWER_UP flag to 0 (carrier off) on the wlan interface.

The upper layers (eg. connman) are not notified of the tethering mode
status change. So, tethering can not be activated anymore.

This patch adds a netif_carrier_off() call when stopping AP mode to fix
the problem.

Signed-off-by: Pierre Le Magourou <plemagourou@aldebaran.com>
---
 drivers/net/wireless/ath/ath6kl/cfg80211.c | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Johannes Berg July 1, 2016, 11:02 p.m. UTC | #1
> +++ b/drivers/net/wireless/ath/ath6kl/cfg80211.c
> @@ -2971,7 +2971,11 @@ static int ath6kl_stop_ap(struct wiphy *wiphy,
> struct net_device *dev)
>  		return -ENOTCONN;
>  
>  	ath6kl_wmi_disconnect_cmd(ar->wmi, vif->fw_vif_idx);
> +
> +	spin_lock_bh(&vif->if_lock);
>  	clear_bit(CONNECTED, &vif->flags);
> +	netif_carrier_off(vif->ndev);
> +	spin_unlock_bh(&vif->if_lock);
> 
The addition of the locking seems rather odd.

johannes
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/net/wireless/ath/ath6kl/cfg80211.c b/drivers/net/wireless/ath/ath6kl/cfg80211.c
index c9c4d7f..400d7dc 100644
--- a/drivers/net/wireless/ath/ath6kl/cfg80211.c
+++ b/drivers/net/wireless/ath/ath6kl/cfg80211.c
@@ -2971,7 +2971,11 @@  static int ath6kl_stop_ap(struct wiphy *wiphy, struct net_device *dev)
 		return -ENOTCONN;
 
 	ath6kl_wmi_disconnect_cmd(ar->wmi, vif->fw_vif_idx);
+
+	spin_lock_bh(&vif->if_lock);
 	clear_bit(CONNECTED, &vif->flags);
+	netif_carrier_off(vif->ndev);
+	spin_unlock_bh(&vif->if_lock);
 
 	/* Restore ht setting in firmware */
 	return ath6kl_restore_htcap(vif);