From patchwork Sat Dec 22 03:35:24 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Lamparter X-Patchwork-Id: 1905401 Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id CE875DFB79 for ; Sat, 22 Dec 2012 03:43:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751507Ab2LVDnP (ORCPT ); Fri, 21 Dec 2012 22:43:15 -0500 Received: from mail-ee0-f47.google.com ([74.125.83.47]:50706 "EHLO mail-ee0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751097Ab2LVDnO (ORCPT ); Fri, 21 Dec 2012 22:43:14 -0500 X-Greylist: delayed 463 seconds by postgrey-1.27 at vger.kernel.org; Fri, 21 Dec 2012 22:43:14 EST Received: by mail-ee0-f47.google.com with SMTP id e51so2694320eek.34 for ; Fri, 21 Dec 2012 19:43:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:subject:to:cc:from:date:mime-version:content-type :content-transfer-encoding:message-id; bh=gVkVjJ+ABgDj0Jwf7Lh+5V8l21CatqEd3HvNMeh3geE=; b=05jMelJcbPx7WbXNE8prbSclCJ5+Ixc7xVi4HXtkpz+ka9GfXg++R30LpH6E7zGbd1 R4ACfY6tvyPgHYjiRuSkrkA9SknEmtb/17n4opG9GBM/UE5qVtLe6+1sTg0/Yxylh5zU 4QMmWvaflSxSEYDPcG8jcClsC21qKPw8w+QSI1bVcISADhzUC7lnz9by7TCUb4QTRgbp hHuUwu/z448F19u4WlFl5l+SyR/Xqx+LbZJXFFhY97a+d1/N6VLX/Hp0xNaDBkgjU7XM rFbZYVQSPysI9KX8gKgPr5CcbKrQ+ktav4FND+V2AoR0r6WxojDg3sbwJnu63TomsbLx gUjw== X-Received: by 10.14.225.194 with SMTP id z42mr37265739eep.22.1356147330280; Fri, 21 Dec 2012 19:35:30 -0800 (PST) Received: from debian64.localnet (pD9F8A1DB.dip.t-dialin.net. [217.248.161.219]) by mx.google.com with ESMTPS id 44sm25415920eek.0.2012.12.21.19.35.26 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 21 Dec 2012 19:35:27 -0800 (PST) Received: from localhost ([127.0.0.1] helo=debian64.localnet ident=chuck) by debian64.localnet with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.80) (envelope-from ) id 1TmFrx-0004PJ-JC; Sat, 22 Dec 2012 04:35:25 +0100 Subject: [PATCH -stable 3.7] carl9170: fix -EINVAL bailout during init with !CONFIG_MAC80211_MESH To: linux-wireless@vger.kernel.org Cc: linville@tuxdriver.com, quantheory@gmail.com From: Christian Lamparter Date: Sat, 22 Dec 2012 04:35:24 +0100 MIME-Version: 1.0 Message-Id: <201212220435.24719.chunkeey@googlemail.com> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Sean reported that as of 3.7, his AR9170 device no longer works because the driver fails during initialization. He noted this is due to: "In carl9170/fw.c, ar->hw->wiphy is tagged with NL80211_IFTYPE_MESH_POINT support if the firmware has Content after Beacon Queuing. This is both in interface_modes and the only iface_combinations entry. If CONFIG_MAC80211_MESH is not set, ieee80211_register_hw removes NL80211_IFTYPE_MESH_POINT from interface_modes, but not iface_combinations. wiphy_register then checks to see if every interface type in every interface combination is in interface_modes. NL80211_IFTYPE_MESH_POINT was removed, so you get a WARN_ON warning and it returns -EINVAL, giving up." Unfortunately, the iface_combination (types) feature bitmap in ieee80211_iface_limit is part of a const member in the ieee80211_iface_combination struct. Hence, the MESH_POINT feature flag can't be masked by wiphy_register in the same way as interface_modes in ieee80211_register_hw. Cc: Reported-by: Sean Patrick Santos Signed-off-by: Christian Lamparter Tested-by: Sean Patrick Santos --- only compile tested. --- drivers/net/wireless/ath/carl9170/fw.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/ath/carl9170/fw.c b/drivers/net/wireless/ath/carl9170/fw.c index aaebecd..63fd9af 100644 --- a/drivers/net/wireless/ath/carl9170/fw.c +++ b/drivers/net/wireless/ath/carl9170/fw.c @@ -336,8 +336,12 @@ static int carl9170_fw(struct ar9170 *ar, const __u8 *data, size_t len) if (SUPP(CARL9170FW_WLANTX_CAB)) { if_comb_types |= BIT(NL80211_IFTYPE_AP) | - BIT(NL80211_IFTYPE_MESH_POINT) | BIT(NL80211_IFTYPE_P2P_GO); + +#ifdef CONFIG_MAC80211_MESH + if_comb_types |= + BIT(NL80211_IFTYPE_MESH_POINT); +#endif /* CONFIG_MAC80211_MESH */ } }