summaryrefslogtreecommitdiff
path: root/ring_rx.h
blob: 8bf439b0a7eb9d3abbd10c2e34a7c24a5c1ad463 (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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/*
 * netsniff-ng - the packet sniffing beast
 * Copyright 2009, 2010 Daniel Borkmann.
 * Subject to the GPL, version 2.
 */

#ifndef RX_RING_H
#define RX_RING_H

#include <stdbool.h>

#include "ring.h"
#include "built_in.h"

extern void destroy_rx_ring(int sock, struct ring *ring);
extern void create_rx_ring(int sock, struct ring *ring, int verbose);
extern void mmap_rx_ring(int sock, struct ring *ring);
extern void alloc_rx_ring_frames(int sock, struct ring *ring);
extern void bind_rx_ring(int sock, struct ring *ring, int ifindex);
extern void setup_rx_ring_layout(int sock, struct ring *ring,
				 unsigned int size, bool jumbo_support, bool v3);
extern void sock_rx_net_stats(int sock, unsigned long seen);

static inline int user_may_pull_from_rx(struct tpacket2_hdr *hdr)
{
	return ((hdr->tp_status & TP_STATUS_USER) == TP_STATUS_USER);
}

static inline int user_may_pull_from_rx_block(struct block_desc *pbd)
{
	return ((pbd->h1.block_status & TP_STATUS_USER) == TP_STATUS_USER);
}

static inline void kernel_may_pull_from_rx(struct tpacket2_hdr *hdr)
{
	hdr->tp_status = TP_STATUS_KERNEL;
}

static inline void kernel_may_pull_from_rx_block(struct block_desc *pbd)
{
	pbd->h1.block_status = TP_STATUS_KERNEL;
}

#endif /* RX_RING_H */
2' class='oid'>1812e794803bddf1f70f9931193ae1560ff459b7 /Documentation/devicetree parent768e66686cfe83f786f6ae26f1799cca69e80523 (diff)
regulator: gpio: check return value of of_get_named_gpio
At boot time the regulator driver can be initialized before the gpio, in which case the call to of_get_named_gpio will return EPROBE_DEFER. This value is silently passed to regulator_register which will return success, although the gpio is not registered (regulator_ena_gpio_request not called) as the value passed is detected as invalid. The gpio_regulator_probe will therefore succeed win no gpio requested. Signed-off-by: Mihai Mihalache <mihai.d.mihalache@intel.com> Reviewed-by: Hans Holmberg <hans.holmberg@intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'Documentation/devicetree')