From patchwork Thu Jun 27 16:58:51 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Wunderlich X-Patchwork-Id: 2794491 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 484B19F3EB for ; Thu, 27 Jun 2013 16:59:39 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 74620203B5 for ; Thu, 27 Jun 2013 16:59:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9523F20320 for ; Thu, 27 Jun 2013 16:59:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753387Ab3F0Q7Q (ORCPT ); Thu, 27 Jun 2013 12:59:16 -0400 Received: from nick.hrz.tu-chemnitz.de ([134.109.228.11]:59380 "EHLO nick.hrz.tu-chemnitz.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752817Ab3F0Q7P (ORCPT ); Thu, 27 Jun 2013 12:59:15 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tu-chemnitz.de; s=dkim2010; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From; bh=oWl9d2ohAr+afmfgERN0ASah1rcKFmHqev0PqDb8mTA=; b=egopEzI9Imp6o3yU4mTgMrS/UZUP2K72qOpztxTOWKX8R1c44aVN8ThZEUtzUmU/S4w2R8DEs02ifesu13Ft5LqfbBYkxMW98KfdizWc0uBqTGplMEbjnIG6l1mM9ZKIj2b7ONBdBIJjin3qjBkHxUq+ziJGQrpApU47zv1KZYY=; Received: from p4ffe56a3.dip0.t-ipconnect.de ([79.254.86.163] helo=pandem0nium) by nick.hrz.tu-chemnitz.de with esmtpsa (TLSv1:DHE-RSA-AES128-SHA:128) (Exim 4.80.1) (envelope-from ) id 1UsFXN-0003iR-Jv; Thu, 27 Jun 2013 18:59:14 +0200 Received: from dotslash by pandem0nium with local (Exim 4.80) (envelope-from ) id 1UsFXM-0005OT-9b; Thu, 27 Jun 2013 18:59:12 +0200 From: Simon Wunderlich To: Johannes Berg Cc: linux-wireless@vger.kernel.org, Mathias Kretschmer , Simon Wunderlich Subject: [PATCHv5 09/18] mac80211: return if IBSS chandef can not be used Date: Thu, 27 Jun 2013 18:58:51 +0200 Message-Id: <1372352340-20663-11-git-send-email-siwu@hrz.tu-chemnitz.de> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1372352340-20663-1-git-send-email-siwu@hrz.tu-chemnitz.de> References: <1372352340-20663-1-git-send-email-siwu@hrz.tu-chemnitz.de> X-purgate: clean.bounce X-purgate-type: clean.bounce X-purgate-ID: 154106::1372352353-000004FE-5D68AFDB/0-0/0-18 X-Scan-AV: nick.hrz.tu-chemnitz.de; 2013-06-27 18:59:13; 9265f7a21c790745c325477bca56f0c6 X-Scan-SA: nick.hrz.tu-chemnitz.de; 2013-06-27 18:59:14; 47ddf03c0ce63e11db1cf5b82a84249b X-Spam-Score: -1.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=-8.1 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 This was originally designed to fail when a 40+/40- mode can not be used, but basic modes (such as 5/10/20 MHz) must be handled with an error. Signed-off-by: Simon Wunderlich --- net/mac80211/ibss.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/net/mac80211/ibss.c b/net/mac80211/ibss.c index 6adc5af..2e0256b 100644 --- a/net/mac80211/ibss.c +++ b/net/mac80211/ibss.c @@ -85,6 +85,14 @@ static void __ieee80211_sta_join_ibss(struct ieee80211_sub_if_data *sdata, chandef = ifibss->chandef; if (!cfg80211_reg_can_beacon(local->hw.wiphy, &chandef)) { + if (chandef.width == NL80211_CHAN_WIDTH_5 || + chandef.width == NL80211_CHAN_WIDTH_10 || + chandef.width == NL80211_CHAN_WIDTH_20_NOHT || + chandef.width == NL80211_CHAN_WIDTH_20) { + sdata_info(sdata, + "Failed to join IBSS, beacons forbidden\n"); + return; + } chandef.width = NL80211_CHAN_WIDTH_20; chandef.center_freq1 = chan->center_freq; }