2018-11-08 22:12:51 +01:00
|
|
|
/*******************************************************************************/
|
|
|
|
/* COS2000 - Compatible Operating System - LGPL v3 - Hordé Nicolas */
|
|
|
|
/* */
|
|
|
|
|
2018-11-12 09:49:00 +01:00
|
|
|
|
|
|
|
|
|
|
|
typedef struct pciclass {
|
|
|
|
u16 number;
|
|
|
|
u8 *name;
|
|
|
|
} pciclass __attribute__ ((packed));
|
|
|
|
|
|
|
|
typedef struct pcidev
|
|
|
|
{
|
|
|
|
u16 vendor_id;
|
|
|
|
u16 device_id;
|
|
|
|
u16 command;
|
|
|
|
u16 status;
|
|
|
|
u8 revision_id;
|
|
|
|
u8 interface;
|
|
|
|
u8 sub_class;
|
|
|
|
u8 base_class;
|
|
|
|
u8 cache_line_size;
|
|
|
|
u8 latency_timer;
|
|
|
|
u8 header_type;
|
|
|
|
u8 bist;
|
|
|
|
} pcidev __attribute__ ((packed));
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct pcidevmini {
|
2018-11-08 22:12:51 +01:00
|
|
|
union {
|
|
|
|
struct {
|
2018-11-12 09:49:00 +01:00
|
|
|
u16 vendor_id;
|
|
|
|
u16 device_id;
|
2018-11-08 22:12:51 +01:00
|
|
|
};
|
|
|
|
u32 dword;
|
|
|
|
};
|
2018-11-12 09:49:00 +01:00
|
|
|
} pcidevmini __attribute__ ((packed));
|
2018-11-08 22:12:51 +01:00
|
|
|
|
2018-11-09 16:44:56 +01:00
|
|
|
u16 pciConfigReadWord(const u8 bus, const u8 dev, const u8 function, const u8 offset);
|
2018-11-12 09:49:00 +01:00
|
|
|
void scanPCImini(void);
|
|
|
|
pcidevmini getPCImininfo(const u8 bus, const u8 dev, const u8 function);
|
|
|
|
bool getPCInfo(pcidev *device, const u8 bus, const u8 dev, const u8 function);
|
2018-11-09 16:44:56 +01:00
|
|
|
void scanPCI(void);
|
2018-11-12 09:49:00 +01:00
|
|
|
u8 * pcigetclassname( const pcidev *device);
|