/* Return the channel from the frequency (in Mhz)  */
int getChannelFromFrequency(int frequency)
/* Return the channel from the frequency (in Mhz)  */
int getChannelFromFrequency(int frequency)
{
	if (frequency >= 2412 && frequency <= 2472)
		return (frequency - 2407) / 5;
	else if (frequency == 2484)
		return 14;
	else if (frequency >= 4920 && frequency <= 6100)
		return (frequency - 5000) / 5;
	else
		return -1;
}