aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjoern A. Zeeb <bz@FreeBSD.org>2024-01-27 13:24:27 +0000
committerBjoern A. Zeeb <bz@FreeBSD.org>2024-10-31 20:52:27 +0000
commit86bc7259d3d558495511a0a23d137b4a6cd030f3 (patch)
tree53c9df3e713150d95f2d3c637268df0217c2d8c8
parent89311e6f987ebb1a968eee6fe594b11bfb91977a (diff)
downloadsrc-86bc7259d3d5.tar.gz
src-86bc7259d3d5.zip
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
-rw-r--r--sys/compat/linuxkpi/common/src/linux_80211.c56
1 files 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);