From patchwork Sun Apr 3 22:16: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: 8735361 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 20509C0553 for ; Sun, 3 Apr 2016 22:22:09 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 470B2200FE for ; Sun, 3 Apr 2016 22:22:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4D383201F5 for ; Sun, 3 Apr 2016 22:22:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753065AbcDCWQv (ORCPT ); Sun, 3 Apr 2016 18:16:51 -0400 Received: from mail-pa0-f52.google.com ([209.85.220.52]:32926 "EHLO mail-pa0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752802AbcDCWQt (ORCPT ); Sun, 3 Apr 2016 18:16:49 -0400 Received: by mail-pa0-f52.google.com with SMTP id zm5so130355597pac.0 for ; Sun, 03 Apr 2016 15:16:49 -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; bh=pjvbaOdyc9me39C5lyDABtqv4M2unPKrbazBjUMmgI0=; b=NSWWHRc744cobGnylR3G5TtzFLPS+DR3oEXc3XDKtlT5UZpK0Q6JR256mv7dogtuBI vl5J6HFnRPBS8RakaaUKYkkfi+/TYaCzcHM1xtYwCIMWnnWzUx958a0B9i3/ZxtGa8xX +3EBVNsK4rBv2FA5RC+IaetU4cHGuueIch6H4= 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; bh=pjvbaOdyc9me39C5lyDABtqv4M2unPKrbazBjUMmgI0=; b=InOMvF6L8rGYx5hs/VSpAbJgzFWZaMtZxv2M/qJwx+j52IdXlD+TthpFGe2t1NUxpP vqwH5DIGip0iTwiZGG10M88m0DOp4SKIIDwuPB1es+Yb45o7OTEVSx/c2hyrM0CvYm5o b34GR/hQdJE+QYmGP+WdCI+L6mFlqq+o8UJrnUi6wQuDFx0LO8zY+CdMHiEi802O/30U qnomRhGrXdxDSjI6WZ6XSlikyozGJoNM9M3N2QeYm2RjmkqEm+/o/hAub0WR+DsemaHs F+NzugiAo4rFfTxzGR4RKxbzVp+jT4fKnBJVeJDthLoXS5MN4aaF042VmvaoYxeXEkU7 o0zQ== X-Gm-Message-State: AD7BkJKSw2KkRblgGQr79QpsxPO/a7nVAdhp2gaE5MfOLNbIcL+s711Xfda1ItXWMFML5rUu X-Received: by 10.66.55.6 with SMTP id n6mr48968508pap.35.1459721809206; Sun, 03 Apr 2016 15:16:49 -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 s64sm34419659pfi.77.2016.04.03.15.16.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 03 Apr 2016 15:16:48 -0700 (PDT) From: Bjorn Andersson To: Eugene Krasnikov , Kalle Valo Cc: Pontus Fuchs , wcn36xx@lists.infradead.org, linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 01/15] wcn36xx: Clean up wcn36xx_smd_send_beacon Date: Sun, 3 Apr 2016 15:16:32 -0700 Message-Id: <1459721806-11817-1-git-send-email-bjorn.andersson@linaro.org> X-Mailer: git-send-email 2.5.0 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=unavailable 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: Pontus Fuchs Needed for coming improvements. No functional changes. Signed-off-by: Pontus Fuchs Signed-off-by: Bjorn Andersson --- drivers/net/wireless/ath/wcn36xx/hal.h | 7 +++++-- drivers/net/wireless/ath/wcn36xx/smd.c | 12 +++++------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/drivers/net/wireless/ath/wcn36xx/hal.h b/drivers/net/wireless/ath/wcn36xx/hal.h index b947de0fb2e5..4fd77ccc2287 100644 --- a/drivers/net/wireless/ath/wcn36xx/hal.h +++ b/drivers/net/wireless/ath/wcn36xx/hal.h @@ -51,8 +51,8 @@ #define WALN_HAL_STA_INVALID_IDX 0xFF #define WCN36XX_HAL_BSS_INVALID_IDX 0xFF -/* Default Beacon template size */ -#define BEACON_TEMPLATE_SIZE 0x180 +/* Default Beacon template size. */ +#define BEACON_TEMPLATE_SIZE 0x17C /* Param Change Bitmap sent to HAL */ #define PARAM_BCN_INTERVAL_CHANGED (1 << 0) @@ -2884,6 +2884,9 @@ struct update_beacon_rsp_msg { struct wcn36xx_hal_send_beacon_req_msg { struct wcn36xx_hal_msg_header header; + /* length of the template + 6. Only qcom knows why */ + u32 beacon_length6; + /* length of the template. */ u32 beacon_length; diff --git a/drivers/net/wireless/ath/wcn36xx/smd.c b/drivers/net/wireless/ath/wcn36xx/smd.c index 74f56a81ad9a..ff3ed2461a69 100644 --- a/drivers/net/wireless/ath/wcn36xx/smd.c +++ b/drivers/net/wireless/ath/wcn36xx/smd.c @@ -1380,19 +1380,17 @@ int wcn36xx_smd_send_beacon(struct wcn36xx *wcn, struct ieee80211_vif *vif, mutex_lock(&wcn->hal_mutex); INIT_HAL_MSG(msg_body, WCN36XX_HAL_SEND_BEACON_REQ); - /* TODO need to find out why this is needed? */ - msg_body.beacon_length = skb_beacon->len + 6; + msg_body.beacon_length = skb_beacon->len; + /* TODO need to find out why + 6 is needed */ + msg_body.beacon_length6 = msg_body.beacon_length + 6; - if (BEACON_TEMPLATE_SIZE > msg_body.beacon_length) { - memcpy(&msg_body.beacon, &skb_beacon->len, sizeof(u32)); - memcpy(&(msg_body.beacon[4]), skb_beacon->data, - skb_beacon->len); - } else { + if (msg_body.beacon_length > BEACON_TEMPLATE_SIZE) { wcn36xx_err("Beacon is to big: beacon size=%d\n", msg_body.beacon_length); ret = -ENOMEM; goto out; } + memcpy(msg_body.beacon, skb_beacon->data, skb_beacon->len); memcpy(msg_body.bssid, vif->addr, ETH_ALEN); /* TODO need to find out why this is needed? */