/** @brief function for IPC message reception Invokes cmd_handler for a command or recv_ipc_frames for IPC messages. @param mld the pointer to a mem_link_device instance */ static void ipc_rx_func(struct mem_link_device *mld) { struct sbd_link_device *sl = &mld->sbd_link_dev; while (1) { struct mst_buff *msb; u16 intr; msb = msb_dequeue(&mld->msb_rxq); if (!msb) break; intr = msb->snapshot.int2ap; if (cmd_valid(intr)) mld->cmd_handler(mld, int2cmd(intr)); if (sbd_active(sl)) recv_sbd_ipc_frames(mld); else recv_ipc_frames(mld, &msb->snapshot); msb_free(msb); } }
static void ipc_rx_func(struct mem_link_device *mld) { #ifdef CONFIG_LINK_DEVICE_WITH_SBD_ARCH struct sbd_link_device *sl = &mld->sbd_link_dev; #endif while (1) { struct mst_buff *msb; u16 intr; msb = msb_dequeue(&mld->msb_rxq); if (!msb) break; intr = msb->snapshot.int2ap; if (cmd_valid(intr)) mld->cmd_handler(mld, int2cmd(intr)); #ifdef CONFIG_LINK_DEVICE_WITH_SBD_ARCH if (sbd_active(sl)) recv_sbd_ipc_frames(mld, &msb->snapshot); else recv_ipc_frames(mld, &msb->snapshot); #else recv_ipc_frames(mld, &msb->snapshot); #endif #if 0 msb_queue_tail(&mld->msb_log, msb); #else msb_free(msb); #endif } }
/** @brief common interrupt handler for all MEMORY interfaces @param mld the pointer to a mem_link_device instance @param msb the pointer to a mst_buff instance */ void mem_irq_handler(struct mem_link_device *mld, struct mst_buff *msb) { struct link_device *ld = &mld->link_dev; struct modem_ctl *mc = ld->mc; u16 intr = msb->snapshot.int2ap; if (unlikely(!int_valid(intr))) { mif_err("%s: ERR! invalid intr 0x%X\n", ld->name, intr); msb_free(msb); return; } if (unlikely(!rx_possible(mc))) { mif_err("%s: ERR! %s.state == %s\n", ld->name, mc->name, mc_state(mc)); msb_free(msb); return; } msb_queue_tail(&mld->msb_rxq, msb); tasklet_hi_schedule(&mld->rx_tsk); }
/** @brief function for IPC message reception Invokes mem_cmd_handler for a command or recv_ipc_frames for IPC messages. @param mld the pointer to a mem_link_device instance */ static void ipc_rx_func(struct mem_link_device *mld) { while (1) { struct mst_buff *msb; u16 intr; msb = msb_dequeue(&mld->msb_rxq); if (!msb) break; intr = msb->snapshot.int2ap; if (cmd_valid(intr)) mem_cmd_handler(mld, int2cmd(intr)); recv_ipc_frames(mld, &msb->snapshot); #if 0/*defined(DEBUG_MODEM_IF)*/ msb_queue_tail(&mld->msb_log, msb); #else msb_free(msb); #endif } }
void msb_queue_purge(struct mst_buff_head *list) { struct mst_buff *msb; while ((msb = msb_dequeue(list)) != NULL) msb_free(msb); }