wifi: ath11k: allocate dummy net_device dynamically
authorBreno Leitao <leitao@debian.org>
Mon, 22 Apr 2024 12:39:03 +0000 (05:39 -0700)
committerDavid S. Miller <davem@davemloft.net>
Wed, 24 Apr 2024 11:00:17 +0000 (12:00 +0100)
commitbca592ead82528b65fb028fbb71911359a642f16
tree61fbf9624b710c41869130df385d666fe923d362
parent57738dab12d95d72fed3d9697082ca50033cee89
wifi: ath11k: allocate dummy net_device dynamically

Embedding net_device into structures prohibits the usage of flexible
arrays in the net_device structure. For more details, see the discussion
at [1].

Un-embed the net_device from struct ath11k_ext_irq_grp by converting it
into a pointer. Then use the leverage alloc_netdev() to allocate the
net_device object at ath11k_ahb_config_ext_irq() for ahb, and
ath11k_pcic_ext_irq_config() for pcic.

The free of the device occurs at ath11k_ahb_free_ext_irq() for the ahb
case, and ath11k_pcic_free_ext_irq() for the pcic case.

[1] https://lore.kernel.org/all/20240229225910.79e224cf@kernel.org/

Signed-off-by: Breno Leitao <leitao@debian.org>
Tested-by: Kalle Valo <kvalo@kernel.org>
Acked-by: Kalle Valo <kvalo@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/wireless/ath/ath11k/ahb.c
drivers/net/wireless/ath/ath11k/core.h
drivers/net/wireless/ath/ath11k/pcic.c