Lines Matching refs:ibi_node

26 static inline int ibi_work_submit(struct i3c_ibi_work *ibi_node)  in ibi_work_submit()  argument
28 return k_work_submit_to_queue(&i3c_ibi_work_q, &ibi_node->work); in ibi_work_submit()
34 struct i3c_ibi_work *ibi_node; in i3c_ibi_work_enqueue() local
43 ibi_node = (struct i3c_ibi_work *)node; in i3c_ibi_work_enqueue()
45 (void)memcpy(ibi_node, ibi_work, sizeof(*ibi_node)); in i3c_ibi_work_enqueue()
47 ret = ibi_work_submit(ibi_node); in i3c_ibi_work_enqueue()
60 struct i3c_ibi_work *ibi_node; in i3c_ibi_work_enqueue_target_irq() local
69 ibi_node = (struct i3c_ibi_work *)node; in i3c_ibi_work_enqueue_target_irq()
71 ibi_node->type = I3C_IBI_TARGET_INTR; in i3c_ibi_work_enqueue_target_irq()
72 ibi_node->target = target; in i3c_ibi_work_enqueue_target_irq()
73 ibi_node->payload.payload_len = payload_len; in i3c_ibi_work_enqueue_target_irq()
76 (void)memcpy(&ibi_node->payload.payload[0], in i3c_ibi_work_enqueue_target_irq()
80 ret = ibi_work_submit(ibi_node); in i3c_ibi_work_enqueue_target_irq()
92 struct i3c_ibi_work *ibi_node; in i3c_ibi_work_enqueue_hotjoin() local
101 ibi_node = (struct i3c_ibi_work *)node; in i3c_ibi_work_enqueue_hotjoin()
103 ibi_node->type = I3C_IBI_HOTJOIN; in i3c_ibi_work_enqueue_hotjoin()
104 ibi_node->controller = dev; in i3c_ibi_work_enqueue_hotjoin()
105 ibi_node->payload.payload_len = 0; in i3c_ibi_work_enqueue_hotjoin()
107 ret = ibi_work_submit(ibi_node); in i3c_ibi_work_enqueue_hotjoin()
120 struct i3c_ibi_work *ibi_node; in i3c_ibi_work_enqueue_cb() local
129 ibi_node = (struct i3c_ibi_work *)node; in i3c_ibi_work_enqueue_cb()
131 ibi_node->type = I3C_IBI_WORKQUEUE_CB; in i3c_ibi_work_enqueue_cb()
132 ibi_node->controller = dev; in i3c_ibi_work_enqueue_cb()
133 ibi_node->work_cb = work_cb; in i3c_ibi_work_enqueue_cb()
135 ret = ibi_work_submit(ibi_node); in i3c_ibi_work_enqueue_cb()
146 struct i3c_ibi_work *ibi_node = CONTAINER_OF(work, struct i3c_ibi_work, work); in i3c_ibi_work_handler() local
151 ((uint32_t)ibi_node->type <= I3C_IBI_TYPE_MAX)) { in i3c_ibi_work_handler()
153 ibi_node, (int)ibi_node->type, in i3c_ibi_work_handler()
154 ibi_node->payload.payload_len); in i3c_ibi_work_handler()
156 if (ibi_node->payload.payload_len > 0U) { in i3c_ibi_work_handler()
157 LOG_HEXDUMP_DBG(&ibi_node->payload.payload[0], in i3c_ibi_work_handler()
158 ibi_node->payload.payload_len, "IBI Payload"); in i3c_ibi_work_handler()
162 switch (ibi_node->type) { in i3c_ibi_work_handler()
164 if (ibi_node->payload.payload_len != 0U) { in i3c_ibi_work_handler()
165 payload = &ibi_node->payload; in i3c_ibi_work_handler()
170 ret = ibi_node->target->ibi_cb(ibi_node->target, payload); in i3c_ibi_work_handler()
172 LOG_ERR("IBI work %p cb returns %d", ibi_node, ret); in i3c_ibi_work_handler()
177 ret = i3c_do_daa(ibi_node->controller); in i3c_ibi_work_handler()
182 if (i3c_bus_has_sec_controller(ibi_node->controller)) { in i3c_ibi_work_handler()
183 ret = i3c_bus_deftgts(ibi_node->controller); in i3c_ibi_work_handler()
191 if (ibi_node->work_cb != NULL) { in i3c_ibi_work_handler()
192 ibi_node->work_cb(work); in i3c_ibi_work_handler()
202 LOG_DBG("Cannot process IBI type %d", (int)ibi_node->type); in i3c_ibi_work_handler()
208 if (ibi_work_submit(ibi_node) < 0) { in i3c_ibi_work_handler()
209 LOG_ERR("Error re-adding IBI work %p", ibi_node); in i3c_ibi_work_handler()
213 sys_slist_append(&i3c_ibi_work_nodes_free, (sys_snode_t *)ibi_node); in i3c_ibi_work_handler()