src/add-ons/kernel/drivers/network/ipro1000/dev/e1000/if_igb.c
/*********************************************************************
 *  Transmit entry point
 *
 *  igb_start is called by the stack to initiate a transmit.
 *  The driver will remain in this routine as long as there are
 *  packets to transmit and transmit resources are available.
 *  In case resources are not available stack is notified and
 *  the packet is requeued.
 **********************************************************************/
Transmit entry point
igb_start is called by the stack to initiate a transmit.
The driver will remain in this routine as long as there are
packets to transmit and transmit resources are available.
In case resources are not available stack is notified and
the packet is requeued.
Transmit entry point igb_start is called by the stack to initiate a transmit . The driver will remain in this routine as long as there are packets to transmit and transmit resources are available . In case resources are not available stack is notified and the packet is requeued .
static void
igb_start_locked(struct tx_ring *txr, struct ifnet *ifp)
{
	struct adapter	*adapter = ifp->if_softc;
	struct mbuf	*m_head;
	IGB_TX_LOCK_ASSERT(txr);
	if ((ifp->if_drv_flags & (IFF_DRV_RUNNING|IFF_DRV_OACTIVE)) !=
	    IFF_DRV_RUNNING)
		return;
	if (!adapter->link_active)
		return;
	if (txr->tx_avail <= IGB_TX_CLEANUP_THRESHOLD)
		igb_txeof(txr);
	while (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) {
		if (txr->tx_avail <= IGB_MAX_SCATTER) {
			txr->queue_status |= IGB_QUEUE_DEPLETED;
			break;
		}
		IFQ_DRV_DEQUEUE(&ifp->if_snd, m_head);
		if (m_head == NULL)
			break;
		if (igb_xmit(txr, &m_head)) {
			if (m_head != NULL)
				IFQ_DRV_PREPEND(&ifp->if_snd, m_head);
			if (txr->tx_avail <= IGB_MAX_SCATTER)
				txr->queue_status |= IGB_QUEUE_DEPLETED;
			break;
		}
		ETHER_BPF_MTAP(ifp, m_head);
		txr->watchdog_time = ticks;
		txr->queue_status |= IGB_QUEUE_WORKING;
	}
}
static void igb_start_locked ( struct tx_ring * txr , struct ifnet * ifp ) { struct adapter * adapter = ifp -> if_softc ; struct mbuf * m_head ; IGB_TX_LOCK_ASSERT ( txr ) ; if ( ( ifp -> if_drv_flags & ( IFF_DRV_RUNNING | IFF_DRV_OACTIVE ) ) != IFF_DRV_RUNNING ) return ; if ( ! adapter -> link_active ) return ; if ( txr -> tx_avail <= IGB_TX_CLEANUP_THRESHOLD ) igb_txeof ( txr ) ; while ( ! IFQ_DRV_IS_EMPTY ( & ifp -> if_snd ) ) { if ( txr -> tx_avail <= IGB_MAX_SCATTER ) { txr -> queue_status |= IGB_QUEUE_DEPLETED ; break ; } IFQ_DRV_DEQUEUE ( & ifp -> if_snd , m_head ) ; if ( m_head == NULL ) break ; if ( igb_xmit ( txr , & m_head ) ) { if ( m_head != NULL ) IFQ_DRV_PREPEND ( & ifp -> if_snd , m_head ) ; if ( txr -> tx_avail <= IGB_MAX_SCATTER ) txr -> queue_status |= IGB_QUEUE_DEPLETED ; break ; } ETHER_BPF_MTAP ( ifp , m_head ) ; txr -> watchdog_time = ticks ; txr -> queue_status |= IGB_QUEUE_WORKING ; } }
Transmit entry point
  igb_start is called by the stack to initiate a transmit.
Transmit entry point igb_start is called by the stack to initiate a transmit .
/* Call cleanup if number of TX descriptors low */ /*
		 *  Encapsulation can modify our pointer, and or make it
		 *  NULL on failure.  In that event, we can't requeue.
		 */ /* Send a copy of the frame to the BPF listener */ /* Set watchdog on */