+static struct ubus_msg_buf *ubus_msg_head(struct ubus_client *cl)
+{
+ return cl->tx_queue[cl->txq_cur];
+}
+
+static void ubus_msg_dequeue(struct ubus_client *cl)
+{
+ struct ubus_msg_buf *ub = ubus_msg_head(cl);
+
+ if (!ub)
+ return;
+
+ ubus_msg_free(ub);
+ cl->txq_ofs = 0;
+ cl->tx_queue[cl->txq_cur] = NULL;
+ cl->txq_cur = (cl->txq_cur + 1) % ARRAY_SIZE(cl->tx_queue);