summaryrefslogtreecommitdiff
path: root/promisc.c
blob: 32184b12e13753e9ad31ffb95a4a9ae42cf234c4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#include <string.h>
#include <sys/socket.h>
#include <linux/if.h>

#include "promisc.h"
#include "dev.h"

short enter_promiscuous_mode(char *ifname)
{
	short ifflags;

	if (!strncmp("any", ifname, strlen("any")))
		return 0;

	ifflags = device_get_flags(ifname);
	device_set_flags(ifname, ifflags | IFF_PROMISC);

	return ifflags;
}

void leave_promiscuous_mode(char *ifname, short oldflags)
{
	if (!strncmp("any", ifname, strlen("any")))
		return;

	device_set_flags(ifname, oldflags);
}
-next.git/patch/?id=937b682cc0bcebe19df7911f3697be7fd8c5dee6'>patch) treebc21eb127069d9958de78ac639de74a4932b310d parentaf7170eee6ee269fe1d4f5cbd276bafc2ce064b8 (diff)
mlxsw: reg: Add Policy-Engine Rules Copy Register
The PRCR register is used for accessing rules within a TCAM region. Signed-off-by: Jiri Pirko <jiri@mellanox.com> Reviewed-by: Ido Schimmel <idosch@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat
-rw-r--r--drivers/net/ethernet/mellanox/mlxsw/reg.h77
1 files changed, 77 insertions, 0 deletions
diff --git a/drivers/net/ethernet/mellanox/mlxsw/reg.h b/drivers/net/ethernet/mellanox/mlxsw/reg.h