From patchwork Mon Jul 8 14:55:57 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Wunderlich X-Patchwork-Id: 2824938 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 19DAA9F9CF for ; Mon, 8 Jul 2013 14:56:56 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id EA4F720181 for ; Mon, 8 Jul 2013 14:56:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id BA7E820179 for ; Mon, 8 Jul 2013 14:56:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752606Ab3GHO4k (ORCPT ); Mon, 8 Jul 2013 10:56:40 -0400 Received: from nick.hrz.tu-chemnitz.de ([134.109.228.11]:58666 "EHLO nick.hrz.tu-chemnitz.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751494Ab3GHO4T (ORCPT ); Mon, 8 Jul 2013 10:56:19 -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=9aF2QDNnLL0Eg0tXVueQBJ458My0Ner8NaaWnJt4ld0=; b=S/arhb1nX2V18j1obNrWffUOJp1CvbjQBluPA0G89/woRyzg+wpCeBHmq0rMwRyzzhCAz7bbCBVetMcdGWv9EwoLp97oIBHF2cxLRKPCR1pvkwr/13q8TT2TUjeJ1ob7CefsIaVISE10/Ro9iVK0qxjT0XYoe/7nnGd2METwRtc=; Received: from p4ffe4810.dip0.t-ipconnect.de ([79.254.72.16] helo=pandem0nium) by nick.hrz.tu-chemnitz.de with esmtpsa (TLSv1:DHE-RSA-AES128-SHA:128) (Exim 4.80.1) (envelope-from ) id 1UwCrS-0003B5-5n; Mon, 08 Jul 2013 16:56:18 +0200 Received: from dotslash by pandem0nium with local (Exim 4.80) (envelope-from ) id 1UwCrP-0003M1-Pj; Mon, 08 Jul 2013 16:56:15 +0200 From: Simon Wunderlich To: Johannes Berg Cc: linux-wireless@vger.kernel.org, Mathias Kretschmer , Simon Wunderlich Subject: [PATCHv6 09/18] mac80211: return if IBSS chandef can not be used Date: Mon, 8 Jul 2013 16:55:57 +0200 Message-Id: <1373295366-12823-10-git-send-email-siwu@hrz.tu-chemnitz.de> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1373295366-12823-1-git-send-email-siwu@hrz.tu-chemnitz.de> References: <1373295366-12823-1-git-send-email-siwu@hrz.tu-chemnitz.de> X-purgate: clean.bounce X-purgate-type: clean.bounce X-purgate-ID: 154106::1373295378-000004FE-97AE5214/0-0/0-18 X-Scan-AV: nick.hrz.tu-chemnitz.de; 2013-07-08 16:56:18; 8f5f8a35e72b3a482d559ba3b95d726c X-Scan-SA: nick.hrz.tu-chemnitz.de; 2013-07-08 16:56:18; 14c9d743c266b5ff4a686bad9a41f396 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=-7.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 b99d948..7941e8d 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; }