/* In the ->set*() methods, we round the computed register value to the nearest integer.  */
static unsigned int get_rx_coal(struct mv643xx_eth_private *mp)
/* In the ->set*() methods, we round the computed register value to the nearest integer.  */
static unsigned int get_rx_coal(struct mv643xx_eth_private *mp)
{
	u32 val = rdlp(mp, SDMA_CONFIG);
	u64 temp;
	if (mp->shared->extended_rx_coal_limit)
		temp = ((val & 0x02000000) >> 10) | ((val & 0x003fff80) >> 7);
	else
		temp = (val & 0x003fff00) >> 8;
	temp *= 64000000;
	do_div(temp, mp->shared->t_clk);
	return (unsigned int)temp;
}