From patchwork Tue Mar 29 06:06:32 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Andersson X-Patchwork-Id: 8682481 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id BB851C0553 for ; Tue, 29 Mar 2016 06:07:33 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E0A4E201F5 for ; Tue, 29 Mar 2016 06:07:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E7B6F2012D for ; Tue, 29 Mar 2016 06:07:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756069AbcC2GHY (ORCPT ); Tue, 29 Mar 2016 02:07:24 -0400 Received: from mail-pf0-f174.google.com ([209.85.192.174]:33321 "EHLO mail-pf0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756008AbcC2GGz (ORCPT ); Tue, 29 Mar 2016 02:06:55 -0400 Received: by mail-pf0-f174.google.com with SMTP id 4so6638926pfd.0 for ; Mon, 28 Mar 2016 23:06:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=esTdcZk5L10F4BtFHkM/y9AKj4TQf4DT2oTtZEE+42s=; b=fHUYncc68grstzk213YjfoH4e/bFBtJeob90xrd2COSOl1bk8pPCVmTxICh6KPdLF1 SOApQBZkdA2ewWr0fiRhJ52XX/fwtaD2AN5SbOERYxVkhfoKVTkZDWwDxkTXdpytQyKb oNmmCX7ACvcn/HZt5FaEOYSAJbmpR/SDo5P3o= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=esTdcZk5L10F4BtFHkM/y9AKj4TQf4DT2oTtZEE+42s=; b=aPZUzXSo+txq5z91NQADCvbSEuaDSu9dOyz2jSj4pfk7HEGQvKZkIUYnkaMfZzaXwg ID04GNsRqyXJUYWI4zdKnUgxfrNaGxXh85iUzriymDEXfuOO8tqRyK3h49HOQM+yt7Iu JClTlE5aXv/K8Nspo5i1d6jWBjJRJrWzjeyX11Wl58YQJuDHIru3xgG9SN6tiEpGOGMs JMWYO0SEqplgP5ZT4AaanoBHzYUL7cSvTS+JrZC7592fn9uNCr16si1ikEBY3n1i4WUG y27z03KDvAzhXSVj/gq6thSqGPKmHnIdZ7F55mWonxoJ2vLJukVODiRCZXP66kxWz3jO KrpQ== X-Gm-Message-State: AD7BkJIKSbOCVldw3LOGwDs86yAXQWqLC/Vi3g47lnvkp3rkkzPE6+KzLMEyPEMGdF/Q73mh X-Received: by 10.98.7.5 with SMTP id b5mr697339pfd.47.1459231614978; Mon, 28 Mar 2016 23:06:54 -0700 (PDT) Received: from localhost.localdomain (ip68-111-223-48.sd.sd.cox.net. [68.111.223.48]) by smtp.gmail.com with ESMTPSA id k88sm39878073pfj.0.2016.03.28.23.06.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 28 Mar 2016 23:06:54 -0700 (PDT) From: Bjorn Andersson To: Eugene Krasnikov , Kalle Valo Cc: wcn36xx@lists.infradead.org, linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Jason Mobarak , Chun-Yeow Yeoh Subject: [PATCH 15/16] wcn36xx: don't pad beacons for mesh Date: Mon, 28 Mar 2016 23:06:32 -0700 Message-Id: <1459231593-360-16-git-send-email-bjorn.andersson@linaro.org> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1459231593-360-1-git-send-email-bjorn.andersson@linaro.org> References: <1459231593-360-1-git-send-email-bjorn.andersson@linaro.org> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-7.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Jason Mobarak 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 Signed-off-by: Chun-Yeow Yeoh Signed-off-by: Bjorn Andersson --- drivers/net/wireless/ath/wcn36xx/smd.c | 5 +++++ 1 file changed, 5 insertions(+) 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;