linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] wcn36xx: enable the beaconing in mesh mode
@ 2013-10-31  6:04 Chun-Yeow Yeoh
  2013-10-31 20:30 ` Eugene Krasnikov
  0 siblings, 1 reply; 6+ messages in thread
From: Chun-Yeow Yeoh @ 2013-10-31  6:04 UTC (permalink / raw)
  To: linux-wireless
  Cc: k.eugene.e, linville, wcn36xx, Chun-Yeow Yeoh, Chun-Yeow Yeoh

Enable the beaconing in wnc36xx by tweaking the tim offset and
force the use of AP-style beaconing. Otherwise, beaconing is not
working. The tim offset is set to 256. Otherwise, this will
overwrite mesh beacon submitted by mac80211.

Signed-off-by: Chun-Yeow Yeoh <yeohchunyeow@cozybit.com>
---
 drivers/net/wireless/ath/wcn36xx/smd.c |   12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/drivers/net/wireless/ath/wcn36xx/smd.c b/drivers/net/wireless/ath/wcn36xx/smd.c
index f8c3a10..19f43de 100644
--- a/drivers/net/wireless/ath/wcn36xx/smd.c
+++ b/drivers/net/wireless/ath/wcn36xx/smd.c
@@ -1134,14 +1134,14 @@ int wcn36xx_smd_config_bss(struct wcn36xx *wcn, struct ieee80211_vif *vif,
 		/* STA */
 		bss->oper_mode = 1;
 		bss->wcn36xx_hal_persona = WCN36XX_HAL_STA_MODE;
-	} else if (vif->type == NL80211_IFTYPE_AP) {
+	} else if (vif->type == NL80211_IFTYPE_AP ||
+		   vif->type == NL80211_IFTYPE_MESH_POINT) {
 		bss->bss_type = WCN36XX_HAL_INFRA_AP_MODE;
 
 		/* AP */
 		bss->oper_mode = 0;
 		bss->wcn36xx_hal_persona = WCN36XX_HAL_STA_SAP_MODE;
-	} else if (vif->type == NL80211_IFTYPE_ADHOC ||
-		   vif->type == NL80211_IFTYPE_MESH_POINT) {
+	} else if (vif->type == NL80211_IFTYPE_ADHOC) {
 		bss->bss_type = WCN36XX_HAL_IBSS_MODE;
 
 		/* STA */
@@ -1291,7 +1291,11 @@ int wcn36xx_smd_send_beacon(struct wcn36xx *wcn, struct ieee80211_vif *vif,
 	memcpy(msg_body.bssid, vif->addr, ETH_ALEN);
 
 	/* TODO need to find out why this is needed? */
-	msg_body.tim_ie_offset = tim_off+4;
+	if (vif->type == NL80211_IFTYPE_MESH_POINT)
+		/* mesh beacon don't need this, so push further down */
+		msg_body.tim_ie_offset = 256;
+	else
+		msg_body.tim_ie_offset = tim_off+4;
 	msg_body.p2p_ie_offset = p2p_off;
 	PREPARE_HAL_BUF(wcn->hal_buf, msg_body);
 
-- 
1.7.9.5


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

* Re: [PATCH] wcn36xx: enable the beaconing in mesh mode
  2013-10-31  6:04 [PATCH] wcn36xx: enable the beaconing in mesh mode Chun-Yeow Yeoh
@ 2013-10-31 20:30 ` Eugene Krasnikov
  2013-11-01  4:14   ` Thomas Pedersen
  0 siblings, 1 reply; 6+ messages in thread
From: Eugene Krasnikov @ 2013-10-31 20:30 UTC (permalink / raw)
  To: Chun-Yeow Yeoh; +Cc: linux-wireless, John Linville, wcn36xx, Chun-Yeow Yeoh

> +               msg_body.tim_ie_offset = 256;

Does not look like correct value. Why 256?

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

* Re: [PATCH] wcn36xx: enable the beaconing in mesh mode
  2013-10-31 20:30 ` Eugene Krasnikov
@ 2013-11-01  4:14   ` Thomas Pedersen
       [not found]     ` <CAEFj984AojwciEHGvOisoYX8h_vG4TqZmJCXL6B_vpDYMbf9HQ@mail.gmail.com>
  0 siblings, 1 reply; 6+ messages in thread
From: Thomas Pedersen @ 2013-11-01  4:14 UTC (permalink / raw)
  To: Eugene Krasnikov
  Cc: Chun-Yeow Yeoh, linux-wireless, John Linville, wcn36xx,
	Chun-Yeow Yeoh

On Thu, Oct 31, 2013 at 1:30 PM, Eugene Krasnikov <k.eugene.e@gmail.com> wrote:
>> +               msg_body.tim_ie_offset = 256;
>
> Does not look like correct value. Why 256?

