Browse Source

[infiniband] Pass a generic MAD to ib_set_port_info()

tags/v0.9.8
Michael Brown 15 years ago
parent
commit
ea6eb7f7ed

+ 3
- 3
src/drivers/infiniband/linda.c View File

242
  * Set port information
242
  * Set port information
243
  *
243
  *
244
  * @v ibdev		Infiniband device
244
  * @v ibdev		Infiniband device
245
- * @v port_info		New port information
245
+ * @v mad		Set port information MAD
246
  */
246
  */
247
-static int linda_set_port_info ( struct ib_device *ibdev,
248
-				 const struct ib_port_info *port_info ) {
247
+static int linda_set_port_info ( struct ib_device *ibdev, union ib_mad *mad ) {
249
 	struct linda *linda = ib_get_drvdata ( ibdev );
248
 	struct linda *linda = ib_get_drvdata ( ibdev );
249
+	struct ib_port_info *port_info = &mad->smp.smp_data.port_info;
250
 	struct QIB_7220_IBCCtrl ibcctrl;
250
 	struct QIB_7220_IBCCtrl ibcctrl;
251
 	unsigned int port_state;
251
 	unsigned int port_state;
252
 	unsigned int link_state;
252
 	unsigned int link_state;

+ 3
- 5
src/include/gpxe/infiniband.h View File

346
 	/** Set port information
346
 	/** Set port information
347
 	 *
347
 	 *
348
 	 * @v ibdev		Infiniband device
348
 	 * @v ibdev		Infiniband device
349
-	 * @v port_info		New port information
349
+	 * @v mad		Set port information MAD
350
 	 *
350
 	 *
351
 	 * This method is required only by adapters that do not have
351
 	 * This method is required only by adapters that do not have
352
 	 * an embedded SMA.
352
 	 * an embedded SMA.
353
 	 */
353
 	 */
354
-	int ( * set_port_info ) ( struct ib_device *ibdev,
355
-				  const struct ib_port_info *port_info );
354
+	int ( * set_port_info ) ( struct ib_device *ibdev, union ib_mad *mad );
356
 };
355
 };
357
 
356
 
358
 /** An Infiniband device */
357
 /** An Infiniband device */
457
 			      struct ib_queue_pair *qp, struct ib_gid *gid );
456
 			      struct ib_queue_pair *qp, struct ib_gid *gid );
458
 extern int ib_get_hca_info ( struct ib_device *ibdev,
457
 extern int ib_get_hca_info ( struct ib_device *ibdev,
459
 			     struct ib_gid_half *hca_guid );
458
 			     struct ib_gid_half *hca_guid );
460
-extern int ib_set_port_info ( struct ib_device *ibdev,
461
-			      const struct ib_port_info *port_info );
459
+extern int ib_set_port_info ( struct ib_device *ibdev, union ib_mad *mad );
462
 extern struct ib_device * alloc_ibdev ( size_t priv_size );
460
 extern struct ib_device * alloc_ibdev ( size_t priv_size );
463
 extern int register_ibdev ( struct ib_device *ibdev );
461
 extern int register_ibdev ( struct ib_device *ibdev );
464
 extern void unregister_ibdev ( struct ib_device *ibdev );
462
 extern void unregister_ibdev ( struct ib_device *ibdev );

+ 5
- 5
src/net/infiniband.c View File

687
 	return num_ports;
687
 	return num_ports;
688
 }
688
 }
689
 
689
 
690
-/** Set port information
690
+/**
691
+ * Set port information
691
  *
692
  *
692
  * @v ibdev		Infiniband device
693
  * @v ibdev		Infiniband device
693
- * @v port_info		New port information
694
+ * @v mad		Set port information MAD
694
  */
695
  */
695
-int ib_set_port_info ( struct ib_device *ibdev,
696
-		       const struct ib_port_info *port_info ) {
696
+int ib_set_port_info ( struct ib_device *ibdev, union ib_mad *mad ) {
697
 	int rc;
697
 	int rc;
698
 
698
 
699
 	/* Adapters with embedded SMAs do not need to support this method */
699
 	/* Adapters with embedded SMAs do not need to support this method */
703
 		return -ENOTSUP;
703
 		return -ENOTSUP;
704
 	}
704
 	}
705
 
705
 
706
-	if ( ( rc = ibdev->op->set_port_info ( ibdev, port_info ) ) != 0 ) {
706
+	if ( ( rc = ibdev->op->set_port_info ( ibdev, mad ) ) != 0 ) {
707
 		DBGC ( ibdev, "IBDEV %p could not set port information: %s\n",
707
 		DBGC ( ibdev, "IBDEV %p could not set port information: %s\n",
708
 		       ibdev, strerror ( rc ) );
708
 		       ibdev, strerror ( rc ) );
709
 		return rc;
709
 		return rc;

+ 1
- 1
src/net/infiniband/ib_gma.c View File

255
 	       "%02x\n", gma, ibdev->lid, ibdev->sm_lid,
255
 	       "%02x\n", gma, ibdev->lid, ibdev->sm_lid,
256
 	       ibdev->link_width_enabled, ibdev->link_speed_enabled );
256
 	       ibdev->link_width_enabled, ibdev->link_speed_enabled );
257
 
257
 
258
-	if ( ( rc = ib_set_port_info ( ibdev, port_info ) ) != 0 ) {
258
+	if ( ( rc = ib_set_port_info ( ibdev, mad ) ) != 0 ) {
259
 		DBGC ( gma, "GMA %p could not set port information: %s\n",
259
 		DBGC ( gma, "GMA %p could not set port information: %s\n",
260
 		       gma, strerror ( rc ) );
260
 		       gma, strerror ( rc ) );
261
 		mad->hdr.status =
261
 		mad->hdr.status =

Loading…
Cancel
Save