FreeBSD/sys/dev/cxgbe/cxgbei/cxgbei_ulp2_ddp.h
/*
 * cxgbei_ulp2_set_non_ddp_tag - mark a given s/w tag as an invalid ddp tag
 * @tformat: tag format information
 * @sw_tag: s/w tag to be checked
 *
 * insert 1 at the upper most reserved bit to mark it as an invalid ddp tag.
 */
mark a given s/w tag as an invalid ddp tag
@tformat: tag format information
@sw_tag: s/w tag to be checked

insert 1 at the upper most reserved bit to mark it as an invalid ddp tag.
mark a given s / w tag as an invalid ddp tag @tformat : tag format information @sw_tag : s / w tag to be checked insert 1 at the upper most reserved bit to mark it as an invalid ddp tag .
static inline uint32_t
cxgbei_ulp2_set_non_ddp_tag(struct cxgbei_ulp2_tag_format *tformat,
					 uint32_t sw_tag)
{
	uint32_t rsvd_bits = tformat->rsvd_bits + tformat->rsvd_shift;
	if (sw_tag) {
                u32 v1 = sw_tag & ((1 << (rsvd_bits - 1)) - 1);
                u32 v2 = (sw_tag >> (rsvd_bits - 1)) << rsvd_bits;
                return v2 | (1 << (rsvd_bits - 1)) | v1;
        }
	return sw_tag | (1 << (rsvd_bits - 1)) ;
}
static inline uint32_t cxgbei_ulp2_set_non_ddp_tag ( struct cxgbei_ulp2_tag_format * tformat , uint32_t sw_tag ) { uint32_t rsvd_bits = tformat -> rsvd_bits + tformat -> rsvd_shift ; if ( sw_tag ) { u32 v1 = sw_tag & ( ( 1 << ( rsvd_bits - 1 ) ) - 1 ) ; u32 v2 = ( sw_tag >> ( rsvd_bits - 1 ) ) << rsvd_bits ; return v2 | ( 1 << ( rsvd_bits - 1 ) ) | v1 ; } return sw_tag | ( 1 << ( rsvd_bits - 1 ) ) ; }
cxgbei_ulp2_set_non_ddp_tag - mark a given s/w tag as an invalid ddp tag
 @tformat: tag format information
 @sw_tag: s/w tag to be checked
cxgbei_ulp2_set_non_ddp_tag - mark a given s / w tag as an invalid ddp tag @tformat : tag format information @sw_tag : s / w tag to be checked