Hi,
can anyone help me backporting the vlan-driver to 4.14?
the official patch needs structures that are available first in 4.15…as i see there has been much changed in dsa-driver backend.
I did as far as i can,but colliding now in modified function get_tag_protocol which has now an additional param and seems to be called via a callback-struct.
anyone have more knowledge than me for porting that? dsa-driver (net/dsa/dsa2.c) has massive changes between 4.14 and 4.15, most functions from 4.14 does not exist in 4.15 and vice versa
e.g.
net/dsa/dsa2.c: In function 'dsa_cpu_parse':
net/dsa/dsa2.c:519:2: error: too few arguments to function 'ds->ops->get_tag_protocol'
tag_protocol = ds->ops->get_tag_protocol(ds);
^
drivers/net/dsa/mt7530.c: In function 'mt7530_port_set_vlan_unaware':
drivers/net/dsa/mt7530.c:825:3: error: implicit declaration of function 'dsa_is_user_port' [-Werror=implicit-function-declaration]
if (dsa_is_user_port(ds, i) &&
^
drivers/net/dsa/mt7530.c:837:9: error: implicit declaration of function 'dsa_user_ports' [-Werror=implicit-function-declaration]
PCR_MATRIX(dsa_user_ports(priv->ds)));
^
drivers/net/dsa/mt7530.c: In function 'mt7530_port_bridge_leave':
drivers/net/dsa/mt7530.c:888:4: error: implicit declaration of function 'dsa_to_port' [-Werror=implicit-function-declaration]
if (dsa_to_port(ds, i)->bridge_dev != bridge)
^
drivers/net/dsa/mt7530.c:888:26: error: invalid type argument of '->' (have 'int')
if (dsa_to_port(ds, i)->bridge_dev != bridge)
^
drivers/net/dsa/mt7530.c: At top level:
drivers/net/dsa/mt7530.c:1321:2: warning: initialization from incompatible pointer type [enabled by default]
.port_vlan_prepare = mt7530_port_vlan_prepare,
^
drivers/net/dsa/mt7530.c:1321:2: warning: (near initialization for 'mt7530_switch_ops.port_vlan_prepare') [enabled by default]
drivers/net/dsa/mt7530.c:1322:2: warning: initialization from incompatible pointer type [enabled by default]
.port_vlan_add = mt7530_port_vlan_add,
^
drivers/net/dsa/mt7530.c:1322:2: warning: (near initialization for 'mt7530_switch_ops.port_vlan_add') [enabled by default]
CC drivers/net/dsa/mt7530.o
drivers/net/dsa/mt7530.c: In function 'mt7530_port_vlan_add':
drivers/net/dsa/mt7530.c:1142:6: warning: unused variable 'ret' [-Wunused-variable]
int ret;
^~~
have you used the branch vlan_414 or vlan_414_new?
as you see in my build.log (github) i’ve did not get this error
compile goes through…but that function is “static void” so ret can be simply commented out
more critical is this:
net/dsa/dsa2.c:649:12: warning: 'dsa_port_parse_of' defined but not used [-Wunused-function]
static int dsa_port_parse_of(struct dsa_port *dp, struct device_node *dn)
because here is the port classified as user/cpu/…that should be called…
Good news it is working on 4.14 kernel. I was able to create a vlan and connect using pppoe to ISP.
# uname -a
Linux bpi-r2 4.14.11-00041-g8d9a66bcc677 #6 SMP Fri Jan 5 19:30:01 CET 2018 armv7l GNU/Linux
dmesg
[44764.006518] mt7530 mdio-bus:00 wan: Link is Up - 1Gbps/Full - flow control off
[44770.132756] PPP generic driver version 2.4.2
[44799.722802] NET: Registered protocol family 24
Link in 1G/Full
# ethtool wan
Settings for wan:
Supported ports: [ TP AUI BNC MII FIBRE ]
Supported link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Full
Supported pause frame use: Symmetric Receive-only
Supports auto-negotiation: Yes
Advertised link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Full
Advertised pause frame use: No
Advertised auto-negotiation: Yes
Link partner advertised link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Full
Link partner advertised pause frame use: No
Link partner advertised auto-negotiation: Yes
Speed: 1000Mb/s
Duplex: Full
Port: MII
PHYAD: 0
Transceiver: internal
Auto-negotiation: on
Supports Wake-on: d
Wake-on: d
Link detected: yes
but for some functions it does not show simple renamings because there are additional functions or function is moved to another position…it is hard to patch right function if name has changed
seems that porting is not needed…i can define vlans via software with main-branch:
auto lan3
iface lan3 inet static
pre-up ip link set $IFACE address 02:01:02:03:04:03 up
auto lan3.60
iface lan3.60 inet static
address 192.168.60.10
netmask 255.255.255.0
root@bpi-r2:~# ping 192.168.60.1
PING 192.168.60.1 (192.168.60.1) 56(84) bytes of data.
64 bytes from 192.168.60.1: icmp_seq=1 ttl=64 time=0.712 ms
64 bytes from 192.168.60.1: icmp_seq=2 ttl=64 time=0.653 ms
64 bytes from 192.168.60.1: icmp_seq=3 ttl=64 time=0.619 ms
^C
--- 192.168.60.1 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2104ms
rtt min/avg/max/mdev = 0.619/0.661/0.712/0.043 ms
on lan3 is a rpi directly connected with similar config (vlan60 and ip 192.168.60.1 which i ping from bpi-r2), port on rpi is mixed mode (untagged in subnet 192.168.0.x+tagged on vlan60
pi@raspberrypi:~$ ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen
1000
link/ether b8:27:eb:5f:b8:a2 brd ff:ff:ff:ff:ff:ff
inet 192.168.0.6/24 brd 192.168.0.255 scope global eth0
valid_lft forever preferred_lft forever
inet 169.254.141.212/16 brd 169.254.255.255 scope global eth0
valid_lft forever preferred_lft forever
3: eth0.60@eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default
qlen 1000
link/ether b8:27:eb:5f:b8:a2 brd ff:ff:ff:ff:ff:ff
inet 192.168.60.1/24 brd 192.168.60.255 scope global eth0.60
valid_lft forever preferred_lft forever