Lines Matching +full:asym +full:- +full:pause
1 // SPDX-License-Identifier: GPL-2.0
15 #include <linux/platform_data/microchip-ksz.h>
209 return dev->chip_id == 0x8830; in ksz_is_ksz88x3()
214 regmap_update_bits(dev->regmap[0], addr, bits, set ? bits : 0); in ksz_cfg()
220 regmap_update_bits(dev->regmap[0], PORT_CTRL_ADDR(port, offset), in ksz_port_cfg()
277 struct ksz8 *ksz8 = dev->priv; in ksz8_r_mib_cnt()
285 masks = ksz8->masks; in ksz8_r_mib_cnt()
286 regs = ksz8->regs; in ksz8_r_mib_cnt()
288 ctrl_addr = addr + dev->reg_mib_cnt * port; in ksz8_r_mib_cnt()
291 mutex_lock(&dev->alu_mutex); in ksz8_r_mib_cnt()
297 for (loop = 2; loop > 0; loop--) { in ksz8_r_mib_cnt()
308 mutex_unlock(&dev->alu_mutex); in ksz8_r_mib_cnt()
314 struct ksz8 *ksz8 = dev->priv; in ksz8795_r_mib_pkt()
322 masks = ksz8->masks; in ksz8795_r_mib_pkt()
323 regs = ksz8->regs; in ksz8795_r_mib_pkt()
325 addr -= dev->reg_mib_cnt; in ksz8795_r_mib_pkt()
326 ctrl_addr = (KSZ8795_MIB_TOTAL_RX_1 - KSZ8795_MIB_TOTAL_RX_0) * port; in ksz8795_r_mib_pkt()
330 mutex_lock(&dev->alu_mutex); in ksz8795_r_mib_pkt()
336 for (loop = 2; loop > 0; loop--) { in ksz8795_r_mib_pkt()
361 mutex_unlock(&dev->alu_mutex); in ksz8795_r_mib_pkt()
367 struct ksz8 *ksz8 = dev->priv; in ksz8863_r_mib_pkt()
368 const u8 *regs = ksz8->regs; in ksz8863_r_mib_pkt()
374 addr -= dev->reg_mib_cnt; in ksz8863_r_mib_pkt()
380 mutex_lock(&dev->alu_mutex); in ksz8863_r_mib_pkt()
383 mutex_unlock(&dev->alu_mutex); in ksz8863_r_mib_pkt()
391 data -= cur; in ksz8863_r_mib_pkt()
422 struct ksz_port_mib *mib = &dev->ports[port].mib; in ksz8_port_init_cnt()
432 mib->cnt_ptr = 0; in ksz8_port_init_cnt()
435 while (mib->cnt_ptr < dev->reg_mib_cnt) { in ksz8_port_init_cnt()
436 dev->dev_ops->r_mib_cnt(dev, port, mib->cnt_ptr, in ksz8_port_init_cnt()
437 &mib->counters[mib->cnt_ptr]); in ksz8_port_init_cnt()
438 ++mib->cnt_ptr; in ksz8_port_init_cnt()
442 dropped = &mib->counters[dev->mib_cnt]; in ksz8_port_init_cnt()
445 while (mib->cnt_ptr < dev->mib_cnt) { in ksz8_port_init_cnt()
446 dev->dev_ops->r_mib_pkt(dev, port, mib->cnt_ptr, in ksz8_port_init_cnt()
447 dropped, &mib->counters[mib->cnt_ptr]); in ksz8_port_init_cnt()
448 ++mib->cnt_ptr; in ksz8_port_init_cnt()
450 mib->cnt_ptr = 0; in ksz8_port_init_cnt()
451 memset(mib->counters, 0, dev->mib_cnt * sizeof(u64)); in ksz8_port_init_cnt()
456 struct ksz8 *ksz8 = dev->priv; in ksz8_r_table()
457 const u8 *regs = ksz8->regs; in ksz8_r_table()
462 mutex_lock(&dev->alu_mutex); in ksz8_r_table()
465 mutex_unlock(&dev->alu_mutex); in ksz8_r_table()
470 struct ksz8 *ksz8 = dev->priv; in ksz8_w_table()
471 const u8 *regs = ksz8->regs; in ksz8_w_table()
476 mutex_lock(&dev->alu_mutex); in ksz8_w_table()
479 mutex_unlock(&dev->alu_mutex); in ksz8_w_table()
484 struct ksz8 *ksz8 = dev->priv; in ksz8_valid_dyn_entry()
489 masks = ksz8->masks; in ksz8_valid_dyn_entry()
490 regs = ksz8->regs; in ksz8_valid_dyn_entry()
494 timeout--; in ksz8_valid_dyn_entry()
499 return -EAGAIN; in ksz8_valid_dyn_entry()
506 return -ENXIO; in ksz8_valid_dyn_entry()
515 struct ksz8 *ksz8 = dev->priv; in ksz8_r_dyn_mac_table()
524 shifts = ksz8->shifts; in ksz8_r_dyn_mac_table()
525 masks = ksz8->masks; in ksz8_r_dyn_mac_table()
526 regs = ksz8->regs; in ksz8_r_dyn_mac_table()
530 mutex_lock(&dev->alu_mutex); in ksz8_r_dyn_mac_table()
534 if (rc == -EAGAIN) { in ksz8_r_dyn_mac_table()
537 } else if (rc == -ENXIO) { in ksz8_r_dyn_mac_table()
571 mutex_unlock(&dev->alu_mutex); in ksz8_r_dyn_mac_table()
579 struct ksz8 *ksz8 = dev->priv; in ksz8_r_sta_mac_table()
585 shifts = ksz8->shifts; in ksz8_r_sta_mac_table()
586 masks = ksz8->masks; in ksz8_r_sta_mac_table()
593 alu->mac[5] = (u8)data_lo; in ksz8_r_sta_mac_table()
594 alu->mac[4] = (u8)(data_lo >> 8); in ksz8_r_sta_mac_table()
595 alu->mac[3] = (u8)(data_lo >> 16); in ksz8_r_sta_mac_table()
596 alu->mac[2] = (u8)(data_lo >> 24); in ksz8_r_sta_mac_table()
597 alu->mac[1] = (u8)data_hi; in ksz8_r_sta_mac_table()
598 alu->mac[0] = (u8)(data_hi >> 8); in ksz8_r_sta_mac_table()
599 alu->port_forward = in ksz8_r_sta_mac_table()
602 alu->is_override = in ksz8_r_sta_mac_table()
605 alu->is_static = true; in ksz8_r_sta_mac_table()
606 alu->is_use_fid = in ksz8_r_sta_mac_table()
608 alu->fid = (data_hi & masks[STATIC_MAC_TABLE_FID]) >> in ksz8_r_sta_mac_table()
612 return -ENXIO; in ksz8_r_sta_mac_table()
618 struct ksz8 *ksz8 = dev->priv; in ksz8_w_sta_mac_table()
624 shifts = ksz8->shifts; in ksz8_w_sta_mac_table()
625 masks = ksz8->masks; in ksz8_w_sta_mac_table()
627 data_lo = ((u32)alu->mac[2] << 24) | in ksz8_w_sta_mac_table()
628 ((u32)alu->mac[3] << 16) | in ksz8_w_sta_mac_table()
629 ((u32)alu->mac[4] << 8) | alu->mac[5]; in ksz8_w_sta_mac_table()
630 data_hi = ((u32)alu->mac[0] << 8) | alu->mac[1]; in ksz8_w_sta_mac_table()
631 data_hi |= (u32)alu->port_forward << shifts[STATIC_MAC_FWD_PORTS]; in ksz8_w_sta_mac_table()
633 if (alu->is_override) in ksz8_w_sta_mac_table()
635 if (alu->is_use_fid) { in ksz8_w_sta_mac_table()
637 data_hi |= (u32)alu->fid << shifts[STATIC_MAC_FID]; in ksz8_w_sta_mac_table()
639 if (alu->is_static) in ksz8_w_sta_mac_table()
651 struct ksz8 *ksz8 = dev->priv; in ksz8_from_vlan()
655 shifts = ksz8->shifts; in ksz8_from_vlan()
656 masks = ksz8->masks; in ksz8_from_vlan()
667 struct ksz8 *ksz8 = dev->priv; in ksz8_to_vlan()
671 shifts = ksz8->shifts; in ksz8_to_vlan()
672 masks = ksz8->masks; in ksz8_to_vlan()
682 struct ksz8 *ksz8 = dev->priv; in ksz8_r_vlan_entries()
687 shifts = ksz8->shifts; in ksz8_r_vlan_entries()
692 dev->vlan_cache[addr + i].table[0] = (u16)data; in ksz8_r_vlan_entries()
723 dev->vlan_cache[vid].table[0] = vlan; in ksz8_w_vlan_table()
729 struct ksz8 *ksz8 = dev->priv; in ksz8_r_phy()
731 const u8 *regs = ksz8->regs; in ksz8_r_phy()
852 struct ksz8 *ksz8 = dev->priv; in ksz8_w_phy()
854 const u8 *regs = ksz8->regs; in ksz8_w_phy()
884 /* Fiber port does not support auto-negotiation. */ in ksz8_w_phy()
885 if (dev->ports[p].fiber) in ksz8_w_phy()
966 struct ksz_device *dev = ds->priv; in ksz8_get_tag_protocol()
976 * Port 1 does not work with LinkMD Cable-Testing. in ksz8_sw_get_phy_flags()
977 * Port 1 does not respond to received PAUSE control frames. in ksz8_sw_get_phy_flags()
988 struct ksz_device *dev = ds->priv; in ksz8_get_strings()
991 for (i = 0; i < dev->mib_cnt; i++) { in ksz8_get_strings()
993 dev->mib_names[i].string, ETH_GSTRING_LEN); in ksz8_get_strings()
1003 data |= (member & dev->port_mask); in ksz8_cfg_port_member()
1005 dev->ports[port].member = member; in ksz8_cfg_port_member()
1010 struct ksz_device *dev = ds->priv; in ksz8_port_stp_state_set()
1011 int forward = dev->member; in ksz8_port_stp_state_set()
1013 int member = -1; in ksz8_port_stp_state_set()
1016 p = &dev->ports[port]; in ksz8_port_stp_state_set()
1024 if (port < dev->phy_port_cnt) in ksz8_port_stp_state_set()
1029 if (port < dev->phy_port_cnt && in ksz8_port_stp_state_set()
1030 p->stp_state == BR_STATE_DISABLED) in ksz8_port_stp_state_set()
1031 member = dev->host_mask | p->vid_member; in ksz8_port_stp_state_set()
1040 if (port == dev->cpu_port) in ksz8_port_stp_state_set()
1044 if (dev->br_member & BIT(port)) { in ksz8_port_stp_state_set()
1045 dev->member |= BIT(port); in ksz8_port_stp_state_set()
1046 member = dev->member; in ksz8_port_stp_state_set()
1048 member = dev->host_mask | p->vid_member; in ksz8_port_stp_state_set()
1053 if (port < dev->phy_port_cnt && in ksz8_port_stp_state_set()
1054 p->stp_state == BR_STATE_DISABLED) in ksz8_port_stp_state_set()
1055 member = dev->host_mask | p->vid_member; in ksz8_port_stp_state_set()
1058 dev_err(ds->dev, "invalid STP state: %d\n", state); in ksz8_port_stp_state_set()
1063 p->stp_state = state; in ksz8_port_stp_state_set()
1065 if (member >= 0 && member != p->member) in ksz8_port_stp_state_set()
1070 if (dev->br_member & BIT(port)) in ksz8_port_stp_state_set()
1071 dev->member &= ~BIT(port); in ksz8_port_stp_state_set()
1077 if (forward != dev->member) in ksz8_port_stp_state_set()
1087 if ((uint)port < dev->port_cnt) { in ksz8_flush_dyn_mac_table()
1093 cnt = dev->port_cnt; in ksz8_flush_dyn_mac_table()
1096 p = &dev->ports[index]; in ksz8_flush_dyn_mac_table()
1097 if (!p->on) in ksz8_flush_dyn_mac_table()
1106 p = &dev->ports[index]; in ksz8_flush_dyn_mac_table()
1107 if (!p->on) in ksz8_flush_dyn_mac_table()
1117 struct ksz_device *dev = ds->priv; in ksz8_port_vlan_filtering()
1120 return -ENOTSUPP; in ksz8_port_vlan_filtering()
1126 for (port = 0; port < dev->phy_port_cnt; ++port) in ksz8_port_vlan_filtering()
1137 0x03 << (4 - 2 * port), state); in ksz8_port_enable_pvid()
1147 bool untagged = vlan->flags & BRIDGE_VLAN_INFO_UNTAGGED; in ksz8_port_vlan_add()
1148 struct ksz_device *dev = ds->priv; in ksz8_port_vlan_add()
1149 struct ksz_port *p = &dev->ports[port]; in ksz8_port_vlan_add()
1154 return -ENOTSUPP; in ksz8_port_vlan_add()
1161 if (untagged != p->remove_tag && vlan->vid != 0 && in ksz8_port_vlan_add()
1162 port != dev->cpu_port) { in ksz8_port_vlan_add()
1169 for (vid = 1; vid < dev->num_vlans; ++vid) { in ksz8_port_vlan_add()
1171 if (vid == vlan->vid) in ksz8_port_vlan_add()
1174 ksz8_from_vlan(dev, dev->vlan_cache[vid].table[0], in ksz8_port_vlan_add()
1177 return -EINVAL; in ksz8_port_vlan_add()
1181 p->remove_tag = untagged; in ksz8_port_vlan_add()
1184 ksz8_r_vlan_table(dev, vlan->vid, &data); in ksz8_port_vlan_add()
1196 ksz8_w_vlan_table(dev, vlan->vid, data); in ksz8_port_vlan_add()
1199 if (vlan->flags & BRIDGE_VLAN_INFO_PVID) in ksz8_port_vlan_add()
1200 new_pvid = vlan->vid; in ksz8_port_vlan_add()
1219 struct ksz_device *dev = ds->priv; in ksz8_port_vlan_del()
1224 return -ENOTSUPP; in ksz8_port_vlan_del()
1229 ksz8_r_vlan_table(dev, vlan->vid, &data); in ksz8_port_vlan_del()
1241 ksz8_w_vlan_table(dev, vlan->vid, data); in ksz8_port_vlan_del()
1243 if (pvid == vlan->vid) in ksz8_port_vlan_del()
1253 struct ksz_device *dev = ds->priv; in ksz8_port_mirror_add()
1257 dev->mirror_rx |= BIT(port); in ksz8_port_mirror_add()
1260 dev->mirror_tx |= BIT(port); in ksz8_port_mirror_add()
1266 if (dev->mirror_rx || dev->mirror_tx) in ksz8_port_mirror_add()
1267 ksz_port_cfg(dev, mirror->to_local_port, P_MIRROR_CTRL, in ksz8_port_mirror_add()
1276 struct ksz_device *dev = ds->priv; in ksz8_port_mirror_del()
1279 if (mirror->ingress) { in ksz8_port_mirror_del()
1281 dev->mirror_rx &= ~BIT(port); in ksz8_port_mirror_del()
1284 dev->mirror_tx &= ~BIT(port); in ksz8_port_mirror_del()
1289 if (!dev->mirror_rx && !dev->mirror_tx) in ksz8_port_mirror_del()
1290 ksz_port_cfg(dev, mirror->to_local_port, P_MIRROR_CTRL, in ksz8_port_mirror_del()
1296 struct ksz_port *p = &dev->ports[port]; in ksz8795_cpu_interface_select()
1299 if (!p->interface && dev->compat_interface) { in ksz8795_cpu_interface_select()
1300 dev_warn(dev->dev, in ksz8795_cpu_interface_select()
1301 "Using legacy switch \"phy-mode\" property, because it is missing on port %d node. " in ksz8795_cpu_interface_select()
1304 p->interface = dev->compat_interface; in ksz8795_cpu_interface_select()
1311 switch (p->interface) { in ksz8795_cpu_interface_select()
1313 p->phydev.speed = SPEED_100; in ksz8795_cpu_interface_select()
1317 p->phydev.speed = SPEED_100; in ksz8795_cpu_interface_select()
1322 p->phydev.speed = SPEED_1000; in ksz8795_cpu_interface_select()
1327 if (p->interface == PHY_INTERFACE_MODE_RGMII_ID || in ksz8795_cpu_interface_select()
1328 p->interface == PHY_INTERFACE_MODE_RGMII_RXID) in ksz8795_cpu_interface_select()
1330 if (p->interface == PHY_INTERFACE_MODE_RGMII_ID || in ksz8795_cpu_interface_select()
1331 p->interface == PHY_INTERFACE_MODE_RGMII_TXID) in ksz8795_cpu_interface_select()
1335 p->phydev.speed = SPEED_1000; in ksz8795_cpu_interface_select()
1339 p->phydev.duplex = 1; in ksz8795_cpu_interface_select()
1344 struct ksz_port *p = &dev->ports[port]; in ksz8_port_setup()
1345 struct ksz8 *ksz8 = dev->priv; in ksz8_port_setup()
1349 masks = ksz8->masks; in ksz8_port_setup()
1371 member = dev->port_mask; in ksz8_port_setup()
1373 member = dev->host_mask | p->vid_member; in ksz8_port_setup()
1380 struct ksz_device *dev = ds->priv; in ksz8_config_cpu_port()
1381 struct ksz8 *ksz8 = dev->priv; in ksz8_config_cpu_port()
1382 const u8 *regs = ksz8->regs; in ksz8_config_cpu_port()
1388 masks = ksz8->masks; in ksz8_config_cpu_port()
1394 p = &dev->ports[dev->cpu_port]; in ksz8_config_cpu_port()
1395 p->vid_member = dev->port_mask; in ksz8_config_cpu_port()
1396 p->on = 1; in ksz8_config_cpu_port()
1398 ksz8_port_setup(dev, dev->cpu_port, true); in ksz8_config_cpu_port()
1399 dev->member = dev->host_mask; in ksz8_config_cpu_port()
1401 for (i = 0; i < dev->phy_port_cnt; i++) { in ksz8_config_cpu_port()
1402 p = &dev->ports[i]; in ksz8_config_cpu_port()
1404 /* Initialize to non-zero so that ksz_cfg_port_member() will in ksz8_config_cpu_port()
1407 p->vid_member = BIT(i); in ksz8_config_cpu_port()
1408 p->member = dev->port_mask; in ksz8_config_cpu_port()
1412 if (i == dev->phy_port_cnt) in ksz8_config_cpu_port()
1414 p->on = 1; in ksz8_config_cpu_port()
1415 p->phy = 1; in ksz8_config_cpu_port()
1417 for (i = 0; i < dev->phy_port_cnt; i++) { in ksz8_config_cpu_port()
1418 p = &dev->ports[i]; in ksz8_config_cpu_port()
1419 if (!p->on) in ksz8_config_cpu_port()
1424 p->fiber = 1; in ksz8_config_cpu_port()
1426 if (p->fiber) in ksz8_config_cpu_port()
1437 struct ksz_device *dev = ds->priv; in ksz8_setup()
1441 dev->vlan_cache = devm_kcalloc(dev->dev, sizeof(struct vlan_table), in ksz8_setup()
1442 dev->num_vlans, GFP_KERNEL); in ksz8_setup()
1443 if (!dev->vlan_cache) in ksz8_setup()
1444 return -ENOMEM; in ksz8_setup()
1448 dev_err(ds->dev, "failed to reset switch\n"); in ksz8_setup()
1458 regmap_update_bits(dev->regmap[0], REG_SW_CTRL_1, in ksz8_setup()
1465 regmap_update_bits(dev->regmap[0], REG_SW_CTRL_2, in ksz8_setup()
1481 regmap_update_bits(dev->regmap[1], S_REPLACE_VID_CTRL, in ksz8_setup()
1486 for (i = 0; i < (dev->num_vlans / 4); i++) in ksz8_setup()
1494 alu.port_forward = dev->host_mask; in ksz8_setup()
1500 ds->configure_vlan_while_not_filtering = false; in ksz8_setup()
1510 struct ksz_device *dev = ds->priv; in ksz8_validate()
1512 if (port == dev->cpu_port) { in ksz8_validate()
1513 if (state->interface != PHY_INTERFACE_MODE_RMII && in ksz8_validate()
1514 state->interface != PHY_INTERFACE_MODE_MII && in ksz8_validate()
1515 state->interface != PHY_INTERFACE_MODE_NA) in ksz8_validate()
1518 if (state->interface != PHY_INTERFACE_MODE_INTERNAL && in ksz8_validate()
1519 state->interface != PHY_INTERFACE_MODE_NA) in ksz8_validate()
1528 * "Port 1 does not respond to received flow control PAUSE frames" in ksz8_validate()
1529 * So, disable Pause support on "Port 1" (port == 0) for all ksz88x3 in ksz8_validate()
1533 phylink_set(mask, Pause); in ksz8_validate()
1535 /* Asym pause is not supported on KSZ8863 and KSZ8873 */ in ksz8_validate()
1547 bitmap_and(state->advertising, state->advertising, mask, in ksz8_validate()
1554 dev_err(ds->dev, "Unsupported interface: %s, port: %d\n", in ksz8_validate()
1555 phy_modes(state->interface), port); in ksz8_validate()
1606 return -ENODEV; in ksz8_switch_detect()
1621 return -ENODEV; in ksz8_switch_detect()
1624 dev_err(dev->dev, "invalid family id: %d\n", id1); in ksz8_switch_detect()
1625 return -ENODEV; in ksz8_switch_detect()
1629 dev->chip_id = id16; in ksz8_switch_detect()
1660 * port map is NOT continuous. The per-port register
1699 struct ksz8 *ksz8 = dev->priv; in ksz8_switch_init()
1702 dev->ds->ops = &ksz8_switch_ops; in ksz8_switch_init()
1707 if (dev->chip_id == chip->chip_id) { in ksz8_switch_init()
1708 dev->name = chip->dev_name; in ksz8_switch_init()
1709 dev->num_vlans = chip->num_vlans; in ksz8_switch_init()
1710 dev->num_alus = chip->num_alus; in ksz8_switch_init()
1711 dev->num_statics = chip->num_statics; in ksz8_switch_init()
1712 dev->port_cnt = fls(chip->cpu_ports); in ksz8_switch_init()
1713 dev->cpu_port = fls(chip->cpu_ports) - 1; in ksz8_switch_init()
1714 dev->phy_port_cnt = dev->port_cnt - 1; in ksz8_switch_init()
1715 dev->cpu_ports = chip->cpu_ports; in ksz8_switch_init()
1716 dev->host_mask = chip->cpu_ports; in ksz8_switch_init()
1717 dev->port_mask = (BIT(dev->phy_port_cnt) - 1) | in ksz8_switch_init()
1718 chip->cpu_ports; in ksz8_switch_init()
1724 if (!dev->cpu_ports) in ksz8_switch_init()
1725 return -ENODEV; in ksz8_switch_init()
1728 ksz8->regs = ksz8863_regs; in ksz8_switch_init()
1729 ksz8->masks = ksz8863_masks; in ksz8_switch_init()
1730 ksz8->shifts = ksz8863_shifts; in ksz8_switch_init()
1731 dev->mib_cnt = ARRAY_SIZE(ksz88xx_mib_names); in ksz8_switch_init()
1732 dev->mib_names = ksz88xx_mib_names; in ksz8_switch_init()
1734 ksz8->regs = ksz8795_regs; in ksz8_switch_init()
1735 ksz8->masks = ksz8795_masks; in ksz8_switch_init()
1736 ksz8->shifts = ksz8795_shifts; in ksz8_switch_init()
1737 dev->mib_cnt = ARRAY_SIZE(ksz87xx_mib_names); in ksz8_switch_init()
1738 dev->mib_names = ksz87xx_mib_names; in ksz8_switch_init()
1741 dev->reg_mib_cnt = MIB_COUNTER_NUM; in ksz8_switch_init()
1743 dev->ports = devm_kzalloc(dev->dev, in ksz8_switch_init()
1744 dev->port_cnt * sizeof(struct ksz_port), in ksz8_switch_init()
1746 if (!dev->ports) in ksz8_switch_init()
1747 return -ENOMEM; in ksz8_switch_init()
1748 for (i = 0; i < dev->port_cnt; i++) { in ksz8_switch_init()
1749 mutex_init(&dev->ports[i].mib.cnt_mutex); in ksz8_switch_init()
1750 dev->ports[i].mib.counters = in ksz8_switch_init()
1751 devm_kzalloc(dev->dev, in ksz8_switch_init()
1753 (dev->mib_cnt + 1), in ksz8_switch_init()
1755 if (!dev->ports[i].mib.counters) in ksz8_switch_init()
1756 return -ENOMEM; in ksz8_switch_init()
1760 dev->ds->num_ports = dev->port_cnt; in ksz8_switch_init()
1765 dev->ds->untag_bridge_pvid = true; in ksz8_switch_init()
1770 dev->ds->vlan_filtering_is_global = true; in ksz8_switch_init()