2
* Copyright (c) 2004 Mellanox Technologies LTD. All rights reserved.
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:
10
* Redistribution and use in source and binary forms, with or
11
* without modification, are permitted provided that the following
14
* - Redistributions of source code must retain the above
15
* copyright notice, this list of conditions and the following
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.
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
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.
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>
60
#include "ibbbm_base.h"
63
/****s* IBIS: ibbbm/ibbbm_t
77
atomic32_t bm_sequence;
78
osm_bind_handle_t h_bind;
79
cl_event_t wait_for_resp;
87
* The ibbbm condition state.
90
* The handle to bind with the lower level.
93
* An event to signal the return of a MAD.
100
/****f* IBIS: ibbbm/ibbbm_construct
105
* Allocation of ibbbm_t struct
111
ibbbm_construct(void);
118
* Return a pointer to an ibbbm struct. Null if fails to do so.
121
* First step of the creation of ibbbm_t
124
* ibbbm_destroy ibbbm_init
127
/****s* IBIS: ibbbm/ibbbm_destroy
132
* release of ibbbm_t struct
139
IN ibbbm_t* const p_ibbbm );
144
* A pointer to the ibbbm_t struct that is joining to be released
149
* Final step of the releasing of ibbbm_t
155
/****f* IBIS: ibbbm/ibbbm_init
160
* Initialization of an ibbbm_t struct
166
IN ibbbm_t* const p_ibbbm );
171
* A pointer to the ibbbm_t struct that is joining to be initialized
174
* The status of the function.
183
/****f* IBIS: ibbbm/ibbbm_bind
188
* Binding the ibbbm object to a lower level.
194
IN ibbbm_t* const p_ibbbm );
199
* A pointer to the ibbbm_t struct that is joining to be binded
202
* The status of the function.
210
/****f* IBIS: ibbbm/ibbbm_get_counters
215
* Send a BBM MAD (port counters) and wait for the reply.
221
IN ibbbm_t* const p_ibbbm,
223
IN uint8_t vpd_device_selector,
224
IN uint16_t bytes_num,
226
OUT ib_bbm_vpd_t *p_bbm_vpd_mad);
231
* A pointer to the ibbbm_t struct.
234
* The Destination lid of the MAD.
237
* A pointer to a Baseboard Management MAD that was received.
240
* The status of the function.
248
/****f* IBIS: ibbbm/ibbbm_write
253
* Send a BBM MAD that writes to a vpd address.
259
IN ibbbm_t* const p_ibbbm,
261
IN uint8_t vpd_device_selector,
262
IN uint16_t bytes_num,
266
#endif /* _IBBBM_H_ */
270
* A pointer to the ibbbm_t struct.
273
* The Destination lid of the MAD.
276
* A pointer to a Baseboard Management MAD that will be sent.
279
* The status of the function.