Changeset 22704


Ignore:
Timestamp:
2010-08-18T18:00:39+02:00 (7 years ago)
Author:
juhosg
Message:

generic: rtl8366: allow use of VIDs 16-4095 if vlan4k is enabled

Location:
trunk/target/linux/generic/files/drivers/net/phy
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/target/linux/generic/files/drivers/net/phy/rtl8366rb.c

    r22703 r22704  
    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 
     
    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); 
  • trunk/target/linux/generic/files/drivers/net/phy/rtl8366s.c

    r22703 r22704  
    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 
     
    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); 
Note: See TracChangeset for help on using the changeset viewer.