Thanks for the response, Andrew!
On 23. okt. 2017 14:58, Andrew Lunn wrote:
#include "dsa_priv.h"
+#include "../../drivers/net/dsa/lan9303.h"
Don't do that. Export the needed parts in an include file in
include/linux.
Do you mean moving struct definitions from drivers/net/dsa/lan9303.h to
a include/linux/lan9303.h? That would be like 80% of
drivers/net/dsa/lan9303.h. I am a bit surprised that is deemed better
than the slightly ugly include.
Or do you have other suggestions?
One possibility could be to have lan9303_tx_use_arl() in
drivers/net/dsa/lan9303-core.c. But it has to be exported, and can
not be inlined.
It is also possible to replace the chip->is_bridged term with:
struct dsa_switch *ds = dp->ds;
if (!dsa_to_port(ds, 1)->bridge_dev)
return false;
if (dsa_to_port(ds, 1)->bridge_dev != dsa_to_port(ds,2)->bridge_dev)
return false;
But it feels silly to duplicate that calculation in the data path.
Otherwise, i think your approach is O.K.
Andrew
Egil