Lines Matching refs:ieee
31 int libipw_is_valid_channel(struct libipw_device *ieee, u8 channel) in libipw_is_valid_channel() argument
37 if (ieee->geo.bg_channels == 0 && ieee->geo.a_channels == 0) in libipw_is_valid_channel()
40 if (ieee->freq_band & LIBIPW_24GHZ_BAND) in libipw_is_valid_channel()
41 for (i = 0; i < ieee->geo.bg_channels; i++) in libipw_is_valid_channel()
45 if ((ieee->geo.bg[i].channel == channel) && in libipw_is_valid_channel()
46 !(ieee->geo.bg[i].flags & LIBIPW_CH_INVALID) && in libipw_is_valid_channel()
47 (!(ieee->mode & IEEE_G) || in libipw_is_valid_channel()
48 !(ieee->geo.bg[i].flags & LIBIPW_CH_B_ONLY))) in libipw_is_valid_channel()
51 if (ieee->freq_band & LIBIPW_52GHZ_BAND) in libipw_is_valid_channel()
52 for (i = 0; i < ieee->geo.a_channels; i++) in libipw_is_valid_channel()
53 if ((ieee->geo.a[i].channel == channel) && in libipw_is_valid_channel()
54 !(ieee->geo.a[i].flags & LIBIPW_CH_INVALID)) in libipw_is_valid_channel()
60 int libipw_channel_to_index(struct libipw_device *ieee, u8 channel) in libipw_channel_to_index() argument
66 if (ieee->geo.bg_channels == 0 && ieee->geo.a_channels == 0) in libipw_channel_to_index()
69 if (ieee->freq_band & LIBIPW_24GHZ_BAND) in libipw_channel_to_index()
70 for (i = 0; i < ieee->geo.bg_channels; i++) in libipw_channel_to_index()
71 if (ieee->geo.bg[i].channel == channel) in libipw_channel_to_index()
74 if (ieee->freq_band & LIBIPW_52GHZ_BAND) in libipw_channel_to_index()
75 for (i = 0; i < ieee->geo.a_channels; i++) in libipw_channel_to_index()
76 if (ieee->geo.a[i].channel == channel) in libipw_channel_to_index()
82 u32 libipw_channel_to_freq(struct libipw_device * ieee, u8 channel) in libipw_channel_to_freq() argument
88 if (ieee->geo.bg_channels == 0 && ieee->geo.a_channels == 0) in libipw_channel_to_freq()
91 ch = libipw_get_channel(ieee, channel); in libipw_channel_to_freq()
97 u8 libipw_freq_to_channel(struct libipw_device * ieee, u32 freq) in libipw_freq_to_channel() argument
103 if (ieee->geo.bg_channels == 0 && ieee->geo.a_channels == 0) in libipw_freq_to_channel()
108 if (ieee->freq_band & LIBIPW_24GHZ_BAND) in libipw_freq_to_channel()
109 for (i = 0; i < ieee->geo.bg_channels; i++) in libipw_freq_to_channel()
110 if (ieee->geo.bg[i].freq == freq) in libipw_freq_to_channel()
111 return ieee->geo.bg[i].channel; in libipw_freq_to_channel()
113 if (ieee->freq_band & LIBIPW_52GHZ_BAND) in libipw_freq_to_channel()
114 for (i = 0; i < ieee->geo.a_channels; i++) in libipw_freq_to_channel()
115 if (ieee->geo.a[i].freq == freq) in libipw_freq_to_channel()
116 return ieee->geo.a[i].channel; in libipw_freq_to_channel()
121 void libipw_set_geo(struct libipw_device *ieee, in libipw_set_geo() argument
124 memcpy(ieee->geo.name, geo->name, 3); in libipw_set_geo()
125 ieee->geo.name[3] = '\0'; in libipw_set_geo()
126 ieee->geo.bg_channels = geo->bg_channels; in libipw_set_geo()
127 ieee->geo.a_channels = geo->a_channels; in libipw_set_geo()
128 memcpy(ieee->geo.bg, geo->bg, geo->bg_channels * in libipw_set_geo()
130 memcpy(ieee->geo.a, geo->a, ieee->geo.a_channels * in libipw_set_geo()
134 const struct libipw_geo *libipw_get_geo(struct libipw_device *ieee) in libipw_get_geo() argument
136 return &ieee->geo; in libipw_get_geo()
139 u8 libipw_get_channel_flags(struct libipw_device * ieee, u8 channel) in libipw_get_channel_flags() argument
141 int index = libipw_channel_to_index(ieee, channel); in libipw_get_channel_flags()
147 return ieee->geo.bg[index].flags; in libipw_get_channel_flags()
149 return ieee->geo.a[index].flags; in libipw_get_channel_flags()
159 *ieee, u8 channel) in libipw_get_channel()
161 int index = libipw_channel_to_index(ieee, channel); in libipw_get_channel()
167 return &ieee->geo.bg[index]; in libipw_get_channel()
169 return &ieee->geo.a[index]; in libipw_get_channel()