1 /*******************************************************************************
3 *Copyright (c) 2014 PMC-Sierra, Inc. All rights reserved.
5 *Redistribution and use in source and binary forms, with or without modification, are permitted provided
6 *that the following conditions are met:
7 *1. Redistributions of source code must retain the above copyright notice, this list of conditions and the
9 *2. Redistributions in binary form must reproduce the above copyright notice,
10 *this list of conditions and the following disclaimer in the documentation and/or other materials provided
11 *with the distribution.
13 *THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED
14 *WARRANTIES,INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
15 *FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
16 *FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
17 *NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
18 *BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
19 *LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
20 *SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE
24 ********************************************************************************/
25 /********************************************************************************
29 * Abstract: This module defines the contants, enum and #define definition used
30 * by Discovery Moduled (DM).
32 ********************************************************************************/
38 /*************************************************
39 * constants for type field in agsaMem_t
40 *************************************************/
41 #define DM_CACHED_MEM 0x00 /**< CACHED memory type */
42 #define DM_DMA_MEM 0x01 /**< DMA memory type */
43 #define DM_CACHED_DMA_MEM 0x02 /**< CACHED DMA memory type */
45 /*************************************************
46 * constants for API return values
47 *************************************************/
48 #define DM_RC_SUCCESS 0x00 /**< Successful function return value */
49 #define DM_RC_FAILURE 0x01 /**< Failed function return value */
50 #define DM_RC_BUSY 0x02 /**< Busy function return value */
51 #define DM_RC_VERSION_INCOMPATIBLE 0x03 /**< Version miss match */
52 #define DM_RC_VERSION_UNTESTED 0x04 /**< Version not tested */
56 /*************************************************
58 *************************************************/
59 #define DM_DISCOVERY_OPTION_FULL_START 0x00 /**< Full discovery */
60 #define DM_DISCOVERY_OPTION_INCREMENTAL_START 0x01 /**< Incremental discovery */
61 #define DM_DISCOVERY_OPTION_ABORT 0x02 /**< Discovery abort */
64 /*************************************************
66 *************************************************/
67 enum dmDiscoveryState_e
74 dmDiscAbortInvalid, /* no discovery to abort */
75 dmDiscAbortInProgress, /* abort in progress */
79 /*************************************************
81 *************************************************/
91 typedef struct dmContext_s {
98 bit16 it_NexusTimeout;
102 bit8 sasAddressHi[4];
103 bit8 sasAddressLo[4];
104 bit8 initiator_ssp_stp_smp;
105 bit8 target_ssp_stp_smp;
106 /* bit8 - bit14 are set by the user of DM such as TDM for directly attached expander
109 9 - 10: types of expander, valid only when bit8 is set
110 10b (2): edge expander
111 11b (3): fanout expander
127 bit32 singleElementLength;
133 #define DM_NUM_MEM_CHUNKS 8
137 dmMem_t dmMemory[DM_NUM_MEM_CHUNKS];
138 } dmMemoryRequirement_t;
140 typedef dmContext_t dmPortContext_t;
142 typedef dmContext_t dmRoot_t;
151 bit32 itNexusTimeout;
155 bit8 sasRemoteAddressHi[4];
156 bit8 sasRemoteAddressLo[4];
157 bit8 sasLocalAddressHi[4];
158 bit8 sasLocalAddressLo[4];