diff options
author | Aleksander Morgado <aleksandermj@chromium.org> | 2022-12-15 22:44:25 +0000 |
---|---|---|
committer | Aleksander Morgado <aleksandermj@chromium.org> | 2022-12-18 21:55:21 +0000 |
commit | c7dac253158394389e0428180b27b0eadb64cd37 (patch) | |
tree | 2965e007d376edf98558fd77214cda7fe73ab9d3 /src/mm-port-mbim.h | |
parent | 309a8a515bf922b679f36971bffc2999bdc6e293 (diff) |
port-mbim: chain up device notifications through the port
Instead of having the modem object listen notifications in the
MbimDevice, the MMPortMbim will act as an intermediate emitter for the
same.
The primary benefit is that the lifecycle of the port object is
tightly coupled to the life of the modem object, so there is no chance
that the port object outlives the modem object.
And the port object will ensure its own device notification handler is
correctly cleared up on its dispose, so there should be no chance of
firing up a signal in the device for a listener that is already
freed.
Diffstat (limited to 'src/mm-port-mbim.h')
-rw-r--r-- | src/mm-port-mbim.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/mm-port-mbim.h b/src/mm-port-mbim.h index 81e3deb7..2bc1855a 100644 --- a/src/mm-port-mbim.h +++ b/src/mm-port-mbim.h @@ -37,6 +37,8 @@ #define MM_IS_PORT_MBIM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MM_TYPE_PORT_MBIM)) #define MM_PORT_MBIM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MM_TYPE_PORT_MBIM, MMPortMbimClass)) +#define MM_PORT_MBIM_SIGNAL_NOTIFICATION "notification" + typedef struct _MMPortMbim MMPortMbim; typedef struct _MMPortMbimClass MMPortMbimClass; typedef struct _MMPortMbimPrivate MMPortMbimPrivate; @@ -48,6 +50,10 @@ struct _MMPortMbim { struct _MMPortMbimClass { MMPortClass parent; + + /* signals */ + void (* notification) (MMPortMbim *port, + MbimMessage *notification); }; GType mm_port_mbim_get_type (void); |