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,
172 dev_dbg(ds->dev, "%s: port: %d, bridge: %s\n",
178 static void dsa_loop_port_bridge_leave(struct dsa_switch *ds, int port,
181 dev_dbg(ds->dev, "%s: port: %d, bridge: %s\n",
185 static void dsa_loop_port_stp_state_set(struct dsa_switch *ds, int port,
188 dev_dbg(ds->dev, "%s: port: %d, state: %d\n",
192 static int dsa_loop_port_vlan_filtering(struct dsa_switch *ds, int port,
196 dev_dbg(ds->dev, "%s: port: %d, vlan_filtering: %d\n",
203 dsa_loop_port_vlan_prepare(struct dsa_switch *ds, int port,
206 struct dsa_loop_priv *ps = ds->priv;
209 dev_dbg(ds->dev, "%s: port: %d, vlan: %d-%d",
221 static void dsa_loop_port_vlan_add(struct dsa_switch *ds, int port,
226 struct dsa_loop_priv *ps = ds->priv;
243 dev_dbg(ds->dev, "%s: port: %d vlan: %d, %stagged, pvid: %d\n",
251 static int dsa_loop_port_vlan_del(struct dsa_switch *ds, int port,
255 struct dsa_loop_priv *ps = ds->priv;
273 dev_dbg(ds->dev, "%s: port: %d vlan: %d, %stagged, pvid: %d\n",
281 static int dsa_loop_port_change_mtu(struct dsa_switch *ds, int port,
284 struct dsa_loop_priv *priv = ds->priv;
291 static int dsa_loop_port_max_mtu(struct dsa_switch *ds, int port)
321 struct dsa_switch *ds;
327 ds = devm_kzalloc(&mdiodev->dev, sizeof(*ds), GFP_KERNEL);
328 if (!ds)
331 ds->dev = &mdiodev->dev;
332 ds->num_ports = DSA_LOOP_NUM_PORTS;
344 ds->dev = &mdiodev->dev;
345 ds->ops = &dsa_loop_driver;
346 ds->priv = ps;
347 ds->configure_vlan_while_not_filtering = true;
350 dev_set_drvdata(&mdiodev->dev, ds);
352 ret = dsa_register_switch(ds);
362 struct dsa_switch *ds = dev_get_drvdata(&mdiodev->dev);
363 struct dsa_loop_priv *ps = ds->priv;
365 dsa_unregister_switch(ds);