public inbox for linux-wireless@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH rtw-next] wifi: rtw89: Fill fw_version member of struct wiphy
@ 2026-03-25 22:21 Bitterblue Smith
  2026-03-26  1:55 ` Ping-Ke Shih
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Bitterblue Smith @ 2026-03-25 22:21 UTC (permalink / raw)
  To: linux-wireless@vger.kernel.org; +Cc: Ping-Ke Shih

Let userspace tools like lshw show the firmware version by filling the
fw_version member of struct wiphy.

Before:

configuration: broadcast=yes driver=rtw89_8852au
driverversion=6.19.6-arch1-1 firmware=N/A link=no multicast=yes
wireless=IEEE 802.11

After:

configuration: broadcast=yes driver=rtw89_8852au
driverversion=6.19.6-arch1-1 firmware=0.13.36.2 link=no multicast=yes
wireless=IEEE 802.11

Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>
---
 drivers/net/wireless/realtek/rtw89/fw.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/net/wireless/realtek/rtw89/fw.c b/drivers/net/wireless/realtek/rtw89/fw.c
index 45d8c5e70084..55aee6eb8478 100644
--- a/drivers/net/wireless/realtek/rtw89/fw.c
+++ b/drivers/net/wireless/realtek/rtw89/fw.c
@@ -755,6 +755,14 @@ static int rtw89_fw_update_ver(struct rtw89_dev *rtwdev,
 		   fw_suit->major_ver, fw_suit->minor_ver, fw_suit->sub_ver,
 		   fw_suit->sub_idex, fw_suit->commitid, fw_suit->cmd_ver, type);
 
+	if (type == RTW89_FW_NORMAL || type == RTW89_FW_NORMAL_CE ||
+	    type == RTW89_FW_NORMAL_B)
+		snprintf(rtwdev->hw->wiphy->fw_version,
+			 sizeof(rtwdev->hw->wiphy->fw_version),
+			 "%u.%u.%u.%u",
+			 fw_suit->major_ver, fw_suit->minor_ver,
+			 fw_suit->sub_ver, fw_suit->sub_idex);
+
 	return 0;
 }
 
-- 
2.53.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* RE: [PATCH rtw-next] wifi: rtw89: Fill fw_version member of struct wiphy
  2026-03-25 22:21 [PATCH rtw-next] wifi: rtw89: Fill fw_version member of struct wiphy Bitterblue Smith
@ 2026-03-26  1:55 ` Ping-Ke Shih
  2026-03-26 12:04   ` Bitterblue Smith
  2026-03-26  9:41 ` kernel test robot
  2026-03-26 10:31 ` kernel test robot
  2 siblings, 1 reply; 5+ messages in thread
From: Ping-Ke Shih @ 2026-03-26  1:55 UTC (permalink / raw)
  To: Bitterblue Smith, linux-wireless@vger.kernel.org

Bitterblue Smith <rtl8821cerfe2@gmail.com> wrote:
> Let userspace tools like lshw show the firmware version by filling the
> fw_version member of struct wiphy.
> 
> Before:
> 
> configuration: broadcast=yes driver=rtw89_8852au
> driverversion=6.19.6-arch1-1 firmware=N/A link=no multicast=yes
> wireless=IEEE 802.11
> 
> After:
> 
> configuration: broadcast=yes driver=rtw89_8852au
> driverversion=6.19.6-arch1-1 firmware=0.13.36.2 link=no multicast=yes
> wireless=IEEE 802.11
> 
> Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>
> ---
>  drivers/net/wireless/realtek/rtw89/fw.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/drivers/net/wireless/realtek/rtw89/fw.c
> b/drivers/net/wireless/realtek/rtw89/fw.c
> index 45d8c5e70084..55aee6eb8478 100644
> --- a/drivers/net/wireless/realtek/rtw89/fw.c
> +++ b/drivers/net/wireless/realtek/rtw89/fw.c
> @@ -755,6 +755,14 @@ static int rtw89_fw_update_ver(struct rtw89_dev *rtwdev,
>                    fw_suit->major_ver, fw_suit->minor_ver, fw_suit->sub_ver,
>                    fw_suit->sub_idex, fw_suit->commitid, fw_suit->cmd_ver,
> type);
> 
> +       if (type == RTW89_FW_NORMAL || type == RTW89_FW_NORMAL_CE ||
> +           type == RTW89_FW_NORMAL_B)
> +               snprintf(rtwdev->hw->wiphy->fw_version,
> +                        sizeof(rtwdev->hw->wiphy->fw_version),

nit: how about defining a local variable wiphy? as well as rtw88.

> +                        "%u.%u.%u.%u",
> +                        fw_suit->major_ver, fw_suit->minor_ver,
> +                        fw_suit->sub_ver, fw_suit->sub_idex);
> +
>         return 0;
>  }
> 
> --
> 2.53.0


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH rtw-next] wifi: rtw89: Fill fw_version member of struct wiphy
  2026-03-25 22:21 [PATCH rtw-next] wifi: rtw89: Fill fw_version member of struct wiphy Bitterblue Smith
  2026-03-26  1:55 ` Ping-Ke Shih
