Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[infiniband] Pass a generic MAD to ib_set_port_info()
  • Loading branch information
Michael Brown committed Jul 17, 2009
1 parent 0095e18 commit ea6eb7f
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 14 deletions.
6 changes: 3 additions & 3 deletions src/drivers/infiniband/linda.c
Expand Up @@ -242,11 +242,11 @@ static void linda_link_state_changed ( struct ib_device *ibdev ) {
* Set port information
*
* @v ibdev Infiniband device
* @v port_info New port information
* @v mad Set port information MAD
*/
static int linda_set_port_info ( struct ib_device *ibdev,
const struct ib_port_info *port_info ) {
static int linda_set_port_info ( struct ib_device *ibdev, union ib_mad *mad ) {
struct linda *linda = ib_get_drvdata ( ibdev );
struct ib_port_info *port_info = &mad->smp.smp_data.port_info;
struct QIB_7220_IBCCtrl ibcctrl;
unsigned int port_state;
unsigned int link_state;
Expand Down
8 changes: 3 additions & 5 deletions src/include/gpxe/infiniband.h
Expand Up @@ -346,13 +346,12 @@ struct ib_device_operations {
/** Set port information
*
* @v ibdev Infiniband device
* @v port_info New port information
* @v mad Set port information MAD
*
* This method is required only by adapters that do not have
* an embedded SMA.
*/
int ( * set_port_info ) ( struct ib_device *ibdev,
const struct ib_port_info *port_info );
int ( * set_port_info ) ( struct ib_device *ibdev, union ib_mad *mad );
};

/** An Infiniband device */
Expand Down Expand Up @@ -457,8 +456,7 @@ extern void ib_mcast_detach ( struct ib_device *ibdev,
struct ib_queue_pair *qp, struct ib_gid *gid );
extern int ib_get_hca_info ( struct ib_device *ibdev,
struct ib_gid_half *hca_guid );
extern int ib_set_port_info ( struct ib_device *ibdev,
const struct ib_port_info *port_info );
extern int ib_set_port_info ( struct ib_device *ibdev, union ib_mad *mad );
extern struct ib_device * alloc_ibdev ( size_t priv_size );
extern int register_ibdev ( struct ib_device *ibdev );
extern void unregister_ibdev ( struct ib_device *ibdev );
Expand Down
10 changes: 5 additions & 5 deletions src/net/infiniband.c
Expand Up @@ -687,13 +687,13 @@ int ib_get_hca_info ( struct ib_device *ibdev,
return num_ports;
}

/** Set port information
/**
* Set port information
*
* @v ibdev Infiniband device
* @v port_info New port information
* @v mad Set port information MAD
*/
int ib_set_port_info ( struct ib_device *ibdev,
const struct ib_port_info *port_info ) {
int ib_set_port_info ( struct ib_device *ibdev, union ib_mad *mad ) {
int rc;

/* Adapters with embedded SMAs do not need to support this method */
Expand All @@ -703,7 +703,7 @@ int ib_set_port_info ( struct ib_device *ibdev,
return -ENOTSUP;
}

if ( ( rc = ibdev->op->set_port_info ( ibdev, port_info ) ) != 0 ) {
if ( ( rc = ibdev->op->set_port_info ( ibdev, mad ) ) != 0 ) {
DBGC ( ibdev, "IBDEV %p could not set port information: %s\n",
ibdev, strerror ( rc ) );
return rc;
Expand Down
2 changes: 1 addition & 1 deletion src/net/infiniband/ib_gma.c
Expand Up @@ -255,7 +255,7 @@ static union ib_mad * ib_sma_set_port_info ( struct ib_gma *gma,
"%02x\n", gma, ibdev->lid, ibdev->sm_lid,
ibdev->link_width_enabled, ibdev->link_speed_enabled );

if ( ( rc = ib_set_port_info ( ibdev, port_info ) ) != 0 ) {
if ( ( rc = ib_set_port_info ( ibdev, mad ) ) != 0 ) {
DBGC ( gma, "GMA %p could not set port information: %s\n",
gma, strerror ( rc ) );
mad->hdr.status =
Expand Down

0 comments on commit ea6eb7f

Please sign in to comment.