Also mesh beacon does need the TIM< only it must be generated by
mac80211. How do you tell the firmware to ignore the beacon TIM?

--
Thomas

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

* Re: [PATCH] wcn36xx: enable the beaconing in mesh mode
       [not found]     ` <CAEFj984AojwciEHGvOisoYX8h_vG4TqZmJCXL6B_vpDYMbf9HQ@mail.gmail.com>
@ 2013-11-01 13:45       ` Eugene Krasnikov
  0 siblings, 0 replies; 6+ messages in thread
From: Eugene Krasnikov @ 2013-11-01 13:45 UTC (permalink / raw)
  To: Yeoh Chun-Yeow
  Cc: Thomas Pedersen, linux-wireless, John Linville, wcn36xx,
	Chun-Yeow Yeoh, devel@lists.open80211s.org

I do not really remember what was the result of testing when we set
tim_ie_offset to 0. Could you please share what do you observe when
tim_ie_offset? Does FW corrupt beacon?

My concern about 256 is that FW may corrupt some memory. Also assume
the reason why FW sets TIM is because you configure FW as AP instead
of mesh with this line:
    bss->bss_type = WCN36XX_HAL_INFRA_AP_MODE;

On Fri, Nov 1, 2013 at 4:33 AM, Yeoh Chun-Yeow <yeohchunyeow@gmail.com> wrote:
>>
>> Also mesh beacon does need the TIM< only it must be generated by
>> mac80211. How do you tell the firmware to ignore the beacon TIM?
>
>
> Hi, Thomas
>
> The HAL send beacon request message requires the tim_ie_offset to be set.
> There is another p2p_ie_offset in the request message. By setting it to 0,
> it seems that the firmware ignores this IE while building the beacon.
> However, I try to set the tim_ie_offset to 0. But this won't work.
>
> Hi, Eugene
>
> Did you ever test the tim_ie_offset set to 0?
>
> ----
> Chun-Yeow
>



-- 
Best regards,
Eugene

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

* [PATCH] wcn36xx: enable the beaconing in mesh mode
@ 2013-12-06  3:28 Chun-Yeow Yeoh
  2013-12-09  7:23 ` Eugene Krasnikov
  0 siblings, 1 reply; 6+ messages in thread
From: Chun-Yeow Yeoh @ 2013-12-06  3:28 UTC (permalink / raw)
  To: linville; +Cc: linux-wireless, Chun-Yeow Yeoh, Chun-Yeow Yeoh

Enable the beaconing in wnc36xx by tweaking the tim offset and
force the use of AP-style beaconing. Otherwise, beaconing is not
working. The tim offset is set to 256. Otherwise, this will
overwrite mesh beacon submitted by mac80211.

Signed-off-by: Chun-Yeow Yeoh <yeohchunyeow@cozybit.com>
---
 drivers/net/wireless/ath/wcn36xx/smd.c |   12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/drivers/net/wireless/ath/wcn36xx/smd.c b/drivers/net/wireless/ath/wcn36xx/smd.c
index f8c3a10..19f43de 100644
--- a/drivers/net/wireless/ath/wcn36xx/smd.c
+++ b/drivers/net/wireless/ath/wcn36xx/smd.c
@@ -1134,14 +1134,14 @@ int wcn36xx_smd_config_bss(struct wcn36xx *wcn, struct ieee80211_vif *vif,
 		/* STA */
 		bss->oper_mode = 1;
 		bss->wcn36xx_hal_persona = WCN36XX_HAL_STA_MODE;
-	} else if (vif->type == NL80211_IFTYPE_AP) {
+	} else if (vif->type == NL80211_IFTYPE_AP ||
+		   vif->type == NL80211_IFTYPE_MESH_POINT) {
 		bss->bss_type = WCN36XX_HAL_INFRA_AP_MODE;
 
 		/* AP */
 		bss->oper_mode = 0;
 		bss->wcn36xx_hal_persona = WCN36XX_HAL_STA_SAP_MODE;
-	} else if (vif->type == NL80211_IFTYPE_ADHOC ||
-		   vif->type == NL80211_IFTYPE_MESH_POINT) {
+	} else if (vif->type == NL80211_IFTYPE_ADHOC) {
 		bss->bss_type = WCN36XX_HAL_IBSS_MODE;
 
 		/* STA */
@@ -1291,7 +1291,11 @@ int wcn36xx_smd_send_beacon(struct wcn36xx *wcn, struct ieee80211_vif *vif,
 	memcpy(msg_body.bssid, vif->addr, ETH_ALEN);
 
 	/* TODO need to find out why this is needed? */
-	msg_body.tim_ie_offset = tim_off+4;
+	if (vif->type == NL80211_IFTYPE_MESH_POINT)
+		/* mesh beacon don't need this, so push further down */
+		msg_body.tim_ie_offset = 256;
+	else
+		msg_body.tim_ie_offset = tim_off+4;
 	msg_body.p2p_ie_offset = p2p_off;
 	PREPARE_HAL_BUF(wcn->hal_buf, msg_body);
 
-- 
1.7.9.5


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

* Re: [PATCH] wcn36xx: enable the beaconing in mesh mode
  2013-12-06  3:28 Chun-Yeow Yeoh
@ 2013-12-09  7:23 ` Eugene Krasnikov
  0 siblings, 0 replies; 6+ messages in thread
