linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH ath12k-ng 00/13] wifi: ath12k: Ath12k modularization changes
@ 2025-08-12 17:09 Kiran Venkatappa
  2025-08-12 17:09 ` [PATCH ath12k-ng 01/13] wifi: ath12k: Restructure PCI code to common and Wi-Fi 7 specific logic Kiran Venkatappa
                   ` (15 more replies)
  0 siblings, 16 replies; 25+ messages in thread
From: Kiran Venkatappa @ 2025-08-12 17:09 UTC (permalink / raw)
  To: ath12k; +Cc: linux-wireless

Current ath drivers have separate implementations for different
classes of devices. For example, ath11k supports WiFi-6 devices,
while ath12k supports Wi-Fi 7 devices. However, there is significant
common functionality across these generations due to shared firmware
and hardware architecture. In the existing driver code, this leverage
is achieved through code duplication. As a result, when a new driver
is introduced, many features are missed, and new additions require
porting across different generation drivers.

To improve reuse and maintainability, ath12k should be split into common
and device-specific modules. Common code can be shared across multiple
architectures, enabling better leverage for future hardware generations.
generation drivers.

Firmware interfaces and core initialization sequences are typically common
across different device families. In contrast, hardware register offsets, copy
engine mappings, and HAL configurations are usually hardware-specific.

Common components include:
      - mac80211 interface: Control path operations are mostly common across
        different ATH hardware and will be shared as much as possible.
      - Firmware interface (WMI, HTT, HTC, QMI): Firmware messaging and
        sequences are common and maintained with backward/forward compatibility
        using TLVs.
      - Datapath: Data path files are also separated similarly. More information
        will be provided in later patches.
      - Core initialization, reset, and recovery sequences: These will be part
        of the shared code.

Device-specific code includes:
      - Hardware capabilities, configurations, HAL, and other
        architecture-specific logic.

The original ath12k.ko is split into these two modules as depicted below.

                                      +-----------------+
                                      |                 |
                                      |   ath12k.ko     |
                                      |    (common)     |
    +---------------+                 |                 |
    |               |                 +-----------------+
    |   ath12k.ko   | ===========>
    |               |                 +------------------+
    +---------------+                 |                  |
                                      | ath12k_wifi7.ko  |
                                      | (wifi7 family)   |
                                      |                  |
                                      +------------------+

The ath12k.ko module will serve as the common component, while ath12k_wifi7.ko
will be the architecture-specific module for WiFi-7 devices.

After this modular separation, adding support for a new device will
primarily involve implementing device-specific code, while reusing the
majority of the shared common components.

---
Kiran Venkatappa (13):
      wifi: ath12k: Restructure PCI code to common and Wi-Fi 7 specific logic
      wifi: ath12k: Move Copy Engine configuration to Wi-Fi 7 specific file
      wifi: ath12k: Move Wi-Fi 7 WMI configuration to dedicated file
      wifi: ath12k: Move Wi-Fi 7 MHI configuration to dedicated file
      wifi: ath12k: Rename hw.c to Wi-Fi 7 specific implementation file
      wifi: ath12k: Rename ahb_hif_ops to reflect generic usage
      wifi: ath12k: Restructure ahb.c into common and Wi-Fi 7 specific modules
      wifi: ath12k: Move Wi-Fi 7 specific init routines to dedicated file
      wifi: ath12k: Move hw_init invocation to target-specific probe
      wifi: ath12k: Modularize driver into common and Wi-Fi 7 specific components
      wifi: ath12k: Rename ath12k_* symbols to ath12k_wifi7_* for clarity
      wifi: ath12k: Remove HAL defines from shared PCI code
      wifi: ath12k: Remove HAL define dependencies from shared AHB code
 
 drivers/net/wireless/ath/ath12k/Makefile         |   4 +-
 drivers/net/wireless/ath/ath12k/ahb.c            | 139 ++--
 drivers/net/wireless/ath/ath12k/ahb.h            |  27 +-
 drivers/net/wireless/ath/ath12k/ce.c             | 301 -------
 drivers/net/wireless/ath/ath12k/ce.h             |   5 +-
 drivers/net/wireless/ath/ath12k/core.c           |  38 +-
 drivers/net/wireless/ath/ath12k/core.h           |   7 +
 drivers/net/wireless/ath/ath12k/debug.c          |   4 +
 drivers/net/wireless/ath/ath12k/dp_rx.c          |   3 +
 drivers/net/wireless/ath/ath12k/hal.c            |   4 +
 drivers/net/wireless/ath/ath12k/htc.c            |   2 +
 drivers/net/wireless/ath/ath12k/hw.h             |   2 -
 drivers/net/wireless/ath/ath12k/mhi.c            | 130 ---
 drivers/net/wireless/ath/ath12k/mhi.h            |   4 +-
 drivers/net/wireless/ath/ath12k/pci.c            | 215 ++---
 drivers/net/wireless/ath/ath12k/pci.h            |  28 +-
 drivers/net/wireless/ath/ath12k/peer.c           |   2 +
 drivers/net/wireless/ath/ath12k/wifi7/Makefile   |  10 +
 drivers/net/wireless/ath/ath12k/wifi7/ahb.c      |  71 ++
 drivers/net/wireless/ath/ath12k/wifi7/ahb.h      |  20 +
 drivers/net/wireless/ath/ath12k/wifi7/ce.c       | 973 +++++++++++++++++++++++
 drivers/net/wireless/ath/ath12k/wifi7/ce.h       |  22 +
 drivers/net/wireless/ath/ath12k/wifi7/core.c     |  44 +
 drivers/net/wireless/ath/ath12k/{ => wifi7}/hw.c | 798 +++----------------
 drivers/net/wireless/ath/ath12k/wifi7/hw.h       |  13 +
 drivers/net/wireless/ath/ath12k/wifi7/mhi.c      | 138 ++++
 drivers/net/wireless/ath/ath12k/wifi7/mhi.h      |  11 +
 drivers/net/wireless/ath/ath12k/wifi7/pci.c      | 188 +++++
 drivers/net/wireless/ath/ath12k/wifi7/pci.h      |  12 +
 drivers/net/wireless/ath/ath12k/wifi7/wmi.c      | 105 +++
 drivers/net/wireless/ath/ath12k/wifi7/wmi.h      |  15 +
 drivers/net/wireless/ath/ath12k/wmi.c            |  97 ---
 drivers/net/wireless/ath/ath12k/wmi.h            |   4 -
 33 files changed, 1956 insertions(+), 1480 deletions(-)
