From patchwork Wed May 3 10:42:14 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arend van Spriel X-Patchwork-Id: 9709225 X-Patchwork-Delegate: johannes@sipsolutions.net 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 9435660351 for ; Wed, 3 May 2017 10:42:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 85357285BA for ; Wed, 3 May 2017 10:42:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 797E9285E9; Wed, 3 May 2017 10:42:42 +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=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_HI autolearn=ham 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 27921285BA for ; Wed, 3 May 2017 10:42:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753365AbdECKml (ORCPT ); Wed, 3 May 2017 06:42:41 -0400 Received: from lpdvrndsmtp01.broadcom.com ([192.19.229.170]:35244 "EHLO rnd-relay.smtp.broadcom.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752348AbdECKm0 (ORCPT ); Wed, 3 May 2017 06:42:26 -0400 Received: from mail-irv-17.broadcom.com (mail-irv-17.lvn.broadcom.net [10.75.224.233]) by rnd-relay.smtp.broadcom.com (Postfix) with ESMTP id C2C5730C032; Wed, 3 May 2017 03:42:23 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.10.3 rnd-relay.smtp.broadcom.com C2C5730C032 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=broadcom.com; s=dkimrelay; t=1493808143; bh=q8z48ZMMsPEqa/f2fD4U0Iz8iYjiYqxMUb7kYPSLLzY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=u9yJLwknVNHxR51EfL1APdl9vG8D2HrCkPB70SuVb65HU/w4qsiAFJMfTPq/AW05T IP4mE9qi0qvORWrLaFrywrCPiZBWcfCfhV9aUX2mGvOcJb+vWg3VnNiZf3WtLb2fBA BPMbDr8HwUV9z/3zdKueB7JnlhyXaeX7jaLkMSe8= Received: from jenkins-cam-14.cam.broadcom.com (jenkins-cam-14.cam.broadcom.com [10.177.128.77]) by mail-irv-17.broadcom.com (Postfix) with ESMTP id 81D9581F25; Wed, 3 May 2017 03:42:23 -0700 (PDT) Received: by jenkins-cam-14.cam.broadcom.com (Postfix, from userid 25152) id F4172B8964E; Wed, 3 May 2017 11:42:18 +0100 (BST) From: Arend van Spriel To: Johannes Berg Cc: linux-wireless , Arend van Spriel Subject: [PATCH V2 9/9] brcmfmac: provide port authorized state in CONNECT event Date: Wed, 3 May 2017 11:42:14 +0100 Message-Id: <1493808134-4074-10-git-send-email-arend.vanspriel@broadcom.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1493808134-4074-1-git-send-email-arend.vanspriel@broadcom.com> References: <1493808134-4074-1-git-send-email-arend.vanspriel@broadcom.com> 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 Fill struct cfg80211_connection_params::authorized field according the supplicant state received from the device. Signed-off-by: Arend van Spriel --- .../broadcom/brcm80211/brcmfmac/cfg80211.c | 27 +++++++++++++--------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c index 9d345c7..0e45993 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c @@ -5327,10 +5327,12 @@ static bool brcmf_is_linkup(struct brcmf_cfg80211_vif *vif, u32 event = e->event_code; u32 status = e->status; - if (vif->profile.use_fwsup == BRCMF_PROFILE_FWSUP_PSK && - event == BRCMF_E_PSK_SUP && - status == BRCMF_E_STATUS_FWSUP_COMPLETED) + if (event == BRCMF_E_PSK_SUP && + status == BRCMF_E_STATUS_FWSUP_COMPLETED) { set_bit(BRCMF_VIF_STATUS_EAP_SUCCESS, &vif->sme_state); + if (vif->profile.use_fwsup == BRCMF_PROFILE_FWSUP_1X) + return true; + } if (event == BRCMF_E_SET_SSID && status == BRCMF_E_STATUS_SUCCESS) { brcmf_dbg(CONN, "Processing set ssid\n"); memcpy(vif->profile.bssid, e->addr, ETH_ALEN); @@ -5341,11 +5343,9 @@ static bool brcmf_is_linkup(struct brcmf_cfg80211_vif *vif, } if (test_bit(BRCMF_VIF_STATUS_EAP_SUCCESS, &vif->sme_state) && - test_bit(BRCMF_VIF_STATUS_ASSOC_SUCCESS, &vif->sme_state)) { - clear_bit(BRCMF_VIF_STATUS_EAP_SUCCESS, &vif->sme_state); - clear_bit(BRCMF_VIF_STATUS_ASSOC_SUCCESS, &vif->sme_state); + test_and_clear_bit(BRCMF_VIF_STATUS_ASSOC_SUCCESS, &vif->sme_state)) return true; - } + return false; } @@ -5542,22 +5542,27 @@ static s32 brcmf_get_assoc_ies(struct brcmf_cfg80211_info *cfg, brcmf_dbg(TRACE, "Enter\n"); if (test_and_clear_bit(BRCMF_VIF_STATUS_CONNECTING, - &ifp->vif->sme_state)) { + &ifp->vif->sme_state) || + e->event_code == BRCMF_E_PSK_SUP) { memset(&conn_params, 0, sizeof(conn_params)); - if (completed) { + if (e->event_code != BRCMF_E_PSK_SUP && completed) { brcmf_get_assoc_ies(cfg, ifp); brcmf_update_bss_info(cfg, ifp); set_bit(BRCMF_VIF_STATUS_CONNECTED, &ifp->vif->sme_state); + } + if (completed) conn_params.status = WLAN_STATUS_SUCCESS; - } else { + else conn_params.status = WLAN_STATUS_AUTH_TIMEOUT; - } conn_params.bssid = profile->bssid; conn_params.req_ie = conn_info->req_ie; conn_params.req_ie_len = conn_info->req_ie_len; conn_params.resp_ie = conn_info->resp_ie; conn_params.resp_ie_len = conn_info->resp_ie_len; + conn_params.authorized = + test_and_clear_bit(BRCMF_VIF_STATUS_EAP_SUCCESS, + &ifp->vif->sme_state); cfg80211_connect_done(ndev, &conn_params, GFP_KERNEL); brcmf_dbg(CONN, "Report connect result - connection %s\n", completed ? "succeeded" : "failed");