From: Bitterblue Smith <rtl8821cerfe2@gmail.com>
To: Ping-Ke Shih <pkshih@realtek.com>,
"linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>
Subject: Re: [PATCH 18/20] wifi: rtw88: Add rtw8821a.{c,h}
Date: Wed, 25 Sep 2024 00:19:34 +0300 [thread overview]
Message-ID: <b4c9ff5c-a8ca-401f-aa79-3798239ffd57@gmail.com> (raw)
In-Reply-To: <73de8e7135554ae9a0f7968780644515@realtek.com>
On 23/09/2024 08:47, Ping-Ke Shih wrote:
> Bitterblue Smith <rtl8821cerfe2@gmail.com> wrote:
>>>>>>>> +
>>>>>>>> +const struct rtw_chip_info rtw8812a_hw_spec = {
>>>>>>>
>>>>>>> Is it possible moving 8812a to individual file?
>>>>>>> Since you have rtw8812au.c and rtw8821au.c.
>>>>>>>
>>>>>>
>>>>>> I think it is possible. But most of the code is common to both chips.
>>>>>> Only the IQ calibration could be moved.
>>>>>
>>>>> Yep, depend on how much IQK code echo chip has.
>>>>>
>>>>
>>>> The IQ calibration for RTL8812AU is about 700 lines.
>>>
>>> rtw8812au -----> (a) rtw8812a
>>> |
>>> v
>>> (b) rtw8821a_common (hard to give a name)
>>> ^
>>> |
>>> rtw8821au -----> (c) rtw8821a
>>>
>>> Put all common code to (b). IQK code in (a) or (c).
>>>
>>> I feel you have thought above picture already. What are problems we will encounter?
>>> Many export symbols? If so, how about below?
>>>
>>> rtw8812au -----> (1) rtw8812a
>>> +---------+
>>> +-> (2) rtw8821a_common (hard to give a name)
>>> +---------+
>>> rtw8821au -----> (3) rtw8821a
>>>
>>> Put rtw8812a_hw_spec and rtw8821a_hw_spec in (2). Only IQK code in (1) and (3)
>>> respectively, and export IQK entry only. Does it work?
>>>
>>>
>> For the name of the common module, I was thinking rtw88_88xxa.ko.
>>
>> I wonder, what is the goal? To put the code in separate kernel
>> modules, or just separate files?
>
> I would like to reduce runtime memory. As I asked, how many IQK code are different
> from them? If you have separated and compiled them, can you share size by the
> output of 'size' command?
>
I separated the IQK code into two files (still just one module).
size says:
text data bss dec hex filename
7192 32 0 7224 1c38 rtw8821a-iqk.o
12319 40 0 12359 3047 rtw8812a-iqk.o
This is x86_64.
>>
>> I think we can have rtw88xxa.c (common code), rtw8821a.c (IQK code,
>> rtw8821a_hw_spec, bluetooth stuff), and rtw8812a.c (IQK code,
>> rtw8812a_hw_spec, some efuse stuff, channel switching)... if these
>> three files compile into a single module, rtw88_88xxa.ko.
>>
>> If each file compiles into a module of its own, we have circular
>> dependencies: rtw8821a_hw_spec -> common code -> IQK code.
>> If *_hw_spec go in the common module, it still depends on both of
>> the other two modules, so what use is it?
>
> If we have dependency of common code -> IQK code, we can't save runtime
> memory, because common code reference to both IQK code. So I felt
> dependency of IQK code would be rtw8812au --> IQK code as above second
> diagram.
>
> But if the work is complicated and save not few runtime memory, we can
> use simple design as current did.
>
>
The IQK code can be separated into different modules if I duplicate
rtw8821a_ops and rtw8821a_pwr_track, and rtw8821a_phy_pwrtrack takes
a pointer to the IQK function. Then your first diagram above can work.
The tables also take up a bit of space:
text data bss dec hex filename
16832 0 0 16832 41c0 rtw8821a_table.o
21552 0 0 21552 5430 rtw8812a_table.o
I don't know how many kilobytes is enough to make it worth
creating two more modules.
next prev parent reply other threads:[~2024-09-24 21:19 UTC|newest]
Thread overview: 64+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-11 20:53 [PATCH 00/20] wifi: rtw88: Add support for RTL8821AU and RTL8812AU Bitterblue Smith
2024-08-11 20:54 ` [PATCH 01/20] wifi: rtw88: Add some definitions for RTL8821AU/RTL8812AU Bitterblue Smith
2024-08-15 6:34 ` Ping-Ke Shih
2024-08-11 20:54 ` [PATCH 02/20] wifi: rtw88: Dump the HW features only for some chips Bitterblue Smith
2024-08-15 6:10 ` Ping-Ke Shih
2024-08-19 17:51 ` Bitterblue Smith
2024-08-11 20:55 ` [PATCH 03/20] wifi: rtw88: Allow different C2H RA report sizes Bitterblue Smith
2024-08-15 6:14 ` Ping-Ke Shih
2024-08-19 17:52 ` Bitterblue Smith
2024-08-20 1:10 ` Ping-Ke Shih
2024-08-20 21:44 ` Bitterblue Smith
2024-08-21 0:31 ` Ping-Ke Shih
2024-08-21 11:13 ` Bitterblue Smith
2024-08-22 0:33 ` Ping-Ke Shih
2024-08-22 6:58 ` Kalle Valo
2024-08-22 14:04 ` Bitterblue Smith
2024-08-11 20:55 ` [PATCH 04/20] wifi: rtw88: Extend the init table parsing for RTL8812AU Bitterblue Smith
2024-08-15 6:27 ` Ping-Ke Shih
2024-08-11 20:57 ` [PATCH 05/20] wifi: rtw88: Allow rtw_chip_info.ltecoex_addr to be NULL Bitterblue Smith
2024-08-15 6:33 ` Ping-Ke Shih
2024-08-19 17:53 ` Bitterblue Smith
2024-08-20 1:15 ` Ping-Ke Shih
2024-08-11 20:57 ` [PATCH 06/20] wifi: rtw88: Let each driver control the power on/off process Bitterblue Smith
2024-08-11 20:59 ` [PATCH 07/20] wifi: rtw88: Enable data rate fallback for older chips Bitterblue Smith
2024-08-15 6:46 ` Ping-Ke Shih
2024-08-11 21:00 ` [PATCH 08/20] wifi: rtw88: Make txagc_remnant_ofdm an array Bitterblue Smith
2024-08-15 6:50 ` Ping-Ke Shih
2024-08-11 21:00 ` [PATCH 09/20] wifi: rtw88: Support TX page sizes bigger than 128 Bitterblue Smith
2024-08-15 6:52 ` Ping-Ke Shih
2024-08-11 21:01 ` [PATCH 10/20] wifi: rtw88: Move pwr_track_tbl to struct rtw_rfe_def Bitterblue Smith
2024-08-15 7:00 ` Ping-Ke Shih
2024-08-11 21:02 ` [PATCH 11/20] wifi: rtw88: usb: Set pkt_info.ls for the reserved page Bitterblue Smith
2024-08-15 7:07 ` Ping-Ke Shih
2024-08-11 21:02 ` [PATCH 12/20] wifi: rtw88: Detect beacon loss with chips other than 8822c Bitterblue Smith
2024-08-15 7:16 ` Ping-Ke Shih
2024-08-11 21:03 ` [PATCH 13/20] wifi: rtw88: coex: Support chips without a scoreboard Bitterblue Smith
2024-08-15 7:19 ` Ping-Ke Shih
2024-08-11 21:04 ` [PATCH 14/20] wifi: rtw88: 8821a: Regularly ask for BT info updates Bitterblue Smith
2024-08-15 7:26 ` Ping-Ke Shih
2024-08-11 21:05 ` [PATCH 15/20] wifi: rtw88: 8812a: Mitigate beacon loss Bitterblue Smith
2024-08-15 7:31 ` Ping-Ke Shih
2024-08-11 21:06 ` [PATCH 16/20] wifi: rtw88: Add rtw8812a_table.{c,h} Bitterblue Smith
2024-08-15 7:53 ` Ping-Ke Shih
2024-08-16 1:19 ` Ping-Ke Shih
2024-08-11 21:06 ` [PATCH 17/20] wifi: rtw88: Add rtw8821a_table.{c,h} Bitterblue Smith
2024-08-15 7:55 ` Ping-Ke Shih
2024-08-11 21:07 ` [PATCH 18/20] wifi: rtw88: Add rtw8821a.{c,h} Bitterblue Smith
2024-08-16 6:06 ` Ping-Ke Shih
2024-08-27 17:52 ` Bitterblue Smith
2024-09-10 2:30 ` Ping-Ke Shih
2024-09-12 15:59 ` Bitterblue Smith
2024-09-13 1:50 ` Ping-Ke Shih
2024-09-21 22:47 ` Bitterblue Smith
2024-09-23 5:47 ` Ping-Ke Shih
2024-09-23 5:58 ` Ping-Ke Shih
2024-09-24 21:19 ` Bitterblue Smith [this message]
2024-09-25 1:25 ` Ping-Ke Shih
2024-09-25 11:28 ` Bitterblue Smith
2024-09-26 2:27 ` Ping-Ke Shih
2024-09-26 16:41 ` Bitterblue Smith
2024-08-11 21:08 ` [PATCH 19/20] wifi: rtw88: Add rtw8821au.c and rtw8812au.c Bitterblue Smith
2024-08-15 7:58 ` Ping-Ke Shih
2024-08-11 21:11 ` [PATCH 20/20] wifi: rtw88: Enable the new RTL8821AU/RTL8812AU drivers Bitterblue Smith
2024-08-15 8:01 ` Ping-Ke Shih
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=b4c9ff5c-a8ca-401f-aa79-3798239ffd57@gmail.com \
--to=rtl8821cerfe2@gmail.com \
--cc=linux-wireless@vger.kernel.org \
--cc=pkshih@realtek.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).