static int cpsw_ale_dump_ucast(u32 *ale_entry, char *buf, int len) { int outlen = 0; static const char *str_ucast_type[] = {"persistant", "untouched", "oui", "touched"}; int ucast_type = cpsw_ale_get_ucast_type(ale_entry); int port_num = cpsw_ale_get_port_num(ale_entry); int secure = cpsw_ale_get_secure(ale_entry); int blocked = cpsw_ale_get_blocked(ale_entry); outlen += snprintf(buf + outlen, len - outlen, "uctype: %s(%d), ", str_ucast_type[ucast_type], ucast_type); outlen += snprintf(buf + outlen, len - outlen, "port: %d%s%s\n", port_num, secure ? ", Secure" : "", blocked ? ", Blocked" : ""); return outlen; }
static int cpsw_ale_find_ageable(struct cpsw_ale *ale) { u32 ale_entry[ALE_ENTRY_WORDS]; int type, idx; for (idx = 0; idx < ale->params.ale_entries; idx++) { cpsw_ale_read(ale, idx, ale_entry); type = cpsw_ale_get_entry_type(ale_entry); if (type != ALE_TYPE_ADDR && type != ALE_TYPE_VLAN_ADDR) continue; if (cpsw_ale_get_mcast(ale_entry)) continue; type = cpsw_ale_get_ucast_type(ale_entry); if (type != ALE_UCAST_PERSISTANT && type != ALE_UCAST_OUI) return idx; } return -ENOENT; }