FreeBSD/sys/dev/cxgb/common/cxgb_t3_hw.c
/**
 *	t3_get_vpd_len - computes the length of a vpd structure
 *	@adapter: the adapter
 *	@vpd: contains the offset of first byte of vpd
 *
 *	Computes the lentgh of the vpd structure starting at vpd->offset.
 */
computes the length of a vpd structure
@adapter: the adapter
@vpd: contains the offset of first byte of vpd

Computes the lentgh of the vpd structure starting at vpd->offset.
computes the length of a vpd structure @adapter : the adapter @vpd : contains the offset of first byte of vpd Computes the lentgh of the vpd structure starting at vpd - > offset .
int t3_get_vpd_len(adapter_t * adapter, struct generic_vpd *vpd)
{
	u32 len=0, offset;
	int inc, ret;
	offset = vpd->offset;
	while (offset < (vpd->offset + MAX_VPD_BYTES)) {
		ret = is_end_tag(adapter, offset);
		if (ret < 0)
			return ret;
		else if (ret == 1)
			break;
		inc = get_desc_len(adapter, offset);
		if (inc < 0)
			return inc;
		len += inc;
		offset += inc;
	}
	return (len + 1);
}
int t3_get_vpd_len ( adapter_t * adapter , struct generic_vpd * vpd ) { u32 len = 0 , offset ; int inc , ret ; offset = vpd -> offset ; while ( offset < ( vpd -> offset + MAX_VPD_BYTES ) ) { ret = is_end_tag ( adapter , offset ) ; if ( ret < 0 ) return ret ; else if ( ret == 1 ) break ; inc = get_desc_len ( adapter , offset ) ; if ( inc < 0 ) return inc ; len += inc ; offset += inc ; } return ( len + 1 ) ; }
t3_get_vpd_len - computes the length of a vpd structure
      @adapter: the adapter
      @vpd: contains the offset of first byte of vpd
t3_get_vpd_len - computes the length of a vpd structure @adapter : the adapter @vpd : contains the offset of first byte of vpd