mirror of
git://projects.qi-hardware.com/openwrt-xburst.git
synced 2024-12-24 22:06:31 +02:00
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
This commit is contained in:
parent
356b45cef3
commit
0c4c78bf4c
@ -554,7 +554,12 @@ static int rtl8366rb_set_mc_index(struct rtl8366_smi *smi, int port, int index)
|
|||||||
|
|
||||||
static int rtl8366rb_is_vlan_valid(struct rtl8366_smi *smi, unsigned vlan)
|
static int rtl8366rb_is_vlan_valid(struct rtl8366_smi *smi, unsigned vlan)
|
||||||
{
|
{
|
||||||
if (vlan == 0 || vlan >= RTL8366RB_NUM_VLANS)
|
unsigned max = RTL8366RB_NUM_VLANS;
|
||||||
|
|
||||||
|
if (smi->vlan4k_enabled)
|
||||||
|
max = RTL8366RB_NUM_VIDS - 1;
|
||||||
|
|
||||||
|
if (vlan == 0 || vlan >= max)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
@ -882,7 +887,7 @@ static int rtl8366rb_switch_init(struct rtl8366_smi *smi)
|
|||||||
dev->name = "RTL8366RB";
|
dev->name = "RTL8366RB";
|
||||||
dev->cpu_port = RTL8366RB_PORT_NUM_CPU;
|
dev->cpu_port = RTL8366RB_PORT_NUM_CPU;
|
||||||
dev->ports = RTL8366RB_NUM_PORTS;
|
dev->ports = RTL8366RB_NUM_PORTS;
|
||||||
dev->vlans = RTL8366RB_NUM_VLANS;
|
dev->vlans = RTL8366RB_NUM_VIDS;
|
||||||
dev->ops = &rtl8366_ops;
|
dev->ops = &rtl8366_ops;
|
||||||
dev->devname = dev_name(smi->parent);
|
dev->devname = dev_name(smi->parent);
|
||||||
|
|
||||||
|
@ -593,7 +593,12 @@ static int rtl8366s_enable_vlan4k(struct rtl8366_smi *smi, int enable)
|
|||||||
|
|
||||||
static int rtl8366s_is_vlan_valid(struct rtl8366_smi *smi, unsigned vlan)
|
static int rtl8366s_is_vlan_valid(struct rtl8366_smi *smi, unsigned vlan)
|
||||||
{
|
{
|
||||||
if (vlan == 0 || vlan >= RTL8366S_NUM_VLANS)
|
unsigned max = RTL8366S_NUM_VLANS;
|
||||||
|
|
||||||
|
if (smi->vlan4k_enabled)
|
||||||
|
max = RTL8366S_NUM_VIDS - 1;
|
||||||
|
|
||||||
|
if (vlan == 0 || vlan >= max)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
@ -909,7 +914,7 @@ static int rtl8366s_switch_init(struct rtl8366_smi *smi)
|
|||||||
dev->name = "RTL8366S";
|
dev->name = "RTL8366S";
|
||||||
dev->cpu_port = RTL8366S_PORT_NUM_CPU;
|
dev->cpu_port = RTL8366S_PORT_NUM_CPU;
|
||||||
dev->ports = RTL8366S_NUM_PORTS;
|
dev->ports = RTL8366S_NUM_PORTS;
|
||||||
dev->vlans = RTL8366S_NUM_VLANS;
|
dev->vlans = RTL8366S_NUM_VIDS;
|
||||||
dev->ops = &rtl8366_ops;
|
dev->ops = &rtl8366_ops;
|
||||||
dev->devname = dev_name(smi->parent);
|
dev->devname = dev_name(smi->parent);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user