File tree Expand file tree Collapse file tree 2 files changed +6
-5
lines changed
subsys/net/l2/ethernet/dsa Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -700,6 +700,9 @@ struct ethernet_context {
700
700
701
701
/** DSA switch context pointer */
702
702
struct dsa_switch_context * dsa_switch_ctx ;
703
+
704
+ /** DSA CPU port connected. */
705
+ struct net_if * dsa_cpu_iface ;
703
706
#endif
704
707
705
708
/** Is network carrier up */
Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ int dsa_port_initialize(const struct device *dev)
28
28
29
29
dsa_switch_ctx -> init_ports ++ ;
30
30
31
- /* Find conduit port */
31
+ /* Find the connection of conduit port and cpu port */
32
32
if (dsa_switch_ctx -> iface_conduit == NULL && cfg -> ethernet_connection != NULL ) {
33
33
dsa_switch_ctx -> iface_conduit = net_if_lookup_by_dev (cfg -> ethernet_connection );
34
34
if (dsa_switch_ctx -> iface_conduit == NULL ) {
@@ -37,13 +37,11 @@ int dsa_port_initialize(const struct device *dev)
37
37
38
38
eth_ctx -> dsa_port = DSA_CPU_PORT ;
39
39
40
- /*
41
- * Provide pointer to DSA switch context to conduit's eth interface
42
- * struct ethernet_context
43
- */
40
+ /* Provide DSA information to the conduit port */
44
41
eth_ctx_conduit = net_if_l2_data (dsa_switch_ctx -> iface_conduit );
45
42
eth_ctx_conduit -> dsa_switch_ctx = dsa_switch_ctx ;
46
43
eth_ctx_conduit -> dsa_port = DSA_CONDUIT_PORT ;
44
+ eth_ctx_conduit -> dsa_cpu_iface = iface ;
47
45
}
48
46
49
47
if (cfg -> ethernet_connection == NULL ) {
You can’t perform that action at this time.
0 commit comments