refactor: one more step towards arch-agnostic design
[lunaix-os.git] / lunaix-os / includes / hal / ahci / ahci.h
index ec9a64ffe6461c1b8d12512216bf01fc514b3222..13312a525135ca63fc12406519ba06d0efaf5cea 100644 (file)
 
 #define AHCI_HBA_CLASS 0x10601
 
-/**
- * @brief 初始化AHCI与HBA
- *
- */
+struct ahci_driver
+{
+    struct llist_header ahci_drvs;
+    struct ahci_hba hba;
+    int id;
+};
+
 void
-ahci_init();
+ahci_parse_dev_info(struct hba_device* dev_info, u16_t* data);
 
 void
-ahci_list_device();
+ahci_parsestr(char* str, u16_t* reg_start, int size_word);
 
-unsigned int
-ahci_get_port_usage();
+/**
+ * @brief Issue a HBA command (synchronized)
+ *
+ * @param port
+ * @param slot
+ * @return int
+ */
+int
+ahci_try_send(struct hba_port* port, int slot);
 
-struct hba_port*
-ahci_get_port(unsigned int index);
+/**
+ * @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 */