FreeBSD kernel pms device code
dm.h
Go to the documentation of this file.
1/*******************************************************************************
2**
3*Copyright (c) 2014 PMC-Sierra, Inc. All rights reserved.
4*
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
8*following disclaimer.
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.
12*
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
21*
22* $FreeBSD$
23*
24********************************************************************************/
25/********************************************************************************
26**
27* dm.h
28*
29* Abstract: This module defines the contants, enum and #define definition used
30* by Discovery Moduled (DM).
31*
32********************************************************************************/
33
34#ifndef DM_H
35
36#define DM_H
37
38/*************************************************
39 * constants for type field in agsaMem_t
40 *************************************************/
41#define DM_CACHED_MEM 0x00
42#define DM_DMA_MEM 0x01
43#define DM_CACHED_DMA_MEM 0x02
45/*************************************************
46 * constants for API return values
47 *************************************************/
48#define DM_RC_SUCCESS 0x00
49#define DM_RC_FAILURE 0x01
50#define DM_RC_BUSY 0x02
51#define DM_RC_VERSION_INCOMPATIBLE 0x03
52#define DM_RC_VERSION_UNTESTED 0x04
56/*************************************************
57 * Discovery option
58 *************************************************/
59#define DM_DISCOVERY_OPTION_FULL_START 0x00
60#define DM_DISCOVERY_OPTION_INCREMENTAL_START 0x01
61#define DM_DISCOVERY_OPTION_ABORT 0x02
64/*************************************************
65 * Discovery status
66 *************************************************/
68{
74 dmDiscAbortInvalid, /* no discovery to abort */
75 dmDiscAbortInProgress, /* abort in progress */
76
77};
78
79/*************************************************
80 * Device status
81 *************************************************/
83{
89};
90
91typedef struct dmContext_s {
92 void *tdData;
93 void *dmData;
95
96typedef struct{
102 bit8 sasAddressHi[4];
103 bit8 sasAddressLo[4];
106 /* bit8 - bit14 are set by the user of DM such as TDM for directly attached expander
107 0 - 7; PhyID
108 8: non SMP or not
109 9 - 10: types of expander, valid only when bit8 is set
110 10b (2): edge expander
111 11b (3): fanout expander
112 11 - 14: MCN
113 */
118
119
120typedef struct{
121 void *virtPtr;
122 void *osHandle;
131} dmMem_t;
132
133#define DM_NUM_MEM_CHUNKS 8
134
135typedef struct{
139
141
143
144typedef struct{
148#ifdef DM_DEBUG
149 bit32 DMDebugLevel;
150#endif
153
154typedef struct{
155 bit8 sasRemoteAddressHi[4];
156 bit8 sasRemoteAddressLo[4];
157 bit8 sasLocalAddressHi[4];
158 bit8 sasLocalAddressLo[4];
161
162
163#endif /* DM_H */
dmDeviceState_e
Definition: dm.h:83
@ dmDeviceArrival
Definition: dm.h:85
@ dmDeviceNoChange
Definition: dm.h:84
@ dmDeviceRateChange
Definition: dm.h:88
@ dmDeviceRemoval
Definition: dm.h:86
@ dmDeviceMCNChange
Definition: dm.h:87
dmContext_t dmPortContext_t
Definition: dm.h:140
#define DM_NUM_MEM_CHUNKS
Definition: dm.h:133
dmContext_t dmRoot_t
Definition: dm.h:142
struct dmContext_s dmContext_t
dmDiscoveryState_e
Definition: dm.h:68
@ dmDiscInProgress
Definition: dm.h:73
@ dmDiscCompleted
Definition: dm.h:69
@ dmDiscAborted
Definition: dm.h:71
@ dmDiscAbortInvalid
Definition: dm.h:74
@ dmDiscFailed
Definition: dm.h:70
@ dmDiscAbortInProgress
Definition: dm.h:75
@ dmDiscAbortFailed
Definition: dm.h:72
unsigned short bit16
Definition: ostypes.h:98
unsigned int bit32
Definition: ostypes.h:99
unsigned char bit8
Definition: ostypes.h:97
Definition: dm.h:91
void * tdData
Definition: dm.h:92
void * dmData
Definition: dm.h:93
bit16 it_NexusTimeout
Definition: dm.h:98
bit8 reserved
Definition: dm.h:116
bit8 initiator_ssp_stp_smp
Definition: dm.h:104
bit16 ext
Definition: dm.h:114
bit8 flag
Definition: dm.h:100
bit8 sataDeviceType
Definition: dm.h:115
bit8 devType_S_Rate
Definition: dm.h:101
bit16 firstBurstSize
Definition: dm.h:99
bit16 smpTimeout
Definition: dm.h:97
bit8 target_ssp_stp_smp
Definition: dm.h:105
Definition: dm.h:120
bit32 numElements
Definition: dm.h:126
bit32 physAddrLower
Definition: dm.h:124
void * osHandle
Definition: dm.h:122
bit32 type
Definition: dm.h:129
bit32 singleElementLength
Definition: dm.h:127
bit32 physAddrUpper
Definition: dm.h:123
bit32 totalLength
Definition: dm.h:125
void * virtPtr
Definition: dm.h:121
bit32 alignment
Definition: dm.h:128
bit32 reserved
Definition: dm.h:130
bit32 flag
Definition: dm.h:159
bit32 numDevHandles
Definition: dm.h:145
bit32 tbd1
Definition: dm.h:146
bit32 tbd2
Definition: dm.h:147
bit32 itNexusTimeout
Definition: dm.h:151