Chameleon

Chameleon Commit Details

Date:2010-10-10 12:15:56 (13 years 6 months ago)
Author:Kabyl
Commit:582
Parents: 581
Message:added pci subsystem ids fields, to be used later when needed
Changes:
M/branches/Kabyl/i386/libsaio/pci.h
M/branches/Kabyl/i386/libsaio/pci.c

File differences

branches/Kabyl/i386/libsaio/pci.c
8484
8585
8686
87
88
89
90
87
88
89
90
91
9192
9293
9394
......
177178
178179
179180
180
181
181182
182183
184
183185
184186
185187
}
new = (pci_dt_t*)malloc(sizeof(pci_dt_t));
bzero(new, sizeof(pci_dt_t));
new->dev.addr= pci_addr;
new->vendor_id= id & 0xffff;
new->device_id= (id >> 16) & 0xffff;
new->class_id= pci_config_read16(pci_addr, PCI_CLASS_DEVICE);
new->dev.addr= pci_addr;
new->vendor_id= id & 0xffff;
new->device_id= (id >> 16) & 0xffff;
new->subsys_id.subsys_id= pci_config_read32(pci_addr, PCI_SUBSYSTEM_VENDOR_ID);
new->class_id= pci_config_read16(pci_addr, PCI_CLASS_DEVICE);
new->parent= start;
header_type = pci_config_read8(pci_addr, PCI_HEADER_TYPE);
current = pci_dt;
while (current) {
printf("%02x:%02x.%x [%04x] [%04x:%04x] :: %s\n",
printf("%02x:%02x.%x [%04x] [%04x:%04x] (subsys [%04x:%04x]):: %s\n",
current->dev.bits.bus, current->dev.bits.dev, current->dev.bits.func,
current->class_id, current->vendor_id, current->device_id,
current->subsys_id.subsys.vendor_id, current->subsys_id.subsys.device_id,
get_pci_dev_path(current));
dump_pci_dt(current->children);
current = current->next;
branches/Kabyl/i386/libsaio/pci.h
2323
2424
2525
26
26
2727
28
29
30
28
29
3130
32
33
34
31
32
33
34
35
36
37
38
39
40
41
42
43
3544
3645
3746
......
4251
4352
4453
45
46
47
48
49
50
54
55
56
57
58
59
5160
5261
5362
} pci_dev_t;
typedef struct pci_dt_t {
pci_dev_tdev;
pci_dev_tdev;
uint16_tvendor_id;
uint16_tdevice_id;
uint16_tclass_id;
uint16_tvendor_id;
uint16_tdevice_id;
struct pci_dt_t*parent;
struct pci_dt_t*children;
struct pci_dt_t*next;
union {
struct {
uint16_tvendor_id;
uint16_tdevice_id;
}subsys;
uint32_tsubsys_id;
}subsys_id;
uint16_tclass_id;
struct pci_dt_t*parent;
struct pci_dt_t*children;
struct pci_dt_t*next;
} pci_dt_t;
#define PCIADDR(bus, dev, func)(1 << 31) | (bus << 16) | (dev << 11) | (func << 8)
extern uint8_tpci_config_read8(uint32_t, uint8_t);
extern uint16_tpci_config_read16(uint32_t, uint8_t);
extern uint32_tpci_config_read32(uint32_t, uint8_t);
extern voidpci_config_write8(uint32_t, uint8_t, uint8_t);
extern voidpci_config_write16(uint32_t, uint8_t, uint16_t);
extern voidpci_config_write32(uint32_t, uint8_t, uint32_t);
extern char*get_pci_dev_path(pci_dt_t *);
extern voidbuild_pci_dt(void);
extern voiddump_pci_dt(pci_dt_t *);
extern voidpci_config_write8(uint32_t, uint8_t, uint8_t);
extern voidpci_config_write16(uint32_t, uint8_t, uint16_t);
extern voidpci_config_write32(uint32_t, uint8_t, uint32_t);
extern char*get_pci_dev_path(pci_dt_t *);
extern voidbuild_pci_dt(void);
extern voiddump_pci_dt(pci_dt_t *);
//-----------------------------------------------------------------------------
// added by iNDi

Archive Download the corresponding diff file

Revision: 582