mirror of
git://projects.qi-hardware.com/openwrt-xburst.git
synced 2024-11-28 00:31:54 +02:00
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
This commit is contained in:
parent
e920aacf90
commit
6938bc08df
@ -741,6 +741,20 @@ static void rtl8366_smi_mii_cleanup(struct rtl8366_smi *smi)
|
|||||||
mdiobus_free(smi->mii_bus);
|
mdiobus_free(smi->mii_bus);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int rtl8366_sw_get_port_pvid(struct switch_dev *dev, int port, int *val)
|
||||||
|
{
|
||||||
|
struct rtl8366_smi *smi = sw_to_rtl8366_smi(dev);
|
||||||
|
return rtl8366_get_pvid(smi, port, val);
|
||||||
|
}
|
||||||
|
EXPORT_SYMBOL_GPL(rtl8366_sw_get_port_pvid);
|
||||||
|
|
||||||
|
int rtl8366_sw_set_port_pvid(struct switch_dev *dev, int port, int val)
|
||||||
|
{
|
||||||
|
struct rtl8366_smi *smi = sw_to_rtl8366_smi(dev);
|
||||||
|
return rtl8366_set_pvid(smi, port, val);
|
||||||
|
}
|
||||||
|
EXPORT_SYMBOL_GPL(rtl8366_sw_set_port_pvid);
|
||||||
|
|
||||||
struct rtl8366_smi *rtl8366_smi_alloc(struct device *parent)
|
struct rtl8366_smi *rtl8366_smi_alloc(struct device *parent)
|
||||||
{
|
{
|
||||||
struct rtl8366_smi *smi;
|
struct rtl8366_smi *smi;
|
||||||
|
@ -110,4 +110,7 @@ static inline struct rtl8366_smi *sw_to_rtl8366_smi(struct switch_dev *sw)
|
|||||||
return container_of(sw, struct rtl8366_smi, sw_dev);
|
return container_of(sw, struct rtl8366_smi, sw_dev);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int rtl8366_sw_get_port_pvid(struct switch_dev *dev, int port, int *val);
|
||||||
|
int rtl8366_sw_set_port_pvid(struct switch_dev *dev, int port, int val);
|
||||||
|
|
||||||
#endif /* _RTL8366_SMI_H */
|
#endif /* _RTL8366_SMI_H */
|
||||||
|
@ -875,18 +875,6 @@ static int rtl8366rb_sw_set_vlan_ports(struct switch_dev *dev,
|
|||||||
return rtl8366_set_vlan(smi, val->port_vlan, member, untag, 0);
|
return rtl8366_set_vlan(smi, val->port_vlan, member, untag, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int rtl8366rb_sw_get_port_pvid(struct switch_dev *dev, int port, int *val)
|
|
||||||
{
|
|
||||||
struct rtl8366_smi *smi = sw_to_rtl8366_smi(dev);
|
|
||||||
return rtl8366_get_pvid(smi, port, val);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int rtl8366rb_sw_set_port_pvid(struct switch_dev *dev, int port, int val)
|
|
||||||
{
|
|
||||||
struct rtl8366_smi *smi = sw_to_rtl8366_smi(dev);
|
|
||||||
return rtl8366_set_pvid(smi, port, val);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int rtl8366rb_sw_reset_switch(struct switch_dev *dev)
|
static int rtl8366rb_sw_reset_switch(struct switch_dev *dev)
|
||||||
{
|
{
|
||||||
struct rtl8366_smi *smi = sw_to_rtl8366_smi(dev);
|
struct rtl8366_smi *smi = sw_to_rtl8366_smi(dev);
|
||||||
@ -998,8 +986,8 @@ static struct switch_dev rtl8366_switch_dev = {
|
|||||||
|
|
||||||
.get_vlan_ports = rtl8366rb_sw_get_vlan_ports,
|
.get_vlan_ports = rtl8366rb_sw_get_vlan_ports,
|
||||||
.set_vlan_ports = rtl8366rb_sw_set_vlan_ports,
|
.set_vlan_ports = rtl8366rb_sw_set_vlan_ports,
|
||||||
.get_port_pvid = rtl8366rb_sw_get_port_pvid,
|
.get_port_pvid = rtl8366_sw_get_port_pvid,
|
||||||
.set_port_pvid = rtl8366rb_sw_set_port_pvid,
|
.set_port_pvid = rtl8366_sw_set_port_pvid,
|
||||||
.reset_switch = rtl8366rb_sw_reset_switch,
|
.reset_switch = rtl8366rb_sw_reset_switch,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -902,18 +902,6 @@ static int rtl8366s_sw_set_vlan_ports(struct switch_dev *dev,
|
|||||||
return rtl8366_set_vlan(smi, val->port_vlan, member, untag, 0);
|
return rtl8366_set_vlan(smi, val->port_vlan, member, untag, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int rtl8366s_sw_get_port_pvid(struct switch_dev *dev, int port, int *val)
|
|
||||||
{
|
|
||||||
struct rtl8366_smi *smi = sw_to_rtl8366_smi(dev);
|
|
||||||
return rtl8366_get_pvid(smi, port, val);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int rtl8366s_sw_set_port_pvid(struct switch_dev *dev, int port, int val)
|
|
||||||
{
|
|
||||||
struct rtl8366_smi *smi = sw_to_rtl8366_smi(dev);
|
|
||||||
return rtl8366_set_pvid(smi, port, val);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int rtl8366s_sw_reset_switch(struct switch_dev *dev)
|
static int rtl8366s_sw_reset_switch(struct switch_dev *dev)
|
||||||
{
|
{
|
||||||
struct rtl8366_smi *smi = sw_to_rtl8366_smi(dev);
|
struct rtl8366_smi *smi = sw_to_rtl8366_smi(dev);
|
||||||
@ -1025,8 +1013,8 @@ static struct switch_dev rtl8366_switch_dev = {
|
|||||||
|
|
||||||
.get_vlan_ports = rtl8366s_sw_get_vlan_ports,
|
.get_vlan_ports = rtl8366s_sw_get_vlan_ports,
|
||||||
.set_vlan_ports = rtl8366s_sw_set_vlan_ports,
|
.set_vlan_ports = rtl8366s_sw_set_vlan_ports,
|
||||||
.get_port_pvid = rtl8366s_sw_get_port_pvid,
|
.get_port_pvid = rtl8366_sw_get_port_pvid,
|
||||||
.set_port_pvid = rtl8366s_sw_set_port_pvid,
|
.set_port_pvid = rtl8366_sw_set_port_pvid,
|
||||||
.reset_switch = rtl8366s_sw_reset_switch,
|
.reset_switch = rtl8366s_sw_reset_switch,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user