Date:2010-07-15 15:05:25 (13 years 8 months ago)
Author:juhosg
Commit:6938bc08dfa57eff5a2b479099e996389b18c900
Message:generic: rtl8366: add common rtl8366_sw_{get,set}_port_pvid functions

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

Change Details

target/linux/generic/files/drivers/net/phy/rtl8366_smi.c
741741    mdiobus_free(smi->mii_bus);
742742}
743743
744int rtl8366_sw_get_port_pvid(struct switch_dev *dev, int port, int *val)
745{
746    struct rtl8366_smi *smi = sw_to_rtl8366_smi(dev);
747    return rtl8366_get_pvid(smi, port, val);
748}
749EXPORT_SYMBOL_GPL(rtl8366_sw_get_port_pvid);
750
751int rtl8366_sw_set_port_pvid(struct switch_dev *dev, int port, int val)
752{
753    struct rtl8366_smi *smi = sw_to_rtl8366_smi(dev);
754    return rtl8366_set_pvid(smi, port, val);
755}
756EXPORT_SYMBOL_GPL(rtl8366_sw_set_port_pvid);
757
744758struct rtl8366_smi *rtl8366_smi_alloc(struct device *parent)
745759{
746760    struct rtl8366_smi *smi;
target/linux/generic/files/drivers/net/phy/rtl8366_smi.h
110110    return container_of(sw, struct rtl8366_smi, sw_dev);
111111}
112112
113int rtl8366_sw_get_port_pvid(struct switch_dev *dev, int port, int *val);
114int rtl8366_sw_set_port_pvid(struct switch_dev *dev, int port, int val);
115
113116#endif /* _RTL8366_SMI_H */
target/linux/generic/files/drivers/net/phy/rtl8366rb.c
875875    return rtl8366_set_vlan(smi, val->port_vlan, member, untag, 0);
876876}
877877
878static int rtl8366rb_sw_get_port_pvid(struct switch_dev *dev, int port, int *val)
879{
880    struct rtl8366_smi *smi = sw_to_rtl8366_smi(dev);
881    return rtl8366_get_pvid(smi, port, val);
882}
883
884static int rtl8366rb_sw_set_port_pvid(struct switch_dev *dev, int port, int val)
885{
886    struct rtl8366_smi *smi = sw_to_rtl8366_smi(dev);
887    return rtl8366_set_pvid(smi, port, val);
888}
889
890878static int rtl8366rb_sw_reset_switch(struct switch_dev *dev)
891879{
892880    struct rtl8366_smi *smi = sw_to_rtl8366_smi(dev);
...... 
998986
999987    .get_vlan_ports = rtl8366rb_sw_get_vlan_ports,
1000988    .set_vlan_ports = rtl8366rb_sw_set_vlan_ports,
1001    .get_port_pvid = rtl8366rb_sw_get_port_pvid,
1002    .set_port_pvid = rtl8366rb_sw_set_port_pvid,
989    .get_port_pvid = rtl8366_sw_get_port_pvid,
990    .set_port_pvid = rtl8366_sw_set_port_pvid,
1003991    .reset_switch = rtl8366rb_sw_reset_switch,
1004992};
1005993
target/linux/generic/files/drivers/net/phy/rtl8366s.c
902902    return rtl8366_set_vlan(smi, val->port_vlan, member, untag, 0);
903903}
904904
905static int rtl8366s_sw_get_port_pvid(struct switch_dev *dev, int port, int *val)
906{
907    struct rtl8366_smi *smi = sw_to_rtl8366_smi(dev);
908    return rtl8366_get_pvid(smi, port, val);
909}
910
911static int rtl8366s_sw_set_port_pvid(struct switch_dev *dev, int port, int val)
912{
913    struct rtl8366_smi *smi = sw_to_rtl8366_smi(dev);
914    return rtl8366_set_pvid(smi, port, val);
915}
916
917905static int rtl8366s_sw_reset_switch(struct switch_dev *dev)
918906{
919907    struct rtl8366_smi *smi = sw_to_rtl8366_smi(dev);
...... 
10251013
10261014    .get_vlan_ports = rtl8366s_sw_get_vlan_ports,
10271015    .set_vlan_ports = rtl8366s_sw_set_vlan_ports,
1028    .get_port_pvid = rtl8366s_sw_get_port_pvid,
1029    .set_port_pvid = rtl8366s_sw_set_port_pvid,
1016    .get_port_pvid = rtl8366_sw_get_port_pvid,
1017    .set_port_pvid = rtl8366_sw_set_port_pvid,
10301018    .reset_switch = rtl8366s_sw_reset_switch,
10311019};
10321020

Archive Download the corresponding diff file



interactive