Lines Matching refs:dp
70 struct dsa_port *dp = dsa_slave_to_port(dev); in dsa_slave_open() local
93 err = dsa_port_enable(dp, dev->phydev); in dsa_slave_open()
97 phylink_start(dp->pl); in dsa_slave_open()
117 struct dsa_port *dp = dsa_slave_to_port(dev); in dsa_slave_close() local
119 cancel_work_sync(&dp->xmit_work); in dsa_slave_close()
120 skb_queue_purge(&dp->xmit_queue); in dsa_slave_close()
122 phylink_stop(dp->pl); in dsa_slave_close()
124 dsa_port_disable(dp); in dsa_slave_close()
243 struct dsa_port *dp = dsa_slave_to_port(dev); in dsa_slave_fdb_dump() local
252 err = dsa_port_fdb_dump(dp, dsa_slave_port_fdb_do_dump, &dump); in dsa_slave_fdb_dump()
261 struct dsa_switch *ds = p->dp->ds; in dsa_slave_ioctl()
262 int port = p->dp->index; in dsa_slave_ioctl()
276 return phylink_mii_ioctl(p->dp->pl, ifr, cmd); in dsa_slave_ioctl()
283 struct dsa_port *dp = dsa_slave_to_port(dev); in dsa_slave_port_attr_set() local
288 ret = dsa_port_set_state(dp, attr->u.stp_state, trans); in dsa_slave_port_attr_set()
291 ret = dsa_port_vlan_filtering(dp, attr->u.vlan_filtering, in dsa_slave_port_attr_set()
295 ret = dsa_port_ageing_time(dp, attr->u.ageing_time, trans); in dsa_slave_port_attr_set()
298 ret = dsa_port_pre_bridge_flags(dp, attr->u.brport_flags, in dsa_slave_port_attr_set()
302 ret = dsa_port_bridge_flags(dp, attr->u.brport_flags, trans); in dsa_slave_port_attr_set()
305 ret = dsa_port_mrouter(dp->cpu_dp, attr->u.mrouter, trans); in dsa_slave_port_attr_set()
319 struct dsa_port *dp = dsa_slave_to_port(dev); in dsa_slave_vlan_add() local
326 if (dp->bridge_dev && !br_vlan_enabled(dp->bridge_dev)) in dsa_slave_vlan_add()
331 err = dsa_port_vlan_add(dp, &vlan, trans); in dsa_slave_vlan_add()
341 err = dsa_port_vlan_add(dp->cpu_dp, &vlan, trans); in dsa_slave_vlan_add()
353 struct dsa_port *dp = dsa_slave_to_port(dev); in dsa_slave_port_obj_add() local
365 err = dsa_port_mdb_add(dp, SWITCHDEV_OBJ_PORT_MDB(obj), trans); in dsa_slave_port_obj_add()
371 err = dsa_port_mdb_add(dp->cpu_dp, SWITCHDEV_OBJ_PORT_MDB(obj), in dsa_slave_port_obj_add()
388 struct dsa_port *dp = dsa_slave_to_port(dev); in dsa_slave_vlan_del() local
393 if (dp->bridge_dev && !br_vlan_enabled(dp->bridge_dev)) in dsa_slave_vlan_del()
399 return dsa_port_vlan_del(dp, SWITCHDEV_OBJ_PORT_VLAN(obj)); in dsa_slave_vlan_del()
405 struct dsa_port *dp = dsa_slave_to_port(dev); in dsa_slave_port_obj_del() local
412 err = dsa_port_mdb_del(dp, SWITCHDEV_OBJ_PORT_MDB(obj)); in dsa_slave_port_obj_del()
418 err = dsa_port_mdb_del(dp->cpu_dp, SWITCHDEV_OBJ_PORT_MDB(obj)); in dsa_slave_port_obj_del()
434 struct dsa_port *dp = dsa_slave_to_port(dev); in dsa_slave_get_port_parent_id() local
435 struct dsa_switch *ds = dp->ds; in dsa_slave_get_port_parent_id()
442 if (dp->ds->devlink) in dsa_slave_get_port_parent_id()
468 struct dsa_switch *ds = p->dp->ds; in dsa_skb_tx_timestamp()
485 if (ds->ops->port_txtstamp(ds, p->dp->index, clone, type)) in dsa_skb_tx_timestamp()
544 struct dsa_port *dp = dsa_slave_to_port(dev); in dsa_defer_xmit() local
548 skb_queue_tail(&dp->xmit_queue, skb); in dsa_defer_xmit()
549 schedule_work(&dp->xmit_work); in dsa_defer_xmit()
556 struct dsa_port *dp = container_of(work, struct dsa_port, xmit_work); in dsa_port_xmit_work() local
557 struct dsa_switch *ds = dp->ds; in dsa_port_xmit_work()
563 while ((skb = skb_dequeue(&dp->xmit_queue)) != NULL) in dsa_port_xmit_work()
564 ds->ops->port_deferred_xmit(ds, dp->index, skb); in dsa_port_xmit_work()
579 struct dsa_port *dp = dsa_slave_to_port(dev); in dsa_slave_get_regs_len() local
580 struct dsa_switch *ds = dp->ds; in dsa_slave_get_regs_len()
583 return ds->ops->get_regs_len(ds, dp->index); in dsa_slave_get_regs_len()
591 struct dsa_port *dp = dsa_slave_to_port(dev); in dsa_slave_get_regs() local
592 struct dsa_switch *ds = dp->ds; in dsa_slave_get_regs()
595 ds->ops->get_regs(ds, dp->index, regs, _p); in dsa_slave_get_regs()
600 struct dsa_port *dp = dsa_slave_to_port(dev); in dsa_slave_nway_reset() local
602 return phylink_ethtool_nway_reset(dp->pl); in dsa_slave_nway_reset()
607 struct dsa_port *dp = dsa_slave_to_port(dev); in dsa_slave_get_eeprom_len() local
608 struct dsa_switch *ds = dp->ds; in dsa_slave_get_eeprom_len()
622 struct dsa_port *dp = dsa_slave_to_port(dev); in dsa_slave_get_eeprom() local
623 struct dsa_switch *ds = dp->ds; in dsa_slave_get_eeprom()
634 struct dsa_port *dp = dsa_slave_to_port(dev); in dsa_slave_set_eeprom() local
635 struct dsa_switch *ds = dp->ds; in dsa_slave_set_eeprom()
646 struct dsa_port *dp = dsa_slave_to_port(dev); in dsa_slave_get_strings() local
647 struct dsa_switch *ds = dp->ds; in dsa_slave_get_strings()
657 ds->ops->get_strings(ds, dp->index, stringset, in dsa_slave_get_strings()
666 struct dsa_port *dp = dsa_slave_to_port(dev); in dsa_slave_get_ethtool_stats() local
668 struct dsa_switch *ds = dp->ds; in dsa_slave_get_ethtool_stats()
690 ds->ops->get_ethtool_stats(ds, dp->index, data + 4); in dsa_slave_get_ethtool_stats()
695 struct dsa_port *dp = dsa_slave_to_port(dev); in dsa_slave_get_sset_count() local
696 struct dsa_switch *ds = dp->ds; in dsa_slave_get_sset_count()
703 count += ds->ops->get_sset_count(ds, dp->index, sset); in dsa_slave_get_sset_count()
713 struct dsa_port *dp = dsa_slave_to_port(dev); in dsa_slave_get_wol() local
714 struct dsa_switch *ds = dp->ds; in dsa_slave_get_wol()
716 phylink_ethtool_get_wol(dp->pl, w); in dsa_slave_get_wol()
719 ds->ops->get_wol(ds, dp->index, w); in dsa_slave_get_wol()
724 struct dsa_port *dp = dsa_slave_to_port(dev); in dsa_slave_set_wol() local
725 struct dsa_switch *ds = dp->ds; in dsa_slave_set_wol()
728 phylink_ethtool_set_wol(dp->pl, w); in dsa_slave_set_wol()
731 ret = ds->ops->set_wol(ds, dp->index, w); in dsa_slave_set_wol()
738 struct dsa_port *dp = dsa_slave_to_port(dev); in dsa_slave_set_eee() local
739 struct dsa_switch *ds = dp->ds; in dsa_slave_set_eee()
743 if (!dev->phydev || !dp->pl) in dsa_slave_set_eee()
749 ret = ds->ops->set_mac_eee(ds, dp->index, e); in dsa_slave_set_eee()
753 return phylink_ethtool_set_eee(dp->pl, e); in dsa_slave_set_eee()
758 struct dsa_port *dp = dsa_slave_to_port(dev); in dsa_slave_get_eee() local
759 struct dsa_switch *ds = dp->ds; in dsa_slave_get_eee()
763 if (!dev->phydev || !dp->pl) in dsa_slave_get_eee()
769 ret = ds->ops->get_mac_eee(ds, dp->index, e); in dsa_slave_get_eee()
773 return phylink_ethtool_get_eee(dp->pl, e); in dsa_slave_get_eee()
779 struct dsa_port *dp = dsa_slave_to_port(dev); in dsa_slave_get_link_ksettings() local
781 return phylink_ethtool_ksettings_get(dp->pl, cmd); in dsa_slave_get_link_ksettings()
787 struct dsa_port *dp = dsa_slave_to_port(dev); in dsa_slave_set_link_ksettings() local
789 return phylink_ethtool_ksettings_set(dp->pl, cmd); in dsa_slave_set_link_ksettings()
837 struct dsa_port *dp = dsa_slave_to_port(dev); in dsa_slave_get_phys_port_name() local
843 if (dp->ds->devlink) in dsa_slave_get_phys_port_name()
846 if (snprintf(name, len, "p%d", dp->index) >= len) in dsa_slave_get_phys_port_name()
869 struct dsa_port *dp = dsa_slave_to_port(dev); in dsa_slave_add_cls_matchall() local
873 struct dsa_switch *ds = dp->ds; in dsa_slave_add_cls_matchall()
908 err = ds->ops->port_mirror_add(ds, dp->index, mirror, ingress); in dsa_slave_add_cls_matchall()
923 struct dsa_port *dp = dsa_slave_to_port(dev); in dsa_slave_del_cls_matchall() local
925 struct dsa_switch *ds = dp->ds; in dsa_slave_del_cls_matchall()
938 ds->ops->port_mirror_del(ds, dp->index, &mall_tc_entry->mirror); in dsa_slave_del_cls_matchall()
1038 struct dsa_port *dp = dsa_slave_to_port(dev); in dsa_slave_setup_tc() local
1039 struct dsa_switch *ds = dp->ds; in dsa_slave_setup_tc()
1047 return ds->ops->port_setup_tc(ds, dp->index, type, type_data); in dsa_slave_setup_tc()
1081 struct dsa_port *dp = dsa_slave_to_port(dev); in dsa_slave_get_rxnfc() local
1082 struct dsa_switch *ds = dp->ds; in dsa_slave_get_rxnfc()
1087 return ds->ops->get_rxnfc(ds, dp->index, nfc, rule_locs); in dsa_slave_get_rxnfc()
1093 struct dsa_port *dp = dsa_slave_to_port(dev); in dsa_slave_set_rxnfc() local
1094 struct dsa_switch *ds = dp->ds; in dsa_slave_set_rxnfc()
1099 return ds->ops->set_rxnfc(ds, dp->index, nfc); in dsa_slave_set_rxnfc()
1106 struct dsa_switch *ds = p->dp->ds; in dsa_slave_get_ts_info()
1111 return ds->ops->get_ts_info(ds, p->dp->index, ts); in dsa_slave_get_ts_info()
1117 struct dsa_port *dp = dsa_slave_to_port(dev); in dsa_slave_vlan_rx_add_vid() local
1124 if (dp->bridge_dev) { in dsa_slave_vlan_rx_add_vid()
1125 if (!br_vlan_enabled(dp->bridge_dev)) in dsa_slave_vlan_rx_add_vid()
1132 ret = br_vlan_get_info(dp->bridge_dev, vid, &info); in dsa_slave_vlan_rx_add_vid()
1137 ret = dsa_port_vid_add(dp, vid, 0); in dsa_slave_vlan_rx_add_vid()
1141 ret = dsa_port_vid_add(dp->cpu_dp, vid, 0); in dsa_slave_vlan_rx_add_vid()
1151 struct dsa_port *dp = dsa_slave_to_port(dev); in dsa_slave_vlan_rx_kill_vid() local
1158 if (dp->bridge_dev) { in dsa_slave_vlan_rx_kill_vid()
1159 if (!br_vlan_enabled(dp->bridge_dev)) in dsa_slave_vlan_rx_kill_vid()
1166 ret = br_vlan_get_info(dp->bridge_dev, vid, &info); in dsa_slave_vlan_rx_kill_vid()
1174 return dsa_port_vid_del(dp, vid); in dsa_slave_vlan_rx_kill_vid()
1207 struct dsa_port *dp = dsa_slave_to_port(dev); in dsa_legacy_fdb_add() local
1209 return dsa_port_fdb_add(dp, addr, vid); in dsa_legacy_fdb_add()
1216 struct dsa_port *dp = dsa_slave_to_port(dev); in dsa_legacy_fdb_del() local
1218 return dsa_port_fdb_del(dp, addr, vid); in dsa_legacy_fdb_del()
1223 struct dsa_port *dp = dsa_slave_to_port(dev); in dsa_slave_get_devlink_port() local
1225 return dp->ds->devlink ? &dp->devlink_port : NULL; in dsa_slave_get_devlink_port()
1260 const struct dsa_port *dp = dsa_to_port(ds, port); in dsa_port_phylink_mac_change() local
1262 phylink_mac_change(dp->pl, up); in dsa_port_phylink_mac_change()
1269 struct dsa_port *dp = dsa_slave_to_port(dev); in dsa_slave_phylink_fixed_state() local
1270 struct dsa_switch *ds = dp->ds; in dsa_slave_phylink_fixed_state()
1275 ds->ops->phylink_fixed_state(ds, dp->index, state); in dsa_slave_phylink_fixed_state()
1281 struct dsa_port *dp = dsa_slave_to_port(slave_dev); in dsa_slave_phy_connect() local
1282 struct dsa_switch *ds = dp->ds; in dsa_slave_phy_connect()
1290 return phylink_connect_phy(dp->pl, slave_dev->phydev); in dsa_slave_phy_connect()
1295 struct dsa_port *dp = dsa_slave_to_port(slave_dev); in dsa_slave_phy_setup() local
1296 struct device_node *port_dn = dp->dn; in dsa_slave_phy_setup()
1297 struct dsa_switch *ds = dp->ds; in dsa_slave_phy_setup()
1305 dp->pl_config.dev = &slave_dev->dev; in dsa_slave_phy_setup()
1306 dp->pl_config.type = PHYLINK_NETDEV; in dsa_slave_phy_setup()
1308 dp->pl = phylink_create(&dp->pl_config, of_fwnode_handle(port_dn), mode, in dsa_slave_phy_setup()
1310 if (IS_ERR(dp->pl)) { in dsa_slave_phy_setup()
1312 "error creating PHYLINK: %ld\n", PTR_ERR(dp->pl)); in dsa_slave_phy_setup()
1313 return PTR_ERR(dp->pl); in dsa_slave_phy_setup()
1321 phylink_fixed_state_cb(dp->pl, dsa_slave_phylink_fixed_state); in dsa_slave_phy_setup()
1324 phy_flags = ds->ops->get_phy_flags(ds, dp->index); in dsa_slave_phy_setup()
1326 ret = phylink_of_phy_connect(dp->pl, port_dn, phy_flags); in dsa_slave_phy_setup()
1331 ret = dsa_slave_phy_connect(slave_dev, dp->index); in dsa_slave_phy_setup()
1335 dp->index, ret); in dsa_slave_phy_setup()
1336 phylink_destroy(dp->pl); in dsa_slave_phy_setup()
1346 struct dsa_port *dp = dsa_slave_to_port(slave_dev); in dsa_slave_suspend() local
1351 cancel_work_sync(&dp->xmit_work); in dsa_slave_suspend()
1352 skb_queue_purge(&dp->xmit_queue); in dsa_slave_suspend()
1357 phylink_stop(dp->pl); in dsa_slave_suspend()
1365 struct dsa_port *dp = dsa_slave_to_port(slave_dev); in dsa_slave_resume() local
1373 phylink_start(dp->pl); in dsa_slave_resume()
1382 struct dsa_port *dp = dsa_slave_to_port(dev); in dsa_slave_notify() local
1384 .switch_number = dp->ds->index, in dsa_slave_notify()
1385 .port_number = dp->index, in dsa_slave_notify()
1437 p->dp = port; in dsa_slave_create()
1465 phylink_disconnect_phy(p->dp->pl); in dsa_slave_create()
1467 phylink_destroy(p->dp->pl); in dsa_slave_create()
1477 struct dsa_port *dp = dsa_slave_to_port(slave_dev); in dsa_slave_destroy() local
1482 phylink_disconnect_phy(dp->pl); in dsa_slave_destroy()
1487 phylink_destroy(dp->pl); in dsa_slave_destroy()
1500 struct dsa_port *dp = dsa_slave_to_port(dev); in dsa_slave_changeupper() local
1505 err = dsa_port_bridge_join(dp, info->upper_dev); in dsa_slave_changeupper()
1508 dsa_port_bridge_leave(dp, info->upper_dev); in dsa_slave_changeupper()
1522 struct dsa_port *dp; in dsa_slave_upper_vlan_check() local
1533 dp = dsa_slave_to_port(slave); in dsa_slave_upper_vlan_check()
1534 if (!dp->bridge_dev) in dsa_slave_upper_vlan_check()
1538 if (br_vlan_enabled(dp->bridge_dev) && in dsa_slave_upper_vlan_check()
1576 struct dsa_port *dp = dsa_slave_to_port(dev); in dsa_slave_switchdev_event_work() local
1586 err = dsa_port_fdb_add(dp, fdb_info->addr, fdb_info->vid); in dsa_slave_switchdev_event_work()
1601 err = dsa_port_fdb_del(dp, fdb_info->addr, fdb_info->vid); in dsa_slave_switchdev_event_work()