/* if NZ = 1, rate = 1.mmmmmmmmm x 2^(eeeee) cells/sec  */
static u16 cellrate_to_float(u32 cr)
/* if NZ = 1, rate = 1.mmmmmmmmm x 2^(eeeee) cells/sec  */
static u16 cellrate_to_float(u32 cr)
{
#define	NZ 		0x4000
#define	M_BITS		9
#define	E_BITS		5
#define	M_MASK		0x1ff#define	E_MASK		0x1f
  u16   flot;
  u32	tmp = cr & 0x00ffffff;
  int 	i   = 0;
  if (cr == 0)
     return 0;
  while (tmp != 1) {
     tmp >>= 1;
     i++;
  }
  if (i == M_BITS)
     flot = NZ | (i << M_BITS) | (cr & M_MASK);
  else if (i < M_BITS)
     flot = NZ | (i << M_BITS) | ((cr << (M_BITS - i)) & M_MASK);
  else
     flot = NZ | (i << M_BITS) | ((cr >> (i - M_BITS)) & M_MASK);
  return flot;
}