source: mainline/uspace/drv/block/ahci/ahci.h@ 7dddd7b

lfn serial ticket/834-toolchain-update topic/msim-upgrade topic/simplify-dev-export
Last change on this file since 7dddd7b was d15797d, checked in by Jiri Svoboda <jiri@…>, 8 years ago

Remove unnecessary references to devman.

  • Property mode set to 100644
File size: 3.0 KB
Line 
1/*
2 * Copyright (c) 2012 Petr Jerman
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 *
9 * - Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
11 * - Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution.
14 * - The name of the author may not be used to endorse or promote products
15 * derived from this software without specific prior written permission.
16 *
17 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
18 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
19 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
20 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
21 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 */
28
29/** @file
30 * Header for AHCI driver.
31 */
32
33#ifndef __AHCI_H__
34#define __AHCI_H__
35
36#include <async.h>
37#include <ddf/interrupt.h>
38#include <stdio.h>
39#include <stddef.h>
40#include <stdint.h>
41#include "ahci_hw.h"
42
43/** AHCI Device. */
44typedef struct {
45 /** Pointer to ddf device. */
46 ddf_dev_t *dev;
47
48 /** Pointer to AHCI memory registers. */
49 volatile ahci_memregs_t *memregs;
50
51 /** Pointers to sata devices. */
52 void *sata_devs[AHCI_MAX_PORTS];
53
54 /** Parent session */
55 async_sess_t *parent_sess;
56} ahci_dev_t;
57
58/** SATA Device. */
59typedef struct {
60 /** Pointer to AHCI device. */
61 ahci_dev_t *ahci;
62
63 /** Pointer to ddf function. */
64 ddf_fun_t *fun;
65
66 /** SATA port number (0-31). */
67 uint8_t port_num;
68
69 /** Device in invalid state (disconnected and so on). */
70 bool is_invalid_device;
71
72 /** Pointer to SATA port. */
73 volatile ahci_port_t *port;
74
75 /** Pointer to command header. */
76 volatile ahci_cmdhdr_t *cmd_header;
77
78 /** Pointer to command table. */
79 volatile uint32_t *cmd_table;
80
81 /** Mutex for single operation on device. */
82 fibril_mutex_t lock;
83
84 /** Mutex for event signaling condition variable. */
85 fibril_mutex_t event_lock;
86
87 /** Event signaling condition variable. */
88 fibril_condvar_t event_condvar;
89
90 /** Event interrupt state. */
91 ahci_port_is_t event_pxis;
92
93 /** Number of device data blocks. */
94 uint64_t blocks;
95
96 /** Size of device data blocks. */
97 size_t block_size;
98
99 /** Name of SATA device. */
100 char model[STR_BOUNDS(40) + 1];
101
102 /** Device in invalid state (disconnected and so on). */
103 bool is_packet_device;
104
105 /** Highest UDMA mode supported. */
106 uint8_t highest_udma_mode;
107} sata_dev_t;
108
109#endif
Note: See TracBrowser for help on using the repository browser.