diff options
Diffstat (limited to 'include/net/can_host.h')
-rw-r--r-- | include/net/can_host.h | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/include/net/can_host.h b/include/net/can_host.h index d79676746b..18979c2e2d 100644 --- a/include/net/can_host.h +++ b/include/net/can_host.h @@ -29,27 +29,26 @@ #define NET_CAN_HOST_H #include "net/can_emu.h" +#include "qom/object.h" #define TYPE_CAN_HOST "can-host" -#define CAN_HOST_CLASS(klass) \ - OBJECT_CLASS_CHECK(CanHostClass, (klass), TYPE_CAN_HOST) -#define CAN_HOST_GET_CLASS(obj) \ - OBJECT_GET_CLASS(CanHostClass, (obj), TYPE_CAN_HOST) -#define CAN_HOST(obj) \ - OBJECT_CHECK(CanHostState, (obj), TYPE_CAN_HOST) - -typedef struct CanHostState { +typedef struct CanHostClass CanHostClass; +typedef struct CanHostState CanHostState; +DECLARE_OBJ_CHECKERS(CanHostState, CanHostClass, + CAN_HOST, TYPE_CAN_HOST) + +struct CanHostState { ObjectClass oc; CanBusState *bus; CanBusClientState bus_client; -} CanHostState; +}; -typedef struct CanHostClass { +struct CanHostClass { ObjectClass oc; void (*connect)(CanHostState *ch, Error **errp); void (*disconnect)(CanHostState *ch); -} CanHostClass; +}; #endif |