}
/**
- * Get object interface destination and operation method
+ * Get object interface destination and operation method (without pass-through)
*
* @v intf Object interface
* @v type Operation type
* @ret dest Destination interface
* @ret func Implementing method, or NULL
*/
-void * intf_get_dest_op_untyped ( struct interface *intf, void *type,
- struct interface **dest ) {
+void * intf_get_dest_op_no_passthru_untyped ( struct interface *intf,
+ void *type,
+ struct interface **dest ) {
struct interface_descriptor *desc;
struct interface_operation *op;
unsigned int i;
+ *dest = intf_get ( intf->dest );
+ desc = (*dest)->desc;
+ for ( i = desc->num_op, op = desc->op ; i ; i--, op++ ) {
+ if ( op->type == type )
+ return op->func;
+ }
+
+ return NULL;
+}
+
+/**
+ * Get object interface destination and operation method
+ *
+ * @v intf Object interface
+ * @v type Operation type
+ * @ret dest Destination interface
+ * @ret func Implementing method, or NULL
+ */
+void * intf_get_dest_op_untyped ( struct interface *intf, void *type,
+ struct interface **dest ) {
+ void *func;
+
while ( 1 ) {
+
/* Search for an implementing method provided by the
* current destination interface.
*/
- *dest = intf_get ( intf->dest );
- desc = (*dest)->desc;
- for ( i = desc->num_op, op = desc->op ; i ; i--, op++ ) {
- if ( op->type == type )
- return op->func;
- }
+ func = intf_get_dest_op_no_passthru_untyped( intf, type, dest );
+ if ( func )
+ return func;
/* Pass through to the underlying interface, if applicable */
if ( ! ( intf = intf_get_passthru ( *dest ) ) )
int xfer_vredirect ( struct interface *intf, int type, va_list args ) {
struct interface *dest;
xfer_vredirect_TYPE ( void * ) *op =
- intf_get_dest_op ( intf, xfer_vredirect, &dest );
+ intf_get_dest_op_no_passthru ( intf, xfer_vredirect, &dest );
void *object = intf_object ( dest );
int rc;
extern struct interface * intf_get ( struct interface *intf );
extern void intf_put ( struct interface *intf );
extern void * __attribute__ (( pure )) intf_object ( struct interface *intf );
+extern void * intf_get_dest_op_no_passthru_untyped ( struct interface *intf,
+ void *type,
+ struct interface **dest );
extern void * intf_get_dest_op_untyped ( struct interface *intf, void *type,
struct interface **dest );
.desc = &(descriptor), \
}
+/**
+ * Get object interface destination and operation method (without pass-through)
+ *
+ * @v intf Object interface
+ * @v type Operation type
+ * @ret dest Destination interface
+ * @ret func Implementing method, or NULL
+ */
+#define intf_get_dest_op_no_passthru( intf, type, dest ) \
+ ( ( type ## _TYPE ( void * ) * ) \
+ intf_get_dest_op_no_passthru_untyped ( intf, type, dest ) )
+
/**
* Get object interface destination and operation method
*