From nobody Thu Oct 31 20:52:37 2024 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 4Xfbm55Sngz5cMcw; Thu, 31 Oct 2024 20:52:37 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xfbm54Hgwz4hXx; Thu, 31 Oct 2024 20:52:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730407957; 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=Aro9NKJBxJJnF9WJNRG4u+o7VNDCGuQqQJm0aqzWWKE=; b=upeeWQhwQPf7cFqsbXxbZR/QMjqfSN+7Em0qHu5VsOWFtKL8ofdZqy13FlgwzfMnRCfy7d qKgXPHehlxjLBhVTewIj7MV0wwJ+L9fRBmwGx6ksSebh1WWSYuhPd7ST/afCczYitmj++b O2+gWE3OFKHdcNo5kvOnytpumOYavsKRXwnwFgEApPABAOHCSl4gl3LftwExPawnaMNikU +ad9fuAgXUWrcAGhKsrQa0qR83sJkgqpeHx3JE/qqt2RitxdWnhyP3hUOfNF/i55iCA7M4 EOKxcq5OUYF6MWApaPwLXyvyw+QdSb6P6zWpEryTJT33w1MlQYzvBiVkZreL4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730407957; 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=Aro9NKJBxJJnF9WJNRG4u+o7VNDCGuQqQJm0aqzWWKE=; b=VmYuVFnVJhy/CNNF6TVWf3+wDyaHqp97MsHnFGJUDZb5iw7ARPmTb3Rr0gSY+s6JAgyLkT ClDs2CTf+YSnhx+7jJwbcuFEBPTSgGwf3/G5MwW9oGe9YqVlKTb1aChVdIbZLajsQjs0+4 g+9uptnDUWO8JpRX7wumP5DMZcfR2mBewSfqjjy5PNnRergcAIptdC1QoYpObGgFHJQl2U khawx01JVRQ5HARgVBoOFnjYm99NEfxw5F1oDYLrWvlrZ/Gfp5qP8JtIa6fwQdWygTpUkv qVU/myOBCql6qP0n2LU0pmD7oT0oNm1CwdO4ui/7EJnQM+GZXvDdQzcMjLrRpA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730407957; a=rsa-sha256; cv=none; b=o/EBwjBYpTiXcrzhCpNaYMK7TQ3vqF71olFuGEohDywy6rgJ5lQBYPaP8xSXRegiRvEvQ2 kcaMRaHBsybnxg/4PizrLbSo6C+KEDG1Uw1lPpnzKQru6hVCV00388rk+WD06JIQopCuI6 lOosibKbJJ++VkG5TlFKaBEQwie3Rbqpgak/w4cRGmUyqVSO2ixRExbUjA/Ih8PnWDD0oW ddjNMPfqFc+cynwBYzBvtoNql8uGxvl+up4dadDmE1HyVimIwxn9EpRI6k4ghusHLL+dGC 3UukA9Ftg+tFp10ylcJhNegkXTHzROHTmXjH4ekguLvPIrXC7rKUxq0ACPiNSQ== 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 4Xfbm53vQrzrhY; Thu, 31 Oct 2024 20:52:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49VKqb1d022439; Thu, 31 Oct 2024 20:52:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49VKqb1d022436; Thu, 31 Oct 2024 20:52:37 GMT (envelope-from git) Date: Thu, 31 Oct 2024 20:52:37 GMT Message-Id: <202410312052.49VKqb1d022436@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: 86bc7259d3d5 - main - LinuxKPI: 802.11: hookup net80211 callbacks dependent on (*ampdu_action)() 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-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: 86bc7259d3d558495511a0a23d137b4a6cd030f3 Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=86bc7259d3d558495511a0a23d137b4a6cd030f3 commit 86bc7259d3d558495511a0a23d137b4a6cd030f3 Author: Bjoern A. Zeeb AuthorDate: 2024-01-27 13:24:27 +0000 Commit: Bjoern A. Zeeb CommitDate: 2024-10-31 20:52:27 +0000 LinuxKPI: 802.11: hookup net80211 callbacks dependent on (*ampdu_action)() If a LinuxkPI base wireless driver does not support the (*ampdu_action)() ieee80211_ops function for offloading parts to firmware there is no reason for us to hook into the net80211 callbacks either but simply to let software (net80211) handle this. Sponsored by: The FreeBSD Foundation (commit) MFC after: 3 days --- sys/compat/linuxkpi/common/src/linux_80211.c | 56 +++++++++++++++------------- 1 file changed, 31 insertions(+), 25 deletions(-) diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c index 6de5c42fe59d..3417c7776567 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.c +++ b/sys/compat/linuxkpi/common/src/linux_80211.c @@ -1,6 +1,6 @@ /*- * Copyright (c) 2020-2024 The FreeBSD Foundation - * Copyright (c) 2020-2022 Bjoern A. Zeeb + * Copyright (c) 2020-2024 Bjoern A. Zeeb * * This software was developed by Björn Zeeb under sponsorship from * the FreeBSD Foundation. @@ -4675,30 +4675,36 @@ linuxkpi_ieee80211_ifattach(struct ieee80211_hw *hw) ic->ic_node_free = lkpi_ic_node_free; #ifdef LKPI_80211_HT - lhw->ic_recv_action = ic->ic_recv_action; - ic->ic_recv_action = lkpi_ic_recv_action; - lhw->ic_send_action = ic->ic_send_action; - ic->ic_send_action = lkpi_ic_send_action; - - lhw->ic_ampdu_enable = ic->ic_ampdu_enable; - ic->ic_ampdu_enable = lkpi_ic_ampdu_enable; - - lhw->ic_addba_request = ic->ic_addba_request; - ic->ic_addba_request = lkpi_ic_addba_request; - lhw->ic_addba_response = ic->ic_addba_response; - ic->ic_addba_response = lkpi_ic_addba_response; - lhw->ic_addba_stop = ic->ic_addba_stop; - ic->ic_addba_stop = lkpi_ic_addba_stop; - lhw->ic_addba_response_timeout = ic->ic_addba_response_timeout; - ic->ic_addba_response_timeout = lkpi_ic_addba_response_timeout; - - lhw->ic_bar_response = ic->ic_bar_response; - ic->ic_bar_response = lkpi_ic_bar_response; - - lhw->ic_ampdu_rx_start = ic->ic_ampdu_rx_start; - ic->ic_ampdu_rx_start = lkpi_ic_ampdu_rx_start; - lhw->ic_ampdu_rx_stop = ic->ic_ampdu_rx_stop; - ic->ic_ampdu_rx_stop = lkpi_ic_ampdu_rx_stop; + /* + * Only attach if the driver/firmware supports (*ampdu_action)(). + * Otherwise it is in the hands of net80211. + */ + if (lhw->ops->ampdu_action != NULL) { + lhw->ic_recv_action = ic->ic_recv_action; + ic->ic_recv_action = lkpi_ic_recv_action; + lhw->ic_send_action = ic->ic_send_action; + ic->ic_send_action = lkpi_ic_send_action; + + lhw->ic_ampdu_enable = ic->ic_ampdu_enable; + ic->ic_ampdu_enable = lkpi_ic_ampdu_enable; + + lhw->ic_addba_request = ic->ic_addba_request; + ic->ic_addba_request = lkpi_ic_addba_request; + lhw->ic_addba_response = ic->ic_addba_response; + ic->ic_addba_response = lkpi_ic_addba_response; + lhw->ic_addba_stop = ic->ic_addba_stop; + ic->ic_addba_stop = lkpi_ic_addba_stop; + lhw->ic_addba_response_timeout = ic->ic_addba_response_timeout; + ic->ic_addba_response_timeout = lkpi_ic_addba_response_timeout; + + lhw->ic_bar_response = ic->ic_bar_response; + ic->ic_bar_response = lkpi_ic_bar_response; + + lhw->ic_ampdu_rx_start = ic->ic_ampdu_rx_start; + ic->ic_ampdu_rx_start = lkpi_ic_ampdu_rx_start; + lhw->ic_ampdu_rx_stop = ic->ic_ampdu_rx_stop; + ic->ic_ampdu_rx_stop = lkpi_ic_ampdu_rx_stop; + } #endif lkpi_radiotap_attach(lhw);