/* Find the channel frequency power info with specific frequency.  */
static struct chan_freq_power* find_cfp_by_band_and_freq(struct lbs_private *priv, u8 band, u32 freq)
/* Find the channel frequency power info with specific frequency.  */
static struct chan_freq_power* find_cfp_by_band_and_freq(struct lbs_private *priv, u8 band, u32 freq)
{
	struct chan_freq_power *cfp = NULL;
	struct region_channel *rc;
	int i, j;
	for (j = 0; !cfp && (j < ARRAY_SIZE(priv->region_channel)); j++) {
		rc = &priv->region_channel[j];
		if (!rc->valid || !rc->CFP)
			continue;
		if (rc->band != band)
			continue;
		for (i = 0; i < rc->nrcfp; i++) {
			if (rc->CFP[i].freq == freq) {
				cfp = &rc->CFP[i];
				break;
			}
		}
	}
	if (!cfp && freq)
		lbs_deb_wext("find_cfp_by_band_and_freql: can't find cfp by "
		       "band %d / freq %d\n", band, freq);
	return cfp;
}