generic: rtl8366: add common rtl8366_sw_{get,set}_port_pvid functions
[openwrt.git] / target / linux / generic / files / drivers / net / phy / rtl8366_smi.c
index c7e03901db06b91835f0c94c6a38cdc10617b089..b1f455696a7fea4219a1ed107a078aba8e7a4e73 100644 (file)
@@ -741,6 +741,20 @@ static void rtl8366_smi_mii_cleanup(struct rtl8366_smi *smi)
        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 *smi;