backfire: generic: rtl8366s: use correct bitmasks in sanity checks (backport of r24935)
[10.03/openwrt.git] / target / linux / generic-2.6 / files / drivers / net / phy / rtl8366s.c
index d45e4d7..80a546a 100644 (file)
@@ -455,8 +455,8 @@ static int rtl8366s_set_vlan_4k(struct rtl8366_smi *smi,
        int i;
 
        if (vlan4k->vid >= RTL8366S_NUM_VIDS ||
-           vlan4k->member > RTL8366S_PORT_ALL ||
-           vlan4k->untag > RTL8366S_PORT_ALL ||
+           vlan4k->member > RTL8366S_VLAN_MEMBER_MASK ||
+           vlan4k->untag > RTL8366S_VLAN_UNTAG_MASK ||
            vlan4k->fid > RTL8366S_FIDMAX)
                return -EINVAL;
 
@@ -524,8 +524,8 @@ static int rtl8366s_set_vlan_mc(struct rtl8366_smi *smi, u32 index,
        if (index >= RTL8366S_NUM_VLANS ||
            vlanmc->vid >= RTL8366S_NUM_VIDS ||
            vlanmc->priority > RTL8366S_PRIORITYMAX ||
-           vlanmc->member > RTL8366S_PORT_ALL ||
-           vlanmc->untag > RTL8366S_PORT_ALL ||
+           vlanmc->member > RTL8366S_VLAN_MEMBER_MASK ||
+           vlanmc->untag > RTL8366S_VLAN_UNTAG_MASK ||
            vlanmc->fid > RTL8366S_FIDMAX)
                return -EINVAL;
 
@@ -883,6 +883,13 @@ static struct switch_attr rtl8366s_vlan[] = {
                .max = 1,
                .set = NULL,
                .get = rtl8366_sw_get_vlan_info,
+       }, {
+               .type = SWITCH_TYPE_INT,
+               .name = "fid",
+               .description = "Get/Set vlan FID",
+               .max = RTL8366S_FIDMAX,
+               .set = rtl8366_sw_set_vlan_fid,
+               .get = rtl8366_sw_get_vlan_fid,
        },
 };
 
@@ -1027,7 +1034,7 @@ static struct rtl8366_smi_ops rtl8366s_smi_ops = {
        .enable_vlan4k  = rtl8366s_enable_vlan4k,
 };
 
-static int __init rtl8366s_probe(struct platform_device *pdev)
+static int __devinit rtl8366s_probe(struct platform_device *pdev)
 {
        static int rtl8366_smi_version_printed;
        struct rtl8366s_platform_data *pdata;