Cleanup AHCI Ident a bit and reduce logging
This commit is contained in:
parent
72885190e9
commit
b8b6576b7f
8 changed files with 195 additions and 68 deletions
|
|
@ -1,5 +1,6 @@
|
|||
#pragma once
|
||||
|
||||
#include <mammoth/memory_region.h>
|
||||
#include <zerrors.h>
|
||||
|
||||
#include "ahci/ahci.h"
|
||||
|
|
@ -12,18 +13,26 @@ class AhciDevice {
|
|||
|
||||
void DumpInfo();
|
||||
|
||||
bool IsInit() { return port_struct_ != nullptr && vmmo_cap_ != 0; }
|
||||
bool IsInit() { return port_struct_ != nullptr && command_structures_; }
|
||||
|
||||
// Result will point to a 512 byte (256 word array).
|
||||
z_err_t SendIdentify(uint16_t** result);
|
||||
z_err_t SendIdentify();
|
||||
void HandleIdentify();
|
||||
|
||||
void HandleIrq();
|
||||
|
||||
private:
|
||||
AhciPort* port_struct_ = nullptr;
|
||||
uint64_t vmmo_cap_ = 0;
|
||||
MappedMemoryRegion command_structures_;
|
||||
|
||||
CommandList* command_list_ = nullptr;
|
||||
ReceivedFis* received_fis_ = nullptr;
|
||||
CommandTable* command_table_ = nullptr;
|
||||
|
||||
struct Command {
|
||||
typedef void (*Callback)(AhciDevice*);
|
||||
MappedMemoryRegion region;
|
||||
Callback callback;
|
||||
};
|
||||
Command commands_[32];
|
||||
uint32_t commands_issued_ = 0;
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue