コード例 #1
0
ファイル: cpsw_ale.c プロジェクト: 3null/linux
static void cpsw_ale_flush_ucast(struct cpsw_ale *ale, u32 *ale_entry,
				 int port_mask)
{
	int port;

	port = cpsw_ale_get_port_num(ale_entry);
	if ((BIT(port) & port_mask) == 0)
		return; /* ports dont intersect, not interested */
	cpsw_ale_set_entry_type(ale_entry, ALE_TYPE_FREE);
}
コード例 #2
0
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;
}