mirror of
https://github.com/ipxe/ipxe
synced 2025-12-24 06:22:59 +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:
@@ -26,20 +26,15 @@ struct ib_gma_handler {
|
||||
uint8_t class_version;
|
||||
/** Method */
|
||||
uint8_t method;
|
||||
/** Response method, or zero */
|
||||
uint8_t resp_method;
|
||||
/** Attribute (in network byte order) */
|
||||
uint16_t attr_id;
|
||||
/** Handle attribute
|
||||
*
|
||||
* @v gma General management agent
|
||||
* @v mad MAD
|
||||
*
|
||||
* The handler should modify the MAD as applicable. If the
|
||||
* handler returns with a non-zero value in the MAD's @c
|
||||
* method field, it will be sent as a response.
|
||||
* @v gma General management agent
|
||||
* @v mad MAD
|
||||
* @ret response MAD response, or NULL to send no response
|
||||
*/
|
||||
void ( * handle ) ( struct ib_gma *gma, union ib_mad *mad );
|
||||
union ib_mad * ( * handle ) ( struct ib_gma *gma, union ib_mad *mad );
|
||||
};
|
||||
|
||||
/** GMA attribute handlers */
|
||||
|
||||
Reference in New Issue
Block a user