From patchwork Tue Jun 9 05:35:33 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chun-Yeow Yeoh X-Patchwork-Id: 6569611 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 536F99F326 for ; Tue, 9 Jun 2015 05:35:57 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 75CCB20490 for ; Tue, 9 Jun 2015 05:35:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9B5342046F for ; Tue, 9 Jun 2015 05:35:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753648AbbFIFfx (ORCPT ); Tue, 9 Jun 2015 01:35:53 -0400 Received: from mail-pd0-f179.google.com ([209.85.192.179]:33496 "EHLO mail-pd0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752812AbbFIFfw (ORCPT ); Tue, 9 Jun 2015 01:35:52 -0400 Received: by pdjn11 with SMTP id n11so7189061pdj.0 for ; Mon, 08 Jun 2015 22:35:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=zmNRTVYA8MiI/idRUw/dmyFYxTAa4ia5eUB7uvLzD8c=; b=SZ2foV2YydD7ZcVZ+tPkzqktXlpMXzNDN9DFdLYRuuzoH3IALDlyCc1D2CFan4twHO Cpk8djDGlEb0aHGZM6Av1d9bF5aUdqrPFG/xCkBcN3hIDk8NgZfmfa1rA656nUDdDpSL cNSu9ztUcLL+ybr5lKpf4z65+B6aTnqRHnlxK2U85Urp7SPXlQuki8D5dbH6SaYeSOPn pjGkOHjGUhFEVHlthFu8X7yuJORTOYJrLzgeApneU7wFfFZr9uxp/7ld2AxK4YOwCv/B oba/0cesW4ek6r7M2Yn9+pClTvRwfAvlSPsL6Fcx5hzpmqOJDXeOKjM/lPY0SsWbzpP0 goxw== X-Received: by 10.68.129.134 with SMTP id nw6mr35232273pbb.109.1433828152106; Mon, 08 Jun 2015 22:35:52 -0700 (PDT) Received: from localhost.localdomain ([58.26.233.145]) by mx.google.com with ESMTPSA id de2sm4231057pdb.15.2015.06.08.22.35.49 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 08 Jun 2015 22:35:51 -0700 (PDT) From: Chun-Yeow Yeoh To: linux-wireless@vger.kernel.org Cc: johannes@sipsolutions.net, devel@lists.open80211s.org, Chun-Yeow Yeoh Subject: [PATCH] mac80211: fix the beacon csa counter for mesh and ibss Date: Tue, 9 Jun 2015 13:35:33 +0800 Message-Id: <1433828133-6904-1-git-send-email-yeohchunyeow@gmail.com> X-Mailer: git-send-email 2.3.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=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, T_RP_MATCHES_RCVD, 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 The csa counter has moved from sdata to beacon/presp but it is not updated accordingly for mesh and ibss. Fix this. This regression is introduced by the following patch: mac80211: move csa counters from sdata to beacon/presp Signed-off-by: Chun-Yeow Yeoh --- net/mac80211/cfg.c | 1 + net/mac80211/ibss.c | 1 + net/mac80211/mesh.c | 1 + 3 files changed, 3 insertions(+) diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c index bb9f836..0fdfc20 100644 --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c @@ -3443,6 +3443,7 @@ static int ieee80211_mgmt_tx(struct wiphy *wiphy, struct wireless_dev *wdev, /* Update CSA counters */ if (sdata->vif.csa_active && (sdata->vif.type == NL80211_IFTYPE_AP || + sdata->vif.type == NL80211_IFTYPE_MESH_POINT || sdata->vif.type == NL80211_IFTYPE_ADHOC) && params->n_csa_offsets) { int i; diff --git a/net/mac80211/ibss.c b/net/mac80211/ibss.c index 21716af..7f72bc9 100644 --- a/net/mac80211/ibss.c +++ b/net/mac80211/ibss.c @@ -146,6 +146,7 @@ ieee80211_ibss_build_presp(struct ieee80211_sub_if_data *sdata, csa_settings->chandef.chan->center_freq); presp->csa_counter_offsets[0] = (pos - presp->head); *pos++ = csa_settings->count; + presp->csa_current_counter = csa_settings->count; } /* put the remaining rates in WLAN_EID_EXT_SUPP_RATES */ diff --git a/net/mac80211/mesh.c b/net/mac80211/mesh.c index d468424..817098a 100644 --- a/net/mac80211/mesh.c +++ b/net/mac80211/mesh.c @@ -680,6 +680,7 @@ ieee80211_mesh_build_beacon(struct ieee80211_if_mesh *ifmsh) *pos++ = 0x0; *pos++ = ieee80211_frequency_to_channel( csa->settings.chandef.chan->center_freq); + bcn->csa_current_counter = csa->settings.count; bcn->csa_counter_offsets[0] = hdr_len + 6; *pos++ = csa->settings.count; *pos++ = WLAN_EID_CHAN_SWITCH_PARAM;