Lines Matching refs:tx_msg
84 * Open: it is marked as active (i2400m->tx_msg is valid) and we
529 * Assumes a TX message is active (i2400m->tx_msg).
536 struct i2400m_msg_hdr *msg_hdr = i2400m->tx_msg;
563 struct i2400m_msg_hdr *tx_msg;
565 BUG_ON(i2400m->tx_msg != NULL);
575 tx_msg = i2400m_tx_fifo_push(i2400m, I2400M_TX_PLD_SIZE,
577 if (tx_msg == NULL)
579 else if (tx_msg == TAIL_FULL) {
585 memset(tx_msg, 0, I2400M_TX_PLD_SIZE);
586 tx_msg->size = I2400M_TX_PLD_SIZE;
588 i2400m->tx_msg = tx_msg;
590 tx_msg, (void *) tx_msg - i2400m->tx_buf);
615 struct i2400m_msg_hdr *tx_msg = i2400m->tx_msg;
621 if (tx_msg->size & I2400M_TX_SKIP) /* a skipper? nothing to do */
623 num_pls = le16_to_cpu(tx_msg->num_pls);
628 tx_msg->size |= I2400M_TX_SKIP;
642 hdr_size = sizeof(*tx_msg)
643 + le16_to_cpu(tx_msg->num_pls) * sizeof(tx_msg->pld[0]);
645 tx_msg->offset = I2400M_TX_PLD_SIZE - hdr_size;
646 tx_msg_moved = (void *) tx_msg + tx_msg->offset;
647 memmove(tx_msg_moved, tx_msg, hdr_size);
648 tx_msg_moved->size -= tx_msg->offset;
675 if (tx_msg != tx_msg_moved)
676 tx_msg->size += padding;
678 i2400m->tx_msg = NULL;
740 if (unlikely(i2400m->tx_msg == NULL))
743 || (is_singleton && i2400m->tx_msg->num_pls != 0))) {
746 is_singleton, i2400m->tx_msg->num_pls);
750 if (i2400m->tx_msg == NULL)
758 if (i2400m->tx_msg->size + padded_len > I2400M_TX_MSG_SIZE) {
763 if (i2400m->tx_msg == NULL)
779 struct i2400m_msg_hdr *tx_msg = i2400m->tx_msg;
780 unsigned num_pls = le16_to_cpu(tx_msg->num_pls);
783 i2400m_pld_set(&tx_msg->pld[num_pls], buf_len, pl_type);
785 le32_to_cpu(tx_msg->pld[num_pls].val),
787 tx_msg->num_pls = le16_to_cpu(num_pls+1);
788 tx_msg->size += padded_len;
790 padded_len, tx_msg->size, num_pls+1);
793 (void *)tx_msg - i2400m->tx_buf, (size_t)tx_msg->size,
842 struct i2400m_msg_hdr *tx_msg, *tx_msg_moved;
858 tx_msg = i2400m->tx_buf + i2400m->tx_out % I2400M_TX_BUF_SIZE;
859 if (tx_msg->size & I2400M_TX_SKIP) { /* skip? */
862 (size_t) tx_msg->size & ~I2400M_TX_SKIP);
863 i2400m->tx_out += tx_msg->size & ~I2400M_TX_SKIP;
867 if (tx_msg->num_pls == 0) { /* No payloads? */
868 if (tx_msg == i2400m->tx_msg) { /* open, we are done */
871 (void *) tx_msg - i2400m->tx_buf);
872 tx_msg = NULL;
877 (void *) tx_msg - i2400m->tx_buf,
878 (size_t) tx_msg->size);
879 i2400m->tx_out += tx_msg->size & ~I2400M_TX_SKIP;
883 if (tx_msg == i2400m->tx_msg) /* open msg? */
887 tx_msg_moved = (void *) tx_msg + tx_msg->offset;
888 i2400m->tx_msg_size = tx_msg->size;
892 current->pid, (void *) tx_msg - i2400m->tx_buf,
893 (size_t) tx_msg->offset, (size_t) tx_msg->size,
961 * for tx_in, tx_out, tx_msg_size and tx_msg. We reset them since
991 i2400m->tx_msg = NULL;