|
@@ -341,18 +341,21 @@ void ib_destroy_madx ( struct ib_device *ibdev __unused,
|
341
|
341
|
*
|
342
|
342
|
* @v ibdev Infiniband device
|
343
|
343
|
* @v type Queue pair type
|
344
|
|
- * @ret mi Management agent, or NULL
|
|
344
|
+ * @v new_mi New management interface to fill in
|
|
345
|
+ * @ret rc Return status code
|
345
|
346
|
*/
|
346
|
|
-struct ib_mad_interface * ib_create_mi ( struct ib_device *ibdev,
|
347
|
|
- enum ib_queue_pair_type type ) {
|
|
347
|
+int ib_create_mi ( struct ib_device *ibdev, enum ib_queue_pair_type type,
|
|
348
|
+ struct ib_mad_interface **new_mi ) {
|
348
|
349
|
struct ib_mad_interface *mi;
|
349
|
350
|
const char *name;
|
350
|
351
|
int rc;
|
351
|
352
|
|
352
|
353
|
/* Allocate and initialise fields */
|
353
|
354
|
mi = zalloc ( sizeof ( *mi ) );
|
354
|
|
- if ( ! mi )
|
|
355
|
+ if ( ! mi ) {
|
|
356
|
+ rc = -ENOMEM;
|
355
|
357
|
goto err_alloc;
|
|
358
|
+ }
|
356
|
359
|
mi->ibdev = ibdev;
|
357
|
360
|
INIT_LIST_HEAD ( &mi->madx );
|
358
|
361
|
|
|
@@ -387,7 +390,8 @@ struct ib_mad_interface * ib_create_mi ( struct ib_device *ibdev,
|
387
|
390
|
|
388
|
391
|
/* Fill receive ring */
|
389
|
392
|
ib_refill_recv ( ibdev, mi->qp );
|
390
|
|
- return mi;
|
|
393
|
+ *new_mi = mi;
|
|
394
|
+ return 0;
|
391
|
395
|
|
392
|
396
|
err_modify_qp:
|
393
|
397
|
ib_destroy_qp ( ibdev, mi->qp );
|
|
@@ -396,7 +400,7 @@ struct ib_mad_interface * ib_create_mi ( struct ib_device *ibdev,
|
396
|
400
|
err_create_cq:
|
397
|
401
|
free ( mi );
|
398
|
402
|
err_alloc:
|
399
|
|
- return NULL;
|
|
403
|
+ return rc;
|
400
|
404
|
}
|
401
|
405
|
|
402
|
406
|
/**
|