From patchwork Sat Jun 18 18:18:35 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= X-Patchwork-Id: 9185793 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 4A7A8601C0 for ; Sat, 18 Jun 2016 18:19:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2DE8E262F2 for ; Sat, 18 Jun 2016 18:19:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 210C928365; Sat, 18 Jun 2016 18:19:32 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,FREEMAIL_FROM,RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 17BF428360 for ; Sat, 18 Jun 2016 18:19:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751860AbcFRSTZ (ORCPT ); Sat, 18 Jun 2016 14:19:25 -0400 Received: from mail-lf0-f66.google.com ([209.85.215.66]:35052 "EHLO mail-lf0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751828AbcFRSTV (ORCPT ); Sat, 18 Jun 2016 14:19:21 -0400 Received: by mail-lf0-f66.google.com with SMTP id w130so2242047lfd.2; Sat, 18 Jun 2016 11:19:19 -0700 (PDT) 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 :mime-version:content-transfer-encoding; bh=od2fyp3Cre8MrYtK4iXEPYOTjtLjNxkuQ6Q6pPabzFU=; b=GlAlBRomz+fzd88qzRvlugk/2otBwNSFIft6IP8gwF+pdfSgk+9k2ANnCQD7zyyIgd gGWT8fWI3ZdBW45A1CUaJdAlJ+Fti19rI9x1Ly19QVvQqSqhNtG0jepTJqGcnhGQAX2s eUYC8IpXhGF9L1ryRvPAIQl3umyj1UMmcMGL9yW5CjWOecaMphfFwhr6hpaijI0qWHxd WveDoNroLMJYYbhL+ODEouBpW0YDqV0OTEVO75xS9hdTsIk5G+QmQf+NuTUK4Zynp+Io TF1mAUZHMMBR+FDuA8EcE8OZBrxHXSiPDrvUgwBmfgB/f+3WSS+DpMoEJ7cEsIpXFqjG cROQ== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=od2fyp3Cre8MrYtK4iXEPYOTjtLjNxkuQ6Q6pPabzFU=; b=Ddm4bKqt+NSKFx/UHZREhJSatKhBPSs9Oi4Kk2wGARZHywcEpKuojCt6ghwsxPamh5 KAaKKsbClcg1Thpb93O6YDQG9/EIWGSraXerZQ78D6muiNxo7kP3dLmND7+NtYU4nJpj kLH84OyQuxvg4w6FV6PsKtDziE0qHOxRmBgZmDQoGw0HMy5W2zMsq9tSDoXjEDOVTtgH 2umJ1v2EpvPwRyjl8w8NCFemrCVx7BNM9Jbe4xXqXKKT3lMA2tziF8aLlNSBSGYtn5gM sw71QTgxToG/D78Lcc5MIvEsZvuzgmCFXT2gJVtp58QgO3l3+UkhvuwhMr7YF2P603yd Ledw== X-Gm-Message-State: ALyK8tLXRio31cUOJWAsDtZMsOpBM6zyY5/ArDgaaiVEPoI6cGchG1BBtKB4WWVE934ohA== X-Received: by 10.25.23.72 with SMTP id n69mr2360422lfi.64.1466273958745; Sat, 18 Jun 2016 11:19:18 -0700 (PDT) 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 h11sm4922151ljh.33.2016.06.18.11.19.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 18 Jun 2016 11:19:18 -0700 (PDT) From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= To: Kalle Valo Cc: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= , Arend van Spriel , Franky Lin , Hante Meuleman , Pieter-Paul Giesberts , "Franky (Zhenhui) Lin" , linux-wireless@vger.kernel.org (open list:BROADCOM BRCM80211 IEEE802.11n WIRELESS DRIVER), brcm80211-dev-list.pdl@broadcom.com (open list:BROADCOM BRCM80211 IEEE802.11n WIRELESS DRIVER), netdev@vger.kernel.org (open list:NETWORKING DRIVERS), linux-kernel@vger.kernel.org (open list) Subject: [PATCH RFC 2/2] brcmfmac: support removing AP interfaces with "interface_remove" Date: Sat, 18 Jun 2016 20:18:35 +0200 Message-Id: <1466273932-11554-2-git-send-email-zajec5@gmail.com> X-Mailer: git-send-email 1.8.4.5 In-Reply-To: <1466273932-11554-1-git-send-email-zajec5@gmail.com> References: <1466273932-11554-1-git-send-email-zajec5@gmail.com> MIME-Version: 1.0 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP New firmwares (e.g. 10.10.69.36 for BCM4366) support "interface_remove" for removing interfaces. Try to use this method on cfg80211 request. In case of older firmwares (e.g. 7.35.177.56 for BCM43602 as I tested) this will just result in firmware rejecting command and this won't change any behavior. Signed-off-by: Rafał Miłecki --- .../broadcom/brcm80211/brcmfmac/cfg80211.c | 37 +++++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c index 502b0a0..aff76c2 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c @@ -785,12 +785,46 @@ s32 brcmf_notify_escan_complete(struct brcmf_cfg80211_info *cfg, return err; } +static int brcmf_cfg80211_del_ap_iface(struct wiphy *wiphy, + struct wireless_dev *wdev) +{ + struct brcmf_cfg80211_info *cfg = wiphy_priv(wiphy); + struct net_device *ndev = wdev->netdev; + struct brcmf_if *ifp = netdev_priv(ndev); + int ret; + int err; + + brcmf_cfg80211_arm_vif_event(cfg, ifp->vif); + + err = brcmf_fil_bsscfg_data_set(ifp, "interface_remove", NULL, 0); + if (err) { + brcmf_err("interface_remove failed %d\n", err); + goto err_unarm; + } + + /* wait for firmware event */ + ret = brcmf_cfg80211_wait_vif_event(cfg, BRCMF_E_IF_DEL, + BRCMF_VIF_EVENT_TIMEOUT); + if (!ret) { + brcmf_err("timeout occurred\n"); + err = -EIO; + goto err_unarm; + } + +err_unarm: + brcmf_cfg80211_arm_vif_event(cfg, NULL); + return err; +} + static int brcmf_cfg80211_del_iface(struct wiphy *wiphy, struct wireless_dev *wdev) { struct brcmf_cfg80211_info *cfg = wiphy_priv(wiphy); struct net_device *ndev = wdev->netdev; + if (ndev == cfg_to_ndev(cfg)) + return -ENOTSUPP; + /* vif event pending in firmware */ if (brcmf_cfg80211_vif_event_armed(cfg)) return -EBUSY; @@ -807,12 +841,13 @@ int brcmf_cfg80211_del_iface(struct wiphy *wiphy, struct wireless_dev *wdev) switch (wdev->iftype) { case NL80211_IFTYPE_ADHOC: case NL80211_IFTYPE_STATION: - case NL80211_IFTYPE_AP: case NL80211_IFTYPE_AP_VLAN: case NL80211_IFTYPE_WDS: case NL80211_IFTYPE_MONITOR: case NL80211_IFTYPE_MESH_POINT: return -EOPNOTSUPP; + case NL80211_IFTYPE_AP: + return brcmf_cfg80211_del_ap_iface(wiphy, wdev); case NL80211_IFTYPE_P2P_CLIENT: case NL80211_IFTYPE_P2P_GO: case NL80211_IFTYPE_P2P_DEVICE: