Lines Matching refs:link
9 static void try_callback(struct modem_pipelink *link, enum modem_pipelink_event event) in try_callback() argument
11 if (link->callback == NULL) { in try_callback()
15 link->callback(link, event, link->user_data); in try_callback()
18 void modem_pipelink_attach(struct modem_pipelink *link, in modem_pipelink_attach() argument
22 K_SPINLOCK(&link->spinlock) { in modem_pipelink_attach()
23 link->callback = callback; in modem_pipelink_attach()
24 link->user_data = user_data; in modem_pipelink_attach()
28 bool modem_pipelink_is_connected(struct modem_pipelink *link) in modem_pipelink_is_connected() argument
32 K_SPINLOCK(&link->spinlock) { in modem_pipelink_is_connected()
33 connected = link->connected; in modem_pipelink_is_connected()
39 struct modem_pipe *modem_pipelink_get_pipe(struct modem_pipelink *link) in modem_pipelink_get_pipe() argument
41 return link->pipe; in modem_pipelink_get_pipe()
44 void modem_pipelink_release(struct modem_pipelink *link) in modem_pipelink_release() argument
46 K_SPINLOCK(&link->spinlock) { in modem_pipelink_release()
47 link->callback = NULL; in modem_pipelink_release()
48 link->user_data = NULL; in modem_pipelink_release()
52 void modem_pipelink_init(struct modem_pipelink *link, struct modem_pipe *pipe) in modem_pipelink_init() argument
54 link->pipe = pipe; in modem_pipelink_init()
55 link->callback = NULL; in modem_pipelink_init()
56 link->user_data = NULL; in modem_pipelink_init()
57 link->connected = false; in modem_pipelink_init()
60 void modem_pipelink_notify_connected(struct modem_pipelink *link) in modem_pipelink_notify_connected() argument
62 K_SPINLOCK(&link->spinlock) { in modem_pipelink_notify_connected()
63 if (link->connected) { in modem_pipelink_notify_connected()
67 link->connected = true; in modem_pipelink_notify_connected()
68 try_callback(link, MODEM_PIPELINK_EVENT_CONNECTED); in modem_pipelink_notify_connected()
72 void modem_pipelink_notify_disconnected(struct modem_pipelink *link) in modem_pipelink_notify_disconnected() argument
74 K_SPINLOCK(&link->spinlock) { in modem_pipelink_notify_disconnected()
75 if (!link->connected) { in modem_pipelink_notify_disconnected()
79 link->connected = false; in modem_pipelink_notify_disconnected()
80 try_callback(link, MODEM_PIPELINK_EVENT_DISCONNECTED); in modem_pipelink_notify_disconnected()