os_mqueue_put

int os_mqueue_put(struct os_mqueue *mq, struct os_eventq *evq, struct os_mbuf *m)

Adds a packet (i.e. packet header mbuf) to an mqueue. The event associated with the mqueue gets posted to the specified eventq.

Arguments

ArgumentsDescription
mqThe mbuf queue to append the mbuf to.
evqThe event queue to post an event to.
mThe mbuf to append to the mbuf queue.

Returned values

0: success

OS_EINVAL: the mbuf is not a packet header mbuf.

Example

int
my_task_rx_data_func(struct os_mbuf *om)
{
    int rc;

    rc = os_mqueue_put(&rxpkt_q, &my_task_evq, om);
    if (rc != 0) {
        return -1;
    }

    return 0;
}