@ 2026-03-26  9:41 ` kernel test robot
  2026-03-26 10:31 ` kernel test robot
  2 siblings, 0 replies; 5+ messages in thread
From: kernel test robot @ 2026-03-26  9:41 UTC (permalink / raw)
  To: Bitterblue Smith, linux-wireless@vger.kernel.org
  Cc: oe-kbuild-all, Ping-Ke Shih

Hi Bitterblue,

kernel test robot noticed the following build errors:

[auto build test ERROR on wireless-next/main]
[also build test ERROR on wireless/main linus/master v7.0-rc5 next-20260325]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Bitterblue-Smith/wifi-rtw89-Fill-fw_version-member-of-struct-wiphy/20260326-082721
base:   https://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless-next.git main
patch link:    https://lore.kernel.org/r/60bdb2f8-d5dd-46a3-8679-5b4a5fd0604b%40gmail.com
patch subject: [PATCH rtw-next] wifi: rtw89: Fill fw_version member of struct wiphy
config: x86_64-rhel-9.4 (https://download.01.org/0day-ci/archive/20260326/202603261021.wmsdP9pa-lkp@intel.com/config)
compiler: gcc-14 (Debian 14.2.0-19) 14.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260326/202603261021.wmsdP9pa-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202603261021.wmsdP9pa-lkp@intel.com/

All errors (new ones prefixed by >>):

   drivers/net/wireless/realtek/rtw89/fw.c: In function 'rtw89_fw_update_ver':
>> drivers/net/wireless/realtek/rtw89/fw.c:759:21: error: 'RTW89_FW_NORMAL_B' undeclared (first use in this function); did you mean 'RTW89_FW_NORMAL_CE'?
     759 |             type == RTW89_FW_NORMAL_B)
         |                     ^~~~~~~~~~~~~~~~~
         |                     RTW89_FW_NORMAL_CE
   drivers/net/wireless/realtek/rtw89/fw.c:759:21: note: each undeclared identifier is reported only once for each function it appears in


