scic_sds_port_configuration_agent.h revision 230557
1184610Salfred/*-
2184610Salfred * This file is provided under a dual BSD/GPLv2 license.  When using or
3184610Salfred * redistributing this file, you may do so under either license.
4184610Salfred *
5184610Salfred * GPL LICENSE SUMMARY
6184610Salfred *
7184610Salfred * Copyright(c) 2008 - 2011 Intel Corporation. All rights reserved.
8184610Salfred *
9184610Salfred * This program is free software; you can redistribute it and/or modify
10184610Salfred * it under the terms of version 2 of the GNU General Public License as
11184610Salfred * published by the Free Software Foundation.
12184610Salfred *
13184610Salfred * This program is distributed in the hope that it will be useful, but
14184610Salfred * WITHOUT ANY WARRANTY; without even the implied warranty of
15184610Salfred * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16184610Salfred * General Public License for more details.
17184610Salfred *
18184610Salfred * You should have received a copy of the GNU General Public License
19184610Salfred * along with this program; if not, write to the Free Software
20184610Salfred * Foundation, Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
21184610Salfred * The full GNU General Public License is included in this distribution
22184610Salfred * in the file called LICENSE.GPL.
23184610Salfred *
24184610Salfred * BSD LICENSE
25184610Salfred *
26184610Salfred * Copyright(c) 2008 - 2011 Intel Corporation. All rights reserved.
27184610Salfred * All rights reserved.
28184610Salfred *
29184610Salfred * Redistribution and use in source and binary forms, with or without
30184610Salfred * modification, are permitted provided that the following conditions
31184610Salfred * are met:
32184610Salfred *
33184610Salfred *   * Redistributions of source code must retain the above copyright
34184610Salfred *     notice, this list of conditions and the following disclaimer.
35184610Salfred *   * Redistributions in binary form must reproduce the above copyright
36184610Salfred *     notice, this list of conditions and the following disclaimer in
37184610Salfred *     the documentation and/or other materials provided with the
38184610Salfred *     distribution.
39184610Salfred *
40184610Salfred * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
41184610Salfred * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
42184610Salfred * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
43184610Salfred * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
44184610Salfred * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
45184610Salfred * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
46184610Salfred * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
47184610Salfred * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
48184610Salfred * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
49184610Salfred * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
50184610Salfred * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
51184610Salfred *
52184610Salfred * $FreeBSD$
53184610Salfred */
54184610Salfred#ifndef _SCIC_SDS_PORT_CONFIGURATION_AGENT_H_
55184610Salfred#define _SCIC_SDS_PORT_CONFIGURATION_AGENT_H_
56184610Salfred
57184610Salfred/**
58184610Salfred * @file
59184610Salfred *
60184610Salfred * @brief This file contains the structures, constants and prototypes used for
61184610Salfred *        the core controller automatic port configuration engine.
62184610Salfred */
63184610Salfred
64184610Salfred#ifdef __cplusplus
65184610Salfredextern "C" {
66184610Salfred#endif // __cplusplus
67184610Salfred
68184610Salfred#include <dev/isci/scil/scic_sds_port.h>
69184610Salfred#include <dev/isci/scil/scic_sds_phy.h>
70184610Salfred
71184610Salfredstruct SCIC_SDS_CONTROLLER;
72184610Salfredstruct SCIC_SDS_PORT_CONFIGURATION_AGENT;
73184610Salfredstruct SCIC_SDS_PORT;
74184610Salfredstruct SCIC_SDS_PHY;
75184610Salfred
76184610Salfredtypedef void (*SCIC_SDS_PORT_CONFIGURATION_AGENT_PHY_HANDLER_T)(
77184610Salfred   struct SCIC_SDS_CONTROLLER *,
78184610Salfred   struct SCIC_SDS_PORT_CONFIGURATION_AGENT *,
79184610Salfred   struct SCIC_SDS_PORT *,
80184610Salfred   struct SCIC_SDS_PHY  *
81184610Salfred);
82184610Salfred
83184610Salfredstruct SCIC_SDS_PORT_RANGE
84184610Salfred{
85184610Salfred   U8 min_index;
86184610Salfred   U8 max_index;
87184610Salfred};
88184610Salfred
89184610Salfredtypedef struct SCIC_SDS_PORT_CONFIGURATION_AGENT
90184610Salfred{
91184610Salfred   U16 phy_configured_mask;
92184610Salfred   U16 phy_ready_mask;
93184610Salfred
94184610Salfred   struct SCIC_SDS_PORT_RANGE phy_valid_port_range[SCI_MAX_PHYS];
95184610Salfred
96184610Salfred   BOOL timer_pending;
97184610Salfred
98184610Salfred   SCIC_SDS_PORT_CONFIGURATION_AGENT_PHY_HANDLER_T link_up_handler;
99184610Salfred   SCIC_SDS_PORT_CONFIGURATION_AGENT_PHY_HANDLER_T link_down_handler;
100184610Salfred
101184610Salfred   void *timer;
102184610Salfred
103184610Salfred} SCIC_SDS_PORT_CONFIGURATION_AGENT_T;
104184610Salfred
105184610Salfredvoid scic_sds_port_configuration_agent_construct(
106184610Salfred   SCIC_SDS_PORT_CONFIGURATION_AGENT_T * port_agent
107184610Salfred);
108184610Salfred
109184610SalfredSCI_STATUS scic_sds_port_configuration_agent_initialize(
110184610Salfred   struct SCIC_SDS_CONTROLLER          * controller,
111184610Salfred   SCIC_SDS_PORT_CONFIGURATION_AGENT_T * port_agent
112184610Salfred);
113184610Salfred
114184610Salfredvoid scic_sds_port_configuration_agent_destroy(
115184610Salfred   struct SCIC_SDS_CONTROLLER          * controller,
116184610Salfred   SCIC_SDS_PORT_CONFIGURATION_AGENT_T * port_agent
117184610Salfred);
118184610Salfred
119184610Salfredvoid scic_sds_port_configuration_agent_release_resource(
120184610Salfred   struct SCIC_SDS_CONTROLLER          * controller,
121184610Salfred   SCIC_SDS_PORT_CONFIGURATION_AGENT_T * port_agent
122184610Salfred);
123184610Salfred
124184610Salfred#ifdef __cplusplus
125184610Salfred}
126184610Salfred#endif // __cplusplus
127184610Salfred
128184610Salfred#endif // _SCIC_SDS_PORT_CONFIGURATION_AGENT_H_
129184610Salfred