Lines Matching full:ds
50 static int dsa_loop_setup_devlink_resources(struct dsa_switch *ds) in dsa_loop_setup_devlink_resources() argument
53 struct dsa_loop_priv *ps = ds->priv; in dsa_loop_setup_devlink_resources()
60 err = dsa_devlink_resource_register(ds, "VTU", ARRAY_SIZE(ps->vlans), in dsa_loop_setup_devlink_resources()
67 dsa_devlink_resource_occ_get_register(ds, in dsa_loop_setup_devlink_resources()
74 dsa_devlink_resources_unregister(ds); in dsa_loop_setup_devlink_resources()
78 static enum dsa_tag_protocol dsa_loop_get_protocol(struct dsa_switch *ds, in dsa_loop_get_protocol() argument
82 dev_dbg(ds->dev, "%s: port: %d\n", __func__, port); in dsa_loop_get_protocol()
87 static int dsa_loop_setup(struct dsa_switch *ds) in dsa_loop_setup() argument
89 struct dsa_loop_priv *ps = ds->priv; in dsa_loop_setup()
92 for (i = 0; i < ds->num_ports; i++) in dsa_loop_setup()
96 dev_dbg(ds->dev, "%s\n", __func__); in dsa_loop_setup()
98 return dsa_loop_setup_devlink_resources(ds); in dsa_loop_setup()
101 static void dsa_loop_teardown(struct dsa_switch *ds) in dsa_loop_teardown() argument
103 dsa_devlink_resources_unregister(ds); in dsa_loop_teardown()
106 static int dsa_loop_get_sset_count(struct dsa_switch *ds, int port, int sset) in dsa_loop_get_sset_count() argument
114 static void dsa_loop_get_strings(struct dsa_switch *ds, int port, in dsa_loop_get_strings() argument
117 struct dsa_loop_priv *ps = ds->priv; in dsa_loop_get_strings()
128 static void dsa_loop_get_ethtool_stats(struct dsa_switch *ds, int port, in dsa_loop_get_ethtool_stats() argument
131 struct dsa_loop_priv *ps = ds->priv; in dsa_loop_get_ethtool_stats()
138 static int dsa_loop_phy_read(struct dsa_switch *ds, int port, int regnum) in dsa_loop_phy_read() argument
140 struct dsa_loop_priv *ps = ds->priv; in dsa_loop_phy_read()
153 static int dsa_loop_phy_write(struct dsa_switch *ds, int port, in dsa_loop_phy_write() argument
156 struct dsa_loop_priv *ps = ds->priv; in dsa_loop_phy_write()
169 static int dsa_loop_port_bridge_join(struct dsa_switch *ds, int port, in dsa_loop_port_bridge_join() argument
174 dev_dbg(ds->dev, "%s: port: %d, bridge: %s\n", in dsa_loop_port_bridge_join()
180 static void dsa_loop_port_bridge_leave(struct dsa_switch *ds, int port, in dsa_loop_port_bridge_leave() argument
183 dev_dbg(ds->dev, "%s: port: %d, bridge: %s\n", in dsa_loop_port_bridge_leave()
187 static void dsa_loop_port_stp_state_set(struct dsa_switch *ds, int port, in dsa_loop_port_stp_state_set() argument
190 dev_dbg(ds->dev, "%s: port: %d, state: %d\n", in dsa_loop_port_stp_state_set()
194 static int dsa_loop_port_vlan_filtering(struct dsa_switch *ds, int port, in dsa_loop_port_vlan_filtering() argument
198 dev_dbg(ds->dev, "%s: port: %d, vlan_filtering: %d\n", in dsa_loop_port_vlan_filtering()
204 static int dsa_loop_port_vlan_add(struct dsa_switch *ds, int port, in dsa_loop_port_vlan_add() argument
210 struct dsa_loop_priv *ps = ds->priv; in dsa_loop_port_vlan_add()
228 dev_dbg(ds->dev, "%s: port: %d vlan: %d, %stagged, pvid: %d\n", in dsa_loop_port_vlan_add()
237 static int dsa_loop_port_vlan_del(struct dsa_switch *ds, int port, in dsa_loop_port_vlan_del() argument
241 struct dsa_loop_priv *ps = ds->priv; in dsa_loop_port_vlan_del()
258 dev_dbg(ds->dev, "%s: port: %d vlan: %d, %stagged, pvid: %d\n", in dsa_loop_port_vlan_del()
265 static int dsa_loop_port_change_mtu(struct dsa_switch *ds, int port, in dsa_loop_port_change_mtu() argument
268 struct dsa_loop_priv *priv = ds->priv; in dsa_loop_port_change_mtu()
275 static int dsa_loop_port_max_mtu(struct dsa_switch *ds, int port) in dsa_loop_port_max_mtu() argument
313 struct dsa_switch *ds; in dsa_loop_drv_probe() local
319 ds = devm_kzalloc(&mdiodev->dev, sizeof(*ds), GFP_KERNEL); in dsa_loop_drv_probe()
320 if (!ds) in dsa_loop_drv_probe()
323 ds->dev = &mdiodev->dev; in dsa_loop_drv_probe()
324 ds->num_ports = DSA_LOOP_NUM_PORTS; in dsa_loop_drv_probe()
336 ds->dev = &mdiodev->dev; in dsa_loop_drv_probe()
337 ds->ops = &dsa_loop_driver; in dsa_loop_drv_probe()
338 ds->priv = ps; in dsa_loop_drv_probe()
341 dev_set_drvdata(&mdiodev->dev, ds); in dsa_loop_drv_probe()
343 ret = dsa_register_switch(ds); in dsa_loop_drv_probe()
353 struct dsa_switch *ds = dev_get_drvdata(&mdiodev->dev); in dsa_loop_drv_remove() local
356 if (!ds) in dsa_loop_drv_remove()
359 ps = ds->priv; in dsa_loop_drv_remove()
361 dsa_unregister_switch(ds); in dsa_loop_drv_remove()
367 struct dsa_switch *ds = dev_get_drvdata(&mdiodev->dev); in dsa_loop_drv_shutdown() local
369 if (!ds) in dsa_loop_drv_shutdown()
372 dsa_switch_shutdown(ds); in dsa_loop_drv_shutdown()