All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ath10k: implement drv_get_tsf for ibss merging
@ 2014-02-12  9:37 ` Chun-Yeow Yeoh
  0 siblings, 0 replies; 6+ messages in thread
From: Chun-Yeow Yeoh @ 2014-02-12  9:37 UTC (permalink / raw)
  To: linux-wireless; +Cc: ath10k, kvalo, Chun-Yeow Yeoh

Implement the get TSF by simply returning 0 so that IBSS
merging is happening. Otherwise, IBSS nodes that have similar
SSID naming won't merge. This is simply fooling the mac80211
that the TSF in the received beacon is higher than the local TSF.

Signed-off-by: Chun-Yeow Yeoh <yeohchunyeow@gmail.com>
---
 drivers/net/wireless/ath/ath10k/mac.c |   16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c
index afa1226..d62d39e 100644
--- a/drivers/net/wireless/ath/ath10k/mac.c
+++ b/drivers/net/wireless/ath/ath10k/mac.c
@@ -4049,6 +4049,21 @@ static void ath10k_sta_rc_update(struct ieee80211_hw *hw,
 	ieee80211_queue_work(hw, &arsta->update_wk);
 }
 
+static u64 ath10k_get_tsf(struct ieee80211_hw *hw, struct ieee80211_vif *vif)
+{
+	struct ath10k *ar = hw->priv;
+	u64 tsf;
+
+	mutex_lock(&ar->conf_mutex);
+	/* FIXME: Return 0 for time being. Need to figure out whether FW has
+	 * the API to fetch 64-bit TSF
+	 */
+	tsf = 0;
+	mutex_unlock(&ar->conf_mutex);
+
+	return tsf;
+}
+
 static const struct ieee80211_ops ath10k_ops = {
 	.tx				= ath10k_tx,
 	.start				= ath10k_start,
@@ -4074,6 +4089,7 @@ static const struct ieee80211_ops ath10k_ops = {
 	.set_bitrate_mask		= ath10k_set_bitrate_mask,
 	.channel_switch_beacon		= ath10k_channel_switch_beacon,
 	.sta_rc_update			= ath10k_sta_rc_update,
+	.get_tsf			= ath10k_get_tsf,
 #ifdef CONFIG_PM
 	.suspend			= ath10k_suspend,
 	.resume				= ath10k_resume,
-- 
1.7.9.5


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

* [PATCH] ath10k: implement drv_get_tsf for ibss merging
@ 2014-02-12  9:37 ` Chun-Yeow Yeoh
  0 siblings, 0 replies; 6+ messages in thread
From: Chun-Yeow Yeoh @ 2014-02-12  9:37 UTC (permalink / raw)
  To: linux-wireless; +Cc: kvalo, Chun-Yeow Yeoh, ath10k

Implement the get TSF by simply returning 0 so that IBSS
merging is happening. Otherwise, IBSS nodes that have similar
SSID naming won't merge. This is simply fooling the mac80211
that the TSF in the received beacon is higher than the local TSF.

Signed-off-by: Chun-Yeow Yeoh <yeohchunyeow@gmail.com>
---
 drivers/net/wireless/ath/ath10k/mac.c |   16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c
index afa1226..d62d39e 100644
--- a/drivers/net/wireless/ath/ath10k/mac.c
+++ b/drivers/net/wireless/ath/ath10k/mac.c
@@ -4049,6 +4049,21 @@ static void ath10k_sta_rc_update(struct ieee80211_hw *hw,
 	ieee80211_queue_work(hw, &arsta->update_wk);
 }
 
