Lines Matching +full:1 +full:mib
32 if (!(dev->member & (1 << i))) in ksz_update_port_member()
45 struct ksz_port_mib *mib = &dev->ports[port].mib; in port_r_cnt() local
48 /* Some ports may not have MIB counters before SWITCH_COUNTER_NUM. */ in port_r_cnt()
49 while (mib->cnt_ptr < dev->reg_mib_cnt) { in port_r_cnt()
50 dev->dev_ops->r_mib_cnt(dev, port, mib->cnt_ptr, in port_r_cnt()
51 &mib->counters[mib->cnt_ptr]); in port_r_cnt()
52 ++mib->cnt_ptr; in port_r_cnt()
56 dropped = &mib->counters[dev->mib_cnt]; in port_r_cnt()
58 /* Some ports may not have MIB counters after SWITCH_COUNTER_NUM. */ in port_r_cnt()
59 while (mib->cnt_ptr < dev->mib_cnt) { in port_r_cnt()
60 dev->dev_ops->r_mib_pkt(dev, port, mib->cnt_ptr, in port_r_cnt()
61 dropped, &mib->counters[mib->cnt_ptr]); in port_r_cnt()
62 ++mib->cnt_ptr; in port_r_cnt()
64 mib->cnt_ptr = 0; in port_r_cnt()
71 struct ksz_port_mib *mib; in ksz_mib_read_work() local
80 mib = &p->mib; in ksz_mib_read_work()
81 mutex_lock(&mib->cnt_mutex); in ksz_mib_read_work()
83 /* Only read MIB counters when the port is told to do. in ksz_mib_read_work()
90 mib->cnt_ptr = dev->reg_mib_cnt; in ksz_mib_read_work()
94 mutex_unlock(&mib->cnt_mutex); in ksz_mib_read_work()
138 /* Read all MIB counters when the link is going down. */ in ksz_mac_link_down()
161 struct ksz_port_mib *mib; in ksz_get_ethtool_stats() local
163 mib = &dev->ports[port].mib; in ksz_get_ethtool_stats()
164 mutex_lock(&mib->cnt_mutex); in ksz_get_ethtool_stats()
168 mib->cnt_ptr = dev->reg_mib_cnt; in ksz_get_ethtool_stats()
170 memcpy(buf, mib->counters, dev->mib_cnt * sizeof(u64)); in ksz_get_ethtool_stats()
171 mutex_unlock(&mib->cnt_mutex); in ksz_get_ethtool_stats()
181 dev->br_member |= (1 << port); in ksz_port_bridge_join()
198 dev->br_member &= ~(1 << port); in ksz_port_bridge_leave()
199 dev->member &= ~(1 << port); in ksz_port_bridge_leave()
281 empty = index + 1; in ksz_port_mdb_add()
291 index = empty - 1; in ksz_port_mdb_add()
400 gpiod_set_value_cansleep(dev->reset_gpio, 1); in ksz_switch_register()
450 /* Read MIB counters every 30 seconds to avoid overflow. */ in ksz_switch_register()
453 /* Start the MIB timer. */ in ksz_switch_register()
472 gpiod_set_value_cansleep(dev->reset_gpio, 1); in ksz_switch_remove()