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

Archive Download this file

Revision: 1984