vim +759 drivers/net/wireless/realtek/rtw89/fw.c

   726	
   727	static int rtw89_fw_update_ver(struct rtw89_dev *rtwdev,
   728				       enum rtw89_fw_type type,
   729				       struct rtw89_fw_suit *fw_suit)
   730	{
   731		const struct rtw89_fw_hdr *v0 = (const struct rtw89_fw_hdr *)fw_suit->data;
   732		const struct rtw89_fw_hdr_v1 *v1 = (const struct rtw89_fw_hdr_v1 *)fw_suit->data;
   733	
   734		if (type == RTW89_FW_LOGFMT)
   735			return 0;
   736	
   737		fw_suit->type = type;
   738		fw_suit->hdr_ver = le32_get_bits(v0->w3, FW_HDR_W3_HDR_VER);
   739	
   740		switch (fw_suit->hdr_ver) {
   741		case 0:
   742			rtw89_fw_update_ver_v0(rtwdev, fw_suit, v0);
   743			break;
   744		case 1:
   745			rtw89_fw_update_ver_v1(rtwdev, fw_suit, v1);
   746			break;
   747		default:
   748			rtw89_err(rtwdev, "Unknown firmware header version %u\n",
   749				  fw_suit->hdr_ver);
   750			return -ENOENT;
   751		}
   752	
   753		rtw89_info(rtwdev,
   754			   "Firmware version %u.%u.%u.%u (%08x), cmd version %u, type %u\n",
   755			   fw_suit->major_ver, fw_suit->minor_ver, fw_suit->sub_ver,
   756			   fw_suit->sub_idex, fw_suit->commitid, fw_suit->cmd_ver, type);
   757	
   758		if (type == RTW89_FW_NORMAL || type == RTW89_FW_NORMAL_CE ||
 > 759		    type == RTW89_FW_NORMAL_B)
   760			snprintf(rtwdev->hw->wiphy->fw_version,
   761				 sizeof(rtwdev->hw->wiphy->fw_version),
   762				 "%u.%u.%u.%u",
   763				 fw_suit->major_ver, fw_suit->minor_ver,
   764				 fw_suit->sub_ver, fw_suit->sub_idex);
   765	
   766		return 0;
   767	}
   768	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH rtw-next] wifi: rtw89: Fill fw_version member of struct wiphy
  2026-03-25 22:21 [PATCH rtw-next] wifi: rtw89: Fill fw_version member of struct wiphy Bitterblue Smith
  2026-03-26  1:55 ` Ping-Ke Shih
  2026-03-26  9:41 ` kernel test robot
@ 2026-03-26 10:31 ` kernel test robot
  2 siblings, 0 replies; 5+ messages in thread
From: kernel test robot @ 2026-03-26 10:31 UTC (permalink / raw)
  To: Bitterblue Smith, linux-wireless@vger.kernel.org
  Cc: llvm, oe-kbuild-all, Ping-Ke Shih

Hi Bitterblue,

kernel test robot noticed the following build errors:

[auto build test ERROR on wireless-next/main]
[also build test ERROR on wireless/main linus/master v7.0-rc5 next-20260325]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Bitterblue-Smith/wifi-rtw89-Fill-fw_version-member-of-struct-wiphy/20260326-082721
base:   https://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless-next.git main
patch link:    https://lore.kernel.org/r/60bdb2f8-d5dd-46a3-8679-5b4a5fd0604b%40gmail.com
patch subject: [PATCH rtw-next] wifi: rtw89: Fill fw_version member of struct wiphy
config: loongarch-defconfig (https://download.01.org/0day-ci/archive/20260326/202603261814.fyYqPTNZ-lkp@intel.com/config)
compiler: clang version 19.1.7 (https://github.com/llvm/llvm-project cd708029e0b2869e80abe31ddb175f7c35361f90)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260326/202603261814.fyYqPTNZ-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202603261814.fyYqPTNZ-lkp@intel.com/

All errors (new ones prefixed by >>):

>> drivers/net/wireless/realtek/rtw89/fw.c:759:14: error: use of undeclared identifier 'RTW89_FW_NORMAL_B'
     759 |             type == RTW89_FW_NORMAL_B)
         |                     ^
   1 error generated.


vim +/RTW89_FW_NORMAL_B +759 drivers/net/wireless/realtek/rtw89/fw.c

   726	
   727	static int rtw89_fw_update_ver(struct rtw89_dev *rtwdev,
   728				       enum rtw89_fw_type type,
   729				       struct rtw89_fw_suit *fw_suit)
   730	{
   731		const struct rtw89_fw_hdr *v0 = (const struct rtw89_fw_hdr *)fw_suit->data;
   732		const struct rtw89_fw_hdr_v1 *v1 = (const struct rtw89_fw_hdr_v1 *)fw_suit->data;
   733	
   734		if (type == RTW89_FW_LOGFMT)
   735			return 0;
   736	
   737		fw_suit->type = type;
   738		fw_suit->hdr_ver = le32_get_bits(v0->w3, FW_HDR_W3_HDR_VER);
   739	
   740		switch (fw_suit->hdr_ver) {
   741		case 0:
   742			rtw89_fw_update_ver_v0(rtwdev, fw_suit, v0);
   743			break;
   744		case 1:
   745			rtw89_fw_update_ver_v1(rtwdev, fw_suit, v1);
   746			break;
   747		default:
   748			rtw89_err(rtwdev, "Unknown firmware header version %u\n",
   749				  fw_suit->hdr_ver);
   750			return -ENOENT;
   751		}
   752	
   753		rtw89_info(rtwdev,
   754			   "Firmware version %u.%u.%u.%u (%08x), cmd version %u, type %u\n",
   755			   fw_suit->major_ver, fw_suit->minor_ver, fw_suit->sub_ver,
   756			   fw_suit->sub_idex, fw_suit->commitid, fw_suit->cmd_ver, type);
   757	
   758		if (type == RTW89_FW_NORMAL || type == RTW89_FW_NORMAL_CE ||
 > 759		    type == RTW89_FW_NORMAL_B)
   760			snprintf(rtwdev->hw->wiphy->fw_version,
   761				 sizeof(rtwdev->hw->wiphy->fw_version),
   762				 "%u.%u.%u.%u",
   763				 fw_suit->major_ver, fw_suit->minor_ver,
   764				 fw_suit->sub_ver, fw_suit->sub_idex);
   765	
   766		return 0;
   767	}
   768	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH rtw-next] wifi: rtw89: Fill fw_version member of struct wiphy
  2026-03-26  1:55 ` Ping-Ke Shih
