OSDN Git Service

net: dsa: setup routing table
authorVivien Didelot <vivien.didelot@savoirfairelinux.com>
Mon, 6 Nov 2017 21:11:51 +0000 (16:11 -0500)
committerDavid S. Miller <davem@davemloft.net>
Thu, 9 Nov 2017 00:26:49 +0000 (09:26 +0900)
commit34c09a8916fb52aac948dfc861b33c0b3b37ac29
tree0d4c1068c05cf00c93d2032186b860546c8caa6b
parentc52866655558e5fc87ceae8aac528a7e410c8a77
net: dsa: setup routing table

The *_complete() functions take too much arguments to do only one thing:
they try to fetch the dsa_port structures corresponding to device nodes
under the "link" list property of DSA ports, and use them to setup the
routing table of switches.

This patch simplifies them by providing instead simpler
dsa_{port,switch,tree}_setup_routing_table functions which return a
boolean value, true if the tree is complete.

dsa_tree_setup_routing_table is called inside dsa_tree_setup which
simplifies the switch registering function as well.

A switch's routing table is now initialized before its setup.

This also makes dsa_port_is_valid obsolete, remove it.

Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/dsa/dsa2.c