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
35
#ifndef IB_TYPES_EXTEND
36
#define IB_TYPES_EXTEND
38
#include <complib/cl_packon.h>
39
typedef struct _ib_pm_counters {
41
ib_net32_t reserved0[10];
44
ib_net16_t counter_select;
45
ib_net16_t symbol_error_counter;
46
uint8_t link_error_recovery_counter;
47
uint8_t link_down_counter;
48
ib_net16_t port_rcv_errors;
49
ib_net16_t port_rcv_remote_physical_errors;
50
ib_net16_t port_rcv_switch_relay_errors;
51
ib_net16_t port_xmit_discard;
52
uint8_t port_xmit_constraint_errors;
53
uint8_t port_rcv_constraint_errors;
55
uint8_t lli_errors_exc_buf_errors;
57
ib_net16_t vl15_dropped;
58
ib_net32_t port_xmit_data;
59
ib_net32_t port_rcv_data;
60
ib_net32_t port_xmit_pkts;
61
ib_net32_t port_rcv_pkts;
62
ib_net32_t reserved5[38];
63
} PACK_SUFFIX ib_pm_counters_t;
64
#include <complib/cl_packoff.h>
66
/****f* IBA Base: Types_extend/ib_switch_info_set_state_change
68
* ib_switch_info_set_state_change
71
* Sets the switch's state change bit.
76
ib_switch_info_set_state_change(
77
IN ib_switch_info_t* const p_si )
79
p_si->life_state = (uint8_t)(p_si->life_state | 0x04);
84
* [in] Pointer to a SwitchInfo attribute.
92
* ib_switch_info_get_state_change, ib_switch_info_clear_state_change
95
/****f* IBA Base: Types_extend/ib_node_info_set_local_port_num
97
* ib_node_info_set_local_port_num
100
* Sets a the local port number In the NodeInfo attribute.
105
ib_node_info_set_local_port_num(
106
IN ib_node_info_t* p_ni,
109
p_ni->port_num_vendor_id = cl_hton32(((cl_ntoh32(p_ni->port_num_vendor_id) & 0x00ffffff) |
115
* [in] Pointer to a NodeInfo attribute.
117
* [in] Port which SMA came on
127
/****f* IBA Base: Types_extend/ib_port_info_get_smsl
129
* ib_port_info_get_smsl
132
* Returns the encoded value for the Master SM SL at this port.
136
static inline uint8_t
137
ib_port_info_get_smsl(
138
IN const ib_port_info_t* const p_pi )
140
return( (uint8_t)(p_pi->mtu_smsl & 0x0F));
145
* [in] Pointer to a PortInfo attribute.
148
* Returns the encoded value for the Master SM SL at this port.
155
/****f* IBA Base: Types/ib_port_info_set_smsl
157
* ib_port_info_set_smsl
160
* Sets the Master SM SL value in the PortInfo attribute.
165
ib_port_info_set_smsl(
166
IN ib_port_info_t* const p_pi,
167
IN const uint8_t mSmSl )
169
p_pi->mtu_smsl = (uint8_t)((p_pi->mtu_smsl & 0xF0) | mSmSl);
174
* [in] Pointer to a PortInfo attribute.
177
* [in] Encoded Master SM SL value to set
187
/****f* IBA Base: Types_extend/ib_port_info_set_vl_cap
189
* ib_port_info_set_vl_cap
192
* Sets the VL Capability of a port.
197
ib_port_info_set_vl_cap(
198
IN ib_port_info_t* p_pi,
199
IN const uint8_t vlCap )
201
p_pi->vl_cap = (p_pi->vl_cap & 0x0F) | (vlCap << 4);
206
* [in] Pointer to a PortInfo attribute.
216
/****s* IBA Base: Types extend /ib_mft_table_t
221
* IBA defined MFT table.
226
#include <complib/cl_packon.h>
227
typedef struct _ib_mft_table
229
ib_net16_t mft_entry[IB_MCAST_BLOCK_SIZE];
231
} PACK_SUFFIX ib_mft_table_t;
232
#include <complib/cl_packoff.h>