From nobody Fri Jan 31 23:53:46 2025 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 4YlCQg3qV6z5m3Gl; Fri, 31 Jan 2025 23:53:47 +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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YlCQf4nXxz3xwF; Fri, 31 Jan 2025 23:53:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1738367626; 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=z1MU7Jv2/yhVXPnT83W2OFRiwvEdrj4hVzqvbIRx6HE=; b=qu7vUwMGC2j6Su5aVzBhE6VgsjFreAABH2/fQmzh7i58ApWQ8lQwXUWGM/fvNo39AsS2rA b/76CIro14kB9DXUJf0QgatJg+fwIEk1abN+cyBOQZi2N2Ck+ohr516aS/HCd2G0E4wgPp xmbmK5wbA2L/kFeQyhcRzj8xP25g6sbDKWPhlPasWURmRT1mhRCJmg1OkaF4GjHdLy91vk oRWmjo008PrSfLCDHn18KueA7gpxsCH8uECJ4Sq2+/xOJ+mD799aZY7OyM3bydd4WPRdv+ 24thLeM1WB5sKEnnFgwHrq8JSK9Qa1kGpbJKcsA8GTTTIldNaacbAa7AelbJvw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1738367626; 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=z1MU7Jv2/yhVXPnT83W2OFRiwvEdrj4hVzqvbIRx6HE=; b=IDy8R41dkCgIJZ+oS8gb2/VeTc0OTvOY8PDyl/Lgg6CIIeQo28FqUcOQAIsgSmQGWmRITZ Wzw/K2tVJ58aFWHal69lWTfd6ZmseMmfimvv9LXCJa9ejnm5+Td5VlmW6RJ5yI2nfiqjY5 XaEh9r0ckBtvcIfKSZzEjoD1MkpT9qqfy50mIfqFfBhM9rVRe7cayd5TNjB+4oirUaPpIG JZ6JttPmhSQSKjDULxh7zU2NmpCtN25Zz+O8VFI2zWIV14HX3kA8+FinMpmp3rVxpg+5XU 1r157Qdg/9JjNtymf2jV3GN3hpwfjcJzMLodVYoXwsTYeII8at/9cmLblV+/vQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1738367626; a=rsa-sha256; cv=none; b=Ctd4lvmx0rYwQ15F/B0ElLrse8EUrlw2ooOozNHKbR84zAzFv6RAC2CCqevFjXuHQvysvu 9oMuKvzFUnx8cvQqmkkwiz7sGn83MtHipKBe2xcviidhs1GOPBCPiBQcsUkreTTtFKGYm1 sEZslRoPc/7bgAxzn0kULwnmQF8GybENc0tqEWj905aSrZleHA59uIdODrQYR6XGC5N7zU cc+lQjHzauRyJW9d5TFcdOIvrjhu0RGrCdOFRhTX6ycXTkg22Crs7/I0+lRTWttHqD0g+3 I3wIq7G1EEOYRvJqJEpV+lyd+8GSHV0Qz9xvQyt1KFV8FTmqo+MBflhBzaZTBg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none 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 4YlCQf4JNLzfyQ; Fri, 31 Jan 2025 23:53:46 +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 50VNrkjq017127; Fri, 31 Jan 2025 23:53:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50VNrkSq017124; Fri, 31 Jan 2025 23:53:46 GMT (envelope-from git) Date: Fri, 31 Jan 2025 23:53:46 GMT Message-Id: <202501312353.50VNrkSq017124@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: 7a5b55e3b448 - main - rtw88/rtw89: add module_param to enable/disable HT/VHT and EHT 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: 7a5b55e3b448744b099c274763992cba2e3ebce5 Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=7a5b55e3b448744b099c274763992cba2e3ebce5 commit 7a5b55e3b448744b099c274763992cba2e3ebce5 Author: Bjoern A. Zeeb AuthorDate: 2025-01-26 00:26:14 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-01-31 23:53:31 +0000 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 --- sys/contrib/dev/rtw88/main.c | 22 ++++++++++++++++++++++ sys/contrib/dev/rtw89/core.c | 30 ++++++++++++++++++++++++++++++ 2 files changed, 52 insertions(+) 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; }