+static u64 ath10k_get_tsf(struct ieee80211_hw *hw, struct ieee80211_vif *vif)
+{
+	struct ath10k *ar = hw->priv;
+	u64 tsf;
+
+	mutex_lock(&ar->conf_mutex);
+	/* FIXME: Return 0 for time being. Need to figure out whether FW has
+	 * the API to fetch 64-bit TSF
+	 */
+	tsf = 0;
+	mutex_unlock(&ar->conf_mutex);
+
+	return tsf;
+}
+
 static const struct ieee80211_ops ath10k_ops = {
 	.tx				= ath10k_tx,
 	.start				= ath10k_start,
@@ -4074,6 +4089,7 @@ static const struct ieee80211_ops ath10k_ops = {
 	.set_bitrate_mask		= ath10k_set_bitrate_mask,
 	.channel_switch_beacon		= ath10k_channel_switch_beacon,
 	.sta_rc_update			= ath10k_sta_rc_update,
+	.get_tsf			= ath10k_get_tsf,
 #ifdef CONFIG_PM
 	.suspend			= ath10k_suspend,
 	.resume				= ath10k_resume,
-- 
1.7.9.5


_______________________________________________
ath10k mailing list
ath10k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath10k

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

* Re: [PATCH] ath10k: implement drv_get_tsf for ibss merging
  2014-02-12  9:37 ` Chun-Yeow Yeoh
@ 2014-02-13 19:13   ` Kalle Valo
  -1 siblings, 0 replies; 6+ messages in thread
From: Kalle Valo @ 2014-02-13 19:13 UTC (permalink / raw)
  To: Chun-Yeow Yeoh; +Cc: linux-wireless, ath10k

Chun-Yeow Yeoh <yeohchunyeow@gmail.com> writes:

> Implement the get TSF by simply returning 0 so that IBSS
> merging is happening. Otherwise, IBSS nodes that have similar
> SSID naming won't merge. This is simply fooling the mac80211
> that the TSF in the received beacon is higher than the local TSF.
>
> Signed-off-by: Chun-Yeow Yeoh <yeohchunyeow@gmail.com>

Yeah, this extremely ugly but don't really know any better way to handle
this now.

> +static u64 ath10k_get_tsf(struct ieee80211_hw *hw, struct ieee80211_vif *vif)
> +{
> +	struct ath10k *ar = hw->priv;
> +	u64 tsf;
> +
> +	mutex_lock(&ar->conf_mutex);
> +	/* FIXME: Return 0 for time being. Need to figure out whether FW has
> +	 * the API to fetch 64-bit TSF
> +	 */
> +	tsf = 0;
> +	mutex_unlock(&ar->conf_mutex);
> +
> +	return tsf;
> +}

But why do you need to take conf_mutex? Isn't this enough:

+static u64 ath10k_get_tsf(struct ieee80211_hw *hw, struct ieee80211_vif *vif)
+{
+       /*
+        * FIXME: Return 0 for time being. Need to figure out whether FW
+        * has the API to fetch 64-bit TSF
+        */
+
+       return 0;
+}

-- 
Kalle Valo

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

* Re: [PATCH] ath10k: implement drv_get_tsf for ibss merging
@ 2014-02-13 19:13   ` Kalle Valo
  0 siblings, 0 replies; 6+ messages in thread
From: Kalle Valo @ 2014-02-13 19:13 UTC (permalink / raw)
  To: Chun-Yeow Yeoh; +Cc: linux-wireless, ath10k

Chun-Yeow Yeoh <yeohchunyeow@gmail.com> writes:

> Implement the get TSF by simply returning 0 so that IBSS
> merging is happening. Otherwise, IBSS nodes that have similar
> SSID naming won't merge. This is simply fooling the mac80211
> that the TSF in the received beacon is higher than the local TSF.
>
> Signed-off-by: Chun-Yeow Yeoh <yeohchunyeow@gmail.com>

Yeah, this extremely ugly but don't really know any better way to handle
this now.

> +static u64 ath10k_get_tsf(struct ieee80211_hw *hw, struct ieee80211_vif *vif)
> +{
> +	struct ath10k *ar = hw->priv;
> +	u64 tsf;
> +
> +	mutex_lock(&ar->conf_mutex);
> +	/* FIXME: Return 0 for time being. Need to figure out whether FW has
> +	 * the API to fetch 64-bit TSF
> +	 */
> +	tsf = 0;
> +	mutex_unlock(&ar->conf_mutex);
> +
> +	return tsf;
> +}

But why do you need to take conf_mutex? Isn't this enough:

+static u64 ath10k_get_tsf(struct ieee80211_hw *hw, struct ieee80211_vif *vif)
+{
+       /*
+        * FIXME: Return 0 for time being. Need to figure out whether FW
+        * has the API to fetch 64-bit TSF
+        */
+
+       return 0;
+}

-- 
Kalle Valo

_______________________________________________
ath10k mailing list
ath10k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath10k

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

* Re: [PATCH] ath10k: implement drv_get_tsf for ibss merging
  2014-02-13 19:13   ` Kalle Valo
@ 2014-02-14  1:55     ` Yeoh Chun-Yeow
  -1 siblings, 0 replies; 6+ messages in thread
From: Yeoh Chun-Yeow @ 2014-02-14  1:55 UTC (permalink / raw)
  To: Kalle Valo; +Cc: linux-wireless, ath10k

> Yeah, this extremely ugly but don't really know any better way to handle
> this now.

I have observed that we have ath10k_wmi_event_tsf_measurement_report,
but no so sure how to trigger this event.

> But why do you need to take conf_mutex? Isn't this enough:
>
> +static u64 ath10k_get_tsf(struct ieee80211_hw *hw, struct ieee80211_vif *vif)
> +{
> +       /*
> +        * FIXME: Return 0 for time being. Need to figure out whether FW
> +        * has the API to fetch 64-bit TSF
> +        */
> +
> +       return 0;
> +}

Ya, I think this is enough for time being. I will submit v2 on this.

-----
Chun-Yeow

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

* Re: [PATCH] ath10k: implement drv_get_tsf for ibss merging
@ 2014-02-14  1:55     ` Yeoh Chun-Yeow
  0 siblings, 0 replies; 6+ messages in thread
From: Yeoh Chun-Yeow @ 2014-02-14  1:55 UTC (permalink / raw)
  To: Kalle Valo; +Cc: linux-wireless, ath10k

> Yeah, this extremely ugly but don't really know any better way to handle
> this now.

I have observed that we have ath10k_wmi_event_tsf_measurement_report,
but no so sure how to trigger this event.

> But why do you need to take conf_mutex? Isn't this enough:
>
> +static u64 ath10k_get_tsf(struct ieee80211_hw *hw, struct ieee80211_vif *vif)
> +{
> +       /*
> +        * FIXME: Return 0 for time being. Need to figure out whether FW
> +        * has the API to fetch 64-bit TSF
> +        */
> +
> +       return 0;
> +}

Ya, I think this is enough for time being. I will submit v2 on this.

-----
Chun-Yeow

_______________________________________________
ath10k mailing list
ath10k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath10k

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

end of thread, other threads:[~2014-02-14  1:55 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-12  9:37 [PATCH] ath10k: implement drv_get_tsf for ibss merging Chun-Yeow Yeoh
2014-02-12  9:37 ` Chun-Yeow Yeoh
2014-02-13 19:13 ` Kalle Valo
2014-02-13 19:13   ` Kalle Valo
2014-02-14  1:55   ` Yeoh Chun-Yeow
2014-02-14  1:55     ` Yeoh Chun-Yeow

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.