|
@@ -86,10 +86,9 @@ static unsigned int next_request_tid;
|
86
|
86
|
*
|
87
|
87
|
* @v gma General management agent
|
88
|
88
|
* @v mad MAD
|
89
|
|
- * @ret rc Return status code
|
90
|
89
|
*/
|
91
|
|
-static int ib_sma_get_node_info ( struct ib_gma *gma,
|
92
|
|
- union ib_mad *mad ) {
|
|
90
|
+static void ib_sma_get_node_info ( struct ib_gma *gma,
|
|
91
|
+ union ib_mad *mad ) {
|
93
|
92
|
struct ib_device *ibdev = gma->ibdev;
|
94
|
93
|
struct ib_node_info *node_info = &mad->smp.smp_data.node_info;
|
95
|
94
|
|
|
@@ -104,8 +103,6 @@ static int ib_sma_get_node_info ( struct ib_gma *gma,
|
104
|
103
|
sizeof ( node_info->port_guid ) );
|
105
|
104
|
node_info->partition_cap = htons ( 1 );
|
106
|
105
|
node_info->local_port_num = ibdev->port;
|
107
|
|
-
|
108
|
|
- return 0;
|
109
|
106
|
}
|
110
|
107
|
|
111
|
108
|
/**
|
|
@@ -113,10 +110,9 @@ static int ib_sma_get_node_info ( struct ib_gma *gma,
|
113
|
110
|
*
|
114
|
111
|
* @v gma General management agent
|
115
|
112
|
* @v mad MAD
|
116
|
|
- * @ret rc Return status code
|
117
|
113
|
*/
|
118
|
|
-static int ib_sma_get_node_desc ( struct ib_gma *gma,
|
119
|
|
- union ib_mad *mad ) {
|
|
114
|
+static void ib_sma_get_node_desc ( struct ib_gma *gma,
|
|
115
|
+ union ib_mad *mad ) {
|
120
|
116
|
struct ib_device *ibdev = gma->ibdev;
|
121
|
117
|
struct ib_node_desc *node_desc = &mad->smp.smp_data.node_desc;
|
122
|
118
|
struct ib_gid_half *guid = &ibdev->gid.u.half[1];
|
|
@@ -127,8 +123,6 @@ static int ib_sma_get_node_desc ( struct ib_gma *gma,
|
127
|
123
|
guid->bytes[0], guid->bytes[1], guid->bytes[2],
|
128
|
124
|
guid->bytes[3], guid->bytes[4], guid->bytes[5],
|
129
|
125
|
guid->bytes[6], guid->bytes[7], ibdev->dev->name );
|
130
|
|
-
|
131
|
|
- return 0;
|
132
|
126
|
}
|
133
|
127
|
|
134
|
128
|
/**
|
|
@@ -136,18 +130,15 @@ static int ib_sma_get_node_desc ( struct ib_gma *gma,
|
136
|
130
|
*
|
137
|
131
|
* @v gma General management agent
|
138
|
132
|
* @v mad MAD
|
139
|
|
- * @ret rc Return status code
|
140
|
133
|
*/
|
141
|
|
-static int ib_sma_get_guid_info ( struct ib_gma *gma,
|
142
|
|
- union ib_mad *mad ) {
|
|
134
|
+static void ib_sma_get_guid_info ( struct ib_gma *gma,
|
|
135
|
+ union ib_mad *mad ) {
|
143
|
136
|
struct ib_device *ibdev = gma->ibdev;
|
144
|
137
|
struct ib_guid_info *guid_info = &mad->smp.smp_data.guid_info;
|
145
|
138
|
|
146
|
139
|
memset ( guid_info, 0, sizeof ( *guid_info ) );
|
147
|
140
|
memcpy ( guid_info->guid[0], &ibdev->gid.u.half[1],
|
148
|
141
|
sizeof ( guid_info->guid[0] ) );
|
149
|
|
-
|
150
|
|
- return 0;
|
151
|
142
|
}
|
152
|
143
|
|
153
|
144
|
/**
|
|
@@ -155,10 +146,9 @@ static int ib_sma_get_guid_info ( struct ib_gma *gma,
|
155
|
146
|
*
|
156
|
147
|
* @v gma General management agent
|
157
|
148
|
* @v mad MAD
|
158
|
|
- * @ret rc Return status code
|
159
|
149
|
*/
|
160
|
|
-static int ib_sma_get_port_info ( struct ib_gma *gma,
|
161
|
|
- union ib_mad *mad ) {
|
|
150
|
+static void ib_sma_get_port_info ( struct ib_gma *gma,
|
|
151
|
+ union ib_mad *mad ) {
|
162
|
152
|
struct ib_device *ibdev = gma->ibdev;
|
163
|
153
|
struct ib_port_info *port_info = &mad->smp.smp_data.port_info;
|
164
|
154
|
|
|
@@ -184,8 +174,6 @@ static int ib_sma_get_port_info ( struct ib_gma *gma,
|
184
|
174
|
port_info->init_type_reply__mtu_cap = IB_MTU_2048;
|
185
|
175
|
port_info->operational_vls__enforcement = ( IB_VL_0 << 4 );
|
186
|
176
|
port_info->guid_cap = 1;
|
187
|
|
-
|
188
|
|
- return 0;
|
189
|
177
|
}
|
190
|
178
|
|
191
|
179
|
/**
|
|
@@ -193,10 +181,9 @@ static int ib_sma_get_port_info ( struct ib_gma *gma,
|
193
|
181
|
*
|
194
|
182
|
* @v gma General management agent
|
195
|
183
|
* @v mad MAD
|
196
|
|
- * @ret rc Return status code
|
197
|
184
|
*/
|
198
|
|
-static int ib_sma_set_port_info ( struct ib_gma *gma,
|
199
|
|
- union ib_mad *mad ) {
|
|
185
|
+static void ib_sma_set_port_info ( struct ib_gma *gma,
|
|
186
|
+ union ib_mad *mad ) {
|
200
|
187
|
struct ib_device *ibdev = gma->ibdev;
|
201
|
188
|
const struct ib_port_info *port_info = &mad->smp.smp_data.port_info;
|
202
|
189
|
int rc;
|
|
@@ -214,7 +201,7 @@ static int ib_sma_set_port_info ( struct ib_gma *gma,
|
214
|
201
|
htons ( IB_MGMT_STATUS_UNSUPPORTED_METHOD_ATTR );
|
215
|
202
|
}
|
216
|
203
|
|
217
|
|
- return ib_sma_get_port_info ( gma, mad );
|
|
204
|
+ ib_sma_get_port_info ( gma, mad );
|
218
|
205
|
}
|
219
|
206
|
|
220
|
207
|
/**
|
|
@@ -222,17 +209,14 @@ static int ib_sma_set_port_info ( struct ib_gma *gma,
|
222
|
209
|
*
|
223
|
210
|
* @v gma General management agent
|
224
|
211
|
* @v mad MAD
|
225
|
|
- * @ret rc Return status code
|
226
|
212
|
*/
|
227
|
|
-static int ib_sma_get_pkey_table ( struct ib_gma *gma,
|
228
|
|
- union ib_mad *mad ) {
|
|
213
|
+static void ib_sma_get_pkey_table ( struct ib_gma *gma,
|
|
214
|
+ union ib_mad *mad ) {
|
229
|
215
|
struct ib_device *ibdev = gma->ibdev;
|
230
|
216
|
struct ib_pkey_table *pkey_table = &mad->smp.smp_data.pkey_table;
|
231
|
217
|
|
232
|
218
|
memset ( pkey_table, 0, sizeof ( *pkey_table ) );
|
233
|
219
|
pkey_table->pkey[0] = htons ( ibdev->pkey );
|
234
|
|
-
|
235
|
|
- return 0;
|
236
|
220
|
}
|
237
|
221
|
|
238
|
222
|
/**
|
|
@@ -240,16 +224,15 @@ static int ib_sma_get_pkey_table ( struct ib_gma *gma,
|
240
|
224
|
*
|
241
|
225
|
* @v gma General management agent
|
242
|
226
|
* @v mad MAD
|
243
|
|
- * @ret rc Return status code
|
244
|
227
|
*/
|
245
|
|
-static int ib_sma_set_pkey_table ( struct ib_gma *gma,
|
246
|
|
- union ib_mad *mad ) {
|
|
228
|
+static void ib_sma_set_pkey_table ( struct ib_gma *gma,
|
|
229
|
+ union ib_mad *mad ) {
|
247
|
230
|
struct ib_device *ibdev = gma->ibdev;
|
248
|
231
|
struct ib_pkey_table *pkey_table = &mad->smp.smp_data.pkey_table;
|
249
|
232
|
|
250
|
233
|
ibdev->pkey = ntohs ( pkey_table->pkey[0] );
|
251
|
234
|
|
252
|
|
- return ib_sma_get_pkey_table ( gma, mad );
|
|
235
|
+ ib_sma_get_pkey_table ( gma, mad );
|
253
|
236
|
}
|
254
|
237
|
|
255
|
238
|
/** List of attribute handlers */
|
|
@@ -331,9 +314,8 @@ struct ib_gma_handler ib_sma_handlers[] __ib_gma_handler = {
|
331
|
314
|
*
|
332
|
315
|
* @v gma General management agent
|
333
|
316
|
* @v mad MAD
|
334
|
|
- * @ret rc Return status code
|
335
|
317
|
*/
|
336
|
|
-static int ib_handle_mad ( struct ib_gma *gma, union ib_mad *mad ) {
|
|
318
|
+static void ib_handle_mad ( struct ib_gma *gma, union ib_mad *mad ) {
|
337
|
319
|
struct ib_mad_hdr *hdr = &mad->hdr;
|
338
|
320
|
struct ib_gma_handler *handler;
|
339
|
321
|
|
|
@@ -344,13 +326,13 @@ static int ib_handle_mad ( struct ib_gma *gma, union ib_mad *mad ) {
|
344
|
326
|
( handler->method == hdr->method ) &&
|
345
|
327
|
( handler->attr_id == hdr->attr_id ) ) {
|
346
|
328
|
hdr->method = handler->resp_method;
|
347
|
|
- return handler->handle ( gma, mad );
|
|
329
|
+ handler->handle ( gma, mad );
|
|
330
|
+ return;
|
348
|
331
|
}
|
349
|
332
|
}
|
350
|
333
|
|
351
|
334
|
hdr->method = IB_MGMT_METHOD_TRAP;
|
352
|
335
|
hdr->status = htons ( IB_MGMT_STATUS_UNSUPPORTED_METHOD_ATTR );
|
353
|
|
- return -ENOTSUP;
|
354
|
336
|
}
|
355
|
337
|
|
356
|
338
|
/**
|
|
@@ -412,21 +394,17 @@ static void ib_gma_complete_recv ( struct ib_device *ibdev,
|
412
|
394
|
}
|
413
|
395
|
}
|
414
|
396
|
|
415
|
|
- /* Handle MAD, if possible */
|
416
|
|
- if ( ( rc = ib_handle_mad ( gma, mad ) ) != 0 ) {
|
417
|
|
- DBGC ( gma, "GMA %p could not handle TID %08x%08x: %s\n",
|
418
|
|
- gma, ntohl ( hdr->tid[0] ), ntohl ( hdr->tid[1] ),
|
419
|
|
- strerror ( rc ) );
|
420
|
|
- /* Do not abort; we may want to send an error response */
|
421
|
|
- }
|
|
397
|
+ /* Handle MAD */
|
|
398
|
+ ib_handle_mad ( gma, mad );
|
422
|
399
|
|
423
|
400
|
/* Finish processing if we have no response to send */
|
424
|
401
|
if ( ! hdr->method )
|
425
|
402
|
goto out;
|
426
|
403
|
|
427
|
|
- DBGC ( gma, "GMA %p TX TID %08x%08x (%02x,%02x,%02x,%04x)\n", gma,
|
428
|
|
- ntohl ( hdr->tid[0] ), ntohl ( hdr->tid[1] ), hdr->mgmt_class,
|
429
|
|
- hdr->class_version, hdr->method, ntohs ( hdr->attr_id ) );
|
|
404
|
+ DBGC ( gma, "GMA %p TX TID %08x%08x (%02x,%02x,%02x,%04x) status "
|
|
405
|
+ "%04x\n", gma, ntohl ( hdr->tid[0] ), ntohl ( hdr->tid[1] ),
|
|
406
|
+ hdr->mgmt_class, hdr->class_version, hdr->method,
|
|
407
|
+ ntohs ( hdr->attr_id ), ntohs ( hdr->status ) );
|
430
|
408
|
DBGC2_HDA ( gma, 0, mad, sizeof ( *mad ) );
|
431
|
409
|
|
432
|
410
|
/* Set response fields for directed route SMPs */
|