From: Eugene Krasnikov @ 2013-12-09  7:23 UTC (permalink / raw)
  To: Chun-Yeow Yeoh; +Cc: John Linville, linux-wireless, Chun-Yeow Yeoh

Looks good to me.

On Fri, Dec 6, 2013 at 3:28 AM, Chun-Yeow Yeoh <yeohchunyeow@gmail.com> wrote:
> Enable the beaconing in wnc36xx by tweaking the tim offset and
> force the use of AP-style beaconing. Otherwise, beaconing is not
> working. The tim offset is set to 256. Otherwise, this will
> overwrite mesh beacon submitted by mac80211.
>
> Signed-off-by: Chun-Yeow Yeoh <yeohchunyeow@cozybit.com>
> ---
>  drivers/net/wireless/ath/wcn36xx/smd.c |   12 ++++++++----
>  1 file changed, 8 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/net/wireless/ath/wcn36xx/smd.c b/drivers/net/wireless/ath/wcn36xx/smd.c
> index f8c3a10..19f43de 100644
> --- a/drivers/net/wireless/ath/wcn36xx/smd.c
> +++ b/drivers/net/wireless/ath/wcn36xx/smd.c
> @@ -1134,14 +1134,14 @@ int wcn36xx_smd_config_bss(struct wcn36xx *wcn, struct ieee80211_vif *vif,
>                 /* STA */
>                 bss->oper_mode = 1;
>                 bss->wcn36xx_hal_persona = WCN36XX_HAL_STA_MODE;
> -       } else if (vif->type == NL80211_IFTYPE_AP) {
> +       } else if (vif->type == NL80211_IFTYPE_AP ||
> +                  vif->type == NL80211_IFTYPE_MESH_POINT) {
>                 bss->bss_type = WCN36XX_HAL_INFRA_AP_MODE;
>
>                 /* AP */
>                 bss->oper_mode = 0;
>                 bss->wcn36xx_hal_persona = WCN36XX_HAL_STA_SAP_MODE;
> -       } else if (vif->type == NL80211_IFTYPE_ADHOC ||
> -                  vif->type == NL80211_IFTYPE_MESH_POINT) {
> +       } else if (vif->type == NL80211_IFTYPE_ADHOC) {
>                 bss->bss_type = WCN36XX_HAL_IBSS_MODE;
>
>                 /* STA */
> @@ -1291,7 +1291,11 @@ int wcn36xx_smd_send_beacon(struct wcn36xx *wcn, struct ieee80211_vif *vif,
>         memcpy(msg_body.bssid, vif->addr, ETH_ALEN);
>
>         /* TODO need to find out why this is needed? */
> -       msg_body.tim_ie_offset = tim_off+4;
> +       if (vif->type == NL80211_IFTYPE_MESH_POINT)
> +               /* mesh beacon don't need this, so push further down */
> +               msg_body.tim_ie_offset = 256;
> +       else
> +               msg_body.tim_ie_offset = tim_off+4;
>         msg_body.p2p_ie_offset = p2p_off;
>         PREPARE_HAL_BUF(wcn->hal_buf, msg_body);
>
> --
> 1.7.9.5
>
> --
> 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



-- 
Best regards,
Eugene

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

end of thread, other threads:[~2013-12-09  7:23 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-31  6:04 [PATCH] wcn36xx: enable the beaconing in mesh mode Chun-Yeow Yeoh
2013-10-31 20:30 ` Eugene Krasnikov
2013-11-01  4:14   ` Thomas Pedersen
     [not found]     ` <CAEFj984AojwciEHGvOisoYX8h_vG4TqZmJCXL6B_vpDYMbf9HQ@mail.gmail.com>
2013-11-01 13:45       ` Eugene Krasnikov
  -- strict thread matches above, loose matches on Subject: below --
2013-12-06  3:28 Chun-Yeow Yeoh
2013-12-09  7:23 ` Eugene Krasnikov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).