FreeBSD/sys/dev/cxgb/cxgb_sge.c
/**
 *	restart_ctrlq - restart a suspended control queue
 *	@qs: the queue set cotaining the control queue
 *
 *	Resumes transmission on a suspended Tx control queue.
 */
restart a suspended control queue
@qs: the queue set cotaining the control queue

Resumes transmission on a suspended Tx control queue.
restart a suspended control queue @qs : the queue set cotaining the control queue Resumes transmission on a suspended Tx control queue .
static void
restart_ctrlq(void *data, int npending)
{
	struct mbuf *m;
	struct sge_qset *qs = (struct sge_qset *)data;
	struct sge_txq *q = &qs->txq[TXQ_CTRL];
	adapter_t *adap = qs->port->adapter;
	TXQ_LOCK(qs);
again:	reclaim_completed_tx_imm(q);
	while (q->in_use < q->size &&
	       (m = mbufq_dequeue(&q->sendq)) != NULL) {
		write_imm(&q->desc[q->pidx], m->m_data, m->m_len, q->gen);
		m_free(m);
		if (++q->pidx >= q->size) {
			q->pidx = 0;
			q->gen ^= 1;
		}
		q->in_use++;
	}
	if (mbufq_len(&q->sendq)) {
		setbit(&qs->txq_stopped, TXQ_CTRL);
		if (should_restart_tx(q) &&
		    test_and_clear_bit(TXQ_CTRL, &qs->txq_stopped))
			goto again;
		q->stops++;
	}
	TXQ_UNLOCK(qs);
	t3_write_reg(adap, A_SG_KDOORBELL,
		     F_SELEGRCNTX | V_EGRCNTX(q->cntxt_id));
}
static void restart_ctrlq ( void * data , int npending ) { struct mbuf * m ; struct sge_qset * qs = ( struct sge_qset * ) data ; struct sge_txq * q = & qs -> txq [ TXQ_CTRL ] ; adapter_t * adap = qs -> port -> adapter ; TXQ_LOCK ( qs ) ; again : reclaim_completed_tx_imm ( q ) ; while ( q -> in_use < q -> size && ( m = mbufq_dequeue ( & q -> sendq ) ) != NULL ) { write_imm ( & q -> desc [ q -> pidx ] , m -> m_data , m -> m_len , q -> gen ) ; m_free ( m ) ; if ( ++ q -> pidx >= q -> size ) { q -> pidx = 0 ; q -> gen ^= 1 ; } q -> in_use ++ ; } if ( mbufq_len ( & q -> sendq ) ) { setbit ( & qs -> txq_stopped , TXQ_CTRL ) ; if ( should_restart_tx ( q ) && test_and_clear_bit ( TXQ_CTRL , & qs -> txq_stopped ) ) goto again ; q -> stops ++ ; } TXQ_UNLOCK ( qs ) ; t3_write_reg ( adap , A_SG_KDOORBELL , F_SELEGRCNTX | V_EGRCNTX ( q -> cntxt_id ) ) ; }
restart_ctrlq - restart a suspended control queue
      @qs: the queue set cotaining the control queue
restart_ctrlq - restart a suspended control queue @qs : the queue set cotaining the control queue