Date:2010-08-18 18:00:34 (2 years 9 months ago)
Author:juhosg
Commit:3b7b50fb893533a1f072fc549f6b0d42a4dbdf00
Message:generic: rtl8366: add enable_vlan{,4k} to smi_ops

git-svn-id: svn://svn.openwrt.org/openwrt/trunk@22702 3c298f89-4303-0410-b956-a3cf2f4a3e73
Files: target/linux/generic/files/drivers/net/phy/rtl8366_smi.h (1 diff)
target/linux/generic/files/drivers/net/phy/rtl8366rb.c (3 diffs)
target/linux/generic/files/drivers/net/phy/rtl8366s.c (3 diffs)

Change Details

target/linux/generic/files/drivers/net/phy/rtl8366_smi.h
8787    int (*get_mib_counter)(struct rtl8366_smi *smi, int counter,
8888                   int port, unsigned long long *val);
8989    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);
9092};
9193
9294struct rtl8366_smi *rtl8366_smi_alloc(struct device *parent);
target/linux/generic/files/drivers/net/phy/rtl8366rb.c
560560    return 1;
561561}
562562
563static int rtl8366rb_vlan_set_vlan(struct rtl8366_smi *smi, int enable)
563static int rtl8366rb_enable_vlan(struct rtl8366_smi *smi, int enable)
564564{
565565    return rtl8366_smi_rmwr(smi, RTL8366RB_SGCR, RTL8366RB_SGCR_EN_VLAN,
566566                (enable) ? RTL8366RB_SGCR_EN_VLAN : 0);
567567}
568568
569static int rtl8366rb_vlan_set_4ktable(struct rtl8366_smi *smi, int enable)
569static int rtl8366rb_enable_vlan4k(struct rtl8366_smi *smi, int enable)
570570{
571571    return rtl8366_smi_rmwr(smi, RTL8366RB_SGCR,
572572                RTL8366RB_SGCR_EN_VLAN_4KTB,
...... 
644644    struct rtl8366_smi *smi = sw_to_rtl8366_smi(dev);
645645
646646    if (attr->ofs == 1)
647        return rtl8366rb_vlan_set_vlan(smi, val->value.i);
647        return rtl8366rb_enable_vlan(smi, val->value.i);
648648    else
649        return rtl8366rb_vlan_set_4ktable(smi, val->value.i);
649        return rtl8366rb_enable_vlan4k(smi, val->value.i);
650650}
651651
652652static int rtl8366rb_sw_get_learning_enable(struct switch_dev *dev,
...... 
10281028    .set_mc_index = rtl8366rb_set_mc_index,
10291029    .get_mib_counter = rtl8366rb_get_mib_counter,
10301030    .is_vlan_valid = rtl8366rb_is_vlan_valid,
1031    .enable_vlan = rtl8366rb_enable_vlan,
1032    .enable_vlan4k = rtl8366rb_enable_vlan4k,
10311033};
10321034
10331035static int __init rtl8366rb_probe(struct platform_device *pdev)
target/linux/generic/files/drivers/net/phy/rtl8366s.c
579579                    RTL8366S_PORT_VLAN_CTRL_SHIFT(port));
580580}
581581
582static int rtl8366s_vlan_set_vlan(struct rtl8366_smi *smi, int enable)
582static int rtl8366s_enable_vlan(struct rtl8366_smi *smi, int enable)
583583{
584584    return rtl8366_smi_rmwr(smi, RTL8366S_SGCR, RTL8366S_SGCR_EN_VLAN,
585585                (enable) ? RTL8366S_SGCR_EN_VLAN : 0);
586586}
587587
588static int rtl8366s_vlan_set_4ktable(struct rtl8366_smi *smi, int enable)
588static int rtl8366s_enable_vlan4k(struct rtl8366_smi *smi, int enable)
589589{
590590    return rtl8366_smi_rmwr(smi, RTL8366S_VLAN_TB_CTRL_REG,
591591                1, (enable) ? 1 : 0);
...... 
669669    struct rtl8366_smi *smi = sw_to_rtl8366_smi(dev);
670670
671671    if (attr->ofs == 1)
672        return rtl8366s_vlan_set_vlan(smi, val->value.i);
672        return rtl8366s_enable_vlan(smi, val->value.i);
673673    else
674        return rtl8366s_vlan_set_4ktable(smi, val->value.i);
674        return rtl8366s_enable_vlan4k(smi, val->value.i);
675675}
676676
677677static int rtl8366s_sw_get_learning_enable(struct switch_dev *dev,
...... 
10551055    .set_mc_index = rtl8366s_set_mc_index,
10561056    .get_mib_counter = rtl8366_get_mib_counter,
10571057    .is_vlan_valid = rtl8366s_is_vlan_valid,
1058    .enable_vlan = rtl8366s_enable_vlan,
1059    .enable_vlan4k = rtl8366s_enable_vlan4k,
10581060};
10591061
10601062static int __init rtl8366s_probe(struct platform_device *pdev)

Archive Download the corresponding diff file



interactive