xref: /haiku/src/add-ons/kernel/drivers/network/ether/usb_rndis/Driver.h (revision 97f11716bfaa0f385eb0e28a52bf56a5023b9e99)
1*b2489546SPulkoMandy /*
2*b2489546SPulkoMandy 	Driver for USB RNDIS network devices
3*b2489546SPulkoMandy 	Copyright (C) 2022 Adrien Destugues <pulkomandy@pulkomandy.tk>
4*b2489546SPulkoMandy 	Distributed under the terms of the MIT license.
5*b2489546SPulkoMandy */
6*b2489546SPulkoMandy #ifndef _USB_RNDIS_DRIVER_H_
7*b2489546SPulkoMandy #define _USB_RNDIS_DRIVER_H_
8*b2489546SPulkoMandy 
9*b2489546SPulkoMandy #include <Drivers.h>
10*b2489546SPulkoMandy #include <KernelExport.h>
11*b2489546SPulkoMandy #include <OS.h>
12*b2489546SPulkoMandy #include <USB3.h>
13*b2489546SPulkoMandy #include <drivers/usb/USB_cdc.h>
14*b2489546SPulkoMandy 
15*b2489546SPulkoMandy #include <util/kernel_cpp.h>
16*b2489546SPulkoMandy 
17*b2489546SPulkoMandy #define DRIVER_NAME	"usb_rndis"
18*b2489546SPulkoMandy #define MAX_DEVICES	8
19*b2489546SPulkoMandy 
20*b2489546SPulkoMandy extern usb_module_info *gUSBModule;
21*b2489546SPulkoMandy 
22*b2489546SPulkoMandy extern "C" {
23*b2489546SPulkoMandy status_t	usb_rndis_device_added(usb_device device, void **cookie);
24*b2489546SPulkoMandy status_t	usb_rndis_device_removed(void *cookie);
25*b2489546SPulkoMandy 
26*b2489546SPulkoMandy status_t	init_hardware();
27*b2489546SPulkoMandy void		uninit_driver();
28*b2489546SPulkoMandy 
29*b2489546SPulkoMandy const char **publish_devices();
30*b2489546SPulkoMandy device_hooks *find_device(const char *name);
31*b2489546SPulkoMandy }
32*b2489546SPulkoMandy 
33*b2489546SPulkoMandy #if TRACE_RNDIS
34*b2489546SPulkoMandy #define TRACE(x...)			dprintf(DRIVER_NAME ": " x)
35*b2489546SPulkoMandy #else
36*b2489546SPulkoMandy #define TRACE(x...)
37*b2489546SPulkoMandy #endif
38*b2489546SPulkoMandy #define TRACE_ALWAYS(x...)	dprintf(DRIVER_NAME ": " x)
39*b2489546SPulkoMandy 
40*b2489546SPulkoMandy #endif //_USB_RNDIS_DRIVER_H_
41