X-Git-Url: https://scm.lunaixsky.com/lunaix-os.git/blobdiff_plain/09a115a4c07e26b3a978c693c0d6d17abea80479..df1e857ac4d1410ae2bd354e361210b842ab7bc8:/lunaix-os/includes/hal/ahci/ahci.h diff --git a/lunaix-os/includes/hal/ahci/ahci.h b/lunaix-os/includes/hal/ahci/ahci.h index 0494181..2ed135a 100644 --- a/lunaix-os/includes/hal/ahci/ahci.h +++ b/lunaix-os/includes/hal/ahci/ahci.h @@ -1,6 +1,8 @@ #ifndef __LUNAIX_AHCI_H #define __LUNAIX_AHCI_H +#include "hba.h" + /* * Macro naming rule: * HBA_R[xxx] @@ -12,9 +14,12 @@ #define AHCI_HBA_CLASS 0x10601 -#define ATA_IDENTIFY_DEVICE 0xec -#define ATA_IDENTIFY_PAKCET_DEVICE 0xa1 -#define ATA_PACKET 0xa0 +struct ahci_driver +{ + struct llist_header ahci_drvs; + struct ahci_hba hba; + int id; +}; /** * @brief 初始化AHCI与HBA @@ -24,6 +29,29 @@ void ahci_init(); void -ahci_list_device(); +ahci_parse_dev_info(struct hba_device* dev_info, uint16_t* data); + +void +ahci_parsestr(char* str, uint16_t* reg_start, int size_word); + +/** + * @brief Issue a HBA command (synchronized) + * + * @param port + * @param slot + * @return int + */ +int +ahci_try_send(struct hba_port* port, int slot); + +/** + * @brief Issue a HBA command (asynchronized) + * + * @param port + * @param state + * @param slot + */ +void +ahci_post(struct hba_port* port, struct hba_cmd_state* state, int slot); #endif /* __LUNAIX_AHCI_H */