FreeBSD/sys/dev/cxgb/cxgb_sge.c
/**
 *	recycle_rx_buf - recycle a receive buffer
 *	@adapter: the adapter
 *	@q: the SGE free list
 *	@idx: index of buffer to recycle
 *
 *	Recycles the specified buffer on the given free list by adding it at
 *	the next available slot on the list.
 */
recycle a receive buffer
@adapter: the adapter
@q: the SGE free list
@idx: index of buffer to recycle

Recycles the specified buffer on the given free list by adding it at
the next available slot on the list.
recycle a receive buffer @adapter : the adapter @q : the SGE free list @idx : index of buffer to recycle Recycles the specified buffer on the given free list by adding it at the next available slot on the list .
static void
recycle_rx_buf(adapter_t *adap, struct sge_fl *q, unsigned int idx)
{
	struct rx_desc *from = &q->desc[idx];
	struct rx_desc *to   = &q->desc[q->pidx];
	q->sdesc[q->pidx] = q->sdesc[idx];
	to->addr_lo = from->addr_lo;        
	to->addr_hi = from->addr_hi;        
	wmb();	
	to->len_gen = htobe32(V_FLD_GEN1(q->gen));
	to->gen2 = htobe32(V_FLD_GEN2(q->gen));
	q->credits++;
	if (++q->pidx == q->size) {
		q->pidx = 0;
		q->gen ^= 1;
	}
	t3_write_reg(adap, A_SG_KDOORBELL, V_EGRCNTX(q->cntxt_id));
}
static void recycle_rx_buf ( adapter_t * adap , struct sge_fl * q , unsigned int idx ) { struct rx_desc * from = & q -> desc [ idx ] ; struct rx_desc * to = & q -> desc [ q -> pidx ] ; q -> sdesc [ q -> pidx ] = q -> sdesc [ idx ] ; to -> addr_lo = from -> addr_lo ; to -> addr_hi = from -> addr_hi ; wmb ( ) ; to -> len_gen = htobe32 ( V_FLD_GEN1 ( q -> gen ) ) ; to -> gen2 = htobe32 ( V_FLD_GEN2 ( q -> gen ) ) ; q -> credits ++ ; if ( ++ q -> pidx == q -> size ) { q -> pidx = 0 ; q -> gen ^= 1 ; } t3_write_reg ( adap , A_SG_KDOORBELL , V_EGRCNTX ( q -> cntxt_id ) ) ; }
recycle_rx_buf - recycle a receive buffer
      @adapter: the adapter
      @q: the SGE free list
      @idx: index of buffer to recycle
recycle_rx_buf - recycle a receive buffer @adapter : the adapter @q : the SGE free list @idx : index of buffer to recycle
// already big endian // likewise /* necessary ? */