/* calc clocks using bus_speed returns (rounded up) time in bus clocks for time in ns  */
static int calc_clk(int time, int bus_speed)
/* calc clocks using bus_speed returns (rounded up) time in bus clocks for time in ns  */
static int calc_clk(int time, int bus_speed)
{
	int clocks;
	clocks = (time*bus_speed+999)/1000 - 1;
	if (clocks < 0)
		clocks = 0;
	if (clocks > 0x0F)
		clocks = 0x0F;
	return clocks;
}