~ubuntu-branches/ubuntu/raring/ibutils/raring-proposed

« back to all changes in this revision

Viewing changes to ibis/src/ibbbm.h

  • Committer: Bazaar Package Importer
  • Author(s): Benoit Mortier
  • Date: 2010-01-11 22:22:00 UTC
  • Revision ID: james.westby@ubuntu.com-20100111222200-53kum2et5nh13rv3
Tags: upstream-1.2-OFED-1.4.2
ImportĀ upstreamĀ versionĀ 1.2-OFED-1.4.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright (c) 2004 Mellanox Technologies LTD. All rights reserved.
 
3
 *
 
4
 * This software is available to you under a choice of one of two
 
5
 * licenses.  You may choose to be licensed under the terms of the GNU
 
6
 * General Public License (GPL) Version 2, available from the file
 
7
 * COPYING in the main directory of this source tree, or the
 
8
 * OpenIB.org BSD license below:
 
9
 *
 
10
 *     Redistribution and use in source and binary forms, with or
 
11
 *     without modification, are permitted provided that the following
 
12
 *     conditions are met:
 
13
 *
 
14
 *      - Redistributions of source code must retain the above
 
15
 *        copyright notice, this list of conditions and the following
 
16
 *        disclaimer.
 
17
 *
 
18
 *      - Redistributions in binary form must reproduce the above
 
19
 *        copyright notice, this list of conditions and the following
 
20
 *        disclaimer in the documentation and/or other materials
 
21
 *        provided with the distribution.
 
22
 *
 
23
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 
24
 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 
25
 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 
26
 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
 
27
 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
 
28
 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
 
29
 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 
30
 * SOFTWARE.
 
31
 *
 
32
 * $Id$
 
33
 */
 
34
 
 
35
/*
 
36
 * Abstract:
 
37
 *      Implementation of ibbbm_t.
 
38
 *      This object represents the Subnet Performance Monitor object.
 
39
 *      This object is part of the IBIS family of objects.
 
40
 *
 
41
 * Environment:
 
42
 *      Linux User Mode
 
43
 *
 
44
 * $Revision: 1.2 $
 
45
 */
 
46
 
 
47
#ifndef _IBBBM_H_
 
48
#define _IBBBM_H_
 
49
 
 
50
#include <complib/cl_qmap.h>
 
51
#include <complib/cl_passivelock.h>
 
52
#include <complib/cl_debug.h>
 
53
#include <iba/ib_types.h>
 
54
#include <opensm/osm_madw.h>
 
55
#include <opensm/osm_log.h>
 
56
#include <opensm/osm_mad_pool.h>
 
57
#include <opensm/osm_msgdef.h>
 
58
#include "ibis_api.h"
 
59
#include "ibis.h"
 
60
#include "ibbbm_base.h"
 
61
 
 
62
 
 
63
/****s* IBIS: ibbbm/ibbbm_t
 
64
* NAME  ibbbm_t
 
65
*
 
66
*
 
67
* DESCRIPTION
 
68
*       ibbbm structure.
 
69
*
 
70
* SYNOPSIS
 
71
*/
 
72
 
 
73
 
 
74
typedef struct _ibbbm
 
75
{
 
76
  ibbbm_state_t      state;
 
77
  atomic32_t         bm_sequence;
 
78
  osm_bind_handle_t  h_bind;
 
79
  cl_event_t         wait_for_resp;
 
80
} ibbbm_t;
 
81
 
 
82
 
 
83
/*
 
84
* FIELDS
 
85
*
 
86
*       state
 
87
*            The ibbbm condition state.
 
88
*
 
89
*       h_bind
 
90
*            The handle to bind with the lower level.
 
91
*
 
92
*      wait_for_resp
 
93
*            An event to signal the return of a MAD.
 
94
*
 
95
* SEE ALSO
 
96
*
 
97
*********/
 
98
 
 
99
 
 
100
/****f* IBIS: ibbbm/ibbbm_construct
 
101
* NAME
 
102
*       ibbbm_construct
 
103
*
 
104
* DESCRIPTION
 
105
*      Allocation of ibbbm_t struct
 
106
*
 
107
* SYNOPSIS
 
108
*/
 
109
 
 
110
ibbbm_t*
 
111
ibbbm_construct(void);
 
112
 
 
113
/*
 
114
* PARAMETERS
 
115
*
 
116
*
 
117
* RETURN VALUE
 
118
*       Return a pointer to an ibbbm struct. Null if fails to do so.
 
119
*
 
120
* NOTES
 
121
*       First step of the creation of ibbbm_t
 
122
*
 
123
* SEE ALSO
 
124
*       ibbbm_destroy ibbbm_init
 
125
*********/
 
126
 
 
127
/****s* IBIS: ibbbm/ibbbm_destroy
 
128
* NAME
 
129
*       ibbbm_destroy
 
130
*
 
131
* DESCRIPTION
 
132
*      release of ibbbm_t struct
 
133
*
 
134
* SYNOPSIS
 
135
*/
 
