/* * netsniff-ng - the packet sniffing beast * Copyright 2009, 2010 Daniel Borkmann. * Subject to the GPL, version 2. */ #include #include #include #include #include #include #include #include #include #include "xmalloc.h" #include "die.h" #include "ring.h" #include "built_in.h" void mmap_ring_generic(int sock, struct ring *ring) { ring->mm_space = mmap(0, ring->mm_len, PROT_READ | PROT_WRITE, MAP_SHARED | MAP_LOCKED | MAP_POPULATE, sock, 0); if (ring->mm_space == MAP_FAILED) panic("Cannot mmap {TX,RX}_RING!\n"); } void alloc_ring_frames_generic(struct ring *ring, int num, size_t size) { int i; size_t len = num * sizeof(*ring->frames); ring->frames = xmalloc_aligned(len, CO_CACHE_LINE_SIZE); fmemset(ring->frames, 0, len); for (i = 0; i < num; ++i) { ring->frames[i].iov_len = size; ring->frames[i].iov_base = ring->mm_space + (i * size); } } void bind_ring_generic(int sock, struct ring *ring, int ifindex) { int ret; /* The {TX,RX}_RING registers itself to the networking stack with * dev_add_pack(), so we have one single RX_RING for all devs * otherwise you'll get the packet twice. */ fmemset(&ring->s_ll, 0, sizeof(ring->s_ll)); ring->s_ll.sll_family = AF_PACKET; ring->s_ll.sll_protocol = htons(ETH_P_ALL); ring->s_ll.sll_ifindex = ifindex; ring->s_ll.sll_hatype = 0; ring->s_ll.sll_halen = 0; ring->s_ll.sll_pkttype = 0; ret = bind(sock, (struct sockaddr *) &ring->s_ll, sizeof(ring->s_ll)); if (ret < 0) panic("Cannot bind {TX,RX}_RING!\n"); } t-next.git/refs/?h=nds-private-remove&id=b5db361eb7746cc9ada51554a6b996170c439f0b'>refslogtreecommitdiff
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2016-08-10 23:54:10 +0200
committerPhilipp Zabel <p.zabel@pengutronix.de>2016-08-11 08:42:01 +0200
commitb5db361eb7746cc9ada51554a6b996170c439f0b (patch)
tree07baac515af0d82b9c56c178618bf8ada948ac45
parent851da9ac53a5e7121f7c38a052f74b574dd73ec3 (diff)
drm/mediatek: add CONFIG_OF dependency
The mediatek DRM driver can be configured for compile testing with CONFIG_OF disabled, but then fails to link: drivers/gpu/built-in.o: In function `mtk_drm_bind': analogix_dp_reg.c:(.text+0x52888): undefined reference to `of_find_device_by_node' analogix_dp_reg.c:(.text+0x52930): undefined reference to `of_find_device_by_node' This adds an explicit Kconfig dependency. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Link: https://patchwork.kernel.org/patch/9120871/ Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
-rw-r--r--drivers/gpu/drm/mediatek/Kconfig1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/gpu/drm/mediatek/Kconfig b/drivers/gpu/drm/mediatek/Kconfig