Is there a way to do this from outside the kernel?
struct mt7530_priv *priv = ds->priv;
mt7530_write(priv, reg, val);
what is switch-register and how to interpret your syntax?
If i understand it right,wan should be port0 (1=lan0,…): https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/tree/arch/arm/boot/dts/mt7623n-bananapi-bpi-r2.dts?h=next-20190116#n161
First is register followed by bits to set in brackets?
So enable portmirroring on port 2 by setting bit 2 (begin on 1 or 0?) on register 0x10? Second step seems then set 3rd bit (port 3) instead of global enable mirroring
is there a interface to sysfs/debugfs, where i can add this commands to make it reachable from userspace?