Lines Matching refs:ds
81 int mv88e6xxx_reg_read(struct dsa_switch *ds, int addr, int reg) in mv88e6xxx_reg_read() argument
83 struct mv88e6xxx_priv_state *ps = (void *)(ds + 1); in mv88e6xxx_reg_read()
87 ret = __mv88e6xxx_reg_read(ds->master_mii_bus, in mv88e6xxx_reg_read()
88 ds->pd->sw_addr, addr, reg); in mv88e6xxx_reg_read()
133 int mv88e6xxx_reg_write(struct dsa_switch *ds, int addr, int reg, u16 val) in mv88e6xxx_reg_write() argument
135 struct mv88e6xxx_priv_state *ps = (void *)(ds + 1); in mv88e6xxx_reg_write()
139 ret = __mv88e6xxx_reg_write(ds->master_mii_bus, in mv88e6xxx_reg_write()
140 ds->pd->sw_addr, addr, reg, val); in mv88e6xxx_reg_write()
146 int mv88e6xxx_config_prio(struct dsa_switch *ds) in mv88e6xxx_config_prio() argument
168 int mv88e6xxx_set_addr_direct(struct dsa_switch *ds, u8 *addr) in mv88e6xxx_set_addr_direct() argument
177 int mv88e6xxx_set_addr_indirect(struct dsa_switch *ds, u8 *addr) in mv88e6xxx_set_addr_indirect() argument
205 int mv88e6xxx_phy_read(struct dsa_switch *ds, int addr, int regnum) in mv88e6xxx_phy_read() argument
208 return mv88e6xxx_reg_read(ds, addr, regnum); in mv88e6xxx_phy_read()
212 int mv88e6xxx_phy_write(struct dsa_switch *ds, int addr, int regnum, u16 val) in mv88e6xxx_phy_write() argument
215 return mv88e6xxx_reg_write(ds, addr, regnum, val); in mv88e6xxx_phy_write()
220 static int mv88e6xxx_ppu_disable(struct dsa_switch *ds) in mv88e6xxx_ppu_disable() argument
238 static int mv88e6xxx_ppu_enable(struct dsa_switch *ds) in mv88e6xxx_ppu_enable() argument
262 struct dsa_switch *ds = ((struct dsa_switch *)ps) - 1; in mv88e6xxx_ppu_reenable_work() local
264 if (mv88e6xxx_ppu_enable(ds) == 0) in mv88e6xxx_ppu_reenable_work()
277 static int mv88e6xxx_ppu_access_get(struct dsa_switch *ds) in mv88e6xxx_ppu_access_get() argument
279 struct mv88e6xxx_priv_state *ps = (void *)(ds + 1); in mv88e6xxx_ppu_access_get()
291 ret = mv88e6xxx_ppu_disable(ds); in mv88e6xxx_ppu_access_get()
305 static void mv88e6xxx_ppu_access_put(struct dsa_switch *ds) in mv88e6xxx_ppu_access_put() argument
307 struct mv88e6xxx_priv_state *ps = (void *)(ds + 1); in mv88e6xxx_ppu_access_put()
316 void mv88e6xxx_ppu_state_init(struct dsa_switch *ds) in mv88e6xxx_ppu_state_init() argument
318 struct mv88e6xxx_priv_state *ps = (void *)(ds + 1); in mv88e6xxx_ppu_state_init()
327 int mv88e6xxx_phy_read_ppu(struct dsa_switch *ds, int addr, int regnum) in mv88e6xxx_phy_read_ppu() argument
331 ret = mv88e6xxx_ppu_access_get(ds); in mv88e6xxx_phy_read_ppu()
333 ret = mv88e6xxx_reg_read(ds, addr, regnum); in mv88e6xxx_phy_read_ppu()
334 mv88e6xxx_ppu_access_put(ds); in mv88e6xxx_phy_read_ppu()
340 int mv88e6xxx_phy_write_ppu(struct dsa_switch *ds, int addr, in mv88e6xxx_phy_write_ppu() argument
345 ret = mv88e6xxx_ppu_access_get(ds); in mv88e6xxx_phy_write_ppu()
347 ret = mv88e6xxx_reg_write(ds, addr, regnum, val); in mv88e6xxx_phy_write_ppu()
348 mv88e6xxx_ppu_access_put(ds); in mv88e6xxx_phy_write_ppu()
355 void mv88e6xxx_poll_link(struct dsa_switch *ds) in mv88e6xxx_poll_link() argument
367 dev = ds->ports[i]; in mv88e6xxx_poll_link()
373 port_status = mv88e6xxx_reg_read(ds, REG_PORT(i), 0x00); in mv88e6xxx_poll_link()
415 static int mv88e6xxx_stats_wait(struct dsa_switch *ds) in mv88e6xxx_stats_wait() argument
429 static int mv88e6xxx_stats_snapshot(struct dsa_switch *ds, int port) in mv88e6xxx_stats_snapshot() argument
441 ret = mv88e6xxx_stats_wait(ds); in mv88e6xxx_stats_snapshot()
448 static void mv88e6xxx_stats_read(struct dsa_switch *ds, int stat, u32 *val) in mv88e6xxx_stats_read() argument
455 ret = mv88e6xxx_reg_write(ds, REG_GLOBAL, 0x1d, 0xcc00 | stat); in mv88e6xxx_stats_read()
459 ret = mv88e6xxx_stats_wait(ds); in mv88e6xxx_stats_read()
463 ret = mv88e6xxx_reg_read(ds, REG_GLOBAL, 0x1e); in mv88e6xxx_stats_read()
469 ret = mv88e6xxx_reg_read(ds, REG_GLOBAL, 0x1f); in mv88e6xxx_stats_read()
476 void mv88e6xxx_get_strings(struct dsa_switch *ds, in mv88e6xxx_get_strings() argument
488 void mv88e6xxx_get_ethtool_stats(struct dsa_switch *ds, in mv88e6xxx_get_ethtool_stats() argument
492 struct mv88e6xxx_priv_state *ps = (void *)(ds + 1); in mv88e6xxx_get_ethtool_stats()
498 ret = mv88e6xxx_stats_snapshot(ds, port); in mv88e6xxx_get_ethtool_stats()
512 mv88e6xxx_stats_read(ds, s->reg, &low); in mv88e6xxx_get_ethtool_stats()
514 mv88e6xxx_stats_read(ds, s->reg + 1, &high); in mv88e6xxx_get_ethtool_stats()