From nobody Tue Mar 22 18:52:49 2022 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 16B7D1A29B41; Tue, 22 Mar 2022 18:52:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4KNLG95twGz3sg9; Tue, 22 Mar 2022 18:52:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1647975169; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FYhjoVzhKAt0LptgL60/w0c8UhXO1+zxJNu7lHwyswA=; b=lqlsHMhEEhoWX6+rggB5imYXjiqcDwH+Pt30eWRifqyuSPuc2FWHgNOYSsi0gRYjQ2Ov4R yea7MCulkgTKMD5L+TnNnLv1gXUz+KDb5WzUmnZq5OaVi63Kp6k+a6jgwEGyZVuIRwbb5E CtfTaeLazYML8XvphJOm6X4FdGKKKQ5xJedm3uUW53+v73CYCLXn0tAxNFqaaXGnm4XyNB F9uNN5Ww5CwBdxkihrccd+g32/254hDW5I5rO22xj1osM9HSVy96QAI4jof0Xe/WFmfmxi Y4I1Fu9uLN1qigCech0MX7k9OQay4mNQsC4tdFlIZi46kygePnuaW5gqvlDGEg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A744015082; Tue, 22 Mar 2022 18:52:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 22MIqnDZ099389; Tue, 22 Mar 2022 18:52:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 22MIqnSW099388; Tue, 22 Mar 2022 18:52:49 GMT (envelope-from git) Date: Tue, 22 Mar 2022 18:52:49 GMT Message-Id: <202203221852.22MIqnSW099388@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: bb81db90f7e0 - main - LinuxKPI: 802.11: implement ieee80211_beacon_loss() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: bb81db90f7e00f56df9ea14132a54ee983e7177f Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1647975169; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FYhjoVzhKAt0LptgL60/w0c8UhXO1+zxJNu7lHwyswA=; b=VeEVod7943RraCdbm4xMiT3q+bjUrxf2Lkn5AT9fJ64mdPhf+eau0ZUQ4zYNoobPVRFf+T /g2KehKp6FWr6kb6EpEjC+QtKzFdY5IB0ySsDSRraE0rgfn2hWefNfSA9/gYvodco5aS3T 1MjBxR56SfOXbxZ3ftX5aaomTRMxzwbKTsnlTGogV4pC7oe5FeWveOv177zcZnBKm3791p Rr+SK2fsGkiRDMjy4iyZ/42GMbQQ9LFImjLvdDfnLCibXMx/fCmVl8/KrcSeu3lG29pwUD xmvOM7TR6CoAA/UTUt/axQWxoLBBq3JmwAAKBLAx616qxYuKHLZ87d2YqYYmLg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1647975169; a=rsa-sha256; cv=none; b=cb9baYED3mwBaMejBr/UZ9rIHGcBi0CJ0QgV+xvSpcx4PuLG1J2iymchu84210WdialwhF Lrgf/VNUK3mWctPRMswXbHFxvki7gWuz6VqOh3PpwLRtCRZH757C/kaw4JNDjoHZYV/0xY sDq08snArbFmQn0ESuGb4fSRjuULW3d0WzZokO1ozv9TCe8RNWsBIlGuGYs2tIKcXtLkvy 2BOy1aRwQBG99srBcdbaBOY4sOMBTPyt99F/U2TpjINcFyPcOuaqr4OOqsqxS8gE7Vmm/R OZXEPAHVPGMHtU2tp0IKqMtNxDTi2Oync+wfXZaVc198vqMWtspxcIyOkuZfhw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=bb81db90f7e00f56df9ea14132a54ee983e7177f commit bb81db90f7e00f56df9ea14132a54ee983e7177f Author: Bjoern A. Zeeb AuthorDate: 2022-03-22 15:02:45 +0000 Commit: Bjoern A. Zeeb CommitDate: 2022-03-22 18:51:43 +0000 LinuxKPI: 802.11: implement ieee80211_beacon_loss() Implement ieee80211_beacon_loss() similar to ieee80211_connection_loss() with different state handling. While here leave a comment in connection_loss() about the state change argument. Sponsored by: The FreeBSD Foundation MFC after: 3 days --- sys/compat/linuxkpi/common/include/net/mac80211.h | 3 ++- sys/compat/linuxkpi/common/src/linux_80211.c | 28 ++++++++++++++++++++++- 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/net/mac80211.h b/sys/compat/linuxkpi/common/include/net/mac80211.h index 8a74e3fcec1b..5cf2c8b75e40 100644 --- a/sys/compat/linuxkpi/common/include/net/mac80211.h +++ b/sys/compat/linuxkpi/common/include/net/mac80211.h @@ -904,6 +904,7 @@ void linuxkpi_ieee80211_txq_get_depth(struct ieee80211_txq *, uint64_t *, uint64_t *); struct wireless_dev *linuxkpi_ieee80211_vif_to_wdev(struct ieee80211_vif *); void linuxkpi_ieee80211_connection_loss(struct ieee80211_vif *); +void linuxkpi_ieee80211_beacon_loss(struct ieee80211_vif *); /* -------------------------------------------------------------------------- */ @@ -1403,7 +1404,7 @@ ieee80211_beacon_get_template(struct ieee80211_hw *hw, static __inline void ieee80211_beacon_loss(struct ieee80211_vif *vif) { - TODO(); + linuxkpi_ieee80211_beacon_loss(vif); } static __inline void diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c index 2fe8b4ebddd0..ceb9c626c507 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.c +++ b/sys/compat/linuxkpi/common/src/linux_80211.c @@ -3708,13 +3708,39 @@ linuxkpi_ieee80211_connection_loss(struct ieee80211_vif *vif) * Let the statemachine handle all neccessary changes. */ nstate = IEEE80211_S_INIT; - arg = 0; + arg = 0; /* Not a valid reason. */ if (debug_80211 & D80211_TRACE) ic_printf(vap->iv_ic, "%s: vif %p\n", __func__, vif); ieee80211_new_state(vap, nstate, arg); } +void +linuxkpi_ieee80211_beacon_loss(struct ieee80211_vif *vif) +{ + struct lkpi_vif *lvif; + struct ieee80211vap *vap; + enum ieee80211_state nstate; + int arg; + + lvif = VIF_TO_LVIF(vif); + vap = LVIF_TO_VAP(lvif); + + /* + * Go to scan; otherwise we need to elaborately check state and + * handle accordingly, e.g., if in RUN we could call iv_bmiss. + * Let the statemachine handle all neccessary changes. + */ + nstate = IEEE80211_S_SCAN; + arg = 0; + + /* We should be in RUN. Can we assert that? */ + if (debug_80211 & D80211_TRACE || vap->iv_state != IEEE80211_S_RUN) + ic_printf(vap->iv_ic, "%s: vif %p vap %p state %s\n", __func__, + vif, vap, ieee80211_state_name[vap->iv_state]); + ieee80211_new_state(vap, nstate, arg); +} + MODULE_VERSION(linuxkpi_wlan, 1); MODULE_DEPEND(linuxkpi_wlan, linuxkpi, 1, 1, 1); MODULE_DEPEND(linuxkpi_wlan, wlan, 1, 1, 1);