FreeBSD/sys/dev/vxge/vxge.c
/*
 * vxge_tx_compl
 * If the interrupt is due to Tx completion, free the sent buffer
 */
vxge_tx_compl
If the interrupt is due to Tx completion, free the sent buffer
vxge_tx_compl If the interrupt is due to Tx completion free the sent buffer
vxge_hal_status_e
vxge_tx_compl(vxge_hal_vpath_h vpath_handle, vxge_hal_txdl_h txdlh,
    void *dtr_priv, vxge_hal_fifo_tcode_e t_code, void *userdata)
{
	vxge_hal_status_e status = VXGE_HAL_OK;
	vxge_txdl_priv_t *txdl_priv;
	vxge_vpath_t *vpath = (vxge_vpath_t *) userdata;
	vxge_dev_t *vdev = vpath->vdev;
	ifnet_t ifp = vdev->ifp;
	VXGE_TX_LOCK(vpath);
	do {
		VXGE_DRV_STATS(vpath, tx_compl);
		if (t_code != VXGE_HAL_FIFO_T_CODE_OK) {
			device_printf(vdev->ndev, "tx transfer code %d\n",
			    t_code);
			if_inc_counter(ifp, IFCOUNTER_OERRORS, 1);
			VXGE_DRV_STATS(vpath, tx_tcode);
			vxge_hal_fifo_handle_tcode(vpath_handle, txdlh, t_code);
		}
		if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1);
		txdl_priv = (vxge_txdl_priv_t *) dtr_priv;
		bus_dmamap_unload(vpath->dma_tag_tx, txdl_priv->dma_map);
		vxge_free_packet(txdl_priv->mbuf_pkt);
		vxge_hal_fifo_txdl_free(vpath->handle, txdlh);
	} while (vxge_hal_fifo_txdl_next_completed(vpath_handle, &txdlh,
	    &dtr_priv, &t_code) == VXGE_HAL_OK);
	ifp->if_drv_flags &= ~IFF_DRV_OACTIVE;
	VXGE_TX_UNLOCK(vpath);
	return (status);
}
vxge_hal_status_e vxge_tx_compl ( vxge_hal_vpath_h vpath_handle , vxge_hal_txdl_h txdlh , void * dtr_priv , vxge_hal_fifo_tcode_e t_code , void * userdata ) { vxge_hal_status_e status = VXGE_HAL_OK ; vxge_txdl_priv_t * txdl_priv ; vxge_vpath_t * vpath = ( vxge_vpath_t * ) userdata ; vxge_dev_t * vdev = vpath -> vdev ; ifnet_t ifp = vdev -> ifp ; VXGE_TX_LOCK ( vpath ) ; do { VXGE_DRV_STATS ( vpath , tx_compl ) ; if ( t_code != VXGE_HAL_FIFO_T_CODE_OK ) { device_printf ( vdev -> ndev , " \n " , t_code ) ; if_inc_counter ( ifp , IFCOUNTER_OERRORS , 1 ) ; VXGE_DRV_STATS ( vpath , tx_tcode ) ; vxge_hal_fifo_handle_tcode ( vpath_handle , txdlh , t_code ) ; } if_inc_counter ( ifp , IFCOUNTER_OPACKETS , 1 ) ; txdl_priv = ( vxge_txdl_priv_t * ) dtr_priv ; bus_dmamap_unload ( vpath -> dma_tag_tx , txdl_priv -> dma_map ) ; vxge_free_packet ( txdl_priv -> mbuf_pkt ) ; vxge_hal_fifo_txdl_free ( vpath -> handle , txdlh ) ; } while ( vxge_hal_fifo_txdl_next_completed ( vpath_handle , & txdlh , & dtr_priv , & t_code ) == VXGE_HAL_OK ) ; ifp -> if_drv_flags &= ~ IFF_DRV_OACTIVE ; VXGE_TX_UNLOCK ( vpath ) ; return ( status ) ; }
vxge_tx_compl
 If the interrupt is due to Tx completion, free the sent buffer
vxge_tx_compl If the interrupt is due to Tx completion free the sent buffer
/*
	 * For each completed descriptor
	 * Get private structure, free buffer, do unmapping, and free descriptor
	 */