aboutsummaryrefslogtreecommitdiff
path: root/sys/contrib/dev
diff options
context:
space:
mode:
authorBjoern A. Zeeb <bz@FreeBSD.org>2025-01-26 00:26:14 +0000
committerBjoern A. Zeeb <bz@FreeBSD.org>2025-01-31 23:53:31 +0000
commit7a5b55e3b448744b099c274763992cba2e3ebce5 (patch)
tree8c5885270b1ed1ccb478b331d273c1e833d49b3a /sys/contrib/dev
parentb4886c4ece3e692c294aa853da7aec849f8d00a2 (diff)
rtw88/rtw89: add module_param to enable/disable HT/VHT and EHT
In order to better test HT and VHT support with LinuxKPI add (tunable) options disabled by default to on-demand enable HT/VHT and for rtw89 also EHT. It is expected that we will remove this FreeBSD-specific code again in the future. Sponsored by: The FreeBSD Foundation MFC after: 3 days
Diffstat (limited to 'sys/contrib/dev')
-rw-r--r--sys/contrib/dev/rtw88/main.c22
-rw-r--r--sys/contrib/dev/rtw89/core.c30
2 files changed, 52 insertions, 0 deletions
diff --git a/sys/contrib/dev/rtw88/main.c b/sys/contrib/dev/rtw88/main.c
index de94f750200e..5157f447b93c 100644
--- a/sys/contrib/dev/rtw88/main.c
+++ b/sys/contrib/dev/rtw88/main.c
@@ -46,6 +46,16 @@ MODULE_PARM_DESC(disable_lps_deep, "Set Y to disable Deep PS");
MODULE_PARM_DESC(support_bf, "Set Y to enable beamformee support");
MODULE_PARM_DESC(debug_mask, "Debugging mask");
+#if defined(__FreeBSD__)
+static bool rtw_ht_support = false;
+module_param_named(support_ht, rtw_ht_support, bool, 0644);
+MODULE_PARM_DESC(support_ht, "Set to Y to enable HT support");
+
+static bool rtw_vht_support = false;
+module_param_named(support_vht, rtw_vht_support, bool, 0644);
+MODULE_PARM_DESC(support_vht, "Set to Y to enable VHT support");
+#endif
+
static struct ieee80211_channel rtw_channeltable_2g[] = {
{.center_freq = 2412, .hw_value = 1,},
{.center_freq = 2417, .hw_value = 2,},
@@ -1666,7 +1676,11 @@ static void rtw_set_supported_band(struct ieee80211_hw *hw,
sband = kmemdup(&rtw_band_2ghz, sizeof(*sband), GFP_KERNEL);
if (!sband)
goto err_out;
+#if defined(__linux__)
if (chip->ht_supported)
+#elif defined(__FreeBSD__)
+ if (rtw_ht_support && chip->ht_supported)
+#endif
rtw_init_ht_cap(rtwdev, &sband->ht_cap);
hw->wiphy->bands[NL80211_BAND_2GHZ] = sband;
}
@@ -1675,9 +1689,17 @@ static void rtw_set_supported_band(struct ieee80211_hw *hw,
sband = kmemdup(&rtw_band_5ghz, sizeof(*sband), GFP_KERNEL);
if (!sband)
goto err_out;
+#if defined(__linux__)
if (chip->ht_supported)
+#elif defined(__FreeBSD__)
+ if (rtw_ht_support && chip->ht_supported)
+#endif
rtw_init_ht_cap(rtwdev, &sband->ht_cap);
+#if defined(__linux__)
if (chip->vht_supported)
+#elif defined(__FreeBSD__)
+ if (rtw_vht_support && chip->vht_supported)
+#endif
rtw_init_vht_cap(rtwdev, &sband->vht_cap);
hw->wiphy->bands[NL80211_BAND_5GHZ] = sband;
}
diff --git a/sys/contrib/dev/rtw89/core.c b/sys/contrib/dev/rtw89/core.c
index d1f82bfad4a9..85d8dee4e85d 100644
--- a/sys/contrib/dev/rtw89/core.c
+++ b/sys/contrib/dev/rtw89/core.c
@@ -29,6 +29,21 @@ static bool rtw89_disable_ps_mode;
module_param_named(disable_ps_mode, rtw89_disable_ps_mode, bool, 0644);
MODULE_PARM_DESC(disable_ps_mode, "Set Y to disable low power mode");
+#if defined(__FreeBSD__)
+static bool rtw_ht_support = false;
+module_param_named(support_ht, rtw_ht_support, bool, 0644);
+MODULE_PARM_DESC(support_ht, "Set to Y to enable HT support");
+
+static bool rtw_vht_support = false;
+module_param_named(support_vht, rtw_vht_support, bool, 0644);
+MODULE_PARM_DESC(support_vht, "Set to Y to enable VHT support");
+
+static bool rtw_eht_support = false;
+module_param_named(support_eht, rtw_eht_support, bool, 0644);
+MODULE_PARM_DESC(support_eht, "Set to Y to enable EHT support");
+#endif
+
+
#define RTW89_DEF_CHAN(_freq, _hw_val, _flags, _band) \
{ .center_freq = _freq, .hw_value = _hw_val, .flags = _flags, .band = _band, }
#define RTW89_DEF_CHAN_2G(_freq, _hw_val) \
@@ -4006,7 +4021,13 @@ static int rtw89_core_set_supported_band(struct rtw89_dev *rtwdev)
sband_2ghz = kmemdup(&rtw89_sband_2ghz, size, GFP_KERNEL);
if (!sband_2ghz)
goto err;
+#if defined(__FreeBSD__)
+ if (rtw_ht_support)
+#endif
rtw89_init_ht_cap(rtwdev, &sband_2ghz->ht_cap);
+#if defined(__FreeBSD__)
+ if (rtw_eht_support)
+#endif
rtw89_init_he_eht_cap(rtwdev, NL80211_BAND_2GHZ, sband_2ghz);
hw->wiphy->bands[NL80211_BAND_2GHZ] = sband_2ghz;
}
@@ -4015,8 +4036,17 @@ static int rtw89_core_set_supported_band(struct rtw89_dev *rtwdev)
sband_5ghz = kmemdup(&rtw89_sband_5ghz, size, GFP_KERNEL);
if (!sband_5ghz)
goto err;
+#if defined(__FreeBSD__)
+ if (rtw_ht_support)
+#endif
rtw89_init_ht_cap(rtwdev, &sband_5ghz->ht_cap);
+#if defined(__FreeBSD__)
+ if (rtw_vht_support)
+#endif
rtw89_init_vht_cap(rtwdev, &sband_5ghz->vht_cap);
+#if defined(__FreeBSD__)
+ if (rtw_eht_support)
+#endif
rtw89_init_he_eht_cap(rtwdev, NL80211_BAND_5GHZ, sband_5ghz);
hw->wiphy->bands[NL80211_BAND_5GHZ] = sband_5ghz;
}