1251652Sgjb/*-
2251652Sgjb * This file is provided under a dual BSD/GPLv2 license.  When using or
3325899Sgjb * redistributing this file, you may do so under either license.
4251652Sgjb *
5251652Sgjb * GPL LICENSE SUMMARY
6251652Sgjb *
7251652Sgjb * Copyright(c) 2008 - 2011 Intel Corporation. All rights reserved.
8262761Sgjb *
9262761Sgjb * This program is free software; you can redistribute it and/or modify
10262761Sgjb * it under the terms of version 2 of the GNU General Public License as
11251652Sgjb * published by the Free Software Foundation.
12251652Sgjb *
13251652Sgjb * This program is distributed in the hope that it will be useful, but
14251652Sgjb * WITHOUT ANY WARRANTY; without even the implied warranty of
15251652Sgjb * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16251652Sgjb * General Public License for more details.
17251652Sgjb *
18251652Sgjb * You should have received a copy of the GNU General Public License
19251652Sgjb * along with this program; if not, write to the Free Software
20251652Sgjb * Foundation, Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
21251652Sgjb * The full GNU General Public License is included in this distribution
22251652Sgjb * in the file called LICENSE.GPL.
23251652Sgjb *
24251652Sgjb * BSD LICENSE
25251652Sgjb *
26251652Sgjb * Copyright(c) 2008 - 2011 Intel Corporation. All rights reserved.
27251652Sgjb * All rights reserved.
28251652Sgjb *
29251652Sgjb * Redistribution and use in source and binary forms, with or without
30251652Sgjb * modification, are permitted provided that the following conditions
31251652Sgjb * are met:
32251652Sgjb *
33251652Sgjb *   * Redistributions of source code must retain the above copyright
34251652Sgjb *     notice, this list of conditions and the following disclaimer.
35251652Sgjb *   * Redistributions in binary form must reproduce the above copyright
36251652Sgjb *     notice, this list of conditions and the following disclaimer in
37251652Sgjb *     the documentation and/or other materials provided with the
38251652Sgjb *     distribution.
39283161Sgjb *
40251652Sgjb * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
41283161Sgjb * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
42251652Sgjb * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
43283161Sgjb * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
44283161Sgjb * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
45283161Sgjb * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
46283161Sgjb * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
47262761Sgjb * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
48283161Sgjb * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
49283161Sgjb * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
50283161Sgjb * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
51283161Sgjb *
52251652Sgjb * $FreeBSD$
53283161Sgjb */
54283161Sgjb#ifndef _SCI_CONTROLLER_H_
55283161Sgjb#define _SCI_CONTROLLER_H_
56283161Sgjb
57283161Sgjb/**
58283161Sgjb * @file
59283161Sgjb *
60264106Sgjb * @brief This file contains all of the interface methods that can be called
61283161Sgjb *        by an SCI user on all SCI controller objects.
62283161Sgjb */
63283161Sgjb
64283161Sgjb#ifdef __cplusplus
65283161Sgjbextern "C" {
66283161Sgjb#endif // __cplusplus
67283161Sgjb
68283161Sgjb#include <dev/isci/scil/sci_types.h>
69252846Sgjb
70283161Sgjb
71283161Sgjb#define SCI_CONTROLLER_INVALID_IO_TAG 0xFFFF
72283161Sgjb
73283161Sgjbtypedef enum _SCI_CONTROLLER_ERROR {
74283161Sgjb    SCI_CONTROLLER_FATAL_ERROR = 1,
75283161Sgjb    SCI_CONTROLLER_REMOTE_DEVICE_ERROR,
76251652Sgjb    SCI_CONTROLLER_FATAL_MEMORY_ERROR
77283161Sgjb} SCI_CONTROLLER_ERROR;
78283161Sgjb
79262761Sgjb/**
80283161Sgjb * @brief This method simply returns a handle for the memory descriptor
81283161Sgjb *        list associated with the supplied controller.  The descriptor list
82283161Sgjb *        provides DMA safe/capable memory requirements for this controller.
83251652Sgjb *
84283161Sgjb * @warning The user must adhere to the alignment requirements specified in
85283161Sgjb *          memory descriptor.  In situations where the operating environment
86283161Sgjb *          does not offer memory allocation utilities supporting alignment,
87283161Sgjb *          then it is the responsibility of the user to manually align the
88283161Sgjb *          memory buffer for SCI.  Thus, the user may have to allocate a
89251652Sgjb *          larger buffer to meet the alignment.  Additionally, the user will
90283161Sgjb *          need to remember the actual memory allocation addresses in order
91283161Sgjb *          to ensure the memory can be properly freed when necessary to do
92283161Sgjb *          so.
93283161Sgjb *
94251652Sgjb * @pre This method will return a valid handle, but the MDL may not be
95283161Sgjb *      accurate until after the user has invoked the associated
96259151Sgjb *      sci_controller_initialize() routine.
97283161Sgjb *
98283161Sgjb * @param[in]  controller This parameter specifies the controller for which
99273080Sgjb *             to retrieve the DMA safe memory descriptor list.
100283161Sgjb *
101283161Sgjb * @return A pointer to a physical memory descriptor array.
102283161Sgjb */
103283161SgjbSCI_MEMORY_DESCRIPTOR_LIST_HANDLE_T
104278985Sgjbsci_controller_get_memory_descriptor_list_handle(
105283161Sgjb   SCI_CONTROLLER_HANDLE_T  controller
106283161Sgjb);
107283161Sgjb
108251652Sgjb#ifdef __cplusplus
109283161Sgjb}
110283161Sgjb#endif // __cplusplus
111283161Sgjb
112283161Sgjb#endif // _SCI_CONTROLLER_H_
113283161Sgjb
114283161Sgjb