diff mbox

[15/16] wcn36xx: don't pad beacons for mesh

Message ID 1459231593-360-16-git-send-email-bjorn.andersson@linaro.org (mailing list archive)
State Changes Requested
Delegated to: Kalle Valo
Headers show

Commit Message

Bjorn Andersson March 29, 2016, 6:06 a.m. UTC
From: Jason Mobarak <jam@cozybit.com>

Patch "wcn36xx: Pad TIM PVM if needed" has caused a regression in mesh
beaconing.  The field tim_off is always 0 for mesh mode, and thus
pvm_len (referring to the TIM length field) and pad are both incorrectly
calculated.  Thus, msg_body.beacon_length is incorrectly calculated for
mesh mode. Fix this.

Signed-off-by: Jason Mobarak <jam@cozybit.com>
Signed-off-by: Chun-Yeow Yeoh <yeohchunyeow@cozybit.com>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
---
 drivers/net/wireless/ath/wcn36xx/smd.c | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Sergei Shtylyov March 29, 2016, 12:45 p.m. UTC | #1
Hello.

On 3/29/2016 9:06 AM, Bjorn Andersson wrote:

> From: Jason Mobarak <jam@cozybit.com>
>
> Patch "wcn36xx: Pad TIM PVM if needed" has caused a regression in mesh

    scripts/checkpatch.pl now enforces the specific commit citing format, i.e. 
<12-digit SHA1> ("<commit summary>").

> beaconing.  The field tim_off is always 0 for mesh mode, and thus
> pvm_len (referring to the TIM length field) and pad are both incorrectly
> calculated.  Thus, msg_body.beacon_length is incorrectly calculated for
> mesh mode. Fix this.
>
> Signed-off-by: Jason Mobarak <jam@cozybit.com>
> Signed-off-by: Chun-Yeow Yeoh <yeohchunyeow@cozybit.com>
> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>

    You might want to add the Fixes: tag.

[...]

MBR, Sergei

--
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/wcn36xx/smd.c b/drivers/net/wireless/ath/wcn36xx/smd.c
index a57d158298a1..b1bdc229e560 100644
--- a/drivers/net/wireless/ath/wcn36xx/smd.c
+++ b/drivers/net/wireless/ath/wcn36xx/smd.c
@@ -1410,6 +1410,11 @@  int wcn36xx_smd_send_beacon(struct wcn36xx *wcn, struct ieee80211_vif *vif,
 
 	pvm_len = skb_beacon->data[tim_off + 1] - 3;
 	pad = TIM_MIN_PVM_SIZE - pvm_len;
+
+	/* Padding is irrelevant to mesh mode since tim_off is always 0. */
+	if (vif->type == NL80211_IFTYPE_MESH_POINT)
+		pad = 0;
+
 	msg_body.beacon_length = skb_beacon->len + pad;
 	/* TODO need to find out why + 6 is needed */
 	msg_body.beacon_length6 = msg_body.beacon_length + 6;