[PATCH net-next 5/5] net: ethernet: mtk_wed: add reset to tx_ring_setup callback

Felix Fietkau nbd at nbd.name
Tue Nov 22 01:41:28 PST 2022


On 22.11.22 05:19, Jakub Kicinski wrote:
> On Mon, 21 Nov 2022 22:18:33 +0100 Lorenzo Bianconi wrote:
>> > On Mon, 21 Nov 2022 09:59:25 +0100 Lorenzo Bianconi wrote:  
>> > > +#define mtk_wed_device_tx_ring_setup(_dev, _ring, _regs, _reset) \
>> > > +	(_dev)->ops->tx_ring_setup(_dev, _ring, _regs, _reset)  
>> > 
>> > FWIW I find the "op macros" quite painful when trying to read a driver
>> > I'm not familiar with. stmmac does this, too. Just letting you know,
>> > it is what it is.  
>> 
>> ack, fine. I maintained the approach currently used in the driver.
>> Do you prefer to run the function pointer directly?
> 
> That's a tiny bit better, yes, saves the reader one lookup.
> 
> Are the ops here serving as a HAL or a way of breaking the dependency
> between the SoC/Eth and the WiFi drivers?
The latter. For a multi-platform kernel it's important that the wifi 
driver does not depend on mtk_eth_soc directly, even when support for 
WED is enabled.

- Felix



More information about the Linux-mediatek mailing list