xref: /freebsd/sys/dev/isci/scil/scic_sds_controller.h (revision 95ee2897e98f5d444f26ed2334cc7c439f9c16c6)
1f11c7f63SJim Harris /*-
2*718cf2ccSPedro F. Giffuni  * SPDX-License-Identifier: BSD-2-Clause OR GPL-2.0
3*718cf2ccSPedro F. Giffuni  *
4f11c7f63SJim Harris  * This file is provided under a dual BSD/GPLv2 license.  When using or
5f11c7f63SJim Harris  * redistributing this file, you may do so under either license.
6f11c7f63SJim Harris  *
7f11c7f63SJim Harris  * GPL LICENSE SUMMARY
8f11c7f63SJim Harris  *
9f11c7f63SJim Harris  * Copyright(c) 2008 - 2011 Intel Corporation. All rights reserved.
10f11c7f63SJim Harris  *
11f11c7f63SJim Harris  * This program is free software; you can redistribute it and/or modify
12f11c7f63SJim Harris  * it under the terms of version 2 of the GNU General Public License as
13f11c7f63SJim Harris  * published by the Free Software Foundation.
14f11c7f63SJim Harris  *
15f11c7f63SJim Harris  * This program is distributed in the hope that it will be useful, but
16f11c7f63SJim Harris  * WITHOUT ANY WARRANTY; without even the implied warranty of
17f11c7f63SJim Harris  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
18f11c7f63SJim Harris  * General Public License for more details.
19f11c7f63SJim Harris  *
20f11c7f63SJim Harris  * You should have received a copy of the GNU General Public License
21f11c7f63SJim Harris  * along with this program; if not, write to the Free Software
22f11c7f63SJim Harris  * Foundation, Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
23f11c7f63SJim Harris  * The full GNU General Public License is included in this distribution
24f11c7f63SJim Harris  * in the file called LICENSE.GPL.
25f11c7f63SJim Harris  *
26f11c7f63SJim Harris  * BSD LICENSE
27f11c7f63SJim Harris  *
28f11c7f63SJim Harris  * Copyright(c) 2008 - 2011 Intel Corporation. All rights reserved.
29f11c7f63SJim Harris  * All rights reserved.
30f11c7f63SJim Harris  *
31f11c7f63SJim Harris  * Redistribution and use in source and binary forms, with or without
32f11c7f63SJim Harris  * modification, are permitted provided that the following conditions
33f11c7f63SJim Harris  * are met:
34f11c7f63SJim Harris  *
35f11c7f63SJim Harris  *   * Redistributions of source code must retain the above copyright
36f11c7f63SJim Harris  *     notice, this list of conditions and the following disclaimer.
37f11c7f63SJim Harris  *   * Redistributions in binary form must reproduce the above copyright
38f11c7f63SJim Harris  *     notice, this list of conditions and the following disclaimer in
39f11c7f63SJim Harris  *     the documentation and/or other materials provided with the
40f11c7f63SJim Harris  *     distribution.
41f11c7f63SJim Harris  *
42f11c7f63SJim Harris  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
43f11c7f63SJim Harris  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
44f11c7f63SJim Harris  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
45f11c7f63SJim Harris  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
46f11c7f63SJim Harris  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
47f11c7f63SJim Harris  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
48f11c7f63SJim Harris  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
49f11c7f63SJim Harris  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
50f11c7f63SJim Harris  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
51f11c7f63SJim Harris  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
52f11c7f63SJim Harris  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
53f11c7f63SJim Harris  */
54f11c7f63SJim Harris #ifndef _SCIC_SDS_CONTROLLER_H_
55f11c7f63SJim Harris #define _SCIC_SDS_CONTROLLER_H_
56f11c7f63SJim Harris 
57f11c7f63SJim Harris /**
58f11c7f63SJim Harris  * @file
59f11c7f63SJim Harris  *
60f11c7f63SJim Harris  * @brief This file contains the structures, constants and prototypes used for
61f11c7f63SJim Harris  *        the core controller object.
62f11c7f63SJim Harris  */
63f11c7f63SJim Harris 
64f11c7f63SJim Harris #ifdef __cplusplus
65f11c7f63SJim Harris extern "C" {
66f11c7f63SJim Harris #endif // __cplusplus
67f11c7f63SJim Harris 
68f11c7f63SJim Harris #include <dev/isci/scil/sci_pool.h>
69f11c7f63SJim Harris #include <dev/isci/scil/sci_controller_constants.h>
70f11c7f63SJim Harris #include <dev/isci/scil/sci_memory_descriptor_list.h>
71f11c7f63SJim Harris #include <dev/isci/scil/sci_base_controller.h>
72f11c7f63SJim Harris #include <dev/isci/scil/scic_config_parameters.h>
73f11c7f63SJim Harris #include <dev/isci/scil/scic_sds_port.h>
74f11c7f63SJim Harris #include <dev/isci/scil/scic_sds_phy.h>
75f11c7f63SJim Harris #include <dev/isci/scil/scic_sds_remote_node_table.h>
76f11c7f63SJim Harris #include <dev/isci/scil/scu_registers.h>
77f11c7f63SJim Harris #include <dev/isci/scil/scu_constants.h>
78f11c7f63SJim Harris #include <dev/isci/scil/scu_remote_node_context.h>
79f11c7f63SJim Harris #include <dev/isci/scil/scu_task_context.h>
80f11c7f63SJim Harris #include <dev/isci/scil/scu_unsolicited_frame.h>
81f11c7f63SJim Harris #include <dev/isci/scil/scic_sds_unsolicited_frame_control.h>
82f11c7f63SJim Harris #include <dev/isci/scil/scic_sds_port_configuration_agent.h>
83f11c7f63SJim Harris #include <dev/isci/scil/scic_sds_pci.h>
84f11c7f63SJim Harris 
85f11c7f63SJim Harris struct SCIC_SDS_REMOTE_DEVICE;
86f11c7f63SJim Harris struct SCIC_SDS_REQUEST;
87f11c7f63SJim Harris 
88f11c7f63SJim Harris 
89f11c7f63SJim Harris #define SCU_COMPLETION_RAM_ALIGNMENT            (64)
90f11c7f63SJim Harris 
91f11c7f63SJim Harris /**
92f11c7f63SJim Harris  * @enum SCIC_SDS_CONTROLLER_MEMORY_DESCRIPTORS
93f11c7f63SJim Harris  *
94f11c7f63SJim Harris  * This enumeration depects the types of MDEs that are going to be created for
95f11c7f63SJim Harris  * the controller object.
96f11c7f63SJim Harris  */
97f11c7f63SJim Harris enum SCIC_SDS_CONTROLLER_MEMORY_DESCRIPTORS
98f11c7f63SJim Harris {
99f11c7f63SJim Harris    /**
100f11c7f63SJim Harris     * Completion queue MDE entry
101f11c7f63SJim Harris     */
102f11c7f63SJim Harris    SCU_MDE_COMPLETION_QUEUE,
103f11c7f63SJim Harris 
104f11c7f63SJim Harris    /**
105f11c7f63SJim Harris     * Remote node context MDE entry
106f11c7f63SJim Harris     */
107f11c7f63SJim Harris    SCU_MDE_REMOTE_NODE_CONTEXT,
108f11c7f63SJim Harris 
109f11c7f63SJim Harris    /**
110f11c7f63SJim Harris     * Task context MDE entry
111f11c7f63SJim Harris     */
112f11c7f63SJim Harris    SCU_MDE_TASK_CONTEXT,
113f11c7f63SJim Harris 
114f11c7f63SJim Harris    /**
115f11c7f63SJim Harris     * Unsolicited frame buffer MDE entrys this is the start of the unsolicited
116f11c7f63SJim Harris     * frame buffer entries.
117f11c7f63SJim Harris     */
118f11c7f63SJim Harris    SCU_MDE_UF_BUFFER,
119f11c7f63SJim Harris 
120f11c7f63SJim Harris    SCU_MAX_MDES
121f11c7f63SJim Harris };
122f11c7f63SJim Harris 
123f11c7f63SJim Harris /**
124f11c7f63SJim Harris  * @struct SCIC_POWER_CONTROL
125f11c7f63SJim Harris  *
126f11c7f63SJim Harris  * This structure defines the fields for managing power control for direct
127f11c7f63SJim Harris  * attached disk devices.
128f11c7f63SJim Harris  */
129f11c7f63SJim Harris typedef struct SCIC_POWER_CONTROL
130f11c7f63SJim Harris {
131f11c7f63SJim Harris    /**
132f11c7f63SJim Harris     * This field is set when the power control timer is running and cleared when
133f11c7f63SJim Harris     * it is not.
134f11c7f63SJim Harris     */
135f11c7f63SJim Harris    BOOL timer_started;
136f11c7f63SJim Harris 
137f11c7f63SJim Harris    /**
138f11c7f63SJim Harris     * This field is the handle to the driver timer object.  This timer is used to
139f11c7f63SJim Harris     * control when the directed attached disks can consume power.
140f11c7f63SJim Harris     */
141f11c7f63SJim Harris    void *timer;
142f11c7f63SJim Harris 
143f11c7f63SJim Harris    /**
144f11c7f63SJim Harris    * This field is used to keep track of how many phys are put into the
145f11c7f63SJim Harris    * requesters field.
146f11c7f63SJim Harris    */
147f11c7f63SJim Harris    U8 phys_waiting;
148f11c7f63SJim Harris 
149f11c7f63SJim Harris    /**
150f11c7f63SJim Harris    * This field is used to keep track of how many remote devices have been granted to consume power
151f11c7f63SJim Harris    */
152f11c7f63SJim Harris    U8 remote_devices_granted_power;
153f11c7f63SJim Harris 
154f11c7f63SJim Harris    /**
155f11c7f63SJim Harris     * This field is an array of phys that we are waiting on. The phys are direct
156f11c7f63SJim Harris     * mapped into requesters via SCIC_SDS_PHY_T.phy_index
157f11c7f63SJim Harris     */
158f11c7f63SJim Harris    SCIC_SDS_PHY_T *requesters[SCI_MAX_PHYS];
159f11c7f63SJim Harris 
160f11c7f63SJim Harris } SCIC_POWER_CONTROL_T;
161f11c7f63SJim Harris 
162f11c7f63SJim Harris /**
163f11c7f63SJim Harris  * @struct SCIC_SDS_CONTROLLER
164f11c7f63SJim Harris  *
165f11c7f63SJim Harris  * This structure represents the SCU contoller object.
166f11c7f63SJim Harris  */
167f11c7f63SJim Harris typedef struct SCIC_SDS_CONTROLLER
168f11c7f63SJim Harris {
169f11c7f63SJim Harris    /**
170f11c7f63SJim Harris     * The SCI_BASE_CONTROLLER is the parent object for the SCIC_SDS_CONTROLLER
171f11c7f63SJim Harris     * object.
172f11c7f63SJim Harris     */
173f11c7f63SJim Harris    SCI_BASE_CONTROLLER_T parent;
174f11c7f63SJim Harris 
175f11c7f63SJim Harris    /**
176f11c7f63SJim Harris     * This field is the driver timer object handler used to time the controller
177f11c7f63SJim Harris     * object start and stop requests.
178f11c7f63SJim Harris     */
179f11c7f63SJim Harris    void *timeout_timer;
180f11c7f63SJim Harris 
181f11c7f63SJim Harris    /**
182f11c7f63SJim Harris     * This field is the current set of state handlers assigned to this controller
183f11c7f63SJim Harris     * object.
184f11c7f63SJim Harris     */
185f11c7f63SJim Harris    struct SCIC_SDS_CONTROLLER_STATE_HANDLER *state_handlers;
186f11c7f63SJim Harris 
187f11c7f63SJim Harris    /**
188f11c7f63SJim Harris     * This field contains the user parameters to be utilized for this
189f11c7f63SJim Harris     * core controller object.
190f11c7f63SJim Harris     */
191f11c7f63SJim Harris    SCIC_USER_PARAMETERS_T  user_parameters;
192f11c7f63SJim Harris 
193f11c7f63SJim Harris    /**
194f11c7f63SJim Harris     * This field contains the OEM parameters version defining the structure
195f11c7f63SJim Harris     * layout. It comes from the version in the OEM block header.
196f11c7f63SJim Harris     */
197f11c7f63SJim Harris    U8 oem_parameters_version;
198f11c7f63SJim Harris 
199f11c7f63SJim Harris    /**
200f11c7f63SJim Harris     * This field contains the OEM parameters to be utilized for this
201f11c7f63SJim Harris     * core controller object.
202f11c7f63SJim Harris     */
203f11c7f63SJim Harris    SCIC_OEM_PARAMETERS_T  oem_parameters;
204f11c7f63SJim Harris 
205f11c7f63SJim Harris    /**
206f11c7f63SJim Harris     * This field contains the port configuration agent for this controller.
207f11c7f63SJim Harris     */
208f11c7f63SJim Harris    SCIC_SDS_PORT_CONFIGURATION_AGENT_T port_agent;
209f11c7f63SJim Harris 
210f11c7f63SJim Harris    /**
211f11c7f63SJim Harris     * This field is the array of port objects that are controlled by this
212f11c7f63SJim Harris     * controller object.  There is one dummy port object also contained within
213f11c7f63SJim Harris     * this controller object.
214f11c7f63SJim Harris     */
215f11c7f63SJim Harris    struct SCIC_SDS_PORT port_table[SCI_MAX_PORTS + 1];
216f11c7f63SJim Harris 
217f11c7f63SJim Harris    /**
218f11c7f63SJim Harris     * This field is the array of phy objects that are controlled by this
219f11c7f63SJim Harris     * controller object.
220f11c7f63SJim Harris     */
221f11c7f63SJim Harris    struct SCIC_SDS_PHY phy_table[SCI_MAX_PHYS];
222f11c7f63SJim Harris 
223f11c7f63SJim Harris    /**
224f11c7f63SJim Harris     * This field is the array of device objects that are currently constructed
225f11c7f63SJim Harris     * for this controller object.  This table is used as a fast lookup of device
226f11c7f63SJim Harris     * objects that need to handle device completion notifications from the
227f11c7f63SJim Harris     * hardware. The table is RNi based.
228f11c7f63SJim Harris     */
229f11c7f63SJim Harris    struct SCIC_SDS_REMOTE_DEVICE *device_table[SCI_MAX_REMOTE_DEVICES];
230f11c7f63SJim Harris 
231f11c7f63SJim Harris    /**
232f11c7f63SJim Harris     * This field is the array of IO request objects that are currently active for
233f11c7f63SJim Harris     * this controller object.  This table is used as a fast lookup of the io
234f11c7f63SJim Harris     * request object that need to handle completion queue notifications.  The
235f11c7f63SJim Harris     * table is TCi based.
236f11c7f63SJim Harris     */
237f11c7f63SJim Harris    struct SCIC_SDS_REQUEST *io_request_table[SCI_MAX_IO_REQUESTS];
238f11c7f63SJim Harris 
239f11c7f63SJim Harris    /**
240f11c7f63SJim Harris     * This field is the free RNi data structure
241f11c7f63SJim Harris     */
242f11c7f63SJim Harris    SCIC_REMOTE_NODE_TABLE_T available_remote_nodes;
243f11c7f63SJim Harris 
244f11c7f63SJim Harris    /**
245f11c7f63SJim Harris     * This field is the TCi pool used to manage the task context index.
246f11c7f63SJim Harris     */
247f11c7f63SJim Harris    SCI_POOL_CREATE(tci_pool, U16, SCI_MAX_IO_REQUESTS);
248f11c7f63SJim Harris 
249f11c7f63SJim Harris    /**
250453130d9SPedro F. Giffuni     * This filed is the SCIC_POWER_CONTROL data used to control when direct
251f11c7f63SJim Harris     * attached devices can consume power.
252f11c7f63SJim Harris     */
253f11c7f63SJim Harris    SCIC_POWER_CONTROL_T power_control;
254f11c7f63SJim Harris 
255f11c7f63SJim Harris    /**
256f11c7f63SJim Harris     * This field is the array of sequence values for the IO Tag fields.  Even
257f11c7f63SJim Harris     * though only 4 bits of the field is used for the sequence the sequence is 16
258f11c7f63SJim Harris     * bits in size so the sequence can be bitwise or'd with the TCi to build the
259f11c7f63SJim Harris     * IO Tag value.
260f11c7f63SJim Harris     */
261f11c7f63SJim Harris    U16 io_request_sequence[SCI_MAX_IO_REQUESTS];
262f11c7f63SJim Harris 
263f11c7f63SJim Harris    /**
264f11c7f63SJim Harris     * This field in the array of sequence values for the RNi.  These are used
265f11c7f63SJim Harris     * to control io request build to io request start operations.  The sequence
266f11c7f63SJim Harris     * value is recorded into an io request when it is built and is checked on
267f11c7f63SJim Harris     * the io request start operation to make sure that there was not a device
268f11c7f63SJim Harris     * hot plug between the build and start operation.
269f11c7f63SJim Harris     */
270f11c7f63SJim Harris    U8  remote_device_sequence[SCI_MAX_REMOTE_DEVICES];
271f11c7f63SJim Harris 
272f11c7f63SJim Harris    /**
273f11c7f63SJim Harris     * This field is a pointer to the memory allocated by the driver for the task
274f11c7f63SJim Harris     * context table.  This data is shared between the hardware and software.
275f11c7f63SJim Harris     */
276f11c7f63SJim Harris    SCU_TASK_CONTEXT_T *task_context_table;
277f11c7f63SJim Harris 
278f11c7f63SJim Harris    /**
279f11c7f63SJim Harris     * This field is a pointer to the memory allocated by the driver for the
280f11c7f63SJim Harris     * remote node context table.  This table is shared between the hardware and
281f11c7f63SJim Harris     * software.
282f11c7f63SJim Harris     */
283f11c7f63SJim Harris    SCU_REMOTE_NODE_CONTEXT_T *remote_node_context_table;
284f11c7f63SJim Harris 
285f11c7f63SJim Harris    /**
286f11c7f63SJim Harris     * This field is the array of physical memory requiremets for this controller
287f11c7f63SJim Harris     * object.
288f11c7f63SJim Harris     */
289f11c7f63SJim Harris    SCI_PHYSICAL_MEMORY_DESCRIPTOR_T memory_descriptors[SCU_MAX_MDES];
290f11c7f63SJim Harris 
291f11c7f63SJim Harris    /**
292f11c7f63SJim Harris     * This field is a pointer to the completion queue.  This memory is
293f11c7f63SJim Harris     * written to by the hardware and read by the software.
294f11c7f63SJim Harris     */
295f11c7f63SJim Harris    U32 *completion_queue;
296f11c7f63SJim Harris 
297f11c7f63SJim Harris    /**
298f11c7f63SJim Harris     * This field is the software copy of the completion queue get pointer.  The
299f11c7f63SJim Harris     * controller object writes this value to the hardware after processing the
300f11c7f63SJim Harris     * completion entries.
301f11c7f63SJim Harris     */
302f11c7f63SJim Harris    U32 completion_queue_get;
303f11c7f63SJim Harris 
304f11c7f63SJim Harris    /**
305f11c7f63SJim Harris     * This field is the minimum of the number of hardware supported port entries
306f11c7f63SJim Harris     * and the software requested port entries.
307f11c7f63SJim Harris     */
308f11c7f63SJim Harris    U32 logical_port_entries;
309f11c7f63SJim Harris 
310f11c7f63SJim Harris    /**
311f11c7f63SJim Harris     * This field is the minimum number of hardware supported completion queue
312f11c7f63SJim Harris     * entries and the software requested completion queue entries.
313f11c7f63SJim Harris     */
314f11c7f63SJim Harris    U32 completion_queue_entries;
315f11c7f63SJim Harris 
316f11c7f63SJim Harris    /**
317f11c7f63SJim Harris     * This field is the minimum number of hardware supported event entries and
318f11c7f63SJim Harris     * the software requested event entries.
319f11c7f63SJim Harris     */
320f11c7f63SJim Harris    U32 completion_event_entries;
321f11c7f63SJim Harris 
322f11c7f63SJim Harris    /**
323f11c7f63SJim Harris     * This field is the minimum number of devices supported by the hardware and
324f11c7f63SJim Harris     * the number of devices requested by the software.
325f11c7f63SJim Harris     */
326f11c7f63SJim Harris    U32 remote_node_entries;
327f11c7f63SJim Harris 
328f11c7f63SJim Harris    /**
329f11c7f63SJim Harris     * This field is the minimum number of IO requests supported by the hardware
330f11c7f63SJim Harris     * and the number of IO requests requested by the software.
331f11c7f63SJim Harris     */
332f11c7f63SJim Harris    U32 task_context_entries;
333f11c7f63SJim Harris 
334f11c7f63SJim Harris    /**
335f11c7f63SJim Harris     * This object contains all of the unsolicited frame specific
336f11c7f63SJim Harris     * data utilized by the core controller.
337f11c7f63SJim Harris     */
338f11c7f63SJim Harris    SCIC_SDS_UNSOLICITED_FRAME_CONTROL_T uf_control;
339f11c7f63SJim Harris 
340f11c7f63SJim Harris    /**
341f11c7f63SJim Harris     * This field records the fact that the controller has encountered a fatal
342f11c7f63SJim Harris     * error and must be reset.
343f11c7f63SJim Harris     */
344f11c7f63SJim Harris    BOOL encountered_fatal_error;
345f11c7f63SJim Harris 
346f11c7f63SJim Harris    /**
347f11c7f63SJim Harris     * This field specifies that the controller should ignore
348f11c7f63SJim Harris     * completion processing for non-fastpath events.  This will
349f11c7f63SJim Harris     * cause the completions to be thrown away.
350f11c7f63SJim Harris     */
351f11c7f63SJim Harris    BOOL restrict_completions;
352f11c7f63SJim Harris 
353f11c7f63SJim Harris    // Phy Startup Data
354f11c7f63SJim Harris    /**
355f11c7f63SJim Harris     * This field is the driver timer handle for controller phy request startup.
356f11c7f63SJim Harris     * On controller start the controller will start each PHY individually in
357f11c7f63SJim Harris     * order of phy index.
358f11c7f63SJim Harris     */
359f11c7f63SJim Harris    void *phy_startup_timer;
360f11c7f63SJim Harris 
361f11c7f63SJim Harris    /**
362f11c7f63SJim Harris     * This field is set when the phy_startup_timer is running and is cleared when
363f11c7f63SJim Harris     * the phy_startup_timer is stopped.
364f11c7f63SJim Harris     */
365f11c7f63SJim Harris    BOOL phy_startup_timer_pending;
366f11c7f63SJim Harris 
367f11c7f63SJim Harris    /**
368f11c7f63SJim Harris     * This field is the index of the next phy start.  It is initialized to 0 and
369f11c7f63SJim Harris     * increments for each phy index that is started.
370f11c7f63SJim Harris     */
371f11c7f63SJim Harris    U32 next_phy_to_start;
372f11c7f63SJim Harris 
373f11c7f63SJim Harris    /**
374453130d9SPedro F. Giffuni     * This field controls the invalid link up notifications to the SCI_USER.  If
375f11c7f63SJim Harris     * an invalid_link_up notification is reported a bit for the PHY index is set
376f11c7f63SJim Harris     * so further notifications are not made.  Once the PHY object reports link up
377f11c7f63SJim Harris     * and is made part of a port then this bit for the PHY index is cleared.
378f11c7f63SJim Harris     */
379f11c7f63SJim Harris    U8  invalid_phy_mask;
380f11c7f63SJim Harris 
381f11c7f63SJim Harris    /**
382f11c7f63SJim Harris     * This is the controller index for this controller object.
383f11c7f63SJim Harris     */
384f11c7f63SJim Harris    U8 controller_index;
385f11c7f63SJim Harris 
386f11c7f63SJim Harris    /**
387f11c7f63SJim Harris     * This field is the PCI revision code for the controller object.
388f11c7f63SJim Harris     */
389f11c7f63SJim Harris    enum SCU_CONTROLLER_PCI_REVISION_CODE pci_revision;
390f11c7f63SJim Harris 
391f11c7f63SJim Harris    /*
392f11c7f63SJim Harris     * This field saves the current interrupt coalescing number of the controller.
393f11c7f63SJim Harris     */
394f11c7f63SJim Harris    U16 interrupt_coalesce_number;
395f11c7f63SJim Harris 
396f11c7f63SJim Harris    /*
397f11c7f63SJim Harris     * This field saves the current interrupt coalescing timeout value in microseconds.
398f11c7f63SJim Harris     */
399f11c7f63SJim Harris    U32 interrupt_coalesce_timeout;
400f11c7f63SJim Harris 
401f11c7f63SJim Harris    // Hardware memory mapped register space
402f11c7f63SJim Harris #ifdef ARLINGTON_BUILD
403f11c7f63SJim Harris    /**
404f11c7f63SJim Harris     * This field is a pointer to the memory mapped register space for the
405f11c7f63SJim Harris     * LEX_REGISTERS.
406f11c7f63SJim Harris     */
407f11c7f63SJim Harris    LEX_REGISTERS_T *lex_registers;
408f11c7f63SJim Harris #endif
409f11c7f63SJim Harris 
410f11c7f63SJim Harris    /**
411f11c7f63SJim Harris     * This field is a pointer to the memory mapped register space for the
412f11c7f63SJim Harris     * SMU_REGISTERS.
413f11c7f63SJim Harris     */
414f11c7f63SJim Harris    SMU_REGISTERS_T *smu_registers;
415f11c7f63SJim Harris 
416f11c7f63SJim Harris    /**
417f11c7f63SJim Harris     * This field is a pointer to the memory mapped register space for the
418f11c7f63SJim Harris     * SCU_REGISTERS.
419f11c7f63SJim Harris     */
420f11c7f63SJim Harris    SCU_REGISTERS_T *scu_registers;
421f11c7f63SJim Harris 
422f11c7f63SJim Harris } SCIC_SDS_CONTROLLER_T;
423f11c7f63SJim Harris 
424f11c7f63SJim Harris 
425f11c7f63SJim Harris typedef void (*SCIC_SDS_CONTROLLER_PHY_HANDLER_T)(
426f11c7f63SJim Harris                      struct SCIC_SDS_CONTROLLER *controller,
427f11c7f63SJim Harris                      struct SCIC_SDS_PORT       *port,
428f11c7f63SJim Harris                      struct SCIC_SDS_PHY        *phy
429f11c7f63SJim Harris                      );
430f11c7f63SJim Harris 
431f11c7f63SJim Harris typedef void (*SCIC_SDS_CONTROLLER_DEVICE_HANDLER_T)(
432f11c7f63SJim Harris                      struct SCIC_SDS_CONTROLLER    * controller,
433f11c7f63SJim Harris                      struct SCIC_SDS_REMOTE_DEVICE * device
434f11c7f63SJim Harris                      );
435f11c7f63SJim Harris /**
436f11c7f63SJim Harris  * @struct SCIC_SDS_CONTROLLER_STATE_HANDLER
437f11c7f63SJim Harris  *
438f11c7f63SJim Harris  * This structure contains the SDS core specific definition for the state
439f11c7f63SJim Harris  * handlers.
440f11c7f63SJim Harris  */
441f11c7f63SJim Harris typedef struct SCIC_SDS_CONTROLLER_STATE_HANDLER
442f11c7f63SJim Harris {
443f11c7f63SJim Harris    SCI_BASE_CONTROLLER_STATE_HANDLER_T parent;
444f11c7f63SJim Harris 
445f11c7f63SJim Harris    SCI_BASE_CONTROLLER_REQUEST_HANDLER_T terminate_request_handler;
446f11c7f63SJim Harris    SCIC_SDS_CONTROLLER_PHY_HANDLER_T     link_up_handler;
447f11c7f63SJim Harris    SCIC_SDS_CONTROLLER_PHY_HANDLER_T     link_down_handler;
448f11c7f63SJim Harris    SCIC_SDS_CONTROLLER_DEVICE_HANDLER_T  remote_device_started_handler;
449f11c7f63SJim Harris    SCIC_SDS_CONTROLLER_DEVICE_HANDLER_T  remote_device_stopped_handler;
450f11c7f63SJim Harris 
451f11c7f63SJim Harris } SCIC_SDS_CONTROLLER_STATE_HANDLER_T;
452f11c7f63SJim Harris 
453f11c7f63SJim Harris extern SCIC_SDS_CONTROLLER_STATE_HANDLER_T
454f11c7f63SJim Harris        scic_sds_controller_state_handler_table[];
455f11c7f63SJim Harris extern SCI_BASE_STATE_T scic_sds_controller_state_table[];
456f11c7f63SJim Harris 
457f11c7f63SJim Harris /**
458f11c7f63SJim Harris  * This macro will increment the specified index to and if the index wraps
459f11c7f63SJim Harris  * to 0 it will toggel the cycle bit.
460f11c7f63SJim Harris  */
461f11c7f63SJim Harris #define INCREMENT_QUEUE_GET(index, cycle, entry_count, bit_toggle) \
462f11c7f63SJim Harris { \
463f11c7f63SJim Harris    if ((index) + 1 == entry_count) \
464f11c7f63SJim Harris    { \
465f11c7f63SJim Harris       (index) = 0; \
466f11c7f63SJim Harris       (cycle) = (cycle) ^ (bit_toggle); \
467f11c7f63SJim Harris    } \
468f11c7f63SJim Harris    else \
469f11c7f63SJim Harris    { \
470f11c7f63SJim Harris       index = index + 1; \
471f11c7f63SJim Harris    } \
472f11c7f63SJim Harris }
473f11c7f63SJim Harris 
474f11c7f63SJim Harris /**
475f11c7f63SJim Harris  * This is a helper macro that sets the state handlers for the controller
476f11c7f63SJim Harris  * object
477f11c7f63SJim Harris  */
478f11c7f63SJim Harris #define scic_sds_controller_set_state_handlers(this_controller, handlers) \
479f11c7f63SJim Harris    ((this_controller)->state_handlers = (handlers))
480f11c7f63SJim Harris 
481f11c7f63SJim Harris /**
482f11c7f63SJim Harris  * This is a helper macro that gets the base state machine for the
483f11c7f63SJim Harris  * controller object
484f11c7f63SJim Harris  */
485f11c7f63SJim Harris #define scic_sds_controller_get_base_state_machine(this_contoroller) \
486f11c7f63SJim Harris    (&(this_controller)->parent.state_machine)
487f11c7f63SJim Harris 
488f11c7f63SJim Harris /**
489f11c7f63SJim Harris  * This is a helper macro to get the port configuration agent from the
490f11c7f63SJim Harris  * controller object.
491f11c7f63SJim Harris  */
492f11c7f63SJim Harris #define scic_sds_controller_get_port_configuration_agent(controller) \
493f11c7f63SJim Harris    (&(controller)->port_agent)
494f11c7f63SJim Harris 
495f11c7f63SJim Harris /**
496f11c7f63SJim Harris  * This is a helper macro that sets the base state machine state handlers
497f11c7f63SJim Harris  * based on the state id
498f11c7f63SJim Harris  */
499f11c7f63SJim Harris #define scic_sds_controller_set_base_state_handlers(this_controller, state_id) \
500f11c7f63SJim Harris    scic_sds_controller_set_state_handlers( \
501f11c7f63SJim Harris       this_controller, &scic_sds_controller_state_handler_table[(state_id)])
502f11c7f63SJim Harris 
503f11c7f63SJim Harris /**
504f11c7f63SJim Harris  * This macro writes to the smu_register for this controller
505f11c7f63SJim Harris  */
506f11c7f63SJim Harris #define smu_register_write(controller, reg, value) \
507f11c7f63SJim Harris    scic_sds_pci_write_smu_dword((controller), &(reg), (value))
508f11c7f63SJim Harris 
509f11c7f63SJim Harris /**
510f11c7f63SJim Harris  * This macro reads the smu_register for this controller
511f11c7f63SJim Harris  */
512f11c7f63SJim Harris #define smu_register_read(controller, reg) \
513f11c7f63SJim Harris    scic_sds_pci_read_smu_dword((controller), &(reg))
514f11c7f63SJim Harris 
515f11c7f63SJim Harris /**
516f11c7f63SJim Harris  * This mcaro writes the scu_register for this controller
517f11c7f63SJim Harris  */
518f11c7f63SJim Harris #define scu_register_write(controller, reg, value) \
519f11c7f63SJim Harris    scic_sds_pci_write_scu_dword((controller), &(reg), (value))
520f11c7f63SJim Harris 
521f11c7f63SJim Harris /**
522f11c7f63SJim Harris  * This macro reads the scu_register for this controller
523f11c7f63SJim Harris  */
524f11c7f63SJim Harris #define scu_register_read(controller, reg) \
525f11c7f63SJim Harris    scic_sds_pci_read_scu_dword((controller), &(reg))
526f11c7f63SJim Harris 
527f11c7f63SJim Harris #ifdef ARLINGTON_BUILD
528f11c7f63SJim Harris    /**
529f11c7f63SJim Harris     * This macro writes to the lex_register for this controller.
530f11c7f63SJim Harris     */
531f11c7f63SJim Harris    #define lex_register_write(controller, reg, value) \
532f11c7f63SJim Harris       scic_cb_pci_write_dword((controller), (reg), (value))
533f11c7f63SJim Harris 
534f11c7f63SJim Harris    /**
535f11c7f63SJim Harris     * This macro reads from the lex_register for this controller.
536f11c7f63SJim Harris     */
537f11c7f63SJim Harris    #define lex_register_read(controller, reg) \
538f11c7f63SJim Harris       scic_cb_pci_read_dword((controller), (reg))
539f11c7f63SJim Harris #endif // ARLINGTON_BUILD
540f11c7f63SJim Harris 
541f11c7f63SJim Harris /**
542f11c7f63SJim Harris  * This macro returns the protocol engine group for this controller object.
543f11c7f63SJim Harris  * Presently we only support protocol engine group 0 so just return that
544f11c7f63SJim Harris  */
545f11c7f63SJim Harris #define scic_sds_controller_get_protocol_engine_group(controller) 0
546f11c7f63SJim Harris 
547f11c7f63SJim Harris /**
548f11c7f63SJim Harris  * This macro constructs an IO tag from the sequence and index values.
549f11c7f63SJim Harris  */
550f11c7f63SJim Harris #define scic_sds_io_tag_construct(sequence, task_index) \
551f11c7f63SJim Harris    ((sequence) << 12 | (task_index))
552f11c7f63SJim Harris 
553f11c7f63SJim Harris /**
554f11c7f63SJim Harris  * This macro returns the IO sequence from the IO tag value.
555f11c7f63SJim Harris  */
556f11c7f63SJim Harris #define scic_sds_io_tag_get_sequence(io_tag) \
557f11c7f63SJim Harris    (((io_tag) & 0xF000) >> 12)
558f11c7f63SJim Harris 
559f11c7f63SJim Harris /**
560f11c7f63SJim Harris  * This macro returns the TCi from the io tag value
561f11c7f63SJim Harris  */
562f11c7f63SJim Harris #define scic_sds_io_tag_get_index(io_tag) \
563f11c7f63SJim Harris    ((io_tag) & 0x0FFF)
564f11c7f63SJim Harris 
565f11c7f63SJim Harris /**
566f11c7f63SJim Harris  * This is a helper macro to increment the io sequence count.
567f11c7f63SJim Harris  *
568f11c7f63SJim Harris  * We may find in the future that it will be faster to store the sequence
569f11c7f63SJim Harris  * count in such a way as we dont perform the shift operation to build io
570f11c7f63SJim Harris  * tag values so therefore need a way to incrment them correctly
571f11c7f63SJim Harris  */
572f11c7f63SJim Harris #define scic_sds_io_sequence_increment(value) \
573f11c7f63SJim Harris    ((value) = (((value) + 1) & 0x000F))
574f11c7f63SJim Harris 
575f11c7f63SJim Harris #define scic_sds_remote_device_node_count(device) \
576f11c7f63SJim Harris    ( \
577f11c7f63SJim Harris       ( \
578f11c7f63SJim Harris          (device)->target_protocols.u.bits.attached_stp_target \
579f11c7f63SJim Harris       && ((device)->is_direct_attached != TRUE) \
580f11c7f63SJim Harris       ) \
581f11c7f63SJim Harris       ? SCU_STP_REMOTE_NODE_COUNT : SCU_SSP_REMOTE_NODE_COUNT \
582f11c7f63SJim Harris    )
583f11c7f63SJim Harris 
584f11c7f63SJim Harris /**
585f11c7f63SJim Harris  * This macro will set the bit in the invalid phy mask for this controller
586f11c7f63SJim Harris  * object.  This is used to control messages reported for invalid link up
587f11c7f63SJim Harris  * notifications.
588f11c7f63SJim Harris  */
589f11c7f63SJim Harris #define scic_sds_controller_set_invalid_phy(controller, phy) \
590f11c7f63SJim Harris    ((controller)->invalid_phy_mask |= (1 << (phy)->phy_index))
591f11c7f63SJim Harris 
592f11c7f63SJim Harris /**
593f11c7f63SJim Harris  * This macro will clear the bit in the invalid phy mask for this controller
594f11c7f63SJim Harris  * object.  This is used to control messages reported for invalid link up
595f11c7f63SJim Harris  * notifications.
596f11c7f63SJim Harris  */
597f11c7f63SJim Harris #define scic_sds_controller_clear_invalid_phy(controller, phy) \
598f11c7f63SJim Harris    ((controller)->invalid_phy_mask &= ~(1 << (phy)->phy_index))
599f11c7f63SJim Harris 
600f11c7f63SJim Harris // ---------------------------------------------------------------------------
601f11c7f63SJim Harris 
602f11c7f63SJim Harris U32 scic_sds_controller_get_object_size(void);
603f11c7f63SJim Harris 
604f11c7f63SJim Harris // ---------------------------------------------------------------------------
605f11c7f63SJim Harris 
606f11c7f63SJim Harris U32 scic_sds_controller_get_min_timer_count(void);
607f11c7f63SJim Harris U32 scic_sds_controller_get_max_timer_count(void);
608f11c7f63SJim Harris 
609f11c7f63SJim Harris // ---------------------------------------------------------------------------
610f11c7f63SJim Harris 
611f11c7f63SJim Harris void scic_sds_controller_post_request(
612f11c7f63SJim Harris    SCIC_SDS_CONTROLLER_T *this_controller,
613f11c7f63SJim Harris    U32                    request
614f11c7f63SJim Harris );
615f11c7f63SJim Harris 
616f11c7f63SJim Harris // ---------------------------------------------------------------------------
617f11c7f63SJim Harris 
618f11c7f63SJim Harris void scic_sds_controller_release_frame(
619f11c7f63SJim Harris    SCIC_SDS_CONTROLLER_T *this_controller,
620f11c7f63SJim Harris    U32                   frame_index
621f11c7f63SJim Harris );
622f11c7f63SJim Harris 
623f11c7f63SJim Harris void scic_sds_controller_copy_sata_response(
624f11c7f63SJim Harris    void * response_buffer,
625f11c7f63SJim Harris    void * frame_header,
626f11c7f63SJim Harris    void * frame_buffer
627f11c7f63SJim Harris );
628f11c7f63SJim Harris 
629f11c7f63SJim Harris // ---------------------------------------------------------------------------
630f11c7f63SJim Harris 
631f11c7f63SJim Harris SCI_STATUS scic_sds_controller_allocate_remote_node_context(
632f11c7f63SJim Harris    SCIC_SDS_CONTROLLER_T         *this_controller,
633f11c7f63SJim Harris    struct SCIC_SDS_REMOTE_DEVICE *the_device,
634f11c7f63SJim Harris    U16                           *node_id
635f11c7f63SJim Harris );
636f11c7f63SJim Harris 
637f11c7f63SJim Harris void scic_sds_controller_free_remote_node_context(
638f11c7f63SJim Harris    SCIC_SDS_CONTROLLER_T         *this_controller,
639f11c7f63SJim Harris    struct SCIC_SDS_REMOTE_DEVICE *the_device,
640f11c7f63SJim Harris    U16                            node_id
641f11c7f63SJim Harris );
642f11c7f63SJim Harris 
643f11c7f63SJim Harris SCU_REMOTE_NODE_CONTEXT_T *scic_sds_controller_get_remote_node_context_buffer(
644f11c7f63SJim Harris    SCIC_SDS_CONTROLLER_T *this_controller,
645f11c7f63SJim Harris    U16                    node_id
646f11c7f63SJim Harris );
647f11c7f63SJim Harris 
648f11c7f63SJim Harris // ---------------------------------------------------------------------------
649f11c7f63SJim Harris 
650f11c7f63SJim Harris struct SCIC_SDS_REQUEST *scic_sds_controller_get_io_request_from_tag(
651f11c7f63SJim Harris    SCIC_SDS_CONTROLLER_T *this_controller,
652f11c7f63SJim Harris    U16                    io_tag
653f11c7f63SJim Harris );
654f11c7f63SJim Harris 
655f11c7f63SJim Harris U16 scic_sds_controller_get_io_sequence_from_tag(
656f11c7f63SJim Harris    SCIC_SDS_CONTROLLER_T *this_controller,
657f11c7f63SJim Harris    U16                    io_tag
658f11c7f63SJim Harris );
659f11c7f63SJim Harris 
660f11c7f63SJim Harris SCU_TASK_CONTEXT_T *scic_sds_controller_get_task_context_buffer(
661f11c7f63SJim Harris    SCIC_SDS_CONTROLLER_T *this_controller,
662f11c7f63SJim Harris    U16                   io_tag
663f11c7f63SJim Harris );
664f11c7f63SJim Harris 
665f11c7f63SJim Harris //-----------------------------------------------------------------------------
666f11c7f63SJim Harris 
667f11c7f63SJim Harris SCI_STATUS scic_sds_terminate_reqests(
668f11c7f63SJim Harris         SCIC_SDS_CONTROLLER_T *this_controller,
669f11c7f63SJim Harris         struct SCIC_SDS_REMOTE_DEVICE *this_remote_device,
670f11c7f63SJim Harris         struct SCIC_SDS_PORT *this_port
671f11c7f63SJim Harris );
672f11c7f63SJim Harris 
673f11c7f63SJim Harris //*****************************************************************************
674f11c7f63SJim Harris //* CORE CONTROLLER POWER CONTROL METHODS
675f11c7f63SJim Harris //*****************************************************************************
676f11c7f63SJim Harris 
677f11c7f63SJim Harris void scic_sds_controller_power_control_timer_handler(
678f11c7f63SJim Harris    void *controller
679f11c7f63SJim Harris );
680f11c7f63SJim Harris 
681f11c7f63SJim Harris void scic_sds_controller_power_control_queue_insert(
682f11c7f63SJim Harris    SCIC_SDS_CONTROLLER_T *this_controller,
683f11c7f63SJim Harris    struct SCIC_SDS_PHY   *the_phy
684f11c7f63SJim Harris );
685f11c7f63SJim Harris 
686f11c7f63SJim Harris void scic_sds_controller_power_control_queue_remove(
687f11c7f63SJim Harris    SCIC_SDS_CONTROLLER_T *this_controller,
688f11c7f63SJim Harris    struct SCIC_SDS_PHY   *the_phy
689f11c7f63SJim Harris );
690f11c7f63SJim Harris 
691f11c7f63SJim Harris //*****************************************************************************
692f11c7f63SJim Harris //* CORE CONTROLLER PHY MESSAGE PROCESSING
693f11c7f63SJim Harris //*****************************************************************************
694f11c7f63SJim Harris 
695f11c7f63SJim Harris void scic_sds_controller_link_up(
696f11c7f63SJim Harris    SCIC_SDS_CONTROLLER_T *this_controller,
697f11c7f63SJim Harris    struct SCIC_SDS_PORT  *the_port,
698f11c7f63SJim Harris    struct SCIC_SDS_PHY   *the_phy
699f11c7f63SJim Harris );
700f11c7f63SJim Harris 
701f11c7f63SJim Harris void scic_sds_controller_link_down(
702f11c7f63SJim Harris    SCIC_SDS_CONTROLLER_T *this_controller,
703f11c7f63SJim Harris    struct SCIC_SDS_PORT  *the_port,
704f11c7f63SJim Harris    struct SCIC_SDS_PHY   *the_phy
705f11c7f63SJim Harris );
706f11c7f63SJim Harris 
707f11c7f63SJim Harris //*****************************************************************************
708f11c7f63SJim Harris //* CORE CONTROLLER PORT AGENT MESSAGE PROCESSING
709f11c7f63SJim Harris //*****************************************************************************
710f11c7f63SJim Harris void scic_sds_controller_port_agent_configured_ports(
711f11c7f63SJim Harris    SCIC_SDS_CONTROLLER_T * this_controller
712f11c7f63SJim Harris );
713f11c7f63SJim Harris 
714f11c7f63SJim Harris //*****************************************************************************
715f11c7f63SJim Harris //* CORE CONTROLLER REMOTE DEVICE MESSAGE PROCESSING
716f11c7f63SJim Harris //*****************************************************************************
717f11c7f63SJim Harris 
718f11c7f63SJim Harris BOOL scic_sds_controller_has_remote_devices_stopping(
719f11c7f63SJim Harris    SCIC_SDS_CONTROLLER_T * this_controller
720f11c7f63SJim Harris );
721f11c7f63SJim Harris 
722f11c7f63SJim Harris void scic_sds_controller_remote_device_started(
723f11c7f63SJim Harris    SCIC_SDS_CONTROLLER_T         * this_controller,
724f11c7f63SJim Harris    struct SCIC_SDS_REMOTE_DEVICE * the_device
725f11c7f63SJim Harris );
726f11c7f63SJim Harris 
727f11c7f63SJim Harris void scic_sds_controller_remote_device_stopped(
728f11c7f63SJim Harris    SCIC_SDS_CONTROLLER_T         * this_controller,
729f11c7f63SJim Harris    struct SCIC_SDS_REMOTE_DEVICE * the_device
730f11c7f63SJim Harris );
731f11c7f63SJim Harris 
732f11c7f63SJim Harris //*****************************************************************************
733f11c7f63SJim Harris //* CORE CONTROLLER PRIVATE METHODS
734f11c7f63SJim Harris //*****************************************************************************
735f11c7f63SJim Harris 
736f11c7f63SJim Harris #ifdef SCI_LOGGING
737f11c7f63SJim Harris void scic_sds_controller_initialize_state_logging(
738f11c7f63SJim Harris    SCIC_SDS_CONTROLLER_T *this_controller
739f11c7f63SJim Harris );
740f11c7f63SJim Harris 
741f11c7f63SJim Harris void scic_sds_controller_deinitialize_state_logging(
742f11c7f63SJim Harris    SCIC_SDS_CONTROLLER_T *this_controller
743f11c7f63SJim Harris );
744f11c7f63SJim Harris #else
745f11c7f63SJim Harris #define scic_sds_controller_initialize_state_logging(x)
746f11c7f63SJim Harris #define scic_sds_controller_deinitialize_state_logging(x)
747f11c7f63SJim Harris #endif
748f11c7f63SJim Harris 
749f11c7f63SJim Harris SCI_STATUS scic_sds_controller_validate_memory_descriptor_table(
750f11c7f63SJim Harris    SCIC_SDS_CONTROLLER_T *this_controller
751f11c7f63SJim Harris );
752f11c7f63SJim Harris 
753f11c7f63SJim Harris void scic_sds_controller_ram_initialization(
754f11c7f63SJim Harris    SCIC_SDS_CONTROLLER_T *this_controller
755f11c7f63SJim Harris );
756f11c7f63SJim Harris 
757f11c7f63SJim Harris void scic_sds_controller_assign_task_entries(
758f11c7f63SJim Harris    SCIC_SDS_CONTROLLER_T *this_controller
759f11c7f63SJim Harris );
760f11c7f63SJim Harris 
761f11c7f63SJim Harris void scic_sds_controller_afe_initialization(
762f11c7f63SJim Harris    SCIC_SDS_CONTROLLER_T * this_controller
763f11c7f63SJim Harris );
764f11c7f63SJim Harris 
765f11c7f63SJim Harris void scic_sds_controller_enable_port_task_scheduler(
766f11c7f63SJim Harris    SCIC_SDS_CONTROLLER_T *this_controller
767f11c7f63SJim Harris );
768f11c7f63SJim Harris 
769f11c7f63SJim Harris void scic_sds_controller_initialize_completion_queue(
770f11c7f63SJim Harris    SCIC_SDS_CONTROLLER_T *this_controller
771f11c7f63SJim Harris );
772f11c7f63SJim Harris 
773f11c7f63SJim Harris void scic_sds_controller_initialize_unsolicited_frame_queue(
774f11c7f63SJim Harris    SCIC_SDS_CONTROLLER_T *this_controller
775f11c7f63SJim Harris );
776f11c7f63SJim Harris 
777f11c7f63SJim Harris void scic_sds_controller_phy_timer_stop(
778f11c7f63SJim Harris    SCIC_SDS_CONTROLLER_T *this_controller
779f11c7f63SJim Harris );
780f11c7f63SJim Harris 
781f11c7f63SJim Harris BOOL scic_sds_controller_is_start_complete(
782f11c7f63SJim Harris    SCIC_SDS_CONTROLLER_T *this_controller
783f11c7f63SJim Harris );
784f11c7f63SJim Harris 
785f11c7f63SJim Harris SCI_STATUS scic_sds_controller_start_next_phy(
786f11c7f63SJim Harris    SCIC_SDS_CONTROLLER_T *this_controller
787f11c7f63SJim Harris );
788f11c7f63SJim Harris 
789f11c7f63SJim Harris SCI_STATUS scic_sds_controller_stop_phys(
790f11c7f63SJim Harris    SCIC_SDS_CONTROLLER_T *this_controller
791f11c7f63SJim Harris );
792f11c7f63SJim Harris 
793f11c7f63SJim Harris SCI_STATUS scic_sds_controller_stop_ports(
794f11c7f63SJim Harris    SCIC_SDS_CONTROLLER_T *this_controller
795f11c7f63SJim Harris );
796f11c7f63SJim Harris 
797f11c7f63SJim Harris SCI_STATUS scic_sds_controller_stop_devices(
798f11c7f63SJim Harris    SCIC_SDS_CONTROLLER_T *this_controller
799f11c7f63SJim Harris );
800f11c7f63SJim Harris 
801f11c7f63SJim Harris void scic_sds_controller_copy_task_context(
802f11c7f63SJim Harris    SCIC_SDS_CONTROLLER_T   *this_controller,
803f11c7f63SJim Harris    struct SCIC_SDS_REQUEST *this_request
804f11c7f63SJim Harris );
805f11c7f63SJim Harris 
806f11c7f63SJim Harris void scic_sds_controller_timeout_handler(
807f11c7f63SJim Harris    SCI_CONTROLLER_HANDLE_T controller
808f11c7f63SJim Harris );
809f11c7f63SJim Harris 
810f11c7f63SJim Harris void scic_sds_controller_initialize_power_control(
811f11c7f63SJim Harris    SCIC_SDS_CONTROLLER_T *this_controller
812f11c7f63SJim Harris );
813f11c7f63SJim Harris 
814f11c7f63SJim Harris void scic_sds_controller_register_setup(
815f11c7f63SJim Harris    SCIC_SDS_CONTROLLER_T *this_controller
816f11c7f63SJim Harris );
817f11c7f63SJim Harris 
818f11c7f63SJim Harris void scic_sds_controller_reset_hardware(
819f11c7f63SJim Harris    SCIC_SDS_CONTROLLER_T * this_controller
820f11c7f63SJim Harris );
821f11c7f63SJim Harris 
822f11c7f63SJim Harris #ifdef ARLINGTON_BUILD
823f11c7f63SJim Harris void scic_sds_controller_lex_atux_initialization(
824f11c7f63SJim Harris    SCIC_SDS_CONTROLLER_T *this_controller
825f11c7f63SJim Harris );
826f11c7f63SJim Harris 
827f11c7f63SJim Harris void scic_sds_controller_enable_chipwatch(
828f11c7f63SJim Harris    SCIC_SDS_CONTROLLER_T *this_controller
829f11c7f63SJim Harris );
830f11c7f63SJim Harris #endif // ARLINGTON_BUILD
831f11c7f63SJim Harris 
832f11c7f63SJim Harris void scic_sds_controller_build_memory_descriptor_table(
833f11c7f63SJim Harris    SCIC_SDS_CONTROLLER_T *this_controller
834f11c7f63SJim Harris );
835f11c7f63SJim Harris 
836f11c7f63SJim Harris #ifdef __cplusplus
837f11c7f63SJim Harris }
838f11c7f63SJim Harris #endif // __cplusplus
839f11c7f63SJim Harris 
840f11c7f63SJim Harris #endif // _SCIC_SDS_CONTROLLER_H_
841