All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] ath6kl: Fix tethering problems
@ 2016-07-01 16:10 Pierre Le Magourou
  2016-07-01 16:10 ` [PATCH 1/3] ath6kl: Fix WLAN tethering authentication problem Pierre Le Magourou
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Pierre Le Magourou @ 2016-07-01 16:10 UTC (permalink / raw)
  To: kvalo; +Cc: ath6kl, linux-wireless, jmassot, Pierre Le Magourou

These 3 patchs fix problems detected when using tethering mode with a
AR9374 chipset.

Pierre Le Magourou (3):
  ath6kl: Fix WLAN tethering authentication problem.
  ath6kl: Fix wrong regulatory domain disconnection.
  ath6kl: Unset IFF_LOWER_UP flag on AP mode leave.

 drivers/net/wireless/ath/ath6kl/cfg80211.c | 7 ++++++-
 drivers/net/wireless/ath/ath6kl/txrx.c     | 9 +++++----
 2 files changed, 11 insertions(+), 5 deletions(-)

-- 
2.9.0


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

* [PATCH 1/3] ath6kl: Fix WLAN tethering authentication problem.
  2016-07-01 16:10 [PATCH 0/3] ath6kl: Fix tethering problems Pierre Le Magourou
@ 2016-07-01 16:10 ` Pierre Le Magourou
  2016-07-01 16:10 ` [PATCH 2/3] ath6kl: Fix wrong regulatory domain disconnection Pierre Le Magourou
  2016-07-01 16:10 ` [PATCH 3/3] ath6kl: Unset IFF_LOWER_UP flag on AP mode leave Pierre Le Magourou
  2 siblings, 0 replies; 5+ messages in thread
From: Pierre Le Magourou @ 2016-07-01 16:10 UTC (permalink / raw)
  To: kvalo; +Cc: ath6kl, linux-wireless, jmassot, Pierre Le Magourou

When enabling WLAN tethering, a new AP is visible and a STA could
connect to it. When the STA tries to authenticate to the newly created
AP, the WPA authentication mechanism is stuck in the 1/4 msg of 4-Way
Handshake.

In ath6kl_rx(), the ath6kl_find_sta() function is looking for the
h_source field of the Ethernet frame header received by the STA. The
datap pointer that points to the Ethernet frame header is incorrect,
and was pointing at the wrong offset in the buffer.

This commit adds a pad_before_data_start offset to set the datap pointer
to the Ethernet frame header. datap->h_source parameter is now really
pointing to the source ethernet address and the authentication process
can continue.

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

diff --git a/drivers/net/wireless/ath/ath6kl/txrx.c b/drivers/net/wireless/ath/ath6kl/txrx.c
index 40432fe..9df41d5 100644
--- a/drivers/net/wireless/ath/ath6kl/txrx.c
+++ b/drivers/net/wireless/ath/ath6kl/txrx.c
@@ -1401,6 +1401,10 @@ void ath6kl_rx(struct htc_target *target, struct htc_packet *packet)
 		return;
 	}
 
