Chameleon

Chameleon Svn Source Tree

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

Archive Download this file

Revision: 1977