From patchwork Fri Mar 7 13:37:51 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rostislav Lisovy X-Patchwork-Id: 3791541 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 265A89F35F for ; Fri, 7 Mar 2014 13:38:23 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 80DC320265 for ; Fri, 7 Mar 2014 13:38:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7CCCE201BA for ; Fri, 7 Mar 2014 13:38:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753432AbaCGNiL (ORCPT ); Fri, 7 Mar 2014 08:38:11 -0500 Received: from mail-ea0-f171.google.com ([209.85.215.171]:65351 "EHLO mail-ea0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752925AbaCGNiJ (ORCPT ); Fri, 7 Mar 2014 08:38:09 -0500 Received: by mail-ea0-f171.google.com with SMTP id n15so2305332ead.16 for ; Fri, 07 Mar 2014 05:38:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=2CFuiryn3KxoPrenS8x2KKlTf/upPl3F2nLvpOvVktk=; b=JazSZ5AENsVvO5zqxIJyBBPW0pZT1Njx3pc8Y9j/6pUcpnpAa+zY6uAsShat2AKlso 5NTOXNsuj9EHynyvkXk+UqfXWK7nXczIgw5Cl1kIZcBgEd0dXvF79lxzauy3FiuOkNQu DDzxJWpgyoRbW+g49LHS3XdAaBjkp2YrzAB0lMkyrM3HQz/RgORZJjLSfopxMbIi5rCc 4DZvuTbwX+v64AX+ztXYhMRU3GBnKYiRFWVIr/oyn3dhT5RFgASpJYRENas8Lzb8YgE6 8M3jIJ3M3izhwIKZCiDiKHvJ7kinCO9QTScr79B3l9PD+8uv7cYRLmvcMHXYV9csP6Dx 9tkw== X-Received: by 10.15.75.66 with SMTP id k42mr19308010eey.2.1394199488504; Fri, 07 Mar 2014 05:38:08 -0800 (PST) Received: from c2c-vostro1.felk.cvut.cz ([147.32.86.166]) by mx.google.com with ESMTPSA id 48sm6764355eee.2.2014.03.07.05.38.06 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 07 Mar 2014 05:38:07 -0800 (PST) From: Rostislav Lisovy To: Johannes Berg , linux-wireless@vger.kernel.org Cc: Michal Sojka , s.sander@nordsys.de, jan-niklas.meier@volkswagen.de Subject: [RFC PATCH 4/8] cfg80211: Modify chandef related functions to work with 5/10MHz channels Date: Fri, 7 Mar 2014 14:37:51 +0100 Message-Id: <1394199475-5208-5-git-send-email-rostislav.lisovy@fel.cvut.cz> X-Mailer: git-send-email 1.8.5.1 In-Reply-To: <1394199475-5208-1-git-send-email-rostislav.lisovy@fel.cvut.cz> References: <1394199475-5208-1-git-send-email-rostislav.lisovy@fel.cvut.cz> 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 Signed-off-by: Rostislav Lisovy --- include/net/cfg80211.h | 4 ++++ net/wireless/chan.c | 10 ++++++++++ 2 files changed, 14 insertions(+) diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h index f5ecd6c..16f19e0 100644 --- a/include/net/cfg80211.h +++ b/include/net/cfg80211.h @@ -367,6 +367,10 @@ static inline enum nl80211_channel_type cfg80211_get_chandef_type(const struct cfg80211_chan_def *chandef) { switch (chandef->width) { + case NL80211_CHAN_WIDTH_5: + return NL80211_CHAN_5MHZ; + case NL80211_CHAN_WIDTH_10: + return NL80211_CHAN_10MHZ; case NL80211_CHAN_WIDTH_20_NOHT: return NL80211_CHAN_NO_HT; case NL80211_CHAN_WIDTH_20: diff --git a/net/wireless/chan.c b/net/wireless/chan.c index 78559b5..0bcdd27 100644 --- a/net/wireless/chan.c +++ b/net/wireless/chan.c @@ -22,6 +22,14 @@ void cfg80211_chandef_create(struct cfg80211_chan_def *chandef, chandef->center_freq2 = 0; switch (chan_type) { + case NL80211_CHAN_5MHZ: + chandef->width = NL80211_CHAN_WIDTH_5; + chandef->center_freq1 = chan->center_freq; + break; + case NL80211_CHAN_10MHZ: + chandef->width = NL80211_CHAN_WIDTH_10; + chandef->center_freq1 = chan->center_freq; + break; case NL80211_CHAN_NO_HT: chandef->width = NL80211_CHAN_WIDTH_20_NOHT; chandef->center_freq1 = chan->center_freq; @@ -531,12 +539,14 @@ bool cfg80211_chandef_usable(struct wiphy *wiphy, width = 5; break; case NL80211_CHAN_WIDTH_10: + prohibited_flags |= IEEE80211_CHAN_NO_10MHZ; width = 10; break; case NL80211_CHAN_WIDTH_20: if (!ht_cap->ht_supported) return false; case NL80211_CHAN_WIDTH_20_NOHT: + prohibited_flags |= IEEE80211_CHAN_NO_20MHZ; width = 20; break; case NL80211_CHAN_WIDTH_40: