FreeBSD/sys/dev/cxgb/cxgb_sge.c
/**
 *	t3_sge_stop - disable SGE operation
 *	@sc: the adapter
 *
 *	Disables the DMA engine.  This can be called in emeregencies (e.g.,
 *	from error interrupts) or from normal process context.  In the latter
 *	case it also disables any pending queue restart tasklets.  Note that
 *	if it is called in interrupt context it cannot disable the restart
 *	tasklets as it cannot wait, however the tasklets will have no effect
 *	since the doorbells are disabled and the driver will call this again
 *	later from process context, at which time the tasklets will be stopped
 *	if they are still running.
 */
disable SGE operation
@sc: the adapter

Disables the DMA engine.  This can be called in emeregencies  or from normal process context.  In the latter
case it also disables any pending queue restart tasklets.  Note that
if it is called in interrupt context it cannot disable the restart
tasklets as it cannot wait, however the tasklets will have no effect
since the doorbells are disabled and the driver will call this again
later from process context, at which time the tasklets will be stopped
if they are still running.
disable SGE operation @sc : the adapter Disables the DMA engine . This can be called in emeregencies or from normal process context . In the latter case it also disables any pending queue restart tasklets . Note that if it is called in interrupt context it cannot disable the restart tasklets as it cannot wait however the tasklets will have no effect since the doorbells are disabled and the driver will call this again later from process context at which time the tasklets will be stopped if they are still running .
void
t3_sge_stop(adapter_t *sc)
{
	int i, nqsets;
	t3_set_reg_field(sc, A_SG_CONTROL, F_GLOBALENABLE, 0);
	if (sc->tq == NULL)
		return;
	for (nqsets = i = 0; i < (sc)->params.nports; i++) 
		nqsets += sc->port[i].nqsets;
#ifdef notyet
	for (i = 0; i < nqsets; ++i) {
		struct sge_qset *qs = &sc->sge.qs[i];
		taskqueue_drain(sc->tq, &qs->txq[TXQ_OFLD].qresume_task);
		taskqueue_drain(sc->tq, &qs->txq[TXQ_CTRL].qresume_task);
	}
#endif
}
void t3_sge_stop ( adapter_t * sc ) { int i , nqsets ; t3_set_reg_field ( sc , A_SG_CONTROL , F_GLOBALENABLE , 0 ) ; if ( sc -> tq == NULL ) return ; for ( nqsets = i = 0 ; i < ( sc ) -> params . nports ; i ++ ) nqsets += sc -> port [ i ] . nqsets ; #ifdef notyet for ( i = 0 ; i < nqsets ; ++ i ) { struct sge_qset * qs = & sc -> sge . qs [ i ] ; taskqueue_drain ( sc -> tq , & qs -> txq [ TXQ_OFLD ] . qresume_task ) ; taskqueue_drain ( sc -> tq , & qs -> txq [ TXQ_CTRL ] . qresume_task ) ; } #endif }
t3_sge_stop - disable SGE operation
      @sc: the adapter
t3_sge_stop - disable SGE operation @sc : the adapter
/*
	 * 
	 * XXX
	 */