Lines Matching refs:cpu_dp
372 struct dsa_port *cpu_dp; in dsa_tree_find_first_master() local
374 cpu_dp = dsa_tree_find_first_cpu(dst); in dsa_tree_find_first_master()
375 ethernet = of_parse_phandle(cpu_dp->dn, "ethernet", 0); in dsa_tree_find_first_master()
387 struct dsa_port *cpu_dp, *dp; in dsa_tree_setup_default_cpu() local
389 cpu_dp = dsa_tree_find_first_cpu(dst); in dsa_tree_setup_default_cpu()
390 if (!cpu_dp) { in dsa_tree_setup_default_cpu()
396 if (dp->cpu_dp) in dsa_tree_setup_default_cpu()
400 dp->cpu_dp = cpu_dp; in dsa_tree_setup_default_cpu()
409 struct dsa_port *cpu_dp; in dsa_switch_preferred_default_local_cpu_port() local
414 cpu_dp = ds->ops->preferred_default_local_cpu_port(ds); in dsa_switch_preferred_default_local_cpu_port()
415 if (!cpu_dp) in dsa_switch_preferred_default_local_cpu_port()
418 if (WARN_ON(!dsa_port_is_cpu(cpu_dp) || cpu_dp->ds != ds)) in dsa_switch_preferred_default_local_cpu_port()
421 return cpu_dp; in dsa_switch_preferred_default_local_cpu_port()
431 struct dsa_port *preferred_cpu_dp, *cpu_dp, *dp; in dsa_tree_setup_cpu_ports() local
433 list_for_each_entry(cpu_dp, &dst->ports, list) { in dsa_tree_setup_cpu_ports()
434 if (!dsa_port_is_cpu(cpu_dp)) in dsa_tree_setup_cpu_ports()
437 preferred_cpu_dp = dsa_switch_preferred_default_local_cpu_port(cpu_dp->ds); in dsa_tree_setup_cpu_ports()
438 if (preferred_cpu_dp && preferred_cpu_dp != cpu_dp) in dsa_tree_setup_cpu_ports()
442 dsa_switch_for_each_port(dp, cpu_dp->ds) { in dsa_tree_setup_cpu_ports()
444 if (dp->cpu_dp) in dsa_tree_setup_cpu_ports()
448 dp->cpu_dp = cpu_dp; in dsa_tree_setup_cpu_ports()
461 dp->cpu_dp = NULL; in dsa_tree_teardown_cpu_ports()
798 struct dsa_port *cpu_dp; in dsa_tree_setup_master() local
803 dsa_tree_for_each_cpu_port(cpu_dp, dst) { in dsa_tree_setup_master()
804 struct net_device *master = cpu_dp->master; in dsa_tree_setup_master()
808 err = dsa_master_setup(master, cpu_dp); in dsa_tree_setup_master()
825 struct dsa_port *cpu_dp; in dsa_tree_teardown_master() local
829 dsa_tree_for_each_cpu_port(cpu_dp, dst) { in dsa_tree_teardown_master()
830 struct net_device *master = cpu_dp->master; in dsa_tree_teardown_master()
1035 struct dsa_port *cpu_dp = master->dsa_ptr; in dsa_tree_master_state_change() local
1038 info.operational = dsa_port_master_is_operational(cpu_dp); in dsa_tree_master_state_change()
1047 struct dsa_port *cpu_dp = master->dsa_ptr; in dsa_tree_master_admin_state_change() local
1056 if ((dsa_port_master_is_operational(cpu_dp)) != in dsa_tree_master_admin_state_change()
1057 (up && cpu_dp->master_oper_up)) in dsa_tree_master_admin_state_change()
1060 cpu_dp->master_admin_up = up; in dsa_tree_master_admin_state_change()
1070 struct dsa_port *cpu_dp = master->dsa_ptr; in dsa_tree_master_oper_state_change() local
1079 if ((dsa_port_master_is_operational(cpu_dp)) != in dsa_tree_master_oper_state_change()
1080 (cpu_dp->master_admin_up && up)) in dsa_tree_master_oper_state_change()
1083 cpu_dp->master_oper_up = up; in dsa_tree_master_oper_state_change()