mirror of
https://github.com/ipxe/ipxe
synced 2025-12-28 18:42:53 +03:00
[infiniband] Allow MAD handlers to indicate response via return value
Now that MAD handlers no longer return a status code, we can allow them to return a pointer to a MAD structure if and only if they want to send a response. This provides a more natural and flexible approach than using a "response method" field within the handler's descriptor.
This commit is contained in:
@@ -170,9 +170,10 @@ int ib_resolve_path ( struct ib_device *ibdev,
|
||||
*
|
||||
* @v gma General management agent
|
||||
* @v mad MAD
|
||||
* @ret response MAD response
|
||||
*/
|
||||
static void ib_handle_path_record ( struct ib_gma *gma,
|
||||
union ib_mad *mad ) {
|
||||
static union ib_mad * ib_handle_path_record ( struct ib_gma *gma,
|
||||
union ib_mad *mad ) {
|
||||
struct ib_device *ibdev = gma->ibdev;
|
||||
struct ib_path_record *path_record = &mad->sa.sa_data.path_record;
|
||||
struct ib_gid *dgid = &path_record->dgid;
|
||||
@@ -185,7 +186,7 @@ static void ib_handle_path_record ( struct ib_gma *gma,
|
||||
if ( mad->hdr.status != htons ( IB_MGMT_STATUS_OK ) ) {
|
||||
DBGC ( gma, "GMA %p path record lookup failed with status "
|
||||
"%04x\n", gma, ntohs ( mad->hdr.status ) );
|
||||
return;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* Extract values from MAD */
|
||||
@@ -208,6 +209,8 @@ static void ib_handle_path_record ( struct ib_gma *gma,
|
||||
cached->rate = rate;
|
||||
cached->sl = sl;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/** Path record response handler */
|
||||
|
||||
Reference in New Issue
Block a user