Lines Matching refs:ps

37 	struct dsa_loop_priv *ps = priv;  in dsa_loop_devlink_vtu_get()  local
41 for (i = 0; i < ARRAY_SIZE(ps->vlans); i++) { in dsa_loop_devlink_vtu_get()
42 vl = &ps->vlans[i]; in dsa_loop_devlink_vtu_get()
53 struct dsa_loop_priv *ps = ds->priv; in dsa_loop_setup_devlink_resources() local
56 devlink_resource_size_params_init(&size_params, ARRAY_SIZE(ps->vlans), in dsa_loop_setup_devlink_resources()
57 ARRAY_SIZE(ps->vlans), in dsa_loop_setup_devlink_resources()
60 err = dsa_devlink_resource_register(ds, "VTU", ARRAY_SIZE(ps->vlans), in dsa_loop_setup_devlink_resources()
69 dsa_loop_devlink_vtu_get, ps); in dsa_loop_setup_devlink_resources()
89 struct dsa_loop_priv *ps = ds->priv; in dsa_loop_setup() local
93 memcpy(ps->ports[i].mib, dsa_loop_mibs, in dsa_loop_setup()
117 struct dsa_loop_priv *ps = ds->priv; in dsa_loop_get_strings() local
125 ps->ports[port].mib[i].name, ETH_GSTRING_LEN); in dsa_loop_get_strings()
131 struct dsa_loop_priv *ps = ds->priv; in dsa_loop_get_ethtool_stats() local
135 data[i] = ps->ports[port].mib[i].val; in dsa_loop_get_ethtool_stats()
140 struct dsa_loop_priv *ps = ds->priv; in dsa_loop_phy_read() local
141 struct mii_bus *bus = ps->bus; in dsa_loop_phy_read()
144 ret = mdiobus_read_nested(bus, ps->port_base + port, regnum); in dsa_loop_phy_read()
146 ps->ports[port].mib[DSA_LOOP_PHY_READ_ERR].val++; in dsa_loop_phy_read()
148 ps->ports[port].mib[DSA_LOOP_PHY_READ_OK].val++; in dsa_loop_phy_read()
156 struct dsa_loop_priv *ps = ds->priv; in dsa_loop_phy_write() local
157 struct mii_bus *bus = ps->bus; in dsa_loop_phy_write()
160 ret = mdiobus_write_nested(bus, ps->port_base + port, regnum, value); in dsa_loop_phy_write()
162 ps->ports[port].mib[DSA_LOOP_PHY_WRITE_ERR].val++; in dsa_loop_phy_write()
164 ps->ports[port].mib[DSA_LOOP_PHY_WRITE_OK].val++; in dsa_loop_phy_write()
208 struct dsa_loop_priv *ps = ds->priv; in dsa_loop_port_vlan_add() local
209 struct mii_bus *bus = ps->bus; in dsa_loop_port_vlan_add()
212 if (vlan->vid >= ARRAY_SIZE(ps->vlans)) in dsa_loop_port_vlan_add()
216 mdiobus_read(bus, ps->port_base + port, MII_BMSR); in dsa_loop_port_vlan_add()
218 vl = &ps->vlans[vlan->vid]; in dsa_loop_port_vlan_add()
230 ps->ports[port].pvid = vlan->vid; in dsa_loop_port_vlan_add()
239 struct dsa_loop_priv *ps = ds->priv; in dsa_loop_port_vlan_del() local
240 u16 pvid = ps->ports[port].pvid; in dsa_loop_port_vlan_del()
241 struct mii_bus *bus = ps->bus; in dsa_loop_port_vlan_del()
245 mdiobus_read(bus, ps->port_base + port, MII_BMSR); in dsa_loop_port_vlan_del()
247 vl = &ps->vlans[vlan->vid]; in dsa_loop_port_vlan_del()
258 ps->ports[port].pvid = pvid; in dsa_loop_port_vlan_del()
301 struct dsa_loop_priv *ps; in dsa_loop_drv_probe() local
315 ps = devm_kzalloc(&mdiodev->dev, sizeof(*ps), GFP_KERNEL); in dsa_loop_drv_probe()
316 if (!ps) in dsa_loop_drv_probe()
319 ps->netdev = dev_get_by_name(&init_net, pdata->netdev); in dsa_loop_drv_probe()
320 if (!ps->netdev) in dsa_loop_drv_probe()
323 pdata->cd.netdev[DSA_LOOP_CPU_PORT] = &ps->netdev->dev; in dsa_loop_drv_probe()
327 ds->priv = ps; in dsa_loop_drv_probe()
328 ps->bus = mdiodev->bus; in dsa_loop_drv_probe()
343 struct dsa_loop_priv *ps; in dsa_loop_drv_remove() local
348 ps = ds->priv; in dsa_loop_drv_remove()
351 dev_put(ps->netdev); in dsa_loop_drv_remove()