@ 2026-03-26 12:04   ` Bitterblue Smith
  0 siblings, 0 replies; 5+ messages in thread
From: Bitterblue Smith @ 2026-03-26 12:04 UTC (permalink / raw)
  To: Ping-Ke Shih, linux-wireless@vger.kernel.org

On 26/03/2026 03:55, Ping-Ke Shih wrote:
> Bitterblue Smith <rtl8821cerfe2@gmail.com> wrote:
>> Let userspace tools like lshw show the firmware version by filling the
>> fw_version member of struct wiphy.
>>
>> Before:
>>
>> configuration: broadcast=yes driver=rtw89_8852au
>> driverversion=6.19.6-arch1-1 firmware=N/A link=no multicast=yes
>> wireless=IEEE 802.11
>>
>> After:
>>
>> configuration: broadcast=yes driver=rtw89_8852au
>> driverversion=6.19.6-arch1-1 firmware=0.13.36.2 link=no multicast=yes
>> wireless=IEEE 802.11
>>
>> Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>
>> ---
>>  drivers/net/wireless/realtek/rtw89/fw.c | 8 ++++++++
>>  1 file changed, 8 insertions(+)
>>
>> diff --git a/drivers/net/wireless/realtek/rtw89/fw.c
>> b/drivers/net/wireless/realtek/rtw89/fw.c
>> index 45d8c5e70084..55aee6eb8478 100644
>> --- a/drivers/net/wireless/realtek/rtw89/fw.c
>> +++ b/drivers/net/wireless/realtek/rtw89/fw.c
>> @@ -755,6 +755,14 @@ static int rtw89_fw_update_ver(struct rtw89_dev *rtwdev,
>>                    fw_suit->major_ver, fw_suit->minor_ver, fw_suit->sub_ver,
>>                    fw_suit->sub_idex, fw_suit->commitid, fw_suit->cmd_ver,
>> type);
>>
>> +       if (type == RTW89_FW_NORMAL || type == RTW89_FW_NORMAL_CE ||
>> +           type == RTW89_FW_NORMAL_B)
>> +               snprintf(rtwdev->hw->wiphy->fw_version,
>> +                        sizeof(rtwdev->hw->wiphy->fw_version),
> 
> nit: how about defining a local variable wiphy? as well as rtw88.
> 

Okay, I will do that.

>> +                        "%u.%u.%u.%u",
>> +                        fw_suit->major_ver, fw_suit->minor_ver,
>> +                        fw_suit->sub_ver, fw_suit->sub_idex);
>> +
>>         return 0;
>>  }
>>
>> --
>> 2.53.0
> 


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-03-26 12:04 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-25 22:21 [PATCH rtw-next] wifi: rtw89: Fill fw_version member of struct wiphy Bitterblue Smith
2026-03-26  1:55 ` Ping-Ke Shih
2026-03-26 12:04   ` Bitterblue Smith
2026-03-26  9:41 ` kernel test robot
2026-03-26 10:31 ` kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox