XenevaOS
Loading...
Searching...
No Matches
audrv.h
Go to the documentation of this file.
1
30#ifndef __AU_DRV_H__
31#define __AU_DRV_H__
32
33#include <stdint.h>
34#ifdef ARCH_X64
35#include <Hal\x86_64_hal.h>
36#include <Hal\hal.h>
37#endif
38#include <Fs\vfs.h>
39
40#define DRIVER_CLASS_AUDIO 1
41#define DRIVER_CLASS_VIDEO 2
42#define DRIVER_CLASS_NETWORK 3
43#define DRIVER_CLASS_CONNECTIVITY_BLUETOOTH 4
44#define DRIVER_CLASS_CONNECTIVITY_WIFI 5
45#define DRIVER_CLASS_STORAGE 6
46#define DRIVER_CLASS_USB 7
47#define DRIVER_CLASS_HID 8
48#define DRIVER_CLASS_UNKNOWN 9
49
50#define DEVICE_CLASS_ETHERNET 1
51#define DEVICE_CLASS_HD_AUDIO 2
52#define DEVICE_CLASS_USB3 3
53
54#define AURORA_MAX_DRIVERS 256
55
56
57typedef int(*au_drv_entry)();
58typedef int(*au_drv_unload)();
59
60#pragma pack(push,1)
71#pragma pack(pop)
72
73#pragma pack(push,1)
82#pragma pack(pop)
83
84/*
85* AuDrvMngrInitialize -- Initialize the driver manager
86* @param info -- kernel boot info
87*/
88extern void AuDrvMngrInitialize(KERNEL_BOOT_INFO *info);
89
90/*
91* AuRegisterDevice -- register a new device to
92* aurora system
93* @param dev -- Pointer to device to add
94*/
96
97/*
98* AuCheckDevice -- checks an aurora device if it's
99* already present
100* @param classC -- class code of the device to check
101* @param subclassC -- sub class code of the device to check
102* @param progIF -- programming interface of the device
103*/
104AU_EXTERN AU_EXPORT bool AuCheckDevice(uint16_t classC, uint16_t subclassC, uint8_t progIF);
105
106/*
107 * AuBootDriverInitialise -- Initialise and load all boot time drivers
108 * @param info -- Kernel boot information passed by XNLDR
109 * [TODO] : Everything is hard coded for now
110 */
112
113/*
114 * AuDrvMgrGetBaseAddress -- returns the current
115 * driver load base address
116 */
118
119/*
120 * AuDrvMgrSetBaseAddress -- sets a new base
121 * address for driver to load
122 * it's highly risky because, if we set it to
123 * kernel stack location, kernel will crash
124 */
125extern void AuDrvMgrSetBaseAddress(uint64_t base_address);
126
127/*
128* AuGetConfEntry -- Get an entry offset in the file for required device
129* @param vendor_id -- vendor id of the product
130* @param device_id -- device id of the product
131* @param buffer -- configuration file buffer
132* @param entryoff -- entry offset from where search begins
133*/
134extern char* AuGetConfEntry(uint32_t vendor_id, uint32_t device_id, uint8_t* buffer, int entryoff);
135
136/*
137* AuGetDriverName -- Extract the driver path from its entry offset
138* @param vendor_id -- vendor id of the product
139* @param device_id -- device id of the product
140* @param buffer -- configuration file buffer
141* @param entryoff -- entry offset from where search begins
142*/
143extern void AuGetDriverName(uint32_t vendor_id, uint32_t device_id, uint8_t* buffer, int entryoff);
144
145
146#endif
#define AU_EXTERN
Definition aurora.h:50
#define AU_EXPORT
Definition aurora.h:38
unsigned int uint32_t
Definition acefiex.h:163
unsigned char uint8_t
Definition acefiex.h:161
COMPILER_DEPENDENT_UINT64 uint64_t
Definition acefiex.h:165
unsigned short int uint16_t
Definition acefiex.h:162
uint64_t AuDrvMgrGetBaseAddress()
AuDrvMgrGetBaseAddress – returns the current driver load base address.
Definition audrv.cpp:428
int(* au_drv_unload)()
Definition audrv.h:58
void AuGetDriverName(uint32_t vendor_id, uint32_t device_id, uint8_t *buffer, int entryoff)
AuGetDriverName – Extract the driver path from its entry offset.
Definition audrv.cpp:199
AU_EXTERN AU_EXPORT void AuBootDriverInitialise(KERNEL_BOOT_INFO *info)
AuBootDriverInitialise – Initialise and load all boot time drivers.
Definition audrv.cpp:395
char * AuGetConfEntry(uint32_t vendor_id, uint32_t device_id, uint8_t *buffer, int entryoff)
AuGetConfEntry – Get an entry offset in the file for required device.
Definition audrv.cpp:91
void AuDrvMngrInitialize(KERNEL_BOOT_INFO *info)
AuDrvMngrInitialize – Initialize the driver manager.
Definition audrv.cpp:283
AU_EXTERN AU_EXPORT bool AuCheckDevice(uint16_t classC, uint16_t subclassC, uint8_t progIF)
AuCheckDevice – checks an aurora device if it's already present.
Definition audrv.cpp:357
struct _aurora_device_ AuDevice
void AuDrvMgrSetBaseAddress(uint64_t base_address)
AuDrvMgrSetBaseAddress – sets a new base address for driver to load it's highly risky because,...
Definition audrv.cpp:438
struct _aurora_driver_ AuDriver
AU_EXTERN AU_EXPORT void AuRegisterDevice(AuDevice *dev)
AuRegisterDevice – register a new device to aurora system.
Definition audrv.cpp:345
int(* au_drv_entry)()
Definition audrv.h:57
Definition aurora.h:99
Definition audrv.h:74
uint8_t progIf
Definition audrv.h:77
uint16_t subClassCode
Definition audrv.h:76
uint8_t aurora_dev_class
Definition audrv.h:79
uint8_t aurora_driver_class
Definition audrv.h:80
uint16_t classCode
Definition audrv.h:75
bool initialized
Definition audrv.h:78
Definition audrv.h:61
uint64_t base
Definition audrv.h:66
uint8_t drv_type
Definition audrv.h:63
bool present
Definition audrv.h:65
au_drv_unload unload
Definition audrv.h:69
uint64_t end
Definition audrv.h:67
au_drv_entry entry
Definition audrv.h:68
char name[32]
Definition audrv.h:64
uint8_t id
Definition audrv.h:62