From patchwork Tue Mar 18 13:53:04 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Kazior X-Patchwork-Id: 3853491 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.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 0A7FF9F334 for ; Wed, 19 Mar 2014 17:45:30 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 36F35200DF for ; Wed, 19 Mar 2014 17:45:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 55CBD201DE for ; Wed, 19 Mar 2014 17:45:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754862AbaCRN7X (ORCPT ); Tue, 18 Mar 2014 09:59:23 -0400 Received: from mail-ee0-f47.google.com ([74.125.83.47]:65516 "EHLO mail-ee0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754186AbaCRN7H (ORCPT ); Tue, 18 Mar 2014 09:59:07 -0400 Received: by mail-ee0-f47.google.com with SMTP id b15so5365796eek.20 for ; Tue, 18 Mar 2014 06:59:06 -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=NHWTymF6vNRoRoqtewqy0kJ2NFERbY3MOFE9bxBsgwE=; b=1gJyI5sSpZHdXhJ4u0bgy/iAGknEK9UNVnD7n8u6i28xoNoWYEoh4cJUbnrpO+VGd4 utA8Ooyg3hhEL9iJOk3F9ikub3wlgURINtywK71kdeVtNgMopGdMz3jaK58hQ8cvUT2h C5pqkHZ0etIkySFeOJmHW1XSghR5whZkj3Yfs= 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=NHWTymF6vNRoRoqtewqy0kJ2NFERbY3MOFE9bxBsgwE=; b=CY0YfQzIu0Zyi2IBY21DYGgmAQlt3efU1bH00mTwWHcYnzeBTAfk6Y3j4BoXfE4HME eQXka9bqC7692RJfCrV7rXM/Ikx91xWO5xFkpdxLaQ2wU7q07Caa+haFqQu8QEPxJaEL wonB0XWbqBOmpaCh0P8DI5jsVQNbbpi2lvpAIBvhnQ0OapaVzaPC4CZf9R55TXp4sdIN lwSjVKWs61wLRlEVmxt5xJhVuPHuUJrYlBnMU6UxbqXhQauo0LzdGBaqdDkusOxTsDD3 90plqi0qax2d7qwv6SSSceohmOMGIUi2QSbAK43+oPfybd7AsddTTLlgoOKYdiwiR6CN TTZg== X-Gm-Message-State: ALoCoQmsc/kRH4uCil8syy1k5R07lMLpiGnqaBavN1cXLfRA2rT+7rTl95LBZe/peu5o01MeqipMB+55nIS9LMExjcZVUZL5Q+YWNjdYRaI5DILwNtUZf0o= X-Received: by 10.15.56.130 with SMTP id y2mr30484861eew.17.1395151146297; Tue, 18 Mar 2014 06:59:06 -0700 (PDT) Received: from localhost.localdomain ([91.198.246.8]) by mx.google.com with ESMTPSA id x45sm35223167eeu.23.2014.03.18.06.59.04 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 18 Mar 2014 06:59:05 -0700 (PDT) From: Michal Kazior To: linux-wireless@vger.kernel.org Cc: johannes@sipsolutions.net, Michal Kazior Subject: [RFC 01/21] mac80211: add support for radar detection for reservations Date: Tue, 18 Mar 2014 14:53:04 +0100 Message-Id: <1395150804-24090-2-git-send-email-michal.kazior@tieto.com> X-Mailer: git-send-email 1.8.5.3 In-Reply-To: <1395150804-24090-1-git-send-email-michal.kazior@tieto.com> References: <1395150804-24090-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=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, 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 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 74b0df6..a3704d4 100644 --- a/net/mac80211/chan.c +++ b/net/mac80211/chan.c @@ -723,7 +723,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; @@ -764,6 +765,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; @@ -808,6 +810,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 a32d62d..15556fe 100644 --- a/net/mac80211/ieee80211_i.h +++ b/net/mac80211/ieee80211_i.h @@ -759,6 +759,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; @@ -1776,7 +1777,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);