18 #include <linux/types.h>
37 static int add_new_msg(
struct list_head *msg_list);
38 static void delete_msg_mgr(
struct msg_mgr *hmsg_mgr);
39 static void delete_msg_queue(
struct msg_queue *msg_queue_obj,
u32 num_to_dsp);
40 static void free_msg_list(
struct list_head *msg_list);
55 if (!msg_man || !msg_callback || !hdev_obj)
68 msg_mgr_obj->
on_exit = msg_callback;
69 msg_mgr_obj->
iomgr = hio_mgr;
93 *msg_man = msg_mgr_obj;
107 u32 num_allocated = 0;
111 if (!hmsg_mgr || msgq ==
NULL)
168 for (i = 0; i < max_msgs && !
status; i++) {
191 delete_msg_queue(msg_q, num_allocated);
202 delete_msg_mgr(hmsg_mgr);
214 if (!msg_queue_obj || !msg_queue_obj->
msg_mgr)
217 hmsg_mgr = msg_queue_obj->
msg_mgr;
218 msg_queue_obj->
done =
true;
221 while (io_msg_pend) {
232 delete_msg_queue(msg_queue_obj, msg_queue_obj->
max_msgs);
251 if (!msg_queue_obj || pmsg ==
NULL)
254 hmsg_mgr = msg_queue_obj->
msg_mgr;
262 *pmsg = msg_frame_obj->
msg_data.msg;
271 if (msg_queue_obj->
done) {
288 if (msg_queue_obj->
done) {
304 *pmsg = msg_frame_obj->
msg_data.msg;
331 if (!msg_queue_obj || !pmsg || !msg_queue_obj->
msg_mgr)
334 hmsg_mgr = msg_queue_obj->
msg_mgr;
343 msg_frame_obj->
msg_data.msg = *pmsg;
360 if (msg_queue_obj->
done) {
377 if (msg_queue_obj->
done) {
402 msg_frame_obj->
msg_data.msg = *pmsg;
432 if (!msg_queue_obj || !hnotification) {
448 status = ntfy_register(msg_queue_obj->
ntfy_obj, hnotification,
449 event_mask, notify_type);
451 status = ntfy_unregister(msg_queue_obj->
ntfy_obj,
477 msg_queue_obj->
msgq_id = msgq_id;
484 static int add_new_msg(
struct list_head *msg_list)
500 static void delete_msg_mgr(
struct msg_mgr *hmsg_mgr)
515 static void delete_msg_queue(
struct msg_queue *msg_queue_obj,
u32 num_to_dsp)
521 if (!msg_queue_obj || !msg_queue_obj->
msg_mgr)
524 hmsg_mgr = msg_queue_obj->
msg_mgr;
532 if (i++ >= num_to_dsp)
540 ntfy_delete(msg_queue_obj->
ntfy_obj);
548 kfree(msg_queue_obj);
554 static void free_msg_list(
struct list_head *msg_list)