示例#1
0
static void *unipro_tx_worker(void *data)
{
    struct dma_channel *channel;
    struct unipro_xfer_descriptor *desc;

    while (1) {
        /* Block until a buffer is pending on any CPort */
        sem_wait(&worker.tx_fifo_lock);

        channel = pick_free_dma_channel();
        do {
            desc = pick_tx_descriptor();
        } while (!desc);

        unipro_dma_xfer(desc, channel);
    }

    return NULL;
}
示例#2
0
static void *unipro_tx_worker(void *data)
{
    struct dma_channel *channel;
    struct unipro_xfer_descriptor *desc;
    unsigned int next_cport;

    while (1) {
        /* Block until a buffer is pending on any CPort */
        sem_wait(&worker.tx_fifo_lock);

        next_cport = 0;
        while ((desc = pick_tx_descriptor(next_cport)) != NULL) {
            next_cport = desc->cport->cportid + 1;
            channel = pick_dma_channel(desc->cport);

            unipro_dma_xfer(desc, channel);
        }
    }

    return NULL;
}