|
@@ -204,16 +204,17 @@ static union ib_mad * ib_sma_get_port_info ( struct ib_gma *gma,
|
204
|
204
|
port_info->lid = ntohs ( ibdev->lid );
|
205
|
205
|
port_info->mastersm_lid = ntohs ( ibdev->sm_lid );
|
206
|
206
|
port_info->local_port_num = ibdev->port;
|
207
|
|
- port_info->link_width_enabled = ibdev->link_width;
|
208
|
|
- port_info->link_width_supported = ibdev->link_width;
|
209
|
|
- port_info->link_width_active = ibdev->link_width;
|
|
207
|
+ port_info->link_width_enabled = ibdev->link_width_enabled;
|
|
208
|
+ port_info->link_width_supported = ibdev->link_width_supported;
|
|
209
|
+ port_info->link_width_active = ibdev->link_width_active;
|
210
|
210
|
port_info->link_speed_supported__port_state =
|
211
|
|
- ( ( ibdev->link_speed << 4 ) | ibdev->port_state );
|
|
211
|
+ ( ( ibdev->link_speed_supported << 4 ) | ibdev->port_state );
|
212
|
212
|
port_info->port_phys_state__link_down_def_state =
|
213
|
213
|
( ( IB_PORT_PHYS_STATE_POLLING << 4 ) |
|
214
|
214
|
IB_PORT_PHYS_STATE_POLLING );
|
215
|
215
|
port_info->link_speed_active__link_speed_enabled =
|
216
|
|
- ( ( ibdev->link_speed << 4 ) | ibdev->link_speed );
|
|
216
|
+ ( ( ibdev->link_speed_active << 4 ) |
|
|
217
|
+ ibdev->link_speed_enabled );
|
217
|
218
|
port_info->neighbour_mtu__mastersm_sl =
|
218
|
219
|
( ( IB_MTU_2048 << 4 ) | ibdev->sm_sl );
|
219
|
220
|
port_info->vl_cap__init_type = ( IB_VL_0 << 4 );
|
|
@@ -236,17 +237,27 @@ static union ib_mad * ib_sma_set_port_info ( struct ib_gma *gma,
|
236
|
237
|
union ib_mad *mad ) {
|
237
|
238
|
struct ib_device *ibdev = gma->ibdev;
|
238
|
239
|
const struct ib_port_info *port_info = &mad->smp.smp_data.port_info;
|
|
240
|
+ unsigned int link_width_enabled;
|
|
241
|
+ unsigned int link_speed_enabled;
|
239
|
242
|
int rc;
|
240
|
243
|
|
241
|
244
|
memcpy ( &ibdev->gid.u.half[0], port_info->gid_prefix,
|
242
|
245
|
sizeof ( ibdev->gid.u.half[0] ) );
|
243
|
246
|
ibdev->lid = ntohs ( port_info->lid );
|
244
|
247
|
ibdev->sm_lid = ntohs ( port_info->mastersm_lid );
|
|
248
|
+ if ( ( link_width_enabled = port_info->link_width_enabled ) )
|
|
249
|
+ ibdev->link_width_enabled = link_width_enabled;
|
|
250
|
+ if ( ( link_speed_enabled =
|
|
251
|
+ ( port_info->link_speed_active__link_speed_enabled & 0xf ) ) )
|
|
252
|
+ ibdev->link_speed_enabled = link_speed_enabled;
|
245
|
253
|
ibdev->sm_sl = ( port_info->neighbour_mtu__mastersm_sl & 0xf );
|
|
254
|
+ DBGC ( gma, "GMA %p set LID %04x SMLID %04x link width %02x speed "
|
|
255
|
+ "%02x\n", gma, ibdev->lid, ibdev->sm_lid,
|
|
256
|
+ ibdev->link_width_enabled, ibdev->link_speed_enabled );
|
246
|
257
|
|
247
|
258
|
if ( ( rc = ib_set_port_info ( ibdev, port_info ) ) != 0 ) {
|
248
|
|
- DBGC ( ibdev, "IBDEV %p could not set port information: %s\n",
|
249
|
|
- ibdev, strerror ( rc ) );
|
|
259
|
+ DBGC ( gma, "GMA %p could not set port information: %s\n",
|
|
260
|
+ gma, strerror ( rc ) );
|
250
|
261
|
mad->hdr.status =
|
251
|
262
|
htons ( IB_MGMT_STATUS_UNSUPPORTED_METHOD_ATTR );
|
252
|
263
|
}
|