/* If delay is small (10% of max) then beta = 1/8 If delay is up to 80% of max then beta = 1/2 In between is a linear function  */
static u32 beta(u32 da, u32 dm)
/* If delay is small (10% of max) then beta = 1/8 If delay is up to 80% of max then beta = 1/2 In between is a linear function  */
static u32 beta(u32 da, u32 dm)
{
	u32 d2, d3;
	d2 = dm / 10;
	if (da <= d2)
		return BETA_MIN;
	d3 = (8 * dm) / 10;
	if (da >= d3 || d3 <= d2)
		return BETA_MAX;
	return (BETA_MIN * d3 - BETA_MAX * d2 + (BETA_MAX - BETA_MIN) * da)
		/ (d3 - d2);
}