| 1 | /*
|
|---|
| 2 | * SPDX-FileCopyrightText: 2012 Petr Jerman
|
|---|
| 3 | *
|
|---|
| 4 | * SPDX-License-Identifier: BSD-3-Clause
|
|---|
| 5 | */
|
|---|
| 6 |
|
|---|
| 7 | /** @addtogroup libdrv
|
|---|
| 8 | * @{
|
|---|
| 9 | */
|
|---|
| 10 | /** @file
|
|---|
| 11 | * @brief AHCI interface definition.
|
|---|
| 12 | */
|
|---|
| 13 |
|
|---|
| 14 | #ifndef LIBDRV_AHCI_IFACE_H_
|
|---|
| 15 | #define LIBDRV_AHCI_IFACE_H_
|
|---|
| 16 |
|
|---|
| 17 | #include "ddf/driver.h"
|
|---|
| 18 | #include <async.h>
|
|---|
| 19 |
|
|---|
| 20 | extern async_sess_t *ahci_get_sess(devman_handle_t, char **);
|
|---|
| 21 |
|
|---|
| 22 | extern errno_t ahci_get_sata_device_name(async_sess_t *, size_t, char *);
|
|---|
| 23 | extern errno_t ahci_get_num_blocks(async_sess_t *, uint64_t *);
|
|---|
| 24 | extern errno_t ahci_get_block_size(async_sess_t *, size_t *);
|
|---|
| 25 | extern errno_t ahci_read_blocks(async_sess_t *, uint64_t, size_t, void *);
|
|---|
| 26 | extern errno_t ahci_write_blocks(async_sess_t *, uint64_t, size_t, void *);
|
|---|
| 27 |
|
|---|
| 28 | /** AHCI device communication interface. */
|
|---|
| 29 | typedef struct {
|
|---|
| 30 | errno_t (*get_sata_device_name)(ddf_fun_t *, size_t, char *);
|
|---|
| 31 | errno_t (*get_num_blocks)(ddf_fun_t *, uint64_t *);
|
|---|
| 32 | errno_t (*get_block_size)(ddf_fun_t *, size_t *);
|
|---|
| 33 | errno_t (*read_blocks)(ddf_fun_t *, uint64_t, size_t, void *);
|
|---|
| 34 | errno_t (*write_blocks)(ddf_fun_t *, uint64_t, size_t, void *);
|
|---|
| 35 | } ahci_iface_t;
|
|---|
| 36 |
|
|---|
| 37 | #endif
|
|---|
| 38 |
|
|---|
| 39 | /**
|
|---|
| 40 | * @}
|
|---|
| 41 | */
|
|---|