isci: workaround port task scheduler starvation issue
[deliverable/linux.git] / drivers / scsi / isci / core / scic_port.h
1 /*
2 * This file is provided under a dual BSD/GPLv2 license. When using or
3 * redistributing this file, you may do so under either license.
4 *
5 * GPL LICENSE SUMMARY
6 *
7 * Copyright(c) 2008 - 2011 Intel Corporation. All rights reserved.
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of version 2 of the GNU General Public License as
11 * published by the Free Software Foundation.
12 *
13 * This program is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
21 * The full GNU General Public License is included in this distribution
22 * in the file called LICENSE.GPL.
23 *
24 * BSD LICENSE
25 *
26 * Copyright(c) 2008 - 2011 Intel Corporation. All rights reserved.
27 * All rights reserved.
28 *
29 * Redistribution and use in source and binary forms, with or without
30 * modification, are permitted provided that the following conditions
31 * are met:
32 *
33 * * Redistributions of source code must retain the above copyright
34 * notice, this list of conditions and the following disclaimer.
35 * * Redistributions in binary form must reproduce the above copyright
36 * notice, this list of conditions and the following disclaimer in
37 * the documentation and/or other materials provided with the
38 * distribution.
39 * * Neither the name of Intel Corporation nor the names of its
40 * contributors may be used to endorse or promote products derived
41 * from this software without specific prior written permission.
42 *
43 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
44 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
45 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
46 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
47 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
48 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
49 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
50 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
51 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
52 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
53 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
54 */
55
56 #ifndef _SCIC_PORT_H_
57 #define _SCIC_PORT_H_
58
59 /**
60 * This file contains all of the interface methods that can be called by an SCI
61 * Core user on a SAS or SATA port.
62 *
63 *
64 */
65
66
67 #include "sci_status.h"
68 #include "intel_sas.h"
69
70 struct scic_sds_port;
71
72 enum SCIC_PORT_NOT_READY_REASON_CODE {
73 SCIC_PORT_NOT_READY_NO_ACTIVE_PHYS,
74 SCIC_PORT_NOT_READY_HARD_RESET_REQUESTED,
75 SCIC_PORT_NOT_READY_INVALID_PORT_CONFIGURATION,
76 SCIC_PORT_NOT_READY_RECONFIGURING,
77
78 SCIC_PORT_NOT_READY_REASON_CODE_MAX
79 };
80
81 /**
82 * struct scic_port_end_point_properties - This structure defines the
83 * properties that can be retrieved for each end-point local or remote
84 * (attached) port in the controller.
85 *
86 *
87 */
88 struct scic_port_end_point_properties {
89 /**
90 * This field indicates the SAS address for the associated end
91 * point in the port.
92 */
93 struct sci_sas_address sas_address;
94
95 /**
96 * This field indicates the protocols supported by the associated
97 * end-point in the port.
98 */
99 struct sci_sas_identify_address_frame_protocols protocols;
100
101 };
102
103 /**
104 * struct scic_port_properties - This structure defines the properties that can
105 * be retrieved for each port in the controller.
106 *
107 *
108 */
109 struct scic_port_properties {
110 /**
111 * This field specifies the logical index of the port (0 relative).
112 */
113 u32 index;
114
115 /**
116 * This field indicates the local end-point properties for port.
117 */
118 struct scic_port_end_point_properties local;
119
120 /**
121 * This field indicates the remote (attached) end-point properties
122 * for the port.
123 */
124 struct scic_port_end_point_properties remote;
125
126 /**
127 * This field specifies the phys contained inside the port.
128 */
129 u32 phy_mask;
130
131 };
132
133 /**
134 * scic_port_get_properties() - This method simply returns the properties
135 * regarding the port, such as: physical index, protocols, sas address, etc.
136 * @port: this parameter specifies the port for which to retrieve the physical
137 * index.
138 * @properties: This parameter specifies the properties structure into which to
139 * copy the requested information.
140 *
141 * Indicate if the user specified a valid port. SCI_SUCCESS This value is
142 * returned if the specified port was valid. SCI_FAILURE_INVALID_PORT This
143 * value is returned if the specified port is not valid. When this value is
144 * returned, no data is copied to the properties output parameter.
145 */
146 enum sci_status scic_port_get_properties(
147 struct scic_sds_port *port,
148 struct scic_port_properties *properties);
149
150 /**
151 * scic_port_stop() - This method will make the port no longer ready for
152 * operation. After invoking this method IO operation is not possible.
153 * @port: This parameter specifies the port to be stopped.
154 *
155 * Indicate if the port was successfully stopped. SCI_SUCCESS This value is
156 * returned if the port was successfully stopped. SCI_WARNING_ALREADY_IN_STATE
157 * This value is returned if the port is already stopped or in the process of
158 * stopping. SCI_FAILURE_INVALID_PORT This value is returned if the supplied
159 * port is not valid. SCI_FAILURE_INVALID_STATE This value is returned if a
160 * stop operation can't be completed due to the state of port.
161 */
162 enum sci_status scic_port_stop(
163 struct scic_sds_port *port);
164
165 /**
166 * scic_port_hard_reset() - This method will request the SCI implementation to
167 * perform a HARD RESET on the SAS Port. If/When the HARD RESET completes
168 * the SCI user will be notified via an SCI OS callback indicating a direct
169 * attached device was found.
170 * @port: a handle corresponding to the SAS port to be hard reset.
171 * @reset_timeout: This parameter specifies the number of milliseconds in which
172 * the port reset operation should complete.
173 *
174 * The SCI User callback in SCIC_USER_CALLBACKS_T will only be called once for
175 * each phy in the SAS Port at completion of the hard reset sequence. Return a
176 * status indicating whether the hard reset started successfully. SCI_SUCCESS
177 * This value is returned if the hard reset operation started successfully.
178 */
179 enum sci_status scic_port_hard_reset(
180 struct scic_sds_port *port,
181 u32 reset_timeout);
182
183 /**
184 * scic_port_enable_broadcast_change_notification() - This API method enables
185 * the broadcast change notification from underneath hardware.
186 * @port: The port upon which broadcast change notifications (BCN) are to be
187 * enabled.
188 *
189 */
190 void scic_port_enable_broadcast_change_notification(
191 struct scic_sds_port *port);
192
193
194 #endif /* _SCIC_PORT_H_ */
195
This page took 0.034387 seconds and 5 git commands to generate.