HaikuDepot: notify work status from main window
[haiku.git] / src / libs / compat / freebsd11_network / device.h
blob9a63201b329c62322a6425435b6a4de7075ea4a3
1 /*
2 * Copyright 2009, Colin Günther, coling@gmx.de. All Rights Reserved.
3 * Copyright 2007, Axel Dörfler, axeld@pinc-software.de. All Rights Reserved.
4 * Copyright 2007, Hugo Santos. All Rights Reserved.
5 * Copyright 2004, Marcus Overhagen. All Rights Reserved.
6 * Distributed under the terms of the MIT License.
7 */
8 #ifndef DEVICE_H
9 #define DEVICE_H
12 #include <stdint.h>
13 #include <stdio.h>
15 #include <KernelExport.h>
16 #include <drivers/PCI.h>
18 #include <util/list.h>
20 #include <net_stack.h>
22 #include <compat/sys/kernel.h>
23 #include <compat/net/if.h>
25 #include "shared.h"
27 #ifdef __cplusplus
28 extern "C" {
29 #endif
31 struct root_device_softc {
32 struct pci_info pci_info;
33 bool is_msi;
34 bool is_msix;
37 enum {
38 DEVICE_OPEN = 1 << 0,
39 DEVICE_CLOSED = 1 << 1,
40 DEVICE_NON_BLOCK = 1 << 2,
41 DEVICE_DESC_ALLOCED = 1 << 3,
42 DEVICE_ATTACHED = 1 << 4
46 extern struct net_stack_module_info *gStack;
47 extern pci_module_info *gPci;
48 extern struct pci_x86_module_info *gPCIx86;
51 static inline void
52 __unimplemented(const char *method)
54 char msg[128];
55 snprintf(msg, sizeof(msg), "fbsd compat, unimplemented: %s", method);
56 panic(msg);
59 #define UNIMPLEMENTED() __unimplemented(__FUNCTION__)
61 status_t init_mbufs(void);
62 void uninit_mbufs(void);
64 status_t init_mutexes(void);
65 void uninit_mutexes(void);
67 status_t init_taskqueues(void);
68 void uninit_taskqueues(void);
70 status_t init_hard_clock(void);
71 void uninit_hard_clock(void);
73 status_t init_callout(void);
74 void uninit_callout(void);
76 device_t find_root_device(int);
78 /* busdma_machdep.c */
79 void init_bounce_pages(void);
80 void uninit_bounce_pages(void);
82 void driver_printf(const char *format, ...)
83 __attribute__ ((format (__printf__, 1, 2)));
84 void driver_vprintf(const char *format, va_list vl);
86 void device_sprintf_name(device_t dev, const char *format, ...)
87 __attribute__ ((format (__printf__, 2, 3)));
89 void ifq_init(struct ifqueue *, const char *);
90 void ifq_uninit(struct ifqueue *);
92 #ifdef __cplusplus
94 #endif
96 #endif /* DEVICE_H */