/* Generate a random time slot between s and S-1 where S = Number of slots (0 -> S-1) s = Current slot  */
int irlap_generate_rand_time_slot(int S, int s)
/* Generate a random time slot between s and S-1 where S = Number of slots (0 -> S-1) s = Current slot  */
int irlap_generate_rand_time_slot(int S, int s)
{
	static int rand;
	int slot;
	IRDA_ASSERT((S - s) > 0, return 0;);
	rand += jiffies;
	rand ^= (rand << 12);
	rand ^= (rand >> 20);
	slot = s + rand % (S-s);
	IRDA_ASSERT((slot >= s) || (slot < S), return 0;);
	return slot;
}