---
base-commit: d9104cec3e8fe4b458b74709853231385779001f
change-id: 20250812-ath12k-mod-bd00156df202


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

end of thread, other threads:[~2025-08-21  1:46 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-12 17:09 [PATCH ath12k-ng 00/13] wifi: ath12k: Ath12k modularization changes Kiran Venkatappa
2025-08-12 17:09 ` [PATCH ath12k-ng 01/13] wifi: ath12k: Restructure PCI code to common and Wi-Fi 7 specific logic Kiran Venkatappa
2025-08-12 17:09 ` [PATCH ath12k-ng 02/13] wifi: ath12k: Move Copy Engine configuration to Wi-Fi 7 specific file Kiran Venkatappa
2025-08-12 17:09 ` [PATCH ath12k-ng 03/13] wifi: ath12k: Move Wi-Fi 7 WMI configuration to dedicated file Kiran Venkatappa
2025-08-13  5:52   ` Krzysztof Kozlowski
2025-08-13 15:43     ` Jeff Johnson
2025-08-13 16:00       ` Krzysztof Kozlowski
2025-08-13 16:24         ` Greg Kroah-Hartman
2025-08-13 18:06           ` Jeff Johnson
2025-08-12 17:09 ` [PATCH ath12k-ng 04/13] wifi: ath12k: Move Wi-Fi 7 MHI " Kiran Venkatappa
2025-08-13  5:52   ` Krzysztof Kozlowski
2025-08-12 17:09 ` [PATCH ath12k-ng 05/13] wifi: ath12k: Rename hw.c to Wi-Fi 7 specific implementation file Kiran Venkatappa
2025-08-12 17:09 ` [PATCH ath12k-ng 06/13] wifi: ath12k: Rename ahb_hif_ops to reflect generic usage Kiran Venkatappa
2025-08-12 17:09 ` [PATCH ath12k-ng 07/13] wifi: ath12k: Restructure ahb.c into common and Wi-Fi 7 specific modules Kiran Venkatappa
2025-08-12 17:09 ` [PATCH ath12k-ng 08/13] wifi: ath12k: Move Wi-Fi 7 specific init routines to dedicated file Kiran Venkatappa
2025-08-12 17:09 ` [PATCH ath12k-ng 09/13] wifi: ath12k: Move hw_init invocation to target-specific probe Kiran Venkatappa
2025-08-12 17:09 ` [PATCH ath12k-ng 10/13] wifi: ath12k: Modularize driver into common and Wi-Fi 7 specific components Kiran Venkatappa
2025-08-12 17:09 ` [PATCH ath12k-ng 11/13] wifi: ath12k: Rename ath12k_* symbols to ath12k_wifi7_* for clarity Kiran Venkatappa
2025-08-12 17:09 ` [PATCH ath12k-ng 12/13] wifi: ath12k: Remove HAL defines from shared PCI code Kiran Venkatappa
2025-08-12 17:09 ` [PATCH ath12k-ng 13/13] wifi: ath12k: Remove HAL define dependencies from shared AHB code Kiran Venkatappa
2025-08-20  4:50 ` [PATCH ath12k-ng 00/13] wifi: ath12k: Ath12k modularization changes Vasanthakumar Thiagarajan
2025-08-20  7:11 ` Baochen Qiang
2025-08-20 20:57   ` Jeff Johnson
2025-08-21  1:46     ` Baochen Qiang
2025-08-20 21:44 ` Jeff Johnson

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).