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);
}
id=b404bcfbf035413dcce539c8ba2c9986d220d8ed'>367fa8e8ca12f8eb8e22982a1bed6aed3edd1b42 parent92e963f50fc74041b5e9e744c330dca48e04f08d (diff)
PCI: Add ACS quirk for all Cavium devices
Cavium devices matching this quirk do not perform peer-to-peer with other functions, allowing masking out these bits as if they were unimplemented in the ACS capability. Signed-off-by: Manish Jaggi <mjaggi@caviumnetworks.com> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Acked-by: Tirumalesh Chalamarla <tchalamarla@cavium.com>
Diffstat