|
@@ -311,3 +311,28 @@ void intf_restart ( struct interface *intf, int rc ) {
|
311
|
311
|
*/
|
312
|
312
|
intf->desc = desc;
|
313
|
313
|
}
|
|
314
|
+
|
|
315
|
+/**
|
|
316
|
+ * Poke an object interface
|
|
317
|
+ *
|
|
318
|
+ * @v intf Object interface
|
|
319
|
+ * @v type Operation type
|
|
320
|
+ *
|
|
321
|
+ * This is a helper function to implement methods which take no
|
|
322
|
+ * parameters and return nothing.
|
|
323
|
+ */
|
|
324
|
+void intf_poke ( struct interface *intf,
|
|
325
|
+ void ( type ) ( struct interface *intf ) ) {
|
|
326
|
+ struct interface *dest;
|
|
327
|
+ intf_poke_TYPE ( void * ) *op =
|
|
328
|
+ intf_get_dest_op_untyped ( intf, type, &dest );
|
|
329
|
+ void *object = intf_object ( dest );
|
|
330
|
+
|
|
331
|
+ if ( op ) {
|
|
332
|
+ op ( object );
|
|
333
|
+ } else {
|
|
334
|
+ /* Default is to do nothing */
|
|
335
|
+ }
|
|
336
|
+
|
|
337
|
+ intf_put ( dest );
|
|
338
|
+}
|