136
 
 
137
void
 
138
ibbbm_destroy(
 
139
  IN ibbbm_t* const p_ibbbm );
 
140
 
 
141
/*
 
142
* PARAMETERS
 
143
*       p_ibbbm
 
144
*               A pointer to the ibbbm_t struct that is joining to be released
 
145
*
 
146
* RETURN VALUE
 
147
*
 
148
* NOTES
 
149
*       Final step of the releasing of ibbbm_t
 
150
*
 
151
* SEE ALSO
 
152
*       ibbbm_construct
 
153
*********/
 
154
 
 
155
/****f* IBIS: ibbbm/ibbbm_init
 
156
* NAME
 
157
*       ibbbm_init
 
158
*
 
159
* DESCRIPTION
 
160
*      Initialization of an ibbbm_t struct
 
161
*
 
162
* SYNOPSIS
 
163
*/
 
164
ib_api_status_t
 
165
ibbbm_init(
 
166
  IN ibbbm_t* const p_ibbbm );
 
167
 
 
168
/*
 
169
* PARAMETERS
 
170
*       p_ibbbm
 
171
*               A pointer to the ibbbm_t struct that is joining to be initialized
 
172
*
 
173
* RETURN VALUE
 
174
*       The status of the function.
 
175
*
 
176
* NOTES
 
177
*
 
178
* SEE ALSO
 
179
*       ibbbm_construct
 
180
* *********/
 
181
 
 
182
 
 
183
/****f* IBIS: ibbbm/ibbbm_bind
 
184
* NAME
 
185
*       ibbbm_bind
 
186
*
 
187
* DESCRIPTION
 
188
*      Binding the ibbbm object to a lower level.
 
189
*
 
190
* SYNOPSIS
 
191
*/
 
192
ib_api_status_t
 
193
ibbbm_bind(
 
194
  IN ibbbm_t* const p_ibbbm );
 
195
 
 
196
/*
 
197
* PARAMETERS
 
198
*       p_ibbbm
 
199
*               A pointer to the ibbbm_t struct that is joining to be binded
 
200
*
 
201
* RETURN VALUE
 
202
*       The status of the function.
 
203
*
 
204
* NOTES
 
205
*
 
206
* SEE ALSO
 
207
*       ibbbm_construct
 
208
*********/
 
209
 
 
210
/****f* IBIS: ibbbm/ibbbm_get_counters
 
211
* NAME
 
212
*     ibbbm_get_counters
 
213
*
 
214
* DESCRIPTION
 
215
*      Send a BBM MAD (port counters) and wait for the reply.
 
216
*
 
217
* SYNOPSIS
 
218
*/
 
219
ib_api_status_t
 
220
ibbbm_read_vpd(
 
221
  IN ibbbm_t* const p_ibbbm,
 
222
  IN uint16_t lid,
 
223
  IN uint8_t vpd_device_selector,
 
224
  IN uint16_t bytes_num,
 
225
  IN uint16_t offset,
 
226
  OUT ib_bbm_vpd_t *p_bbm_vpd_mad);
 
227
 
 
228
/*
 
229
* PARAMETERS
 
230
*       p_ibbbm
 
231
*               A pointer to the ibbbm_t struct.
 
232
*
 
233
*       lid
 
234
*               The Destination lid of the MAD.
 
235
*
 
236
*       p_bbm_vpd_mad
 
237
*               A pointer to a Baseboard Management MAD that was received.
 
238
*
 
239
* RETURN VALUE
 
240
*       The status of the function.
 
241
*
 
242
* NOTES
 
243
*
 
244
* SEE ALSO
 
245
*       ibbbm_write
 
246
*********/
 
247
 
 
248
/****f* IBIS: ibbbm/ibbbm_write
 
249
* NAME
 
250
*     ibbbm_write
 
251
*
 
252
* DESCRIPTION
 
253
*      Send a BBM MAD  that writes to a vpd address.
 
254
*
 
255
* SYNOPSIS
 
256
*/
 
257
ib_api_status_t
 
258
ibbbm_write_vpd(
 
259
  IN ibbbm_t* const p_ibbbm,
 
260
  IN uint16_t lid,
 
261
  IN uint8_t vpd_device_selector,
 
262
  IN uint16_t bytes_num,
 
263
  IN uint16_t offset,
 
264
  IN uint8_t *p_data);
 
265
 
 
266
#endif /* _IBBBM_H_ */
 
267
/*
 
268
* PARAMETERS
 
269
*       p_ibbbm
 
270
*               A pointer to the ibbbm_t struct.
 
271
*
 
272
*       lid
 
273
*               The Destination lid of the MAD.
 
274
*
 
275
*       p_bbm_vpd_mad
 
276
*               A pointer to a Baseboard Management MAD that will be sent.
 
277
*
 
278
* RETURN VALUE
 
279
*       The status of the function.
 
280
*
 
281
* NOTES
 
282
*
 
283
* SEE ALSO
 
284
*       ibbb_read
 
285
*********/