🆕 按照class来读取对应的pci设备的接口

This commit is contained in:
fslongjin
2022-03-30 15:36:00 +08:00
parent 576d9e33d9
commit 741aa09b9b
6 changed files with 124 additions and 38 deletions

View File

@ -1,3 +1,19 @@
#include "ahci.h"
#include "../../../common/kprint.h"
struct pci_device_structure_header_t *ahci_devices[100];
uint32_t count_ahci_devices = 0;
/**
* @brief 初始化ahci模块
*
*/
void ahci_init()
{
pci_get_device_structure(0x1, 0x6, ahci_devices, &count_ahci_devices);
for(int i=0;i<count_ahci_devices;++i)
{
kdebug("[%d] class_code=%d, sub_class=%d, progIF=%d", i, ahci_devices[i]->Class_code, ahci_devices[i]->SubClass, ahci_devices[i]->ProgIF);
}
}