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.
7 * Copyright(c) 2008 - 2011 Intel Corporation. All rights reserved.
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.
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.
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.
26 * Copyright(c) 2008 - 2011 Intel Corporation. All rights reserved.
27 * All rights reserved.
29 * Redistribution and use in source and binary forms, with or without
30 * modification, are permitted provided that the following conditions
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
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.
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.
59 #include <linux/interrupt.h>
60 #include <linux/types.h>
62 #define DRV_NAME "isci"
63 #define SCI_PCI_BAR_COUNT 2
64 #define SCI_NUM_MSI_X_INT 2
66 #define SCI_SMU_BAR_SIZE (16*1024)
68 #define SCI_SCU_BAR_SIZE (4*1024*1024)
69 #define SCI_IO_SPACE_BAR0 2
70 #define SCI_IO_SPACE_BAR1 3
71 #define ISCI_CAN_QUEUE_VAL 250 /* < SCI_MAX_IO_REQUESTS ? */
72 #define SCIC_CONTROLLER_STOP_TIMEOUT 5000
74 #define SCI_CONTROLLER_INVALID_IO_TAG 0xFFFF
76 enum sci_controller_mode {
78 SCI_MODE_SIZE /* deprecated */
81 #define SCI_MAX_PHYS (4)
82 #define SCI_MAX_PORTS SCI_MAX_PHYS
83 #define SCI_MIN_SMP_PHYS (38)
84 #define SCI_MAX_SMP_PHYS (384) /* not silicon constrained */
85 #define SCI_MAX_REMOTE_DEVICES (256)
86 #define SCI_MIN_REMOTE_DEVICES (16)
87 #define SCI_MAX_IO_REQUESTS (256)
88 #define SCI_MIN_IO_REQUESTS (1)
89 #define SCI_MAX_MSIX_MESSAGES (2)
90 #define SCI_MAX_SCATTER_GATHER_ELEMENTS 130 /* not silicon constrained */
91 #define SCI_MIN_SCATTER_GATHER_ELEMENTS 1
92 #define SCI_MAX_CONTROLLERS 2
93 #define SCI_MAX_DOMAINS SCI_MAX_PORTS
95 /* 2 indicates the maximum number of UFs that can occur for a given IO request.
96 * The hardware handles reception of additional unsolicited frames while all
97 * UFs are in use, by holding off the transmitting device. This number could
98 * be theoretically reduced to 1, but 2 provides for more reliable operation.
99 * During SATA PIO operation, it is possible under some conditions for there to
100 * be 3 separate FISes received, back to back to back (PIO Setup, Data, D2H
101 * Register). It is unlikely to have all 3 pending all at once without some of
102 * them already being processed.
104 #define SCU_MIN_UNSOLICITED_FRAMES (1)
105 #define SCU_MIN_CRITICAL_NOTIFICATIONS (24)
106 #define SCU_MIN_EVENTS (4)
107 #define SCU_MIN_COMPLETION_QUEUE_SCRATCH (2)
108 #define SCU_MIN_COMPLETION_QUEUE_ENTRIES (SCU_MIN_CRITICAL_NOTIFICATIONS \
110 + SCU_MIN_UNSOLICITED_FRAMES \
111 + SCI_MIN_IO_REQUESTS \
112 + SCU_MIN_COMPLETION_QUEUE_SCRATCH)
114 #define SCU_MAX_CRITICAL_NOTIFICATIONS (384)
115 #define SCU_MAX_EVENTS (128)
116 #define SCU_MAX_UNSOLICITED_FRAMES (128)
117 #define SCU_MAX_COMPLETION_QUEUE_SCRATCH (128)
118 #define SCU_MAX_COMPLETION_QUEUE_ENTRIES (SCU_MAX_CRITICAL_NOTIFICATIONS \
120 + SCU_MAX_UNSOLICITED_FRAMES \
121 + SCI_MAX_IO_REQUESTS \
122 + SCU_MAX_COMPLETION_QUEUE_SCRATCH)
124 #if !defined(ENABLE_MINIMUM_MEMORY_MODE)
125 #define SCU_UNSOLICITED_FRAME_COUNT SCU_MAX_UNSOLICITED_FRAMES
126 #define SCU_CRITICAL_NOTIFICATION_COUNT SCU_MAX_CRITICAL_NOTIFICATIONS
127 #define SCU_EVENT_COUNT SCU_MAX_EVENTS
128 #define SCU_COMPLETION_QUEUE_SCRATCH SCU_MAX_COMPLETION_QUEUE_SCRATCH
129 #define SCU_IO_REQUEST_COUNT SCI_MAX_IO_REQUESTS
130 #define SCU_IO_REQUEST_SGE_COUNT SCI_MAX_SCATTER_GATHER_ELEMENTS
131 #define SCU_COMPLETION_QUEUE_COUNT SCU_MAX_COMPLETION_QUEUE_ENTRIES
133 #define SCU_UNSOLICITED_FRAME_COUNT SCU_MIN_UNSOLICITED_FRAMES
134 #define SCU_CRITICAL_NOTIFICATION_COUNT SCU_MIN_CRITICAL_NOTIFICATIONS
135 #define SCU_EVENT_COUNT SCU_MIN_EVENTS
136 #define SCU_COMPLETION_QUEUE_SCRATCH SCU_MIN_COMPLETION_QUEUE_SCRATCH
137 #define SCU_IO_REQUEST_COUNT SCI_MIN_IO_REQUESTS
138 #define SCU_IO_REQUEST_SGE_COUNT SCI_MIN_SCATTER_GATHER_ELEMENTS
139 #define SCU_COMPLETION_QUEUE_COUNT SCU_MIN_COMPLETION_QUEUE_ENTRIES
140 #endif /* !defined(ENABLE_MINIMUM_MEMORY_OPERATION) */
145 * The SCU_COMPLETION_QUEUE_COUNT constant indicates the size of the completion
146 * queue into which the hardware DMAs 32-bit quantas (completion entries).
152 * This queue must be programmed to a power of 2 size (e.g. 32, 64, 1024, etc.).
154 #if (SCU_COMPLETION_QUEUE_COUNT != 16) && \
155 (SCU_COMPLETION_QUEUE_COUNT != 32) && \
156 (SCU_COMPLETION_QUEUE_COUNT != 64) && \
157 (SCU_COMPLETION_QUEUE_COUNT != 128) && \
158 (SCU_COMPLETION_QUEUE_COUNT != 256) && \
159 (SCU_COMPLETION_QUEUE_COUNT != 512) && \
160 (SCU_COMPLETION_QUEUE_COUNT != 1024)
161 #error "SCU_COMPLETION_QUEUE_COUNT must be set to a power of 2."
164 #if SCU_MIN_UNSOLICITED_FRAMES > SCU_MAX_UNSOLICITED_FRAMES
165 #error "Invalid configuration of unsolicited frame constants"
166 #endif /* SCU_MIN_UNSOLICITED_FRAMES > SCU_MAX_UNSOLICITED_FRAMES */
168 #define SCU_MIN_UF_TABLE_ENTRIES (8)
169 #define SCU_ABSOLUTE_MAX_UNSOLICITED_FRAMES (4096)
170 #define SCU_UNSOLICITED_FRAME_BUFFER_SIZE (1024)
171 #define SCU_INVALID_FRAME_INDEX (0xFFFF)
173 #define SCU_IO_REQUEST_MAX_SGE_SIZE (0x00FFFFFF)
174 #define SCU_IO_REQUEST_MAX_TRANSFER_LENGTH (0x00FFFFFF)
177 * Determine the size of the unsolicited frame array including
179 #if SCU_UNSOLICITED_FRAME_COUNT <= SCU_MIN_UF_TABLE_ENTRIES
180 #define SCU_UNSOLICITED_FRAME_CONTROL_ARRAY_SIZE SCU_MIN_UF_TABLE_ENTRIES
182 #define SCU_UNSOLICITED_FRAME_CONTROL_ARRAY_SIZE SCU_MAX_UNSOLICITED_FRAMES
183 #endif /* SCU_UNSOLICITED_FRAME_COUNT <= SCU_MIN_UF_TABLE_ENTRIES */
186 * enum sci_status - This is the general return status enumeration for non-IO,
187 * non-task management related SCI interface methods.
193 * This member indicates successful completion.
198 * This value indicates that the calling method completed successfully,
199 * but that the IO may have completed before having it's start method
200 * invoked. This occurs during SAT translation for requests that do
201 * not require an IO to the target or for any other requests that may
202 * be completed without having to submit IO.
204 SCI_SUCCESS_IO_COMPLETE_BEFORE_START,
207 * This Value indicates that the SCU hardware returned an early response
208 * because the io request specified more data than is returned by the
209 * target device (mode pages, inquiry data, etc.). The completion routine
210 * will handle this case to get the actual number of bytes transferred.
212 SCI_SUCCESS_IO_DONE_EARLY,
215 * This member indicates that the object for which a state change is
216 * being requested is already in said state.
218 SCI_WARNING_ALREADY_IN_STATE,
221 * This member indicates interrupt coalescence timer may cause SAS
222 * specification compliance issues (i.e. SMP target mode response
223 * frames must be returned within 1.9 milliseconds).
225 SCI_WARNING_TIMER_CONFLICT,
228 * This field indicates a sequence of action is not completed yet. Mostly,
229 * this status is used when multiple ATA commands are needed in a SATI translation.
231 SCI_WARNING_SEQUENCE_INCOMPLETE,
234 * This member indicates that there was a general failure.
239 * This member indicates that the SCI implementation is unable to complete
240 * an operation due to a critical flaw the prevents any further operation
241 * (i.e. an invalid pointer).
246 * This member indicates the calling function failed, because the state
247 * of the controller is in a state that prevents successful completion.
249 SCI_FAILURE_INVALID_STATE,
252 * This member indicates the calling function failed, because there is
253 * insufficient resources/memory to complete the request.
255 SCI_FAILURE_INSUFFICIENT_RESOURCES,
258 * This member indicates the calling function failed, because the
259 * controller object required for the operation can't be located.
261 SCI_FAILURE_CONTROLLER_NOT_FOUND,
264 * This member indicates the calling function failed, because the
265 * discovered controller type is not supported by the library.
267 SCI_FAILURE_UNSUPPORTED_CONTROLLER_TYPE,
270 * This member indicates the calling function failed, because the
271 * requested initialization data version isn't supported.
273 SCI_FAILURE_UNSUPPORTED_INIT_DATA_VERSION,
276 * This member indicates the calling function failed, because the
277 * requested configuration of SAS Phys into SAS Ports is not supported.
279 SCI_FAILURE_UNSUPPORTED_PORT_CONFIGURATION,
282 * This member indicates the calling function failed, because the
283 * requested protocol is not supported by the remote device, port,
286 SCI_FAILURE_UNSUPPORTED_PROTOCOL,
289 * This member indicates the calling function failed, because the
290 * requested information type is not supported by the SCI implementation.
292 SCI_FAILURE_UNSUPPORTED_INFORMATION_TYPE,
295 * This member indicates the calling function failed, because the
296 * device already exists.
298 SCI_FAILURE_DEVICE_EXISTS,
301 * This member indicates the calling function failed, because adding
302 * a phy to the object is not possible.
304 SCI_FAILURE_ADDING_PHY_UNSUPPORTED,
307 * This member indicates the calling function failed, because the
308 * requested information type is not supported by the SCI implementation.
310 SCI_FAILURE_UNSUPPORTED_INFORMATION_FIELD,
313 * This member indicates the calling function failed, because the SCI
314 * implementation does not support the supplied time limit.
316 SCI_FAILURE_UNSUPPORTED_TIME_LIMIT,
319 * This member indicates the calling method failed, because the SCI
320 * implementation does not contain the specified Phy.
322 SCI_FAILURE_INVALID_PHY,
325 * This member indicates the calling method failed, because the SCI
326 * implementation does not contain the specified Port.
328 SCI_FAILURE_INVALID_PORT,
331 * This member indicates the calling method was partly successful
332 * The port was reset but not all phys in port are operational
334 SCI_FAILURE_RESET_PORT_PARTIAL_SUCCESS,
337 * This member indicates that calling method failed
338 * The port reset did not complete because none of the phys are operational
340 SCI_FAILURE_RESET_PORT_FAILURE,
343 * This member indicates the calling method failed, because the SCI
344 * implementation does not contain the specified remote device.
346 SCI_FAILURE_INVALID_REMOTE_DEVICE,
349 * This member indicates the calling method failed, because the remote
350 * device is in a bad state and requires a reset.
352 SCI_FAILURE_REMOTE_DEVICE_RESET_REQUIRED,
355 * This member indicates the calling method failed, because the SCI
356 * implementation does not contain or support the specified IO tag.
358 SCI_FAILURE_INVALID_IO_TAG,
361 * This member indicates that the operation failed and the user should
362 * check the response data associated with the IO.
364 SCI_FAILURE_IO_RESPONSE_VALID,
367 * This member indicates that the operation failed, the failure is
368 * controller implementation specific, and the response data associated
369 * with the request is not valid. You can query for the controller
370 * specific error information via scic_controller_get_request_status()
372 SCI_FAILURE_CONTROLLER_SPECIFIC_IO_ERR,
375 * This member indicated that the operation failed because the
376 * user requested this IO to be terminated.
378 SCI_FAILURE_IO_TERMINATED,
381 * This member indicates that the operation failed and the associated
382 * request requires a SCSI abort task to be sent to the target.
384 SCI_FAILURE_IO_REQUIRES_SCSI_ABORT,
387 * This member indicates that the operation failed because the supplied
388 * device could not be located.
390 SCI_FAILURE_DEVICE_NOT_FOUND,
393 * This member indicates that the operation failed because the
394 * objects association is required and is not correctly set.
396 SCI_FAILURE_INVALID_ASSOCIATION,
399 * This member indicates that the operation failed, because a timeout
405 * This member indicates that the operation failed, because the user
406 * specified a value that is either invalid or not supported.
408 SCI_FAILURE_INVALID_PARAMETER_VALUE,
411 * This value indicates that the operation failed, because the number
412 * of messages (MSI-X) is not supported.
414 SCI_FAILURE_UNSUPPORTED_MESSAGE_COUNT,
417 * This value indicates that the method failed due to a lack of
418 * available NCQ tags.
420 SCI_FAILURE_NO_NCQ_TAG_AVAILABLE,
423 * This value indicates that a protocol violation has occurred on the
426 SCI_FAILURE_PROTOCOL_VIOLATION,
429 * This value indicates a failure condition that retry may help to clear.
431 SCI_FAILURE_RETRY_REQUIRED,
434 * This field indicates the retry limit was reached when a retry is attempted
436 SCI_FAILURE_RETRY_LIMIT_REACHED,
439 * This member indicates the calling method was partly successful.
440 * Mostly, this status is used when a LUN_RESET issued to an expander attached
441 * STP device in READY NCQ substate needs to have RNC suspended/resumed
444 SCI_FAILURE_RESET_DEVICE_PARTIAL_SUCCESS,
447 * This field indicates an illegal phy connection based on the routing attribute
448 * of both expander phy attached to each other.
450 SCI_FAILURE_ILLEGAL_ROUTING_ATTRIBUTE_CONFIGURATION,
453 * This field indicates a CONFIG ROUTE INFO command has a response with function result
454 * INDEX DOES NOT EXIST, usually means exceeding max route index.
456 SCI_FAILURE_EXCEED_MAX_ROUTE_INDEX,
459 * This value indicates that an unsupported PCI device ID has been
460 * specified. This indicates that attempts to invoke
461 * scic_library_allocate_controller() will fail.
463 SCI_FAILURE_UNSUPPORTED_PCI_DEVICE_ID
468 * enum sci_io_status - This enumeration depicts all of the possible IO
469 * completion status values. Each value in this enumeration maps directly
470 * to a value in the enum sci_status enumeration. Please refer to that
471 * enumeration for detailed comments concerning what the status represents.
473 * Add the API to retrieve the SCU status from the core. Check to see that the
474 * following status are properly handled: - SCI_IO_FAILURE_UNSUPPORTED_PROTOCOL
475 * - SCI_IO_FAILURE_INVALID_IO_TAG
478 SCI_IO_SUCCESS = SCI_SUCCESS,
479 SCI_IO_FAILURE = SCI_FAILURE,
480 SCI_IO_SUCCESS_COMPLETE_BEFORE_START = SCI_SUCCESS_IO_COMPLETE_BEFORE_START,
481 SCI_IO_SUCCESS_IO_DONE_EARLY = SCI_SUCCESS_IO_DONE_EARLY,
482 SCI_IO_FAILURE_INVALID_STATE = SCI_FAILURE_INVALID_STATE,
483 SCI_IO_FAILURE_INSUFFICIENT_RESOURCES = SCI_FAILURE_INSUFFICIENT_RESOURCES,
484 SCI_IO_FAILURE_UNSUPPORTED_PROTOCOL = SCI_FAILURE_UNSUPPORTED_PROTOCOL,
485 SCI_IO_FAILURE_RESPONSE_VALID = SCI_FAILURE_IO_RESPONSE_VALID,
486 SCI_IO_FAILURE_CONTROLLER_SPECIFIC_ERR = SCI_FAILURE_CONTROLLER_SPECIFIC_IO_ERR,
487 SCI_IO_FAILURE_TERMINATED = SCI_FAILURE_IO_TERMINATED,
488 SCI_IO_FAILURE_REQUIRES_SCSI_ABORT = SCI_FAILURE_IO_REQUIRES_SCSI_ABORT,
489 SCI_IO_FAILURE_INVALID_PARAMETER_VALUE = SCI_FAILURE_INVALID_PARAMETER_VALUE,
490 SCI_IO_FAILURE_NO_NCQ_TAG_AVAILABLE = SCI_FAILURE_NO_NCQ_TAG_AVAILABLE,
491 SCI_IO_FAILURE_PROTOCOL_VIOLATION = SCI_FAILURE_PROTOCOL_VIOLATION,
493 SCI_IO_FAILURE_REMOTE_DEVICE_RESET_REQUIRED = SCI_FAILURE_REMOTE_DEVICE_RESET_REQUIRED,
495 SCI_IO_FAILURE_RETRY_REQUIRED = SCI_FAILURE_RETRY_REQUIRED,
496 SCI_IO_FAILURE_RETRY_LIMIT_REACHED = SCI_FAILURE_RETRY_LIMIT_REACHED,
497 SCI_IO_FAILURE_INVALID_REMOTE_DEVICE = SCI_FAILURE_INVALID_REMOTE_DEVICE
501 * enum sci_task_status - This enumeration depicts all of the possible task
502 * completion status values. Each value in this enumeration maps directly
503 * to a value in the enum sci_status enumeration. Please refer to that
504 * enumeration for detailed comments concerning what the status represents.
506 * Check to see that the following status are properly handled:
508 enum sci_task_status {
509 SCI_TASK_SUCCESS = SCI_SUCCESS,
510 SCI_TASK_FAILURE = SCI_FAILURE,
511 SCI_TASK_FAILURE_INVALID_STATE = SCI_FAILURE_INVALID_STATE,
512 SCI_TASK_FAILURE_INSUFFICIENT_RESOURCES = SCI_FAILURE_INSUFFICIENT_RESOURCES,
513 SCI_TASK_FAILURE_UNSUPPORTED_PROTOCOL = SCI_FAILURE_UNSUPPORTED_PROTOCOL,
514 SCI_TASK_FAILURE_INVALID_TAG = SCI_FAILURE_INVALID_IO_TAG,
515 SCI_TASK_FAILURE_RESPONSE_VALID = SCI_FAILURE_IO_RESPONSE_VALID,
516 SCI_TASK_FAILURE_CONTROLLER_SPECIFIC_ERR = SCI_FAILURE_CONTROLLER_SPECIFIC_IO_ERR,
517 SCI_TASK_FAILURE_TERMINATED = SCI_FAILURE_IO_TERMINATED,
518 SCI_TASK_FAILURE_INVALID_PARAMETER_VALUE = SCI_FAILURE_INVALID_PARAMETER_VALUE,
520 SCI_TASK_FAILURE_REMOTE_DEVICE_RESET_REQUIRED = SCI_FAILURE_REMOTE_DEVICE_RESET_REQUIRED,
521 SCI_TASK_FAILURE_RESET_DEVICE_PARTIAL_SUCCESS = SCI_FAILURE_RESET_DEVICE_PARTIAL_SUCCESS
526 * sci_swab32_cpy - convert between scsi and scu-hardware byte format
527 * @dest: receive the 4-byte endian swapped version of src
528 * @src: word aligned source buffer
530 * scu hardware handles SSP/SMP control, response, and unidentified
531 * frames in "big endian dword" order. Regardless of host endian this
532 * is always a swab32()-per-dword conversion of the standard definition,
533 * i.e. single byte fields swapped and multi-byte fields in little-
536 static inline void sci_swab32_cpy(void *_dest, void *_src, ssize_t word_cnt)
538 u32 *dest = _dest, *src = _src;
540 while (--word_cnt >= 0)
541 dest[word_cnt] = swab32(src[word_cnt]);
544 extern unsigned char no_outbound_task_to;
545 extern u16 ssp_max_occ_to;
546 extern u16 stp_max_occ_to;
547 extern u16 ssp_inactive_to;
548 extern u16 stp_inactive_to;
549 extern unsigned char phy_gen;
550 extern unsigned char max_concurr_spinup;
552 irqreturn_t isci_msix_isr(int vec, void *data);
553 irqreturn_t isci_intx_isr(int vec, void *data);
554 irqreturn_t isci_error_isr(int vec, void *data);
557 * Each timer is associated with a cancellation flag that is set when
558 * del_timer() is called and checked in the timer callback function. This
559 * is needed since del_timer_sync() cannot be called with scic_lock held.
560 * For deinit however, del_timer_sync() is used without holding the lock.
563 struct timer_list timer;
568 void sci_init_timer(struct sci_timer *tmr, void (*fn)(unsigned long))
570 tmr->timer.function = fn;
571 tmr->timer.data = (unsigned long) tmr;
573 init_timer(&tmr->timer);
576 static inline void sci_mod_timer(struct sci_timer *tmr, unsigned long msec)
579 mod_timer(&tmr->timer, jiffies + msecs_to_jiffies(msec));
582 static inline void sci_del_timer(struct sci_timer *tmr)
585 del_timer(&tmr->timer);
588 struct sci_base_state_machine {
589 const struct sci_base_state *state_table;
590 u32 initial_state_id;
591 u32 current_state_id;
592 u32 previous_state_id;
595 typedef void (*sci_state_transition_t)(struct sci_base_state_machine *sm);
597 struct sci_base_state {
598 sci_state_transition_t enter_state; /* Called on state entry */
599 sci_state_transition_t exit_state; /* Called on state exit */
602 extern void sci_init_sm(struct sci_base_state_machine *sm,
603 const struct sci_base_state *state_table,
605 extern void sci_change_state(struct sci_base_state_machine *sm, u32 next_state);
606 #endif /* __ISCI_H__ */