diff options
Diffstat (limited to 'sys/include')
-rw-r--r-- | sys/include/dev/ic/ahciregs.h | 2 | ||||
-rw-r--r-- | sys/include/dev/ic/ahcivar.h | 30 |
2 files changed, 32 insertions, 0 deletions
diff --git a/sys/include/dev/ic/ahciregs.h b/sys/include/dev/ic/ahciregs.h index 4a4dc65..973c761 100644 --- a/sys/include/dev/ic/ahciregs.h +++ b/sys/include/dev/ic/ahciregs.h @@ -122,6 +122,8 @@ struct hba_memspace { */ #define AHCI_CAP_NP(CAP) (CAP & 0x1F) /* Number of ports */ #define AHCI_CAP_NCS(CAP) ((CAP >> 8) & 0x1F) /* Number of command slots */ +#define AHCI_CAP_EMS(CAP) ((CAP >> 6) & 1) /* Enclosure management support */ +#define AHCI_CAP_SAL(CAP) ((CAP >> 25) & 1) /* Supports activity LED */ /* * Device detection (DET) and Interface power diff --git a/sys/include/dev/ic/ahcivar.h b/sys/include/dev/ic/ahcivar.h index 0d307cd..cc6d346 100644 --- a/sys/include/dev/ic/ahcivar.h +++ b/sys/include/dev/ic/ahcivar.h @@ -30,10 +30,40 @@ #ifndef _IC_AHCIVAR_H_ #define _IC_AHCIVAR_H_ +#include <sys/param.h> +#include <sys/types.h> #include <dev/ic/ahciregs.h> +/* + * AHCI Host Bus Adapter + * + * @io: HBA MMIO + * @maxports: Max number of HBA ports + * @nports: Number of implemented HBA ports. + * @nslots: Number of command slots + * @ems: Enclosure management support + * @sal: Supports activity LED + */ struct ahci_hba { struct hba_memspace *io; + uint32_t maxports; + uint32_t nports; + uint32_t nslots; + uint8_t ems : 1; + uint8_t sal : 1; +}; + +/* + * A device attached to a physical HBA port. + * + * @io: Memory mapped port registers + * @hba: HBA descriptor + * @dev: Device minor number. + */ +struct hba_device { + struct hba_port *io; + struct ahci_hba *hba; + dev_t dev; }; #define AHCI_TIMEOUT 500 /* In ms */ |