summaryrefslogtreecommitdiffstats
path: root/sys/net/bpfdesc.h
diff options
context:
space:
mode:
authorrwatson <rwatson@FreeBSD.org>2004-09-09 00:19:27 +0000
committerrwatson <rwatson@FreeBSD.org>2004-09-09 00:19:27 +0000
commitc30a3c01a10dd20c3319c39e0201b6c5852a357c (patch)
tree15ec106212b51b6e139dea42d2a3e830b5466f97 /sys/net/bpfdesc.h
parenta43f8c237d71208d31dd8f3fb3e10e51da52b2a8 (diff)
downloadFreeBSD-src-c30a3c01a10dd20c3319c39e0201b6c5852a357c.zip
FreeBSD-src-c30a3c01a10dd20c3319c39e0201b6c5852a357c.tar.gz
Reformulate use of linked lists in 'struct bpf_d' and 'struct bpf_if'
to use queue(3) list macros rather than hand-crafted lists. While here, move to doubly linked lists to eliminate iterating lists in order to remove entries. This change simplifies and clarifies the list logic in the BPF descriptor code as a first step towards revising the locking strategy. RELENG_5 candidate. Reviewed by: fenner
Diffstat (limited to 'sys/net/bpfdesc.h')
-rw-r--r--sys/net/bpfdesc.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/net/bpfdesc.h b/sys/net/bpfdesc.h
index ef03b70..3561927 100644
--- a/sys/net/bpfdesc.h
+++ b/sys/net/bpfdesc.h
@@ -41,12 +41,13 @@
#include <sys/callout.h>
#include <sys/selinfo.h>
+#include <sys/queue.h>
/*
* Descriptor associated with each open bpf file.
*/
struct bpf_d {
- struct bpf_d *bd_next; /* Linked list of descriptors */
+ LIST_ENTRY(bpf_d) bd_next; /* Linked list of descriptors */
/*
* Buffer slots: two mbuf clusters buffer the incoming packets.
* The model has three slots. Sbuf is always occupied.
@@ -113,8 +114,8 @@ struct bpf_d {
* Descriptor associated with each attached hardware interface.
*/
struct bpf_if {
- struct bpf_if *bif_next; /* list of all interfaces */
- struct bpf_d *bif_dlist; /* descriptor list */
+ LIST_ENTRY(bpf_if) bif_next; /* list of all interfaces */
+ LIST_HEAD(, bpf_d) bif_dlist; /* descriptor list */
struct bpf_if **bif_driverp; /* pointer into softc */
u_int bif_dlt; /* link layer type */
u_int bif_hdrlen; /* length of header (with padding) */
OpenPOWER on IntegriCloud