From patchwork Wed Jan 20 12:47:07 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= X-Patchwork-Id: 8071741 Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 7BF18BEEE5 for ; Wed, 20 Jan 2016 12:47:36 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 95FCD20411 for ; Wed, 20 Jan 2016 12:47:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A009020456 for ; Wed, 20 Jan 2016 12:47:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751310AbcATMrX (ORCPT ); Wed, 20 Jan 2016 07:47:23 -0500 Received: from mail-lf0-f46.google.com ([209.85.215.46]:33461 "EHLO mail-lf0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751039AbcATMrW (ORCPT ); Wed, 20 Jan 2016 07:47:22 -0500 Received: by mail-lf0-f46.google.com with SMTP id m198so5103916lfm.0 for ; Wed, 20 Jan 2016 04:47:21 -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:mime-version:content-type :content-transfer-encoding; bh=68HQlqtqblV9KuZZnuKRpBFWL+K36JO/59FUfHS5MCw=; b=hBQDWZ8YHpuSbB6EPtjVVzQtZAPzPNlZiBtt5naB9cmerOj7k4KToP7yXB2Bo3u1jR Gk0yL/AKu8+KTu1ahDYWf+2RsKfZVwfpkpQZGjYVsC5m0QMu7whVuqCsxgdiDi4A6dp1 tyPwcBnWFL8UB9nx06oqJrUuETnfZ1vnZdKc3qmZUTXDNkU3qxBaU6Sk/grg6A7VunPH 0GUHJ13wUOjZ33zzVjg4+aua1PVHuLB89JOFjqz0xlqeqrdAdOOImFfpbSm/Xtw7vbZL sgpt+vg5708sDdySko9W4RzC6lv3zcE9UUTV+fkQMEONvtE5nPYa8RU1TMQluprOeFhE iNcw== 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:mime-version :content-type:content-transfer-encoding; bh=68HQlqtqblV9KuZZnuKRpBFWL+K36JO/59FUfHS5MCw=; b=NllV3yVRJKDpZ8oy4m4teZAnldL8iy4B0ef0Uc5D0bGsQ2jk7p95i8DNZQVAov2ywG xUtK0EvC16v8vZ/RJaytLd/KCCTbd/TwKyxc8VTvzEz22OIWQodAFKm77uZMIcti2lCg L1kErnUGrKiqffiFG7T2X2LsFtcJq/vIT4TMhgDuuozF+T8gMrSEh2m7Q6y6nSovZYtk m8LyyOU1rA+Wp5hxh3Lmp3HHL7tNxgZwGy8hsJlEzdf3EVwJBGfet12/mgKj4kKpldZv uTL6AuxJqPdTPyBx6gziQLeM4hUOKESkXaxb065Fl4TUHQmMsYHAGhNgqQa/JwnHs6S5 aVmQ== X-Gm-Message-State: ALoCoQlhivmBW5bSlbhNCoJbCL28hbeMog40ORamAisG2HZfucE3JE3OkcU1fAXQNh3dAAt+x434zt4vINH/HYP3TqxNblU8Mw== X-Received: by 10.25.131.150 with SMTP id f144mr13039523lfd.155.1453294040399; Wed, 20 Jan 2016 04:47:20 -0800 (PST) Received: from linux-samsung.lan (ip-194-187-74-233.konfederacka.maverick.com.pl. [194.187.74.233]) by smtp.gmail.com with ESMTPSA id b10sm4520315lbs.37.2016.01.20.04.47.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 20 Jan 2016 04:47:19 -0800 (PST) From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= To: Brett Rudley , Arend van Spriel , "Franky (Zhenhui) Lin" , Hante Meuleman , linux-wireless@vger.kernel.org, brcm80211-dev-list@broadcom.com Cc: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= Subject: [RFC PATCH] brcmfmac: set WIPHY_FLAG_HAVE_AP_SME Date: Wed, 20 Jan 2016 13:47:07 +0100 Message-Id: <1453294027-12811-1-git-send-email-zajec5@gmail.com> X-Mailer: git-send-email 1.8.4.5 MIME-Version: 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=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, 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 This allows user space check NL80211_ATTR_DEVICE_AP_SME and realize it's dealing with a FullMAC device. It's important for a proper AP setup. So far user space was only able to guess it's AP_SME after failing to create monitor interface. Signed-off-by: Rafa? Mi?ecki --- While this patch makes sense to me, it's breaking user space (hostapd). There are two similar code paths in hostapd for FullMAC devices. For details see nl80211_setup_ap, below is my summary: 1) hostapd doesn't get AP_SME It tries to create monitor interface and after failing to it fallbacks to the AP_SME: > nl80211: Setup AP(wlan0) - device_ap_sme=0 use_monitor=1 > Failed to create interface mon.wlan0: -95 (Not supported) > nl80211: Driver does not support monitor interface type - try to run without it After that it tries to register for PROBE_REQ management frames but it's not required to succeed. 2) hostapd knows about AP_SME It tries to register for ACTION management frames requiring it to succeed. If it fails it goes like this: > nl80211: Subscribe to mgmt frames with AP handle 0x99f50 (device SME) > nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0x99f50 match= > nl80211: Register frame command failed (type=208): ret=-22 (Invalid argument) > nl80211: Register frame match - hexdump(len=0): [NULL] > nl80211: Could not configure driver mode Now, the problem with brcmfmac is that it doesn't report support for any management frames in AP mode. It supports sending ACTION (and maybe PROBE_RESP) frames, but it can't pass ACTION to the cfg80211. So even if we report we can send ACTION (as it seems we do), it won't fix the problem. So this patch will trigger another code path in hostapd that due to brcmfmac missing support for receiving & passing ACTION will fail. Do you have any idea how to handle this? Should hostapd drop depndency on ACTION frames? Should brcmfmac fake support for receiving & passing ACTION frames? Or should support for ACTION frames be added indeed? --- drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c index 7b01e4d..ab431e5 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c @@ -6180,6 +6180,7 @@ static int brcmf_setup_wiphy(struct wiphy *wiphy, struct brcmf_if *ifp) wiphy->cipher_suites = __wl_cipher_suites; wiphy->n_cipher_suites = ARRAY_SIZE(__wl_cipher_suites); wiphy->flags |= WIPHY_FLAG_PS_ON_BY_DEFAULT | + WIPHY_FLAG_HAVE_AP_SME | WIPHY_FLAG_OFFCHAN_TX | WIPHY_FLAG_HAS_REMAIN_ON_CHANNEL; if (brcmf_feat_is_enabled(ifp, BRCMF_FEAT_TDLS))