int libipw_is_valid_channel(struct libipw_device *ieee, u8 channel)
{ int i;
/* Driver needs to initialize the geography map before using
* these helper functions */ if (ieee->geo.bg_channels == 0 && ieee->geo.a_channels == 0) return 0;
if (ieee->freq_band & LIBIPW_24GHZ_BAND) for (i = 0; i < ieee->geo.bg_channels; i++) /* NOTE: If G mode is currently supported but * this is a B only channel, we don't see it
* as valid. */ if ((ieee->geo.bg[i].channel == channel) &&
!(ieee->geo.bg[i].flags & LIBIPW_CH_INVALID) &&
(!(ieee->mode & IEEE_G) ||
!(ieee->geo.bg[i].flags & LIBIPW_CH_B_ONLY))) return LIBIPW_24GHZ_BAND;
if (ieee->freq_band & LIBIPW_52GHZ_BAND) for (i = 0; i < ieee->geo.a_channels; i++) if ((ieee->geo.a[i].channel == channel) &&
!(ieee->geo.a[i].flags & LIBIPW_CH_INVALID)) return LIBIPW_52GHZ_BAND;
return 0;
}
int libipw_channel_to_index(struct libipw_device *ieee, u8 channel)
{ int i;
/* Driver needs to initialize the geography map before using
* these helper functions */ if (ieee->geo.bg_channels == 0 && ieee->geo.a_channels == 0) return -1;
if (ieee->freq_band & LIBIPW_24GHZ_BAND) for (i = 0; i < ieee->geo.bg_channels; i++) if (ieee->geo.bg[i].channel == channel) return i;
if (ieee->freq_band & LIBIPW_52GHZ_BAND) for (i = 0; i < ieee->geo.a_channels; i++) if (ieee->geo.a[i].channel == channel) return i;
/* Driver needs to initialize the geography map before using
* these helper functions */ if (ieee->geo.bg_channels == 0 && ieee->geo.a_channels == 0) return 0;
u8 libipw_freq_to_channel(struct libipw_device * ieee, u32 freq)
{ int i;
/* Driver needs to initialize the geography map before using
* these helper functions */ if (ieee->geo.bg_channels == 0 && ieee->geo.a_channels == 0) return 0;
freq /= 100000;
if (ieee->freq_band & LIBIPW_24GHZ_BAND) for (i = 0; i < ieee->geo.bg_channels; i++) if (ieee->geo.bg[i].freq == freq) return ieee->geo.bg[i].channel;
if (ieee->freq_band & LIBIPW_52GHZ_BAND) for (i = 0; i < ieee->geo.a_channels; i++) if (ieee->geo.a[i].freq == freq) return ieee->geo.a[i].channel;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.