FreeBSD/sys/dev/cxgbe/common/t4_hw.c
/**
 *	t4_get_mps_bg_map - return the buffer groups associated with a port
 *	@adap: the adapter
 *	@idx: the port index
 *
 *	Returns a bitmap indicating which MPS buffer groups are associated
 *	with the given port.  Bit i is set if buffer group i is used by the
 *	port.
 */
return the buffer groups associated with a port
@adap: the adapter
@idx: the port index

Returns a bitmap indicating which MPS buffer groups are associated
with the given port.  Bit i is set if buffer group i is used by the
port.
return the buffer groups associated with a port @adap : the adapter @idx : the port index Returns a bitmap indicating which MPS buffer groups are associated with the given port . Bit i is set if buffer group i is used by the port .
static unsigned int t4_get_mps_bg_map(struct adapter *adap, int idx)
{
	u32 n = G_NUMPORTS(t4_read_reg(adap, A_MPS_CMN_CTL));
	if (n == 0)
		return idx == 0 ? 0xf : 0;
	if (n == 1 && chip_id(adap) <= CHELSIO_T5)
		return idx < 2 ? (3 << (2 * idx)) : 0;
	return 1 << idx;
}
static unsigned int t4_get_mps_bg_map ( struct adapter * adap , int idx ) { u32 n = G_NUMPORTS ( t4_read_reg ( adap , A_MPS_CMN_CTL ) ) ; if ( n == 0 ) return idx == 0 ? 0xf : 0 ; if ( n == 1 && chip_id ( adap ) <= CHELSIO_T5 ) return idx < 2 ? ( 3 << ( 2 * idx ) ) : 0 ; return 1 << idx ; }
t4_get_mps_bg_map - return the buffer groups associated with a port
      @adap: the adapter
      @idx: the port index
t4_get_mps_bg_map - return the buffer groups associated with a port @adap : the adapter @idx : the port index