From patchwork Mon Mar 31 10:39:22 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Kazior X-Patchwork-Id: 3913581 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.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 52026BF540 for ; Mon, 31 Mar 2014 11:43:20 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6F039203AC for ; Mon, 31 Mar 2014 11:43:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9916C20386 for ; Mon, 31 Mar 2014 11:43:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752992AbaCaLnP (ORCPT ); Mon, 31 Mar 2014 07:43:15 -0400 Received: from mail-wg0-f52.google.com ([74.125.82.52]:44757 "EHLO mail-wg0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752666AbaCaLnN (ORCPT ); Mon, 31 Mar 2014 07:43:13 -0400 Received: by mail-wg0-f52.google.com with SMTP id k14so5666727wgh.11 for ; Mon, 31 Mar 2014 04:43:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tieto.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=+OzGIXnhXd6j9fPABSFEnsHChwhRzJdQ6U4YXCdPYcQ=; b=D+muzwPe85JkvNPUEqw6R+XxrZ0CPL4sOdPc7hvh2e87ifKf/4noqwkS9A1zW4h6QM 2IFNJYOCEIDegwknF6aM3eJ2Wpcq/IKRz7s/WdID89lGKolwYAhstUiUwW+ARRMDHJ3/ TByjhHNEbPnpwjzATJrhf53HDBGGaul+c0jyA= 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=+OzGIXnhXd6j9fPABSFEnsHChwhRzJdQ6U4YXCdPYcQ=; b=Ikm2bqVp29Mig4Qdq5sciSkJpwrs0pObVTgNbcqolghVhs8QWYdQCxX8K+i7GpZEQw DD0CcNOdBgEN0TxCmxRUmhsopwoq+j5xxpsdQOjxc+mNLg4oGUAstYrYhxQ1XSey/CnY xKh0DLzWpnkSXZJtByp5PpdPes555hAgCdZ9raC5hP9YOj7SAM/x1vhTXHD8hyWfEDqk OfpMSbWZTlj7nmuViwn5sF8MlDKbATtA9YJtDC6IOYdj5pE58AGXrjuM0Ky6Ncd8tMtC 3ft99/soQXfgklke2fiXJteob1mfsPnj/Zp/vskG3CPwQ+tSx5Pdmse8sgANM6ifYHkz ElYQ== X-Gm-Message-State: ALoCoQkoi5g2BaGQdk83D+WF6GKaucu4iwZLdrRAnE3QmbgYU9V2QVNR5lQzlUl6j1sdbegxbCXFLrVDMHtbKNT9LzR+eB3Rs7umFEb/Q6Cv6i3tmib98uk= X-Received: by 10.180.184.167 with SMTP id ev7mr11626391wic.55.1396266192212; Mon, 31 Mar 2014 04:43:12 -0700 (PDT) Received: from localhost.localdomain ([91.198.246.8]) by mx.google.com with ESMTPSA id q49sm32467516eem.34.2014.03.31.04.43.07 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 31 Mar 2014 04:43:08 -0700 (PDT) From: Michal Kazior To: linux-wireless@vger.kernel.org Cc: johannes@sipsolutions.net, Michal Kazior Subject: [PATCH v3 04/13] mac80211: add support for radar detection for reservations Date: Mon, 31 Mar 2014 12:39:22 +0200 Message-Id: <1396262371-6466-5-git-send-email-michal.kazior@tieto.com> X-Mailer: git-send-email 1.8.5.3 In-Reply-To: <1396262371-6466-1-git-send-email-michal.kazior@tieto.com> References: <1395409651-26120-1-git-send-email-michal.kazior@tieto.com> <1396262371-6466-1-git-send-email-michal.kazior@tieto.com> X-DomainID: tieto.com 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.4 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 Initial chanctx reservation code wasn't aware of radar detection requirements. This is necessary for chanctx reservations to be used for channel switching in the future. Signed-off-by: Michal Kazior --- net/mac80211/chan.c | 5 ++++- net/mac80211/ieee80211_i.h | 4 +++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/net/mac80211/chan.c b/net/mac80211/chan.c index 90cac10..cc85ad8 100644 --- a/net/mac80211/chan.c +++ b/net/mac80211/chan.c @@ -743,7 +743,8 @@ int ieee80211_vif_unreserve_chanctx(struct ieee80211_sub_if_data *sdata) int ieee80211_vif_reserve_chanctx(struct ieee80211_sub_if_data *sdata, const struct cfg80211_chan_def *chandef, - enum ieee80211_chanctx_mode mode) + enum ieee80211_chanctx_mode mode, + bool radar_required) { struct ieee80211_local *local = sdata->local; struct ieee80211_chanctx_conf *conf; @@ -787,6 +788,7 @@ int ieee80211_vif_reserve_chanctx(struct ieee80211_sub_if_data *sdata, new_ctx->refcount++; sdata->reserved_chanctx = new_ctx; sdata->reserved_chandef = *chandef; + sdata->reserved_radar_required = radar_required; out: mutex_unlock(&local->chanctx_mtx); return ret; @@ -831,6 +833,7 @@ int ieee80211_vif_use_reserved_context(struct ieee80211_sub_if_data *sdata, /* unref our reservation */ ctx->refcount--; sdata->reserved_chanctx = NULL; + sdata->radar_required = sdata->reserved_radar_required; if (old_ctx == ctx) { /* This is our own context, just change it */ diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h index 41d9e49..a96e375 100644 --- a/net/mac80211/ieee80211_i.h +++ b/net/mac80211/ieee80211_i.h @@ -760,6 +760,7 @@ struct ieee80211_sub_if_data { /* context reservation -- protected with chanctx_mtx */ struct ieee80211_chanctx *reserved_chanctx; struct cfg80211_chan_def reserved_chandef; + bool reserved_radar_required; /* used to reconfigure hardware SM PS */ struct work_struct recalc_smps; @@ -1785,7 +1786,8 @@ ieee80211_vif_use_channel(struct ieee80211_sub_if_data *sdata, int __must_check ieee80211_vif_reserve_chanctx(struct ieee80211_sub_if_data *sdata, const struct cfg80211_chan_def *chandef, - enum ieee80211_chanctx_mode mode); + enum ieee80211_chanctx_mode mode, + bool radar_required); int __must_check ieee80211_vif_use_reserved_context(struct ieee80211_sub_if_data *sdata, u32 *changed);