| target/linux/generic/files/drivers/net/phy/rtl8366_smi.h |
| 87 | 87 | int (*get_mib_counter)(struct rtl8366_smi *smi, int counter, |
| 88 | 88 | int port, unsigned long long *val); |
| 89 | 89 | int (*is_vlan_valid)(struct rtl8366_smi *smi, unsigned vlan); |
| 90 | int (*enable_vlan)(struct rtl8366_smi *smi, int enable); |
| 91 | int (*enable_vlan4k)(struct rtl8366_smi *smi, int enable); |
| 90 | 92 | }; |
| 91 | 93 | |
| 92 | 94 | struct rtl8366_smi *rtl8366_smi_alloc(struct device *parent); |
| target/linux/generic/files/drivers/net/phy/rtl8366rb.c |
| 560 | 560 | return 1; |
| 561 | 561 | } |
| 562 | 562 | |
| 563 | | static int rtl8366rb_vlan_set_vlan(struct rtl8366_smi *smi, int enable) |
| 563 | static int rtl8366rb_enable_vlan(struct rtl8366_smi *smi, int enable) |
| 564 | 564 | { |
| 565 | 565 | return rtl8366_smi_rmwr(smi, RTL8366RB_SGCR, RTL8366RB_SGCR_EN_VLAN, |
| 566 | 566 | (enable) ? RTL8366RB_SGCR_EN_VLAN : 0); |
| 567 | 567 | } |
| 568 | 568 | |
| 569 | | static int rtl8366rb_vlan_set_4ktable(struct rtl8366_smi *smi, int enable) |
| 569 | static int rtl8366rb_enable_vlan4k(struct rtl8366_smi *smi, int enable) |
| 570 | 570 | { |
| 571 | 571 | return rtl8366_smi_rmwr(smi, RTL8366RB_SGCR, |
| 572 | 572 | RTL8366RB_SGCR_EN_VLAN_4KTB, |
| ... | ... | |
| 644 | 644 | struct rtl8366_smi *smi = sw_to_rtl8366_smi(dev); |
| 645 | 645 | |
| 646 | 646 | if (attr->ofs == 1) |
| 647 | | return rtl8366rb_vlan_set_vlan(smi, val->value.i); |
| 647 | return rtl8366rb_enable_vlan(smi, val->value.i); |
| 648 | 648 | else |
| 649 | | return rtl8366rb_vlan_set_4ktable(smi, val->value.i); |
| 649 | return rtl8366rb_enable_vlan4k(smi, val->value.i); |
| 650 | 650 | } |
| 651 | 651 | |
| 652 | 652 | static int rtl8366rb_sw_get_learning_enable(struct switch_dev *dev, |
| ... | ... | |
| 1028 | 1028 | .set_mc_index = rtl8366rb_set_mc_index, |
| 1029 | 1029 | .get_mib_counter = rtl8366rb_get_mib_counter, |
| 1030 | 1030 | .is_vlan_valid = rtl8366rb_is_vlan_valid, |
| 1031 | .enable_vlan = rtl8366rb_enable_vlan, |
| 1032 | .enable_vlan4k = rtl8366rb_enable_vlan4k, |
| 1031 | 1033 | }; |
| 1032 | 1034 | |
| 1033 | 1035 | static int __init rtl8366rb_probe(struct platform_device *pdev) |
| target/linux/generic/files/drivers/net/phy/rtl8366s.c |
| 579 | 579 | RTL8366S_PORT_VLAN_CTRL_SHIFT(port)); |
| 580 | 580 | } |
| 581 | 581 | |
| 582 | | static int rtl8366s_vlan_set_vlan(struct rtl8366_smi *smi, int enable) |
| 582 | static int rtl8366s_enable_vlan(struct rtl8366_smi *smi, int enable) |
| 583 | 583 | { |
| 584 | 584 | return rtl8366_smi_rmwr(smi, RTL8366S_SGCR, RTL8366S_SGCR_EN_VLAN, |
| 585 | 585 | (enable) ? RTL8366S_SGCR_EN_VLAN : 0); |
| 586 | 586 | } |
| 587 | 587 | |
| 588 | | static int rtl8366s_vlan_set_4ktable(struct rtl8366_smi *smi, int enable) |
| 588 | static int rtl8366s_enable_vlan4k(struct rtl8366_smi *smi, int enable) |
| 589 | 589 | { |
| 590 | 590 | return rtl8366_smi_rmwr(smi, RTL8366S_VLAN_TB_CTRL_REG, |
| 591 | 591 | 1, (enable) ? 1 : 0); |
| ... | ... | |
| 669 | 669 | struct rtl8366_smi *smi = sw_to_rtl8366_smi(dev); |
| 670 | 670 | |
| 671 | 671 | if (attr->ofs == 1) |
| 672 | | return rtl8366s_vlan_set_vlan(smi, val->value.i); |
| 672 | return rtl8366s_enable_vlan(smi, val->value.i); |
| 673 | 673 | else |
| 674 | | return rtl8366s_vlan_set_4ktable(smi, val->value.i); |
| 674 | return rtl8366s_enable_vlan4k(smi, val->value.i); |
| 675 | 675 | } |
| 676 | 676 | |
| 677 | 677 | static int rtl8366s_sw_get_learning_enable(struct switch_dev *dev, |
| ... | ... | |
| 1055 | 1055 | .set_mc_index = rtl8366s_set_mc_index, |
| 1056 | 1056 | .get_mib_counter = rtl8366_get_mib_counter, |
| 1057 | 1057 | .is_vlan_valid = rtl8366s_is_vlan_valid, |
| 1058 | .enable_vlan = rtl8366s_enable_vlan, |
| 1059 | .enable_vlan4k = rtl8366s_enable_vlan4k, |
| 1058 | 1060 | }; |
| 1059 | 1061 | |
| 1060 | 1062 | static int __init rtl8366s_probe(struct platform_device *pdev) |