Chameleon

Chameleon Svn Source Tree

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

Archive Download this file

Revision: 2178