xref: /haiku/src/libs/compat/openbsd_network/compat/net/ifq.h (revision f8a90df5fd348427c6475bcca99ba87dbe3afb89)
1 /*
2  * Copyright 2022, Haiku, Inc. All rights reserved.
3  * Distributed under the terms of the MIT License.
4  */
5 #ifndef _OBSD_COMPAT_NET_IFQ_H_
6 #define _OBSD_COMPAT_NET_IFQ_H_
7 
8 
9 #define ifq_purge(IFQ)				IFQ_PURGE(IFQ)
10 #define ifq_set_maxlen(IFQ, LEN)	IFQ_SET_MAXLEN(IFQ, LEN)
11 
12 #define ifq_is_oactive(IFQ) ((if_getdrvflags(ifp) & IFF_DRV_OACTIVE) != 0)
13 #define ifq_set_oactive(IFQ) if_setdrvflagbits(ifp, IFF_DRV_OACTIVE, 0)
14 #define ifq_clr_oactive(IFQ) if_setdrvflagbits(ifp, 0, IFF_DRV_OACTIVE)
15 
16 
17 static void
ifq_serialize(struct ifaltq * ifq,struct task * t)18 ifq_serialize(struct ifaltq* ifq, struct task* t)
19 {
20 	task_add(systq, t);
21 }
22 
23 
24 static void
ifq_barrier(struct ifaltq * ifq)25 ifq_barrier(struct ifaltq* ifq)
26 {
27 	taskqueue_drain_all(taskqueue_fast);
28 }
29 
30 
31 #endif	/* _OBSD_COMPAT_NET_IFQ_H_ */
32