X-Git-Url: https://scm.lunaixsky.com/lunaix-os.git/blobdiff_plain/c4d08ac5260bb26db10bcfd9dc6fd2db60efebe9..34f6af4f61e0eec9c96113e07f140b609b4113c8:/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 c768510..7eaf10d 100644 --- a/lunaix-os/includes/hal/ahci/ahci.h +++ b/lunaix-os/includes/hal/ahci/ahci.h @@ -2,6 +2,7 @@ #define __LUNAIX_AHCI_H #include "hba.h" +#include /* * Macro naming rule: @@ -14,29 +15,50 @@ #define AHCI_HBA_CLASS 0x10601 -/** - * @brief 初始化AHCI与HBA - * - */ -void -ahci_init(); +struct ahci_driver +{ + struct llist_header ahci_drvs; + struct ahci_hba hba; + int id; +}; -void -ahci_list_device(); - -unsigned int -ahci_get_port_usage(); - -struct hba_port* -ahci_get_port(unsigned int index); +struct ahci_driver_param +{ + ptr_t mmio_base; + size_t mmio_size; + int ahci_iv; +}; void -ahci_parse_dev_info(struct hba_device* dev_info, uint16_t* data); +ahci_parse_dev_info(struct hba_device* dev_info, u16_t* data); void -ahci_parsestr(char* str, uint16_t* reg_start, int size_word); +ahci_parsestr(char* str, u16_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); + +struct ahci_driver* +ahci_driver_init(struct ahci_driver_param* param); + +void +ahci_hba_isr(const struct hart_state* hstate); + #endif /* __LUNAIX_AHCI_H */