尊敬的 TI:
我们使用 Linux SDK 0805 Linux 本机驱动程序来测试环境、我们要在 Linux 中设置 ALE VLAN 条目、
这是否受支持?
我们看到有些示例"为 A72添加多播条目"和"仅为端口1添加 A72的 VLAN 条目"
在 RTOS [常见问题解答] TDA4VM:如何配置 CPSW 5G/9G ALE -处理器论坛-处理器- TI E2E 支持论坛
,Linux 是否可以按照相同的设置运行?
我们找到了以下 Linux API、 这些 API 是否可以用于设置? 有没有其他相关示例
int cpsw_ale_add_mcast (struct cpsw_ale * ale、const u8 * addr、int port_mask、
int 标志、u16 vid、int mcast_state)
{
u32 ale_entry[ale_entry_words]={0、0、0};
int idx、mask;
idx = cpsw_ale_match_addr (ale、addr、(flags & ale_vlan)? VID:0);
如果(IDx >= 0)
½ cpsw_ale_read (ale、idx、ale_entry);
cpsw_ale_set_vlan_entry_type (ale_entry、flags、vid);
cpsw_ale_set_addr (ale_entry、addr);
cpsw_ale_set_super (ale_entry、(flags & ale_super)? 1:0);
cpsw_ale_set_mcast_state (ale_entry、mcast_state);
MASK = cpsw_ale_get_port_mask (ale_entry、
ALE->PORT_MASK_BITS);
PORT_MASK |= MASK;
cpsw_ale_set_port_mask (ale_entry、port_mask、
ALE->PORT_MASK_BITS);
如果(Idx < 0)
IDx = cpsw_ale_match_free (ale);
如果(Idx < 0)
IDx = cpsw_ale_find_ageable (ale);
如果(Idx < 0)
返回-ENOMEM;
cpsw_ale_write (ale、idx、ale_entry);
返回0;
}
int cpsw_ale_add_uccast (struct cpsw_ale * ale、const u8 * addr、int port、
int flags、U16 vid)
{
u32 ale_entry[ale_entry_words]={0、0、0};
内部 idx;
cpsw_ale_set_vlan_entry_type (ale_entry、flags、vid);
cpsw_ale_set_addr (ale_entry、addr);
cpsw_ale_set_ucast_type (ale_entry、ale_UCAST_persistant);
cpsw_ale_set_secure (ale_entry、(flags & ale_secure)? 1:0);
cpsw_ale_set_blocked (ale_entry、flags & ale_blocked)? 1:0);
cpsw_ale_set_port_num (ale_entry、port、ale->port_num_bits);
idx = cpsw_ale_match_addr (ale、addr、(flags & ale_vlan)? VID:0);
如果(Idx < 0)
IDx = cpsw_ale_match_free (ale);
如果(Idx < 0)
IDx = cpsw_ale_find_ageable (ale);
如果(Idx < 0)
返回-ENOMEM;
cpsw_ale_write (ale、idx、ale_entry);
返回0;
}
int cpsw_ale_add_vlan (struct cpsw_ale *ale、u16 vid、int port_mask、int untag、
int reg_mcast、int unreg_mcast)
{
u32 ale_entry[ale_entry_words]={0、0、0};
内部 idx;
idx = cpsw_ale_match_vlan (ale、vid);
如果(IDx >= 0)
cpsw_ale_read (ale、idx、ale_entry);
cpsw_ale_set_entry_type (ale_entry、ale_type_vlan);
cpsw_ale_set_vlan_id (ale_entry、vid);
cpsw_ale_set_vlan_undtag (ale、ale_entry、vid、undag);
如果(!ale->params.nu_switch_ale){
cpsw_ale_vlan_set_fld (ale、ale_entry、
ALE_ENT_VID_REG_MCAST_MSK、REG_MCAST);
cpsw_ale_vlan_set_fld (ale、ale_entry、
ALE_ENT_VID_UNREG_MCAST_MSK、UNREG_MCAST);
}其他{
cpsw_ale_vlan_set_fld (ale、ale_entry、
ALE_ENT_VID_UNREG_MCAST_IDX、
NU_VLAN_UNREG_MCast_IDX);
cpsw_ale_set_vlan_mcast (ale、ale_entry、reg_mcast、unreg_mcast);
}
cpsw_ale_vlan_set_fld (ale、ale_entry、
ALE_ENT_VID_MEMBER_LIST、PORT_MASK);
如果(Idx < 0)
IDx = cpsw_ale_match_free (ale);
如果(Idx < 0)
IDx = cpsw_ale_find_ageable (ale);
如果(Idx < 0)
返回-ENOMEM;
cpsw_ale_write (ale、idx、ale_entry);
返回0;
}
