Lines Matching full: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()
206 struct dsa_loop_priv *ps = ds->priv; in dsa_loop_port_vlan_prepare() local
207 struct mii_bus *bus = ps->bus; in dsa_loop_port_vlan_prepare()
213 mdiobus_read(bus, ps->port_base + port, MII_BMSR); in dsa_loop_port_vlan_prepare()
215 if (vlan->vid_end > ARRAY_SIZE(ps->vlans)) in dsa_loop_port_vlan_prepare()
226 struct dsa_loop_priv *ps = ds->priv; in dsa_loop_port_vlan_add() local
227 struct mii_bus *bus = ps->bus; in dsa_loop_port_vlan_add()
232 mdiobus_read(bus, ps->port_base + port, MII_BMSR); in dsa_loop_port_vlan_add()
235 vl = &ps->vlans[vid]; in dsa_loop_port_vlan_add()
248 ps->ports[port].pvid = vid; in dsa_loop_port_vlan_add()
255 struct dsa_loop_priv *ps = ds->priv; in dsa_loop_port_vlan_del() local
256 struct mii_bus *bus = ps->bus; in dsa_loop_port_vlan_del()
258 u16 vid, pvid = ps->ports[port].pvid; in dsa_loop_port_vlan_del()
261 mdiobus_read(bus, ps->port_base + port, MII_BMSR); in dsa_loop_port_vlan_del()
264 vl = &ps->vlans[vid]; in dsa_loop_port_vlan_del()
276 ps->ports[port].pvid = pvid; in dsa_loop_port_vlan_del()
320 struct dsa_loop_priv *ps; in dsa_loop_drv_probe() local
334 ps = devm_kzalloc(&mdiodev->dev, sizeof(*ps), GFP_KERNEL); in dsa_loop_drv_probe()
335 if (!ps) in dsa_loop_drv_probe()
338 ps->netdev = dev_get_by_name(&init_net, pdata->netdev); in dsa_loop_drv_probe()
339 if (!ps->netdev) in dsa_loop_drv_probe()
342 pdata->cd.netdev[DSA_LOOP_CPU_PORT] = &ps->netdev->dev; in dsa_loop_drv_probe()
346 ds->priv = ps; in dsa_loop_drv_probe()
348 ps->bus = mdiodev->bus; in dsa_loop_drv_probe()
363 struct dsa_loop_priv *ps = ds->priv; in dsa_loop_drv_remove() local
366 dev_put(ps->netdev); in dsa_loop_drv_remove()