git://scm.lunaixsky.com
/
lunaix-os.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
refactor: one more step towards arch-agnostic design
[lunaix-os.git]
/
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 0494181d03efc7ecda592091b63cb69a9eefbc89..13312a525135ca63fc12406519ba06d0efaf5cea 100644
(file)
--- 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
#ifndef __LUNAIX_AHCI_H
#define __LUNAIX_AHCI_H
+#include "hba.h"
+
/*
* Macro naming rule:
* HBA_R[xxx]
/*
* Macro naming rule:
* HBA_R[xxx]
@@
-12,18
+14,37
@@
#define AHCI_HBA_CLASS 0x10601
#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;
+};
+
+void
+ahci_parse_dev_info(struct hba_device* dev_info, u16_t* data);
+
+void
+ahci_parsestr(char* str, u16_t* reg_start, int size_word);
/**
/**
- * @brief
初始化AHCI与HBA
+ * @brief
Issue a HBA command (synchronized)
*
*
+ * @param port
+ * @param slot
+ * @return int
*/
*/
-void
-ahci_
init(
);
+int
+ahci_
try_send(struct hba_port* port, int slot
);
+/**
+ * @brief Issue a HBA command (asynchronized)
+ *
+ * @param port
+ * @param state
+ * @param slot
+ */
void
void
-ahci_
list_device(
);
+ahci_
post(struct hba_port* port, struct hba_cmd_state* state, int slot
);
#endif /* __LUNAIX_AHCI_H */
#endif /* __LUNAIX_AHCI_H */