diff options
author | David Kilroy <kilroyd@googlemail.com> | 2009-06-18 18:21:34 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-07-10 15:01:47 -0400 |
commit | 934fd51a94572bcdeea5150ba6a0148971ea9980 (patch) | |
tree | 51229317fb16eefed265175211a3ab17632d757d /drivers/net/wireless/orinoco | |
parent | c63cdbe8f80487c372fe0dfe460ed30467029f01 (diff) |
orinoco: convert giwrange to cfg80211
Signed-off-by: David Kilroy <kilroyd@googlemail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/orinoco')
-rw-r--r-- | drivers/net/wireless/orinoco/wext.c | 115 |
1 files changed, 1 insertions, 114 deletions
diff --git a/drivers/net/wireless/orinoco/wext.c b/drivers/net/wireless/orinoco/wext.c index 082ea0a0cc98..21db57815dda 100644 --- a/drivers/net/wireless/orinoco/wext.c +++ b/drivers/net/wireless/orinoco/wext.c | |||
@@ -172,119 +172,6 @@ static int orinoco_ioctl_getwap(struct net_device *dev, | |||
172 | return err; | 172 | return err; |
173 | } | 173 | } |
174 | 174 | ||
175 | static int orinoco_ioctl_getiwrange(struct net_device *dev, | ||
176 | struct iw_request_info *info, | ||
177 | struct iw_point *rrq, | ||
178 | char *extra) | ||
179 | { | ||
180 | struct orinoco_private *priv = ndev_priv(dev); | ||
181 | int err = 0; | ||
182 | struct iw_range *range = (struct iw_range *) extra; | ||
183 | int numrates; | ||
184 | int i, k; | ||
185 | |||
186 | rrq->length = sizeof(struct iw_range); | ||
187 | memset(range, 0, sizeof(struct iw_range)); | ||
188 | |||
189 | range->we_version_compiled = WIRELESS_EXT; | ||
190 | range->we_version_source = 22; | ||
191 | |||
192 | /* Set available channels/frequencies */ | ||
193 | range->num_channels = NUM_CHANNELS; | ||
194 | k = 0; | ||
195 | for (i = 0; i < NUM_CHANNELS; i++) { | ||
196 | if (priv->channel_mask & (1 << i)) { | ||
197 | range->freq[k].i = i + 1; | ||
198 | range->freq[k].m = (ieee80211_dsss_chan_to_freq(i + 1) * | ||
199 | 100000); | ||
200 | range->freq[k].e = 1; | ||
201 | k++; | ||
202 | } | ||
203 | |||
204 | if (k >= IW_MAX_FREQUENCIES) | ||
205 | break; | ||
206 | } | ||
207 | range->num_frequency = k; | ||
208 | range->sensitivity = 3; | ||
209 | |||
210 | if (priv->has_wep) { | ||
211 | range->max_encoding_tokens = ORINOCO_MAX_KEYS; | ||
212 | range->encoding_size[0] = SMALL_KEY_SIZE; | ||
213 | range->num_encoding_sizes = 1; | ||
214 | |||
215 | if (priv->has_big_wep) { | ||
216 | range->encoding_size[1] = LARGE_KEY_SIZE; | ||
217 | range->num_encoding_sizes = 2; | ||
218 | } | ||
219 | } | ||
220 | |||
221 | if (priv->has_wpa) | ||
222 | range->enc_capa = IW_ENC_CAPA_WPA | IW_ENC_CAPA_CIPHER_TKIP; | ||
223 | |||
224 | if ((priv->iw_mode == NL80211_IFTYPE_ADHOC) && (!SPY_NUMBER(priv))) { | ||
225 | /* Quality stats meaningless in ad-hoc mode */ | ||
226 | } else { | ||
227 | range->max_qual.qual = 0x8b - 0x2f; | ||
228 | range->max_qual.level = 0x2f - 0x95 - 1; | ||
229 | range->max_qual.noise = 0x2f - 0x95 - 1; | ||
230 | /* Need to get better values */ | ||
231 | range->avg_qual.qual = 0x24; | ||
232 | range->avg_qual.level = 0xC2; | ||
233 | range->avg_qual.noise = 0x9E; | ||
234 | } | ||
235 | |||
236 | err = orinoco_hw_get_bitratelist(priv, &numrates, | ||
237 | range->bitrate, IW_MAX_BITRATES); | ||
238 | if (err) | ||
239 | return err; | ||
240 | range->num_bitrates = numrates; | ||
241 | |||
242 | /* Set an indication of the max TCP throughput in bit/s that we can | ||
243 | * expect using this interface. May be use for QoS stuff... | ||
244 | * Jean II */ | ||
245 | if (numrates > 2) | ||
246 | range->throughput = 5 * 1000 * 1000; /* ~5 Mb/s */ | ||
247 | else | ||
248 | range->throughput = 1.5 * 1000 * 1000; /* ~1.5 Mb/s */ | ||
249 | |||
250 | range->min_rts = 0; | ||
251 | range->max_rts = 2347; | ||
252 | range->min_frag = 256; | ||
253 | range->max_frag = 2346; | ||
254 | |||
255 | range->min_pmp = 0; | ||
256 | range->max_pmp = 65535000; | ||
257 | range->min_pmt = 0; | ||
258 | range->max_pmt = 65535 * 1000; /* ??? */ | ||
259 | range->pmp_flags = IW_POWER_PERIOD; | ||
260 | range->pmt_flags = IW_POWER_TIMEOUT; | ||
261 | range->pm_capa = (IW_POWER_PERIOD | IW_POWER_TIMEOUT | | ||
262 | IW_POWER_UNICAST_R); | ||
263 | |||
264 | range->retry_capa = IW_RETRY_LIMIT | IW_RETRY_LIFETIME; | ||
265 | range->retry_flags = IW_RETRY_LIMIT; | ||
266 | range->r_time_flags = IW_RETRY_LIFETIME; | ||
267 | range->min_retry = 0; | ||
268 | range->max_retry = 65535; /* ??? */ | ||
269 | range->min_r_time = 0; | ||
270 | range->max_r_time = 65535 * 1000; /* ??? */ | ||
271 | |||
272 | if (priv->firmware_type == FIRMWARE_TYPE_AGERE) | ||
273 | range->scan_capa = IW_SCAN_CAPA_ESSID; | ||
274 | else | ||
275 | range->scan_capa = IW_SCAN_CAPA_NONE; | ||
276 | |||
277 | /* Event capability (kernel) */ | ||
278 | IW_EVENT_CAPA_SET_KERNEL(range->event_capa); | ||
279 | /* Event capability (driver) */ | ||
280 | IW_EVENT_CAPA_SET(range->event_capa, SIOCGIWTHRSPY); | ||
281 | IW_EVENT_CAPA_SET(range->event_capa, SIOCGIWAP); | ||
282 | IW_EVENT_CAPA_SET(range->event_capa, SIOCGIWSCAN); | ||
283 | IW_EVENT_CAPA_SET(range->event_capa, IWEVTXDROP); | ||
284 | |||
285 | return 0; | ||
286 | } | ||
287 | |||
288 | static int orinoco_ioctl_setiwencode(struct net_device *dev, | 175 | static int orinoco_ioctl_setiwencode(struct net_device *dev, |
289 | struct iw_request_info *info, | 176 | struct iw_request_info *info, |
290 | struct iw_point *erq, | 177 | struct iw_point *erq, |
@@ -1641,7 +1528,7 @@ static const iw_handler orinoco_handler[] = { | |||
1641 | STD_IW_HANDLER(SIOCGIWMODE, cfg80211_wext_giwmode), | 1528 | STD_IW_HANDLER(SIOCGIWMODE, cfg80211_wext_giwmode), |
1642 | STD_IW_HANDLER(SIOCSIWSENS, orinoco_ioctl_setsens), | 1529 | STD_IW_HANDLER(SIOCSIWSENS, orinoco_ioctl_setsens), |
1643 | STD_IW_HANDLER(SIOCGIWSENS, orinoco_ioctl_getsens), | 1530 | STD_IW_HANDLER(SIOCGIWSENS, orinoco_ioctl_getsens), |
1644 | STD_IW_HANDLER(SIOCGIWRANGE, orinoco_ioctl_getiwrange), | 1531 | STD_IW_HANDLER(SIOCGIWRANGE, cfg80211_wext_giwrange), |
1645 | STD_IW_HANDLER(SIOCSIWSPY, iw_handler_set_spy), | 1532 | STD_IW_HANDLER(SIOCSIWSPY, iw_handler_set_spy), |
1646 | STD_IW_HANDLER(SIOCGIWSPY, iw_handler_get_spy), | 1533 | STD_IW_HANDLER(SIOCGIWSPY, iw_handler_get_spy), |
1647 | STD_IW_HANDLER(SIOCSIWTHRSPY, iw_handler_set_thrspy), | 1534 | STD_IW_HANDLER(SIOCSIWTHRSPY, iw_handler_set_thrspy), |