Root/
Source at commit HEAD created 5 years 6 days ago. By ifabio, Few update to kernelPatcher (Credits to CrazyBirdy) | |
---|---|
1 | /*␊ |
2 | *␉Copyright 2009 Jasmin Fazlic All rights reserved.␊ |
3 | */␊ |
4 | /*␊ |
5 | *␉Cleaned and merged by iNDi␊ |
6 | */␊ |
7 | ␊ |
8 | #ifndef __LIBSAIO_DEVICE_INJECT_H␊ |
9 | #define __LIBSAIO_DEVICE_INJECT_H␊ |
10 | ␊ |
11 | #define DP_ADD_TEMP_VAL(dev, val) devprop_add_value(dev, (char*)val[0], (uint8_t*)val[1], strlen(val[1]) + 1)␊ |
12 | #define DP_ADD_TEMP_VAL_DATA(dev, val) devprop_add_value(dev, (char*)val.name, (uint8_t*)val.data, val.size)␊ |
13 | #define MAX_PCI_DEV_PATHS 4␊ |
14 | ␊ |
15 | #define DEV_PROP_DEVICE_MAX_ENTRIES 64␊ |
16 | ␊ |
17 | extern void setupDeviceProperties(Node *node);␊ |
18 | ␊ |
19 | struct ACPIDevPath {␊ |
20 | ␉uint8_t␉␉type;␉␉// = 2 ACPI device-path␊ |
21 | ␉uint8_t␉␉subtype;␉// = 1 ACPI Device-path␊ |
22 | ␉uint16_t␉length;␉␉// = 0x0c␊ |
23 | ␉uint32_t␉_HID;␉␉// = 0xD041030A ?␊ |
24 | ␉uint32_t␉_UID;␉␉// = 0x00000000 PCI ROOT␊ |
25 | ␉uint32_t␉_CID;␉␉// = Optional variable length␊ |
26 | ␊ |
27 | };␊ |
28 | ␊ |
29 | struct PCIDevPath {␊ |
30 | ␉uint8_t␉␉type;␉␉// = 1 Hardware device-path␊ |
31 | ␉uint8_t␉␉subtype;␉// = 1 PCI␊ |
32 | ␉uint16_t␉length;␉␉// = 6␊ |
33 | ␉uint8_t␉␉function;␉// pci func number␊ |
34 | ␉uint8_t␉␉device;␉␉// pci dev number␊ |
35 | };␊ |
36 | ␊ |
37 | struct DevicePathEnd {␊ |
38 | ␉uint8_t␉␉type;␉␉// = 0x7f␊ |
39 | ␉uint8_t␉␉subtype;␉// = 0xff␊ |
40 | ␉uint16_t␉length;␉␉// = 4;␊ |
41 | };␊ |
42 | ␊ |
43 | struct DevPropDevice {␊ |
44 | ␉uint32_t length;␊ |
45 | ␉uint16_t numentries;␊ |
46 | ␉uint16_t WHAT2;␉␉␉␉␉␉␉␉// 0x0000 ?␊ |
47 | ␉struct ACPIDevPath acpi_dev_path;␉␉␉␉␉// = 0x02010c00 0xd041030a␊ |
48 | ␉struct PCIDevPath pci_dev_path[MAX_PCI_DEV_PATHS];␉␉␉// = 0x01010600 func dev␊ |
49 | ␉struct DevicePathEnd path_end;␉␉␉␉␉␉// = 0x7fff0400␊ |
50 | ␉uint8_t *data;␊ |
51 | ␉␊ |
52 | ␉// ------------------------␊ |
53 | ␉uint8_t␉ num_pci_devpaths;␊ |
54 | ␉struct DevPropString *string;␊ |
55 | ␉// ------------------------␊ |
56 | };␊ |
57 | ␊ |
58 | typedef struct DevPropDevice DevPropDevice;␊ |
59 | ␊ |
60 | struct DevPropString {␊ |
61 | ␉uint32_t length;␊ |
62 | ␉uint32_t WHAT2;␉␉␉// 0x01000000 ?␊ |
63 | ␉uint16_t numentries;␊ |
64 | ␉uint16_t WHAT3;␉␉␉// 0x0000 ?␊ |
65 | ␉struct DevPropDevice **entries;␊ |
66 | };␊ |
67 | ␊ |
68 | typedef struct DevPropString DevPropString;␊ |
69 | ␊ |
70 | extern DevPropString *string;␊ |
71 | extern uint8_t *stringdata;␊ |
72 | extern uint32_t stringlength;␊ |
73 | ␊ |
74 | DevPropString␉␉*devprop_create_string(void);␊ |
75 | DevPropDevice␉␉*devprop_add_device(DevPropString *string, char *path);␊ |
76 | char␉␉␉*efi_inject_get_devprop_string(uint32_t *len);␊ |
77 | int␉␉␉devprop_add_value(DevPropDevice *device, char *nm, uint8_t *vl, uint32_t len);␊ |
78 | char␉␉␉*devprop_generate_string(DevPropString *string);␊ |
79 | void␉␉␉devprop_free_string(DevPropString *string);␊ |
80 | ␊ |
81 | int␉␉␉devprop_add_network_template(DevPropDevice *device, uint16_t vendor_id);␊ |
82 | ␊ |
83 | #endif /* !__LIBSAIO_DEVICE_INJECT_H */␊ |
84 |