Lines Matching refs:ds

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