Chameleon

Chameleon Svn Source Tree

Root/branches/Chimera/i386/libsaio/device_inject.h

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#define DEV_PROP_DEVICE_MAX_ENTRIES 64
15
16extern struct DevPropString *string;
17extern uint8_t *stringdata;
18extern uint32_t stringlength;
19
20extern void setupDeviceProperties(Node *node);
21
22struct ACPIDevPath {
23uint8_ttype;// = 2 ACPI device-path
24uint8_tsubtype;// = 1 ACPI Device-path
25uint16_tlength;// = 0x0c
26uint32_t_HID;// = 0xD041030A ?
27uint32_t_UID;// = 0x00000000 PCI ROOT
28};
29
30struct PCIDevPath {
31uint8_ttype;// = 1 Hardware device-path
32uint8_tsubtype;// = 1 PCI
33uint16_tlength;// = 6
34uint8_tfunction;// pci func number
35uint8_tdevice;// pci dev number
36};
37
38struct DevicePathEnd {
39uint8_ttype;// = 0x7f
40uint8_tsubtype;// = 0xff
41uint16_tlength;// = 4;
42};
43
44struct DevPropDevice {
45uint32_t length;
46uint16_t numentries;
47uint16_t WHAT2;// 0x0000 ?
48struct ACPIDevPath acpi_dev_path;// = 0x02010c00 0xd041030a
49struct PCIDevPath pci_dev_path[MAX_PCI_DEV_PATHS]; // = 0x01010600 func dev
50struct DevicePathEnd path_end;// = 0x7fff0400
51uint8_t *data;
52
53// ------------------------
54uint8_t num_pci_devpaths;
55struct DevPropString *string;
56// ------------------------
57};
58
59struct DevPropString {
60uint32_t length;
61uint32_t WHAT2;// 0x01000000 ?
62uint16_t numentries;
63uint16_t WHAT3;// 0x0000 ?
64struct DevPropDevice **entries;
65};
66
67char*efi_inject_get_devprop_string(uint32_t *len);
68intdevprop_add_network_template(struct DevPropDevice *device, uint16_t vendor_id);
69struct DevPropString*devprop_create_string(void);
70struct DevPropDevice*devprop_add_device(struct DevPropString *string, char *path);
71intdevprop_add_value(struct DevPropDevice *device, char *nm, uint8_t *vl, uint32_t len);
72char*devprop_generate_string(struct DevPropString *string);
73voiddevprop_free_string(struct DevPropString *string);
74
75#endif /* !__LIBSAIO_DEVICE_INJECT_H */
76

Archive Download this file

Revision: 2249