+	pad_before_data_start =
+		(le16_to_cpu(dhdr->info3) >> WMI_DATA_HDR_PAD_BEFORE_DATA_SHIFT)
+			& WMI_DATA_HDR_PAD_BEFORE_DATA_MASK;
+
 	/* Get the Power save state of the STA */
 	if (vif->nw_type == AP_NETWORK) {
 		meta_type = wmi_data_hdr_get_meta(dhdr);
@@ -1408,7 +1412,7 @@ void ath6kl_rx(struct htc_target *target, struct htc_packet *packet)
 		ps_state = !!((dhdr->info >> WMI_DATA_HDR_PS_SHIFT) &
 			      WMI_DATA_HDR_PS_MASK);
 
-		offset = sizeof(struct wmi_data_hdr);
+		offset = sizeof(struct wmi_data_hdr) + pad_before_data_start;
 		trig_state = !!(le16_to_cpu(dhdr->info3) & WMI_DATA_HDR_TRIG);
 
 		switch (meta_type) {
@@ -1523,9 +1527,6 @@ void ath6kl_rx(struct htc_target *target, struct htc_packet *packet)
 	seq_no = wmi_data_hdr_get_seqno(dhdr);
 	meta_type = wmi_data_hdr_get_meta(dhdr);
 	dot11_hdr = wmi_data_hdr_get_dot11(dhdr);
-	pad_before_data_start =
-		(le16_to_cpu(dhdr->info3) >> WMI_DATA_HDR_PAD_BEFORE_DATA_SHIFT)
-			& WMI_DATA_HDR_PAD_BEFORE_DATA_MASK;
 
 	skb_pull(skb, sizeof(struct wmi_data_hdr));
 
-- 
2.9.0


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

* [PATCH 2/3] ath6kl: Fix wrong regulatory domain disconnection.
  2016-07-01 16:10 [PATCH 0/3] ath6kl: Fix tethering problems Pierre Le Magourou
  2016-07-01 16:10 ` [PATCH 1/3] ath6kl: Fix WLAN tethering authentication problem Pierre Le Magourou
@ 2016-07-01 16:10 ` Pierre Le Magourou
  2016-07-01 16:10 ` [PATCH 3/3] ath6kl: Unset IFF_LOWER_UP flag on AP mode leave Pierre Le Magourou
  2 siblings, 0 replies; 5+ messages in thread
From: Pierre Le Magourou @ 2016-07-01 16:10 UTC (permalink / raw)
  To: kvalo; +Cc: ath6kl, linux-wireless, jmassot, Pierre Le Magourou

One minute after a successful connection, the kernel checks if the
frequency and the channel width are well configured for the country we
are in. (regulatory domain)

ath6kl driver was setting the NL80211_CHAN_HT20 channel without checking
for the HT capabilities. (we should have NL80211_CHAN_NO_HT in our
case because the firmware did not support HT)

This patch adds a check on ht_cap.ht_supported in order to create the
channel corresponding to the firmware capabilities.

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

diff --git a/drivers/net/wireless/ath/ath6kl/cfg80211.c b/drivers/net/wireless/ath/ath6kl/cfg80211.c
index 4e11ba0..c9c4d7f 100644
--- a/drivers/net/wireless/ath/ath6kl/cfg80211.c
+++ b/drivers/net/wireless/ath/ath6kl/cfg80211.c
@@ -1104,7 +1104,8 @@ void ath6kl_cfg80211_ch_switch_notify(struct ath6kl_vif *vif, int freq,
 
 	cfg80211_chandef_create(&chandef,
 				ieee80211_get_channel(vif->ar->wiphy, freq),
-				(mode == WMI_11G_HT20) ?
+				(mode == WMI_11G_HT20 &&
+				 ath6kl_band_2ghz.ht_cap.ht_supported) ?
 					NL80211_CHAN_HT20 : NL80211_CHAN_NO_HT);
 
 	mutex_lock(&vif->wdev.mtx);
-- 
2.9.0


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

* [PATCH 3/3] ath6kl: Unset IFF_LOWER_UP flag on AP mode leave.
  2016-07-01 16:10 [PATCH 0/3] ath6kl: Fix tethering problems Pierre Le Magourou
  2016-07-01 16:10 ` [PATCH 1/3] ath6kl: Fix WLAN tethering authentication problem Pierre Le Magourou
  2016-07-01 16:10 ` [PATCH 2/3] ath6kl: Fix wrong regulatory domain disconnection Pierre Le Magourou
@ 2016-07-01 16:10 ` Pierre Le Magourou
  2016-07-01 23:02   ` Johannes Berg
  2 siblings, 1 reply; 5+ messages in thread
From: Pierre Le Magourou @ 2016-07-01 16:10 UTC (permalink / raw)
  To: kvalo; +Cc: ath6kl, linux-wireless, jmassot, Pierre Le Magourou

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(+)

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);
-- 
2.9.0


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

* Re: [PATCH 3/3] ath6kl: Unset IFF_LOWER_UP flag on AP mode leave.
  2016-07-01 16:10 ` [PATCH 3/3] ath6kl: Unset IFF_LOWER_UP flag on AP mode leave Pierre Le Magourou
@ 2016-07-01 23:02   ` Johannes Berg
  0 siblings, 0 replies; 5+ messages in thread
From: Johannes Berg @ 2016-07-01 23:02 UTC (permalink / raw)
  To: Pierre Le Magourou, kvalo
  Cc: ath6kl, linux-wireless, jmassot, Pierre Le Magourou



> +++ 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

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

end of thread, other threads:[~2016-07-01 23:02 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-07-01 16:10 [PATCH 0/3] ath6kl: Fix tethering problems Pierre Le Magourou
2016-07-01 16:10 ` [PATCH 1/3] ath6kl: Fix WLAN tethering authentication problem Pierre Le Magourou
2016-07-01 16:10 ` [PATCH 2/3] ath6kl: Fix wrong regulatory domain disconnection Pierre Le Magourou
2016-07-01 16:10 ` [PATCH 3/3] ath6kl: Unset IFF_LOWER_UP flag on AP mode leave Pierre Le Magourou
2016-07-01 23:02   ` Johannes Berg

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.