While releasing dedicated mode, pending SDCCH and SACCH messages need to be
flushed. Without it, it would also cause old pending messages to be sent
during next dedicated mode.
/* safely enable a message into the L1S TX queue */
void l1a_txq_msgb_enq(struct llist_head *queue, struct msgb *msg);
+/* flush all pending msgb */
+void l1a_txq_msgb_flush(struct llist_head *queue);
+
/* request a RACH request at the next multiframe T3 = fn51 */
void l1a_rach_req(uint8_t fn51, uint8_t mf_off, uint8_t ra);
local_irq_restore(flags);
}
+/* flush all pending msgb */
+void l1a_txq_msgb_flush(struct llist_head *queue)
+{
+ struct msgb *msg;
+ unsigned long flags;
+
+ local_firq_save(flags);
+ while ((msg = msgb_dequeue(queue)))
+ msgb_free(msg);
+ local_irq_restore(flags);
+}
+
/* Enable a repeating multiframe task */
void l1a_mftask_enable(enum mframe_task task)
{
printd("L1CTL_DM_REL_REQ\n");
l1a_mftask_set(0);
l1s.dedicated.type = GSM_DCHAN_NONE;
+ l1a_txq_msgb_flush(&l1s.tx_queue[L1S_CHAN_MAIN]);
+ l1a_txq_msgb_flush(&l1s.tx_queue[L1S_CHAN_SACCH]);
}
/* receive a L1CTL_RACH_REQ from L23 */