Date:2010-08-18 18:00:39 (2 years 9 months ago)
Author:juhosg
Commit:0c4c78bf4c8df288a664bf6dca154d77ea03f14e
Message:generic: rtl8366: allow use of VIDs 16-4095 if vlan4k is enabled

git-svn-id: svn://svn.openwrt.org/openwrt/trunk@22704 3c298f89-4303-0410-b956-a3cf2f4a3e73
Files: 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/rtl8366rb.c
554554
555555static int rtl8366rb_is_vlan_valid(struct rtl8366_smi *smi, unsigned vlan)
556556{
557    if (vlan == 0 || vlan >= RTL8366RB_NUM_VLANS)
557    unsigned max = RTL8366RB_NUM_VLANS;
558
559    if (smi->vlan4k_enabled)
560        max = RTL8366RB_NUM_VIDS - 1;
561
562    if (vlan == 0 || vlan >= max)
558563        return 0;
559564
560565    return 1;
...... 
882887    dev->name = "RTL8366RB";
883888    dev->cpu_port = RTL8366RB_PORT_NUM_CPU;
884889    dev->ports = RTL8366RB_NUM_PORTS;
885    dev->vlans = RTL8366RB_NUM_VLANS;
890    dev->vlans = RTL8366RB_NUM_VIDS;
886891    dev->ops = &rtl8366_ops;
887892    dev->devname = dev_name(smi->parent);
888893
target/linux/generic/files/drivers/net/phy/rtl8366s.c
593593
594594static int rtl8366s_is_vlan_valid(struct rtl8366_smi *smi, unsigned vlan)
595595{
596    if (vlan == 0 || vlan >= RTL8366S_NUM_VLANS)
596    unsigned max = RTL8366S_NUM_VLANS;
597
598    if (smi->vlan4k_enabled)
599        max = RTL8366S_NUM_VIDS - 1;
600
601    if (vlan == 0 || vlan >= max)
597602        return 0;
598603
599604    return 1;
...... 
909914    dev->name = "RTL8366S";
910915    dev->cpu_port = RTL8366S_PORT_NUM_CPU;
911916    dev->ports = RTL8366S_NUM_PORTS;
912    dev->vlans = RTL8366S_NUM_VLANS;
917    dev->vlans = RTL8366S_NUM_VIDS;
913918    dev->ops = &rtl8366_ops;
914919    dev->devname = dev_name(smi->parent);
915920

Archive Download the corresponding diff file



interactive