aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorDan Williams <dcbw@redhat.com>2007-05-10 23:04:39 -0400
committerJohn W. Linville <linville@tuxdriver.com>2007-05-11 14:54:54 -0400
commit4b19fcc363e9d3886d45818ad72633d5f0cba88d (patch)
tree897d5bca32f3c66aabbc1523385b97abe6c4ba87 /drivers/net
parent3ce4023275a9d65d913d738846cea4a844e24b51 (diff)
[PATCH] libertas: Purge non-mesh ioctls
Signed-off-by: Dan Williams <dcbw@redhat.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/wireless/libertas/README516
-rw-r--r--drivers/net/wireless/libertas/ioctl.c1349
-rw-r--r--drivers/net/wireless/libertas/join.c135
-rw-r--r--drivers/net/wireless/libertas/join.h4
-rw-r--r--drivers/net/wireless/libertas/wext.c274
-rw-r--r--drivers/net/wireless/libertas/wext.h85
6 files changed, 0 insertions, 2363 deletions
diff --git a/drivers/net/wireless/libertas/README b/drivers/net/wireless/libertas/README
index 688da4c784b1..378577200b56 100644
--- a/drivers/net/wireless/libertas/README
+++ b/drivers/net/wireless/libertas/README
@@ -40,64 +40,11 @@ NAME
40SYNOPSIS 40SYNOPSIS
41 iwpriv <ethX> <command> [sub-command] ... 41 iwpriv <ethX> <command> [sub-command] ...
42 42
43 iwpriv ethX version
44 iwpriv ethX scantype [sub-command]
45 iwpriv ethX getSNR <n>
46 iwpriv ethX getNF <n>
47 iwpriv ethX getRSSI <n>
48 iwpriv ethX setrxant <n>
49 iwpriv ethX getrxant
50 iwpriv ethX settxant <n>
51 iwpriv ethX gettxant
52 iwpriv ethX authalgs <n>
53 iwpriv ethX pre-TBTT <n>
54 iwpriv ethX 8021xauthalgs <n>
55 iwpriv ethX encryptionmode <n>
56 iwpriv ethX setregioncode <n> 43 iwpriv ethX setregioncode <n>
57 iwpriv ethX getregioncode 44 iwpriv ethX getregioncode
58 iwpriv ethX setbcnavg <n>
59 iwpriv ethX getbcnavg
60 iwpriv ethX setdataavg <n>
61 iwpriv ethX setlisteninter <n>
62 iwpriv ethX getlisteninter
63 iwpriv ethX setmultipledtim <n>
64 iwpriv ethX getmultipledtim
65 iwpriv ethX atimwindow <n>
66 iwpriv ethX deauth
67 iwpriv ethX adhocstop
68 iwpriv ethX radioon
69 iwpriv ethX radiooff
70 iwpriv ethX reasso-on
71 iwpriv ethX reasso-off
72 iwpriv ethX scanmode [sub-command]
73 iwpriv ethX setwpaie <n>
74 iwpriv ethX wlanidle-off
75 iwpriv ethX wlanidle-on
76 iwpriv ethX getcis
77 iwpriv ethX getlog
78 iwpriv ethX getadhocstatus
79 iwpriv ethX adhocgrate <n>
80
81Version 4 Command:
82 iwpriv ethX inactvityto <n>
83 iwpriv ethX sleeppd <n>
84 iwpriv ethX enable11d <n>
85 iwpriv ethX tpccfg <n>
86 iwpriv ethX powercfg <n>
87 iwpriv ethX setafc <n>
88 iwpriv ethX getafc
89 45
90Version 5 Command: 46Version 5 Command:
91 iwpriv ethX ledgpio <n> 47 iwpriv ethX ledgpio <n>
92 iwpriv ethX scanprobes <n>
93 iwpriv ethX lolisteninter <n>
94 iwpriv ethX rateadapt <n> <m>
95 iwpriv ethX txcontrol <n>
96 iwpriv ethX psnullinterval <n>
97 iwpriv ethX prescan <n>
98 iwpriv ethX getrxinfo
99 iwpriv ethX gettxrate
100 iwpriv ethX beaconinterval
101 48
102BT Commands: 49BT Commands:
103 The blinding table (BT) contains a list of mac addresses that should be 50 The blinding table (BT) contains a list of mac addresses that should be
@@ -150,114 +97,6 @@ DESCRIPTION
150 The ethX parameter specifies the network device that is to be used to 97 The ethX parameter specifies the network device that is to be used to
151 perform this command on. it could be eth0, eth1 etc. 98 perform this command on. it could be eth0, eth1 etc.
152 99
153version
154 This is used to get the current version of the driver and the firmware.
155
156scantype
157 This command is used to set the scan type to be used by the driver in
158 the scan command. This setting will not be used while performing a scan
159 for a specific SSID, as it is always done with scan type being active.
160
161 where the sub-commands are: -
162 active -- to set the scan type to active
163 passive -- to set the scan type to passive
164 get -- to get the scan type set in the driver
165
166getSNR
167 This command gets the average and non average value of Signal to Noise
168 Ratio of Beacon and Data.
169
170 where value is:-
171 0 -- Beacon non-average.
172 1 -- Beacon average.
173 2 -- Data non-average.
174 3 -- Data average.
175
176 If no value is given, all four values are returned in the order mentioned
177 above.
178
179 Note: This command is available only when STA is connected.
180
181getRSSI
182 This command gets the average and non average value os Receive Signal
183 Strength of Beacon and Data.
184
185 where value is:-
186 0 -- Beacon non-average.
187 1 -- Beacon average.
188 2 -- Data non-average.
189 3 -- Data average.
190
191 Note: This command is available only when STA is connected.
192
193getNF
194 This command gets the average and non average value of Noise Floor of
195 Beacon and Data.
196
197 where value is:-
198 0 -- Beacon non-average.
199 1 -- Beacon average.
200 2 -- Data non-average.
201 3 -- Data average.
202
203 Note: This command is available only when STA is connected.
204
205setrxant
206 This command is used to set the mode for Rx antenna.
207
208 The options that can be sent are:-
209 1 -- Antenna 1.
210 2 -- Antenna 2.
211 0xFFFF -- Diversity.
212
213 Usage:
214 iwpriv ethX setrxant 0x01: select Antenna 1.
215
216getrxant
217 This command is used to get the mode for Rx antenna.
218
219
220settxant
221 This command is used to set the mode for Tx antenna.
222 The options that can be sent are:-
223 1 -- Antenna 1.
224 2 -- Antenna 2.
225 0xFFFF -- Diversity.
226 Usage:
227 iwpriv ethX settxant 0x01: select Antenna 1.
228
229gettxant
230 This command is used to get the mode for Tx antenna.
231
232authalgs
233 This command is used by the WPA supplicant to set the authentication
234 algorithms in the station.
235
2368021xauthalgs
237 This command is used by the WPA supplicant to set the 8021.x authentication algorithm type
238 station.
239
240 where values can be:-
241 1 -- None
242 2 -- LEAP
243 4 -- TLS
244 8 -- TTLs
245 16 -- MD5
246
247
248encryptionmode
249 This command is used by the WPA supplicant to set the encryption algorithm.
250
251 where values can be:-
252 0 -- NONE
253 1 -- WEP40
254 2 -- TKIP
255 3 -- CCMP
256 4 -- WEP104
257
258pre-TBTT
259 This command is used to set pre-TBTT time period where value is in microseconds.
260
261setregioncode 100setregioncode
262 This command is used to set the region code in the station. 101 This command is used to set the region code in the station.
263 where value is 'region code' for various regions like 102 where value is 'region code' for various regions like
@@ -270,114 +109,6 @@ getregioncode
270 This command is used to get the region code information set in the 109 This command is used to get the region code information set in the
271 station. 110 station.
272 111
273setbcnavg
274 Set the weighting factor for calculating RSSI.
275
276getbcnavg
277 Get weighting factor for calculating RSSI.
278
279setdataavg
280 Set the weighting factor for calculating SNR.
281
282setlisteninter
283 This command is used to set the listen interval in the
284 station.
285
286 where the value ranges between 1 - 255
287
288getlisteninter
289 This command is used to get the listen interval value set in the
290 station.
291
292setmultipledtim
293 This command is used to set the multiple dtim value in the
294 station.
295 where the value is 1,2,3,4,5,0xfffe
296 0xfffe means the firmware will use listen interval in association
297 command for waking up
298
299getmultipledtim
300 This command is used to get the multiple dtim value set in the station.
301
302atimwindow
303 This command is used to set the atim value in the
304 station.
305
306 where the value ranges between 0 - 50
307
308deauth
309 This command is used to send the de-authentication to the AP with which
310 the station is associated. This command is valid only when
311 station is in Infrastructure mode.
312
313 Note: This command is available only when STA is connected.
314
315adhocstop
316 This command is used to stop beacon transmission from the station and
317 go into idle state in ad-hoc mode.
318
319 Note: This command is available only when STA is connected.
320
321radioon
322 This command is used to turn on the RF antenna.
323
324radiooff
325 This command is sued to turn off the RF antenna.
326
327scanmode
328 This command is used to set the station to scan for either IBSS
329 networks or BSS networks or both BSS and IBSS networks. This
330 command can be used with sub commands,
331
332 where the value for
333 bss -- Scan All the BSS networks.
334 ibss -- Scan All the IBSS networks.
335 any -- Scan both BSS and IBSS networks.
336
337
338
339setwpaie
340 This command is used by WPA supplicant to send the WPA-IE to the driver.
341
342wlanidle-off
343 This command is used to get into idle state.
344
345 Note: This command is available only when STA is connected.
346
347wlanidle-on
348 This command is used to get off the idle state.
349
350 Note: This command is available only when STA is connected.
351
352
353getlog
354 This command is used to get the 802.11 statistics available in the
355 station.
356
357 Note: This command is available only when STA is connected.
358
359getadhocstatus
360 This command is used to get the ad-hoc Network Status.
361
362 The various status codes are:
363 AdhocStarted
364 AdhocJoined
365 AdhocIdle
366 InfraMode
367 AutoUnknownMode
368
369 Note: This command is available only when STA is connected.
370
371adhocgrate
372 This command is used to enable(1) g_rate, Disable(0) g_rate
373 and request(2) the status which g_rate is disabled/enabled,
374 for Ad-hoc creator.
375
376 where value is:-
377 0 -- Disabled
378 1 -- Enabled
379 2 -- Get
380
381ledgpio 112ledgpio
382 This command is used to set/get LEDs. 113 This command is used to set/get LEDs.
383 114
@@ -400,253 +131,6 @@ ledgpio
400 Note: LED0 is invalid 131 Note: LED0 is invalid
401 Note: Maximum Number of LEDs are 16. 132 Note: Maximum Number of LEDs are 16.
402 133
403inactivityto
404 This command is used by the host to set/get the inactivity timeout value,
405 which specifies when WLAN device is put to sleep.
406
407 Usage:
408 iwpriv ethX inactivityto [<timeout>]
409
410 where the parameter are:
411 timeout: timeout value in milliseconds.
412
413 Example:
414 iwpriv eth1 inactivityto
415 "get the timeout value"
416
417 iwpriv eth1 inactivityto X
418 "set timeout value to X ms"
419
420
421sleeppd
422 This command is used to configure the sleep period of the WLAN device.
423
424 Usage:
425 iwpriv ethX sleeppd [<sleep period>]
426
427 where the parameter are:
428 Period: sleep period in milliseconds. Range 10~60.
429
430 Example:
431 iwpriv eth1 sleeppd 10
432 "set period as 10 ms"
433 iwpriv eth1 sleeppd
434 "get the sleep period configuration"
435
436enable11d
437 This command is used to control 11d
438 where value is:-
439 1 -- Enabled
440 0 -- Disabled
441 2 -- Get
442
443
444
445
446tpccfg
447 Enables or disables automatic transmit power control.
448
449 The first parameter turns this feature on (1) or off (0). When turning
450 on, the user must also supply four more parameters in the following
451 order:
452 -UseSNR (Use SNR (in addition to PER) for TPC algorithm),
453 -P0 (P0 power level for TPC),
454 -P1 (P1 power level for TPC),
455 -P2 (P2 power level for TPC).
456
457 Usage:
458 iwpriv ethX tpccfg: Get current configuration
459 iwpriv ethX tpccfg 0: disable auto TPC
460 iwpriv ethX tpccfg 0x01 0x00 0x05 0x0a 0x0d: enable auto TPC; do not use SNR;
461 P0=0x05; P1=0x0a; P2=0x0d;
462 iwpriv ethX tpccfg 0x01 0x01 0x05 0x0a 0x0d: enable auto TPC; use SNR;
463 P0=0x05; P1=0x0a; P2=0x0d.
464
465powercfg
466 Enables or disables power adaptation.
467
468 The first parameter turns this feature on (1) or off (0). When turning
469 on, the user must also supply three more parameters in the following
470 order:
471 -P0 (P0 power level for Power Adaptation),
472 -P1 (P1 power level for Power Adaptation),
473 -P2 (P2 power level for Power Adaptation).
474
475 Usage:
476 iwpriv ethX powercfg: Get current configuration
477 iwpriv ethX powercfg 0: disable power adaptation
478 iwpriv ethX powercfg 1 0x0d 0x0f 0x12: enable power adaptation;
479 P0=0x0d; P1=0x0f; P2=0x12.
480
481getafc
482 This command returns automatic frequency control parameters. It returns
483 three integers:
484 -P0: automatic is on (1), or off (0),
485 -P1: current timing offset in PPM (part per million), and
486 -P2: current frequency offset in PPM.
487
488setafc
489 Set automatic frequency control options.
490
491 The first parameter turns automatic on (1) or off (0).
492 The user must supply two more parameters in either case, in the following
493 order:
494
495 When auto is on:
496
497 -P0 (automatic adjustment frequency threshold in PPM),
498 -P1 (automatic adjustment period in beacon period),
499
500 When auto is off:
501
502 -P0 (manual adjustment timing offset in PPM), and
503 -P1 (manual adjustment frequency offset in PPM).
504
505 Usage:
506 iwpriv ethX setafc 0 10 10: manual adjustment, both timing and frequcncy
507 offset are 10 PPM.
508
509 iwpriv ethX setafc 1 10 10 enable afc, automatic adjustment,
510 frequency threshold 10 PPM, for every 10 beacon periods.
511
512
513
514scanprobes
515 This command sets number of probe requests per channel.
516
517 Usage:
518 iwpriv ethX scanprobes 3 (set scan probes to 3)
519 iwpriv ethX scanprobes (get scan probes)
520
521lolisteninter
522 This command sets the value of listen interval.
523
524 Usage:
525 iwpriv ethX lolisteninter 234 (set the lolisteninter to 234)
526 iwpriv ethX lolisteninter (get the lolisteninter value)
527
528rateadapt
529 This command sets the data rates bitmap.
530 Where <n>
531 0: Disable auto rate adapt
532 1: Enable auto rate adapt
533
534 <m>
535 data rate bitmap
536 Bit Data rate
537 0 1 Mbps
538 1 2 Mbps
539 2 5.5 Mbps
540 3 11 Mbps
541 4 Reserved
542 5 6 Mbps
543 6 9 Mbps
544 7 12 Mbps
545 8 18 Mbps
546 9 24 Mbps
547 10 36 Mbps
548 11 48 Mbps
549 12 54 Mbps
550 12-15 Reserved
551
552 Usage:
553 iwpriv ethX rateadapt
554 read the currect data rate setting
555 iwpriv ethX rateadapt 1 0x07
556 enable auto data rate adapt and
557 data rates are 1Mbps, 2Mbsp and 5.5Mbps
558
559
560txcontrol
561 This command is used to set the Tx rate, ack policy, and retry limit on a per packet basis.
562
563 Where value <n> is:
564 if bit[4] == 1:
565 bit[3:0] -- 0 1 2 3 4 5 6 7 8 9 10 11 12 13-16
566 Data Rate(Mbps) -- 1 2 5.5 11 Rsv 6 9 12 18 24 36 48 54 Rsv
567
568 bit[12:8]
569 if bit[12] == 1, bit[11:8] specifies the Tx retry limit.
570
571 bit[14:13] specifies per packet ack policy:
572 bit[14:13]
573 1 0 use immediate ack policy for this packet
574 1 1 use no ack policy for this packet
575 0 x use the per-packet ack policy setting
576
577 Usage:
578 iwpriv ethX txcontrol 0x7513
579 Use no-ack policy, 5 retires for Tx, 11Mbps rate
580
581
582
583psnullinterval
584 This command is used to set/request NULL package interval for Power Save
585 under infrastructure mode.
586
587 where value is:-
588 -1 -- Disabled
589 n>0 -- Set interval as n (seconds)
590
591prescan
592 This command is used to enable (1)/disable(0) auto prescan before assoicate to the ap
593
594 where value is:-
595 0 -- Disabled
596 1 -- Enabled
597 2 -- Get
598
599getrxinfo
600 This command gets non average value of Signal to Noise Ratio of Data and rate index.
601
602 The following table shows RateIndex and Rate
603
604 RateIndex Data rate
605 0 1 Mbps
606 1 2 Mbps
607 2 5.5 Mbps
608 3 11 Mbps
609 4 Reserved
610 5 6 Mbps
611 6 9 Mbps
612 7 12 Mbps
613 8 18 Mbps
614 9 24 Mbps
615 10 36 Mbps
616 11 48 Mbps
617 12 54 Mbps
618 13-15 Reserved
619
620gettxrate
621 This command gets current Tx rate index of the first packet associated with Rate Adaptation.
622
623 The following table shows RateIndex and Rate
624
625 RateIndex Data rate
626 0 1 Mbps
627 1 2 Mbps
628 2 5.5 Mbps
629 3 11 Mbps
630 4 Reserved
631 5 6 Mbps
632 6 9 Mbps
633 7 12 Mbps
634 8 18 Mbps
635 9 24 Mbps
636 10 36 Mbps
637 11 48 Mbps
638 12 54 Mbps
639 13-15 Reserved
640
641bcninterval
642 This command is used to sets beacon interval in adhoc mode when an argument is given, and gets current adhoc
643 beacon interval when no argument is given. The valid beacon interval is between 20 - 1000,
644 default beacon interval is 100.
645
646 Usage:
647 iwpriv ethX bcninterval 100 (set adhoc beacon interval to 100)
648 iwpriv ethX bcninterval (get adhoc beacon interval)
649
650fwt_add 134fwt_add
651 This command is used to insert an entry into the FWT table. The list of 135 This command is used to insert an entry into the FWT table. The list of
652 parameters must follow the following structure: 136 parameters must follow the following structure:
diff --git a/drivers/net/wireless/libertas/ioctl.c b/drivers/net/wireless/libertas/ioctl.c
index 636a0897150e..42dfd45890c2 100644
--- a/drivers/net/wireless/libertas/ioctl.c
+++ b/drivers/net/wireless/libertas/ioctl.c
@@ -27,95 +27,6 @@
27 27
28#define WAIT_FOR_SCAN_RRESULT_MAX_TIME (10 * HZ) 28#define WAIT_FOR_SCAN_RRESULT_MAX_TIME (10 * HZ)
29 29
30static int setrxantenna(wlan_private * priv, int mode)
31{
32 int ret = 0;
33 wlan_adapter *adapter = priv->adapter;
34
35 if (mode != RF_ANTENNA_1 && mode != RF_ANTENNA_2
36 && mode != RF_ANTENNA_AUTO) {
37 return -EINVAL;
38 }
39
40 adapter->rxantennamode = mode;
41
42 lbs_pr_debug(1, "SET RX Antenna mode to 0x%04x\n", adapter->rxantennamode);
43
44 ret = libertas_prepare_and_send_command(priv, cmd_802_11_rf_antenna,
45 cmd_act_set_rx,
46 cmd_option_waitforrsp, 0,
47 &adapter->rxantennamode);
48 return ret;
49}
50
51static int settxantenna(wlan_private * priv, int mode)
52{
53 int ret = 0;
54 wlan_adapter *adapter = priv->adapter;
55
56 if ((mode != RF_ANTENNA_1) && (mode != RF_ANTENNA_2)
57 && (mode != RF_ANTENNA_AUTO)) {
58 return -EINVAL;
59 }
60
61 adapter->txantennamode = mode;
62
63 lbs_pr_debug(1, "SET TX Antenna mode to 0x%04x\n", adapter->txantennamode);
64
65 ret = libertas_prepare_and_send_command(priv, cmd_802_11_rf_antenna,
66 cmd_act_set_tx,
67 cmd_option_waitforrsp, 0,
68 &adapter->txantennamode);
69
70 return ret;
71}
72
73static int getrxantenna(wlan_private * priv, char *buf)
74{
75 int ret = 0;
76 wlan_adapter *adapter = priv->adapter;
77
78 // clear it, so we will know if the value
79 // returned below is correct or not.
80 adapter->rxantennamode = 0;
81
82 ret = libertas_prepare_and_send_command(priv, cmd_802_11_rf_antenna,
83 cmd_act_get_rx,
84 cmd_option_waitforrsp, 0, NULL);
85
86 if (ret) {
87 LEAVE();
88 return ret;
89 }
90
91 lbs_pr_debug(1, "Get Rx Antenna mode:0x%04x\n", adapter->rxantennamode);
92
93 return sprintf(buf, "0x%04x", adapter->rxantennamode) + 1;
94}
95
96static int gettxantenna(wlan_private * priv, char *buf)
97{
98 int ret = 0;
99 wlan_adapter *adapter = priv->adapter;
100
101 // clear it, so we will know if the value
102 // returned below is correct or not.
103 adapter->txantennamode = 0;
104
105 ret = libertas_prepare_and_send_command(priv, cmd_802_11_rf_antenna,
106 cmd_act_get_tx,
107 cmd_option_waitforrsp, 0, NULL);
108
109 if (ret) {
110 LEAVE();
111 return ret;
112 }
113
114 lbs_pr_debug(1, "Get Tx Antenna mode:0x%04x\n", adapter->txantennamode);
115
116 return sprintf(buf, "0x%04x", adapter->txantennamode) + 1;
117}
118
119static int wlan_set_region(wlan_private * priv, u16 region_code) 30static int wlan_set_region(wlan_private * priv, u16 region_code)
120{ 31{
121 int i; 32 int i;
@@ -144,852 +55,6 @@ static int wlan_set_region(wlan_private * priv, u16 region_code)
144 return 0; 55 return 0;
145} 56}
146 57
147/**
148 * @brief Get/Set Firmware wakeup method
149 *
150 * @param priv A pointer to wlan_private structure
151 * @param wrq A pointer to user data
152 * @return 0--success, otherwise fail
153 */
154static int wlan_txcontrol(wlan_private * priv, struct iwreq *wrq)
155{
156 wlan_adapter *adapter = priv->adapter;
157 int data;
158 ENTER();
159
160 if ((int)wrq->u.data.length == 0) {
161 if (copy_to_user
162 (wrq->u.data.pointer, &adapter->pkttxctrl, sizeof(u32))) {
163 lbs_pr_alert("copy_to_user failed!\n");
164 return -EFAULT;
165 }
166 } else {
167 if ((int)wrq->u.data.length > 1) {
168 lbs_pr_alert("ioctl too many args!\n");
169 return -EFAULT;
170 }
171 if (copy_from_user(&data, wrq->u.data.pointer, sizeof(int))) {
172 lbs_pr_alert("Copy from user failed\n");
173 return -EFAULT;
174 }
175
176 adapter->pkttxctrl = (u32) data;
177 }
178
179 wrq->u.data.length = 1;
180
181 LEAVE();
182 return 0;
183}
184
185/**
186 * @brief Get/Set NULL Package generation interval
187 *
188 * @param priv A pointer to wlan_private structure
189 * @param wrq A pointer to user data
190 * @return 0--success, otherwise fail
191 */
192static int wlan_null_pkt_interval(wlan_private * priv, struct iwreq *wrq)
193{
194 wlan_adapter *adapter = priv->adapter;
195 int data;
196 ENTER();
197
198 if ((int)wrq->u.data.length == 0) {
199 data = adapter->nullpktinterval;
200
201 if (copy_to_user(wrq->u.data.pointer, &data, sizeof(int))) {
202 lbs_pr_alert( "copy_to_user failed!\n");
203 return -EFAULT;
204 }
205 } else {
206 if ((int)wrq->u.data.length > 1) {
207 lbs_pr_alert( "ioctl too many args!\n");
208 return -EFAULT;
209 }
210 if (copy_from_user(&data, wrq->u.data.pointer, sizeof(int))) {
211 lbs_pr_debug(1, "Copy from user failed\n");
212 return -EFAULT;
213 }
214
215 adapter->nullpktinterval = data;
216 }
217
218 wrq->u.data.length = 1;
219
220 LEAVE();
221 return 0;
222}
223
224static int wlan_get_rxinfo(wlan_private * priv, struct iwreq *wrq)
225{
226 wlan_adapter *adapter = priv->adapter;
227 int data[2];
228 ENTER();
229 data[0] = adapter->SNR[TYPE_RXPD][TYPE_NOAVG];
230 data[1] = adapter->rxpd_rate;
231 if (copy_to_user(wrq->u.data.pointer, data, sizeof(int) * 2)) {
232 lbs_pr_debug(1, "Copy to user failed\n");
233 return -EFAULT;
234 }
235 wrq->u.data.length = 2;
236 LEAVE();
237 return 0;
238}
239
240static int wlan_get_snr(wlan_private * priv, struct iwreq *wrq)
241{
242 int ret = 0;
243 wlan_adapter *adapter = priv->adapter;
244 int data[4];
245
246 ENTER();
247 memset(data, 0, sizeof(data));
248 if (wrq->u.data.length) {
249 if (copy_from_user(data, wrq->u.data.pointer,
250 min_t(size_t, wrq->u.data.length, 4) * sizeof(int)))
251 return -EFAULT;
252 }
253 if ((wrq->u.data.length == 0) || (data[0] == 0) || (data[0] == 1)) {
254 if (adapter->connect_status == libertas_connected) {
255 ret = libertas_prepare_and_send_command(priv,
256 cmd_802_11_rssi,
257 0,
258 cmd_option_waitforrsp,
259 0, NULL);
260
261 if (ret) {
262 LEAVE();
263 return ret;
264 }
265 }
266 }
267
268 if (wrq->u.data.length == 0) {
269 data[0] = adapter->SNR[TYPE_BEACON][TYPE_NOAVG];
270 data[1] = adapter->SNR[TYPE_BEACON][TYPE_AVG];
271 data[2] = adapter->SNR[TYPE_RXPD][TYPE_NOAVG];
272 data[3] = adapter->SNR[TYPE_RXPD][TYPE_AVG] / AVG_SCALE;
273 if (copy_to_user(wrq->u.data.pointer, data, sizeof(int) * 4))
274 return -EFAULT;
275 wrq->u.data.length = 4;
276 } else if (data[0] == 0) {
277 data[0] = adapter->SNR[TYPE_BEACON][TYPE_NOAVG];
278 if (copy_to_user(wrq->u.data.pointer, data, sizeof(int)))
279 return -EFAULT;
280 wrq->u.data.length = 1;
281 } else if (data[0] == 1) {
282 data[0] = adapter->SNR[TYPE_BEACON][TYPE_AVG];
283 if (copy_to_user(wrq->u.data.pointer, data, sizeof(int)))
284 return -EFAULT;
285 wrq->u.data.length = 1;
286 } else if (data[0] == 2) {
287 data[0] = adapter->SNR[TYPE_RXPD][TYPE_NOAVG];
288 if (copy_to_user(wrq->u.data.pointer, data, sizeof(int)))
289 return -EFAULT;
290 wrq->u.data.length = 1;
291 } else if (data[0] == 3) {
292 data[0] = adapter->SNR[TYPE_RXPD][TYPE_AVG] / AVG_SCALE;
293 if (copy_to_user(wrq->u.data.pointer, data, sizeof(int)))
294 return -EFAULT;
295 wrq->u.data.length = 1;
296 } else
297 return -ENOTSUPP;
298
299 LEAVE();
300 return 0;
301}
302
303static int wlan_beacon_interval(wlan_private * priv, struct iwreq *wrq)
304{
305 int data;
306 wlan_adapter *adapter = priv->adapter;
307
308 if (wrq->u.data.length > 0) {
309 if (copy_from_user(&data, wrq->u.data.pointer, sizeof(int)))
310 return -EFAULT;
311
312 lbs_pr_debug(1, "WLAN SET BEACON INTERVAL: %d\n", data);
313 if ((data > MRVDRV_MAX_BEACON_INTERVAL)
314 || (data < MRVDRV_MIN_BEACON_INTERVAL))
315 return -ENOTSUPP;
316 adapter->beaconperiod = data;
317 }
318 data = adapter->beaconperiod;
319 if (copy_to_user(wrq->u.data.pointer, &data, sizeof(int)))
320 return -EFAULT;
321
322 wrq->u.data.length = 1;
323
324 return 0;
325}
326
327static int wlan_get_rssi(wlan_private * priv, struct iwreq *wrq)
328{
329 int ret = 0;
330 wlan_adapter *adapter = priv->adapter;
331 int temp;
332 int data = 0;
333 int *val;
334
335 ENTER();
336 data = SUBCMD_DATA(wrq);
337 if ((data == 0) || (data == 1)) {
338 ret = libertas_prepare_and_send_command(priv,
339 cmd_802_11_rssi,
340 0, cmd_option_waitforrsp,
341 0, NULL);
342 if (ret) {
343 LEAVE();
344 return ret;
345 }
346 }
347
348 switch (data) {
349 case 0:
350
351 temp = CAL_RSSI(adapter->SNR[TYPE_BEACON][TYPE_NOAVG],
352 adapter->NF[TYPE_BEACON][TYPE_NOAVG]);
353 break;
354 case 1:
355 temp = CAL_RSSI(adapter->SNR[TYPE_BEACON][TYPE_AVG],
356 adapter->NF[TYPE_BEACON][TYPE_AVG]);
357 break;
358 case 2:
359 temp = CAL_RSSI(adapter->SNR[TYPE_RXPD][TYPE_NOAVG],
360 adapter->NF[TYPE_RXPD][TYPE_NOAVG]);
361 break;
362 case 3:
363 temp = CAL_RSSI(adapter->SNR[TYPE_RXPD][TYPE_AVG] / AVG_SCALE,
364 adapter->NF[TYPE_RXPD][TYPE_AVG] / AVG_SCALE);
365 break;
366 default:
367 return -ENOTSUPP;
368 }
369 val = (int *)wrq->u.name;
370 *val = temp;
371
372 LEAVE();
373 return 0;
374}
375
376static int wlan_get_nf(wlan_private * priv, struct iwreq *wrq)
377{
378 int ret = 0;
379 wlan_adapter *adapter = priv->adapter;
380 int temp;
381 int data = 0;
382 int *val;
383
384 data = SUBCMD_DATA(wrq);
385 if ((data == 0) || (data == 1)) {
386 ret = libertas_prepare_and_send_command(priv,
387 cmd_802_11_rssi,
388 0, cmd_option_waitforrsp,
389 0, NULL);
390
391 if (ret) {
392 LEAVE();
393 return ret;
394 }
395 }
396
397 switch (data) {
398 case 0:
399 temp = adapter->NF[TYPE_BEACON][TYPE_NOAVG];
400 break;
401 case 1:
402 temp = adapter->NF[TYPE_BEACON][TYPE_AVG];
403 break;
404 case 2:
405 temp = adapter->NF[TYPE_RXPD][TYPE_NOAVG];
406 break;
407 case 3:
408 temp = adapter->NF[TYPE_RXPD][TYPE_AVG] / AVG_SCALE;
409 break;
410 default:
411 return -ENOTSUPP;
412 }
413
414 temp = CAL_NF(temp);
415
416 lbs_pr_debug(1, "%s: temp = %d\n", __FUNCTION__, temp);
417 val = (int *)wrq->u.name;
418 *val = temp;
419 return 0;
420}
421
422static int wlan_get_txrate_ioctl(wlan_private * priv, struct ifreq *req)
423{
424 wlan_adapter *adapter = priv->adapter;
425 int *pdata;
426 struct iwreq *wrq = (struct iwreq *)req;
427 int ret = 0;
428 adapter->txrate = 0;
429 lbs_pr_debug(1, "wlan_get_txrate_ioctl\n");
430 ret = libertas_prepare_and_send_command(priv, cmd_802_11_tx_rate_query,
431 cmd_act_get, cmd_option_waitforrsp,
432 0, NULL);
433 if (ret)
434 return ret;
435
436 pdata = (int *)wrq->u.name;
437 *pdata = (int)adapter->txrate;
438 return 0;
439}
440
441static int wlan_get_adhoc_status_ioctl(wlan_private * priv, struct iwreq *wrq)
442{
443 char status[64];
444 wlan_adapter *adapter = priv->adapter;
445
446 memset(status, 0, sizeof(status));
447
448 switch (adapter->mode) {
449 case IW_MODE_ADHOC:
450 if (adapter->connect_status == libertas_connected) {
451 if (adapter->adhoccreate)
452 memcpy(&status, "AdhocStarted", sizeof(status));
453 else
454 memcpy(&status, "AdhocJoined", sizeof(status));
455 } else {
456 memcpy(&status, "AdhocIdle", sizeof(status));
457 }
458 break;
459 case IW_MODE_INFRA:
460 memcpy(&status, "Inframode", sizeof(status));
461 break;
462 default:
463 memcpy(&status, "AutoUnknownmode", sizeof(status));
464 break;
465 }
466
467 lbs_pr_debug(1, "status = %s\n", status);
468 wrq->u.data.length = strlen(status) + 1;
469
470 if (wrq->u.data.pointer) {
471 if (copy_to_user(wrq->u.data.pointer,
472 &status, wrq->u.data.length))
473 return -EFAULT;
474 }
475
476 LEAVE();
477 return 0;
478}
479
480/**
481 * @brief Set Auto prescan
482 * @param priv A pointer to wlan_private structure
483 * @param wrq A pointer to iwreq structure
484 * @return 0 --success, otherwise fail
485 */
486static int wlan_subcmd_setprescan_ioctl(wlan_private * priv, struct iwreq *wrq)
487{
488 int data;
489 wlan_adapter *adapter = priv->adapter;
490 int *val;
491
492 data = SUBCMD_DATA(wrq);
493 lbs_pr_debug(1, "WLAN_SUBCMD_SET_PRESCAN %d\n", data);
494 adapter->prescan = data;
495
496 val = (int *)wrq->u.name;
497 *val = data;
498 return 0;
499}
500
501static int wlan_set_multiple_dtim_ioctl(wlan_private * priv, struct ifreq *req)
502{
503 struct iwreq *wrq = (struct iwreq *)req;
504 u32 mdtim;
505 int idata;
506 int ret = -EINVAL;
507
508 ENTER();
509
510 idata = SUBCMD_DATA(wrq);
511 mdtim = (u32) idata;
512 if (((mdtim >= MRVDRV_MIN_MULTIPLE_DTIM)
513 && (mdtim <= MRVDRV_MAX_MULTIPLE_DTIM))
514 || (mdtim == MRVDRV_IGNORE_MULTIPLE_DTIM)) {
515 priv->adapter->multipledtim = mdtim;
516 ret = 0;
517 }
518 if (ret)
519 lbs_pr_debug(1, "Invalid parameter, multipledtim not changed.\n");
520
521 LEAVE();
522 return ret;
523}
524
525static void adjust_mtu(wlan_private * priv)
526{
527 int mtu_increment = 0;
528
529 if (priv->adapter->linkmode == WLAN_LINKMODE_802_11)
530 mtu_increment += sizeof(struct ieee80211_hdr_4addr);
531
532 if (priv->adapter->radiomode == WLAN_RADIOMODE_RADIOTAP)
533 mtu_increment += max(sizeof(struct tx_radiotap_hdr),
534 sizeof(struct rx_radiotap_hdr));
535 priv->wlan_dev.netdev->mtu = ETH_FRAME_LEN
536 - sizeof(struct ethhdr)
537 + mtu_increment;
538}
539
540/**
541 * @brief Set Link-Layer Layer mode
542 * @param priv A pointer to wlan_private structure
543 * @param req A pointer to ifreq structure
544 * @return 0 --success, otherwise fail
545 */
546static int wlan_set_linkmode_ioctl(wlan_private * priv, struct ifreq *req)
547{
548 int mode;
549
550 mode = (int)((struct ifreq *)((u8 *) req + 4))->ifr_data;
551
552 switch (mode) {
553 case WLAN_LINKMODE_802_3:
554 priv->adapter->linkmode = mode;
555 break;
556 case WLAN_LINKMODE_802_11:
557 priv->adapter->linkmode = mode;
558 break;
559 default:
560 lbs_pr_info("usb8388-5: invalid link-layer mode (%#x)\n",
561 mode);
562 return -EINVAL;
563 break;
564 }
565 lbs_pr_debug(1, "usb8388-5: link-layer mode is %#x\n", mode);
566
567 adjust_mtu(priv);
568
569 return 0;
570}
571
572/**
573 * @brief Set Radio header mode
574 * @param priv A pointer to wlan_private structure
575 * @param req A pointer to ifreq structure
576 * @return 0 --success, otherwise fail
577 */
578static int wlan_set_radiomode_ioctl(wlan_private * priv, struct ifreq *req)
579{
580 int mode;
581
582 mode = (int)((struct ifreq *)((u8 *) req + 4))->ifr_data;
583
584 switch (mode) {
585 case WLAN_RADIOMODE_NONE:
586 priv->adapter->radiomode = mode;
587 break;
588 case WLAN_RADIOMODE_RADIOTAP:
589 priv->adapter->radiomode = mode;
590 break;
591 default:
592 lbs_pr_debug(1, "usb8388-5: invalid radio header mode (%#x)\n",
593 mode);
594 return -EINVAL;
595 }
596 lbs_pr_debug(1, "usb8388-5: radio-header mode is %#x\n", mode);
597
598 adjust_mtu(priv);
599 return 0;
600}
601
602/**
603 * @brief Set Debug header mode
604 * @param priv A pointer to wlan_private structure
605 * @param req A pointer to ifreq structure
606 * @return 0 --success, otherwise fail
607 */
608static int wlan_set_debugmode_ioctl(wlan_private * priv, struct ifreq *req)
609{
610 priv->adapter->debugmode = (int)((struct ifreq *)
611 ((u8 *) req + 4))->ifr_data;
612 return 0;
613}
614
615static int wlan_subcmd_getrxantenna_ioctl(wlan_private * priv,
616 struct ifreq *req)
617{
618 int len;
619 char buf[8];
620 struct iwreq *wrq = (struct iwreq *)req;
621
622 lbs_pr_debug(1, "WLAN_SUBCMD_GETRXANTENNA\n");
623 len = getrxantenna(priv, buf);
624
625 wrq->u.data.length = len;
626 if (wrq->u.data.pointer) {
627 if (copy_to_user(wrq->u.data.pointer, &buf, len)) {
628 lbs_pr_debug(1, "CopyToUser failed\n");
629 return -EFAULT;
630 }
631 }
632
633 return 0;
634}
635
636static int wlan_subcmd_gettxantenna_ioctl(wlan_private * priv,
637 struct ifreq *req)
638{
639 int len;
640 char buf[8];
641 struct iwreq *wrq = (struct iwreq *)req;
642
643 lbs_pr_debug(1, "WLAN_SUBCMD_GETTXANTENNA\n");
644 len = gettxantenna(priv, buf);
645
646 wrq->u.data.length = len;
647 if (wrq->u.data.pointer) {
648 if (copy_to_user(wrq->u.data.pointer, &buf, len)) {
649 lbs_pr_debug(1, "CopyToUser failed\n");
650 return -EFAULT;
651 }
652 }
653 return 0;
654}
655
656/**
657 * @brief Get the MAC TSF value from the firmware
658 *
659 * @param priv A pointer to wlan_private structure
660 * @param wrq A pointer to iwreq structure containing buffer
661 * space to store a TSF value retrieved from the firmware
662 *
663 * @return 0 if successful; IOCTL error code otherwise
664 */
665static int wlan_get_tsf_ioctl(wlan_private * priv, struct iwreq *wrq)
666{
667 u64 tsfval;
668 int ret;
669
670 ret = libertas_prepare_and_send_command(priv,
671 cmd_get_tsf,
672 0, cmd_option_waitforrsp, 0, &tsfval);
673
674 lbs_pr_debug(1, "IOCTL: Get TSF = 0x%016llx\n", tsfval);
675
676 if (ret != 0) {
677 lbs_pr_debug(1, "IOCTL: Get TSF; command exec failed\n");
678 ret = -EFAULT;
679 } else {
680 if (copy_to_user(wrq->u.data.pointer,
681 &tsfval,
682 min_t(size_t, wrq->u.data.length,
683 sizeof(tsfval))) != 0) {
684
685 lbs_pr_debug(1, "IOCTL: Get TSF; Copy to user failed\n");
686 ret = -EFAULT;
687 } else {
688 ret = 0;
689 }
690 }
691 return ret;
692}
693
694/**
695 * @brief Get/Set adapt rate
696 * @param priv A pointer to wlan_private structure
697 * @param wrq A pointer to iwreq structure
698 * @return 0 --success, otherwise fail
699 */
700static int wlan_adapt_rateset(wlan_private * priv, struct iwreq *wrq)
701{
702 int ret;
703 wlan_adapter *adapter = priv->adapter;
704 int data[2];
705
706 memset(data, 0, sizeof(data));
707 if (!wrq->u.data.length) {
708 lbs_pr_debug(1, "Get ADAPT RATE SET\n");
709 ret = libertas_prepare_and_send_command(priv,
710 cmd_802_11_rate_adapt_rateset,
711 cmd_act_get,
712 cmd_option_waitforrsp, 0, NULL);
713 data[0] = adapter->enablehwauto;
714 data[1] = adapter->ratebitmap;
715 if (copy_to_user(wrq->u.data.pointer, data, sizeof(int) * 2)) {
716 lbs_pr_debug(1, "Copy to user failed\n");
717 return -EFAULT;
718 }
719#define GET_TWO_INT 2
720 wrq->u.data.length = GET_TWO_INT;
721 } else {
722 lbs_pr_debug(1, "Set ADAPT RATE SET\n");
723 if (wrq->u.data.length > 2)
724 return -EINVAL;
725 if (copy_from_user
726 (data, wrq->u.data.pointer,
727 sizeof(int) * wrq->u.data.length)) {
728 lbs_pr_debug(1, "Copy from user failed\n");
729 return -EFAULT;
730 }
731
732 adapter->enablehwauto = data[0];
733 adapter->ratebitmap = data[1];
734 ret = libertas_prepare_and_send_command(priv,
735 cmd_802_11_rate_adapt_rateset,
736 cmd_act_set,
737 cmd_option_waitforrsp, 0, NULL);
738 }
739 return ret;
740}
741
742/**
743 * @brief Get/Set inactivity timeout
744 * @param priv A pointer to wlan_private structure
745 * @param wrq A pointer to iwreq structure
746 * @return 0 --success, otherwise fail
747 */
748static int wlan_inactivity_timeout(wlan_private * priv, struct iwreq *wrq)
749{
750 int ret;
751 int data = 0;
752 u16 timeout = 0;
753
754 ENTER();
755 if (wrq->u.data.length > 1)
756 return -ENOTSUPP;
757
758 if (wrq->u.data.length == 0) {
759 /* Get */
760 ret = libertas_prepare_and_send_command(priv,
761 cmd_802_11_inactivity_timeout,
762 cmd_act_get,
763 cmd_option_waitforrsp, 0,
764 &timeout);
765 data = timeout;
766 if (copy_to_user(wrq->u.data.pointer, &data, sizeof(int))) {
767 lbs_pr_debug(1, "Copy to user failed\n");
768 return -EFAULT;
769 }
770 } else {
771 /* Set */
772 if (copy_from_user(&data, wrq->u.data.pointer, sizeof(int))) {
773 lbs_pr_debug(1, "Copy from user failed\n");
774 return -EFAULT;
775 }
776
777 timeout = data;
778 ret = libertas_prepare_and_send_command(priv,
779 cmd_802_11_inactivity_timeout,
780 cmd_act_set,
781 cmd_option_waitforrsp, 0,
782 &timeout);
783 }
784
785 wrq->u.data.length = 1;
786
787 LEAVE();
788 return ret;
789}
790
791static int wlan_do_getlog_ioctl(wlan_private * priv, struct iwreq *wrq)
792{
793 int ret;
794 char buf[GETLOG_BUFSIZE - 1];
795 wlan_adapter *adapter = priv->adapter;
796
797 lbs_pr_debug(1, " GET STATS\n");
798
799 ret = libertas_prepare_and_send_command(priv, cmd_802_11_get_log,
800 0, cmd_option_waitforrsp, 0, NULL);
801
802 if (ret) {
803 return ret;
804 }
805
806 if (wrq->u.data.pointer) {
807 sprintf(buf, "\n mcasttxframe %u failed %u retry %u "
808 "multiretry %u framedup %u "
809 "rtssuccess %u rtsfailure %u ackfailure %u\n"
810 "rxfrag %u mcastrxframe %u fcserror %u "
811 "txframe %u wepundecryptable %u ",
812 adapter->logmsg.mcasttxframe,
813 adapter->logmsg.failed,
814 adapter->logmsg.retry,
815 adapter->logmsg.multiretry,
816 adapter->logmsg.framedup,
817 adapter->logmsg.rtssuccess,
818 adapter->logmsg.rtsfailure,
819 adapter->logmsg.ackfailure,
820 adapter->logmsg.rxfrag,
821 adapter->logmsg.mcastrxframe,
822 adapter->logmsg.fcserror,
823 adapter->logmsg.txframe,
824 adapter->logmsg.wepundecryptable);
825 wrq->u.data.length = strlen(buf) + 1;
826 if (copy_to_user(wrq->u.data.pointer, buf, wrq->u.data.length)) {
827 lbs_pr_debug(1, "Copy to user failed\n");
828 return -EFAULT;
829 }
830 }
831
832 return 0;
833}
834
835static int wlan_scan_type_ioctl(wlan_private * priv, struct iwreq *wrq)
836{
837 u8 buf[12];
838 u8 *option[] = { "active", "passive", "get", };
839 int i, max_options = (sizeof(option) / sizeof(option[0]));
840 int ret = 0;
841 wlan_adapter *adapter = priv->adapter;
842
843 if (priv->adapter->enable11d) {
844 lbs_pr_debug(1, "11D: Cannot set scantype when 11D enabled\n");
845 return -EFAULT;
846 }
847
848 memset(buf, 0, sizeof(buf));
849
850 if (copy_from_user(buf, wrq->u.data.pointer, min_t(size_t, sizeof(buf),
851 wrq->u.data.length)))
852 return -EFAULT;
853
854 lbs_pr_debug(1, "Scan type Option = %s\n", buf);
855
856 buf[sizeof(buf) - 1] = '\0';
857
858 for (i = 0; i < max_options; i++) {
859 if (!strcmp(buf, option[i]))
860 break;
861 }
862
863 switch (i) {
864 case 0:
865 adapter->scantype = cmd_scan_type_active;
866 break;
867 case 1:
868 adapter->scantype = cmd_scan_type_passive;
869 break;
870 case 2:
871 wrq->u.data.length = strlen(option[adapter->scantype]) + 1;
872
873 if (copy_to_user(wrq->u.data.pointer,
874 option[adapter->scantype],
875 wrq->u.data.length)) {
876 lbs_pr_debug(1, "Copy to user failed\n");
877 ret = -EFAULT;
878 }
879
880 break;
881 default:
882 lbs_pr_debug(1, "Invalid Scan type Ioctl Option\n");
883 ret = -EINVAL;
884 break;
885 }
886
887 return ret;
888}
889
890static int wlan_scan_mode_ioctl(wlan_private * priv, struct iwreq *wrq)
891{
892 wlan_adapter *adapter = priv->adapter;
893 u8 buf[12];
894 u8 *option[] = { "bss", "ibss", "any", "get" };
895 int i, max_options = (sizeof(option) / sizeof(option[0]));
896 int ret = 0;
897
898 ENTER();
899
900 memset(buf, 0, sizeof(buf));
901
902 if (copy_from_user(buf, wrq->u.data.pointer, min_t(size_t, sizeof(buf),
903 wrq->u.data.length))) {
904 lbs_pr_debug(1, "Copy from user failed\n");
905 return -EFAULT;
906 }
907
908 lbs_pr_debug(1, "Scan mode Option = %s\n", buf);
909
910 buf[sizeof(buf) - 1] = '\0';
911
912 for (i = 0; i < max_options; i++) {
913 if (!strcmp(buf, option[i]))
914 break;
915 }
916
917 switch (i) {
918
919 case 0:
920 adapter->scanmode = cmd_bss_type_bss;
921 break;
922 case 1:
923 adapter->scanmode = cmd_bss_type_ibss;
924 break;
925 case 2:
926 adapter->scanmode = cmd_bss_type_any;
927 break;
928 case 3:
929
930 wrq->u.data.length = strlen(option[adapter->scanmode - 1]) + 1;
931
932 lbs_pr_debug(1, "Get Scan mode Option = %s\n",
933 option[adapter->scanmode - 1]);
934
935 lbs_pr_debug(1, "Scan mode length %d\n", wrq->u.data.length);
936
937 if (copy_to_user(wrq->u.data.pointer,
938 option[adapter->scanmode - 1],
939 wrq->u.data.length)) {
940 lbs_pr_debug(1, "Copy to user failed\n");
941 ret = -EFAULT;
942 }
943 lbs_pr_debug(1, "GET Scan type Option after copy = %s\n",
944 (char *)wrq->u.data.pointer);
945
946 break;
947
948 default:
949 lbs_pr_debug(1, "Invalid Scan mode Ioctl Option\n");
950 ret = -EINVAL;
951 break;
952 }
953
954 LEAVE();
955 return ret;
956}
957
958/**
959 * @brief Get/Set Adhoc G Rate
960 *
961 * @param priv A pointer to wlan_private structure
962 * @param wrq A pointer to user data
963 * @return 0--success, otherwise fail
964 */
965static int wlan_do_set_grate_ioctl(wlan_private * priv, struct iwreq *wrq)
966{
967 wlan_adapter *adapter = priv->adapter;
968 int data, data1;
969 int *val;
970
971 ENTER();
972
973 data1 = SUBCMD_DATA(wrq);
974 switch (data1) {
975 case 0:
976 adapter->adhoc_grate_enabled = 0;
977 break;
978 case 1:
979 adapter->adhoc_grate_enabled = 1;
980 break;
981 case 2:
982 break;
983 default:
984 return -EINVAL;
985 }
986 data = adapter->adhoc_grate_enabled;
987 val = (int *)wrq->u.name;
988 *val = data;
989 LEAVE();
990 return 0;
991}
992
993static inline int hex2int(char c) 58static inline int hex2int(char c)
994{ 59{
995 if (c >= '0' && c <= '9') 60 if (c >= '0' && c <= '9')
@@ -1752,36 +817,8 @@ int libertas_do_ioctl(struct net_device *dev, struct ifreq *req, int cmd)
1752 817
1753 lbs_pr_debug(1, "libertas_do_ioctl: ioctl cmd = 0x%x\n", cmd); 818 lbs_pr_debug(1, "libertas_do_ioctl: ioctl cmd = 0x%x\n", cmd);
1754 switch (cmd) { 819 switch (cmd) {
1755 case WLANSCAN_TYPE:
1756 lbs_pr_debug(1, "Scan type Ioctl\n");
1757 ret = wlan_scan_type_ioctl(priv, wrq);
1758 break;
1759
1760 case WLAN_SETNONE_GETNONE: /* set WPA mode on/off ioctl #20 */ 820 case WLAN_SETNONE_GETNONE: /* set WPA mode on/off ioctl #20 */
1761 switch (wrq->u.data.flags) { 821 switch (wrq->u.data.flags) {
1762 case WLANDEAUTH:
1763 lbs_pr_debug(1, "Deauth\n");
1764 libertas_send_deauth(priv);
1765 break;
1766
1767 case WLANADHOCSTOP:
1768 lbs_pr_debug(1, "Adhoc stop\n");
1769 ret = libertas_do_adhocstop_ioctl(priv);
1770 break;
1771
1772 case WLANRADIOON:
1773 wlan_radio_ioctl(priv, 1);
1774 break;
1775
1776 case WLANRADIOOFF:
1777 wlan_radio_ioctl(priv, 0);
1778 break;
1779 case WLANWLANIDLEON:
1780 libertas_idle_on(priv);
1781 break;
1782 case WLANWLANIDLEOFF:
1783 libertas_idle_off(priv);
1784 break;
1785 case WLAN_SUBCMD_BT_RESET: /* bt_reset */ 822 case WLAN_SUBCMD_BT_RESET: /* bt_reset */
1786 wlan_bt_reset_ioctl(priv); 823 wlan_bt_reset_ioctl(priv);
1787 break; 824 break;
@@ -1791,81 +828,6 @@ int libertas_do_ioctl(struct net_device *dev, struct ifreq *req, int cmd)
1791 } /* End of switch */ 828 } /* End of switch */
1792 break; 829 break;
1793 830
1794 case WLAN_SETINT_GETINT:
1795 /* The first 4 bytes of req->ifr_data is sub-ioctl number
1796 * after 4 bytes sits the payload.
1797 */
1798 subcmd = (int)req->ifr_data; //from iwpriv subcmd
1799 switch (subcmd) {
1800 case WLANNF:
1801 ret = wlan_get_nf(priv, wrq);
1802 break;
1803 case WLANRSSI:
1804 ret = wlan_get_rssi(priv, wrq);
1805 break;
1806 case WLANENABLE11D:
1807 ret = libertas_cmd_enable_11d(priv, wrq);
1808 break;
1809 case WLANADHOCGRATE:
1810 ret = wlan_do_set_grate_ioctl(priv, wrq);
1811 break;
1812 case WLAN_SUBCMD_SET_PRESCAN:
1813 ret = wlan_subcmd_setprescan_ioctl(priv, wrq);
1814 break;
1815 }
1816 break;
1817
1818 case WLAN_SETONEINT_GETONEINT:
1819 switch (wrq->u.data.flags) {
1820 case WLAN_BEACON_INTERVAL:
1821 ret = wlan_beacon_interval(priv, wrq);
1822 break;
1823
1824 case WLAN_LISTENINTRVL:
1825 if (!wrq->u.data.length) {
1826 int data;
1827 lbs_pr_debug(1, "Get locallisteninterval value\n");
1828#define GET_ONE_INT 1
1829 data = adapter->locallisteninterval;
1830 if (copy_to_user(wrq->u.data.pointer,
1831 &data, sizeof(int))) {
1832 lbs_pr_debug(1, "Copy to user failed\n");
1833 return -EFAULT;
1834 }
1835
1836 wrq->u.data.length = GET_ONE_INT;
1837 } else {
1838 int data;
1839 if (copy_from_user
1840 (&data, wrq->u.data.pointer, sizeof(int))) {
1841 lbs_pr_debug(1, "Copy from user failed\n");
1842 return -EFAULT;
1843 }
1844
1845 lbs_pr_debug(1, "Set locallisteninterval = %d\n",
1846 data);
1847#define MAX_U16_VAL 65535
1848 if (data > MAX_U16_VAL) {
1849 lbs_pr_debug(1, "Exceeds U16 value\n");
1850 return -EINVAL;
1851 }
1852 adapter->locallisteninterval = data;
1853 }
1854 break;
1855 case WLAN_TXCONTROL:
1856 ret = wlan_txcontrol(priv, wrq); //adds for txcontrol ioctl
1857 break;
1858
1859 case WLAN_NULLPKTINTERVAL:
1860 ret = wlan_null_pkt_interval(priv, wrq);
1861 break;
1862
1863 default:
1864 ret = -EOPNOTSUPP;
1865 break;
1866 }
1867 break;
1868
1869 case WLAN_SETONEINT_GETNONE: 831 case WLAN_SETONEINT_GETNONE:
1870 /* The first 4 bytes of req->ifr_data is sub-ioctl number 832 /* The first 4 bytes of req->ifr_data is sub-ioctl number
1871 * after 4 bytes sits the payload. 833 * after 4 bytes sits the payload.
@@ -1876,62 +838,10 @@ int libertas_do_ioctl(struct net_device *dev, struct ifreq *req, int cmd)
1876 subcmd = (int)req->ifr_data; //from iwpriv subcmd 838 subcmd = (int)req->ifr_data; //from iwpriv subcmd
1877 839
1878 switch (subcmd) { 840 switch (subcmd) {
1879 case WLAN_SUBCMD_SETRXANTENNA: /* SETRXANTENNA */
1880 idata = SUBCMD_DATA(wrq);
1881 ret = setrxantenna(priv, idata);
1882 break;
1883 case WLAN_SUBCMD_SETTXANTENNA: /* SETTXANTENNA */
1884 idata = SUBCMD_DATA(wrq);
1885 ret = settxantenna(priv, idata);
1886 break;
1887 case WLAN_SET_ATIM_WINDOW:
1888 adapter->atimwindow = SUBCMD_DATA(wrq);
1889 adapter->atimwindow = min_t(__u16, adapter->atimwindow, 50);
1890 break;
1891 case WLANSETBCNAVG:
1892 adapter->bcn_avg_factor = SUBCMD_DATA(wrq);
1893 if (adapter->bcn_avg_factor == 0)
1894 adapter->bcn_avg_factor =
1895 DEFAULT_BCN_AVG_FACTOR;
1896 if (adapter->bcn_avg_factor > DEFAULT_BCN_AVG_FACTOR)
1897 adapter->bcn_avg_factor =
1898 DEFAULT_BCN_AVG_FACTOR;
1899 break;
1900 case WLANSETDATAAVG:
1901 adapter->data_avg_factor = SUBCMD_DATA(wrq);
1902 if (adapter->data_avg_factor == 0)
1903 adapter->data_avg_factor =
1904 DEFAULT_DATA_AVG_FACTOR;
1905 if (adapter->data_avg_factor > DEFAULT_DATA_AVG_FACTOR)
1906 adapter->data_avg_factor =
1907 DEFAULT_DATA_AVG_FACTOR;
1908 break;
1909 case WLANSETREGION: 841 case WLANSETREGION:
1910 idata = SUBCMD_DATA(wrq); 842 idata = SUBCMD_DATA(wrq);
1911 ret = wlan_set_region(priv, (u16) idata); 843 ret = wlan_set_region(priv, (u16) idata);
1912 break; 844 break;
1913
1914 case WLAN_SET_LISTEN_INTERVAL:
1915 idata = SUBCMD_DATA(wrq);
1916 adapter->listeninterval = (u16) idata;
1917 break;
1918
1919 case WLAN_SET_MULTIPLE_DTIM:
1920 ret = wlan_set_multiple_dtim_ioctl(priv, req);
1921 break;
1922
1923 case WLAN_SET_LINKMODE:
1924 ret = wlan_set_linkmode_ioctl(priv, req);
1925 break;
1926
1927 case WLAN_SET_RADIOMODE:
1928 ret = wlan_set_radiomode_ioctl(priv, req);
1929 break;
1930
1931 case WLAN_SET_DEBUGMODE:
1932 ret = wlan_set_debugmode_ioctl(priv, req);
1933 break;
1934
1935 case WLAN_SUBCMD_MESH_SET_TTL: 845 case WLAN_SUBCMD_MESH_SET_TTL:
1936 idata = SUBCMD_DATA(wrq); 846 idata = SUBCMD_DATA(wrq);
1937 ret = wlan_mesh_set_ttl_ioctl(priv, idata); 847 ret = wlan_mesh_set_ttl_ioctl(priv, idata);
@@ -1944,38 +854,8 @@ int libertas_do_ioctl(struct net_device *dev, struct ifreq *req, int cmd)
1944 854
1945 break; 855 break;
1946 856
1947 case WLAN_SETNONE_GETTWELVE_CHAR: /* Get Antenna settings */
1948 /*
1949 * We've not used IW_PRIV_TYPE_FIXED so sub-ioctl number is
1950 * in flags of iwreq structure, otherwise it will be in
1951 * mode member of iwreq structure.
1952 */
1953 switch ((int)wrq->u.data.flags) {
1954 case WLAN_SUBCMD_GETRXANTENNA: /* Get Rx Antenna */
1955 ret = wlan_subcmd_getrxantenna_ioctl(priv, req);
1956 break;
1957
1958 case WLAN_SUBCMD_GETTXANTENNA: /* Get Tx Antenna */
1959 ret = wlan_subcmd_gettxantenna_ioctl(priv, req);
1960 break;
1961
1962 case WLAN_GET_TSF:
1963 ret = wlan_get_tsf_ioctl(priv, wrq);
1964 break;
1965 }
1966 break;
1967
1968 case WLAN_SET128CHAR_GET128CHAR: 857 case WLAN_SET128CHAR_GET128CHAR:
1969 switch ((int)wrq->u.data.flags) { 858 switch ((int)wrq->u.data.flags) {
1970
1971 case WLANSCAN_MODE:
1972 lbs_pr_debug(1, "Scan mode Ioctl\n");
1973 ret = wlan_scan_mode_ioctl(priv, wrq);
1974 break;
1975
1976 case WLAN_GET_ADHOC_STATUS:
1977 ret = wlan_get_adhoc_status_ioctl(priv, wrq);
1978 break;
1979 case WLAN_SUBCMD_BT_ADD: 859 case WLAN_SUBCMD_BT_ADD:
1980 ret = wlan_bt_add_ioctl(priv, req); 860 ret = wlan_bt_add_ioctl(priv, req);
1981 break; 861 break;
@@ -2008,40 +888,10 @@ int libertas_do_ioctl(struct net_device *dev, struct ifreq *req, int cmd)
2008 888
2009 case WLAN_SETNONE_GETONEINT: 889 case WLAN_SETNONE_GETONEINT:
2010 switch ((int)req->ifr_data) { 890 switch ((int)req->ifr_data) {
2011 case WLANGETBCNAVG:
2012 pdata = (int *)wrq->u.name;
2013 *pdata = (int)adapter->bcn_avg_factor;
2014 break;
2015
2016 case WLANGETREGION: 891 case WLANGETREGION:
2017 pdata = (int *)wrq->u.name; 892 pdata = (int *)wrq->u.name;
2018 *pdata = (int)adapter->regioncode; 893 *pdata = (int)adapter->regioncode;
2019 break; 894 break;
2020
2021 case WLAN_GET_LISTEN_INTERVAL:
2022 pdata = (int *)wrq->u.name;
2023 *pdata = (int)adapter->listeninterval;
2024 break;
2025
2026 case WLAN_GET_LINKMODE:
2027 req->ifr_data = (char *)((u32) adapter->linkmode);
2028 break;
2029
2030 case WLAN_GET_RADIOMODE:
2031 req->ifr_data = (char *)((u32) adapter->radiomode);
2032 break;
2033
2034 case WLAN_GET_DEBUGMODE:
2035 req->ifr_data = (char *)((u32) adapter->debugmode);
2036 break;
2037
2038 case WLAN_GET_MULTIPLE_DTIM:
2039 pdata = (int *)wrq->u.name;
2040 *pdata = (int)adapter->multipledtim;
2041 break;
2042 case WLAN_GET_TX_RATE:
2043 ret = wlan_get_txrate_ioctl(priv, req);
2044 break;
2045 case WLAN_SUBCMD_FWT_CLEANUP: /* fwt_cleanup */ 895 case WLAN_SUBCMD_FWT_CLEANUP: /* fwt_cleanup */
2046 ret = wlan_fwt_cleanup_ioctl(priv, req); 896 ret = wlan_fwt_cleanup_ioctl(priv, req);
2047 break; 897 break;
@@ -2061,196 +911,8 @@ int libertas_do_ioctl(struct net_device *dev, struct ifreq *req, int cmd)
2061 911
2062 break; 912 break;
2063 913
2064 case WLANGETLOG:
2065 ret = wlan_do_getlog_ioctl(priv, wrq);
2066 break;
2067
2068 case WLAN_SET_GET_SIXTEEN_INT: 914 case WLAN_SET_GET_SIXTEEN_INT:
2069 switch ((int)wrq->u.data.flags) { 915 switch ((int)wrq->u.data.flags) {
2070 case WLAN_TPCCFG:
2071 {
2072 int data[5];
2073 struct cmd_ds_802_11_tpc_cfg cfg;
2074 memset(&cfg, 0, sizeof(cfg));
2075 if ((wrq->u.data.length > 1)
2076 && (wrq->u.data.length != 5))
2077 return -1;
2078
2079 if (wrq->u.data.length == 0) {
2080 cfg.action =
2081 cpu_to_le16
2082 (cmd_act_get);
2083 } else {
2084 if (copy_from_user
2085 (data, wrq->u.data.pointer,
2086 sizeof(int) * 5)) {
2087 lbs_pr_debug(1,
2088 "Copy from user failed\n");
2089 return -EFAULT;
2090 }
2091
2092 cfg.action =
2093 cpu_to_le16
2094 (cmd_act_set);
2095 cfg.enable = data[0];
2096 cfg.usesnr = data[1];
2097 cfg.P0 = data[2];
2098 cfg.P1 = data[3];
2099 cfg.P2 = data[4];
2100 }
2101
2102 ret =
2103 libertas_prepare_and_send_command(priv,
2104 cmd_802_11_tpc_cfg,
2105 0,
2106 cmd_option_waitforrsp,
2107 0, (void *)&cfg);
2108
2109 data[0] = cfg.enable;
2110 data[1] = cfg.usesnr;
2111 data[2] = cfg.P0;
2112 data[3] = cfg.P1;
2113 data[4] = cfg.P2;
2114 if (copy_to_user
2115 (wrq->u.data.pointer, data,
2116 sizeof(int) * 5)) {
2117 lbs_pr_debug(1, "Copy to user failed\n");
2118 return -EFAULT;
2119 }
2120
2121 wrq->u.data.length = 5;
2122 }
2123 break;
2124
2125 case WLAN_POWERCFG:
2126 {
2127 int data[4];
2128 struct cmd_ds_802_11_pwr_cfg cfg;
2129 memset(&cfg, 0, sizeof(cfg));
2130 if ((wrq->u.data.length > 1)
2131 && (wrq->u.data.length != 4))
2132 return -1;
2133 if (wrq->u.data.length == 0) {
2134 cfg.action =
2135 cpu_to_le16
2136 (cmd_act_get);
2137 } else {
2138 if (copy_from_user
2139 (data, wrq->u.data.pointer,
2140 sizeof(int) * 4)) {
2141 lbs_pr_debug(1,
2142 "Copy from user failed\n");
2143 return -EFAULT;
2144 }
2145
2146 cfg.action =
2147 cpu_to_le16
2148 (cmd_act_set);
2149 cfg.enable = data[0];
2150 cfg.PA_P0 = data[1];
2151 cfg.PA_P1 = data[2];
2152 cfg.PA_P2 = data[3];
2153 }
2154 ret =
2155 libertas_prepare_and_send_command(priv,
2156 cmd_802_11_pwr_cfg,
2157 0,
2158 cmd_option_waitforrsp,
2159 0, (void *)&cfg);
2160 data[0] = cfg.enable;
2161 data[1] = cfg.PA_P0;
2162 data[2] = cfg.PA_P1;
2163 data[3] = cfg.PA_P2;
2164 if (copy_to_user
2165 (wrq->u.data.pointer, data,
2166 sizeof(int) * 4)) {
2167 lbs_pr_debug(1, "Copy to user failed\n");
2168 return -EFAULT;
2169 }
2170
2171 wrq->u.data.length = 4;
2172 }
2173 break;
2174 case WLAN_AUTO_FREQ_SET:
2175 {
2176 int data[3];
2177 struct cmd_ds_802_11_afc afc;
2178 memset(&afc, 0, sizeof(afc));
2179 if (wrq->u.data.length != 3)
2180 return -1;
2181 if (copy_from_user
2182 (data, wrq->u.data.pointer,
2183 sizeof(int) * 3)) {
2184 lbs_pr_debug(1, "Copy from user failed\n");
2185 return -EFAULT;
2186 }
2187 afc.afc_auto = data[0];
2188
2189 if (afc.afc_auto != 0) {
2190 afc.threshold = data[1];
2191 afc.period = data[2];
2192 } else {
2193 afc.timing_offset = data[1];
2194 afc.carrier_offset = data[2];
2195 }
2196 ret =
2197 libertas_prepare_and_send_command(priv,
2198 cmd_802_11_set_afc,
2199 0,
2200 cmd_option_waitforrsp,
2201 0, (void *)&afc);
2202 }
2203 break;
2204 case WLAN_AUTO_FREQ_GET:
2205 {
2206 int data[3];
2207 struct cmd_ds_802_11_afc afc;
2208 memset(&afc, 0, sizeof(afc));
2209 ret =
2210 libertas_prepare_and_send_command(priv,
2211 cmd_802_11_get_afc,
2212 0,
2213 cmd_option_waitforrsp,
2214 0, (void *)&afc);
2215 data[0] = afc.afc_auto;
2216 data[1] = afc.timing_offset;
2217 data[2] = afc.carrier_offset;
2218 if (copy_to_user
2219 (wrq->u.data.pointer, data,
2220 sizeof(int) * 3)) {
2221 lbs_pr_debug(1, "Copy to user failed\n");
2222 return -EFAULT;
2223 }
2224
2225 wrq->u.data.length = 3;
2226 }
2227 break;
2228 case WLAN_SCANPROBES:
2229 {
2230 int data;
2231 if (wrq->u.data.length > 0) {
2232 if (copy_from_user
2233 (&data, wrq->u.data.pointer,
2234 sizeof(int))) {
2235 lbs_pr_debug(1,
2236 "Copy from user failed\n");
2237 return -EFAULT;
2238 }
2239
2240 adapter->scanprobes = data;
2241 } else {
2242 data = adapter->scanprobes;
2243 if (copy_to_user
2244 (wrq->u.data.pointer, &data,
2245 sizeof(int))) {
2246 lbs_pr_debug(1,
2247 "Copy to user failed\n");
2248 return -EFAULT;
2249 }
2250 }
2251 wrq->u.data.length = 1;
2252 }
2253 break;
2254 case WLAN_LED_GPIO_CTRL: 916 case WLAN_LED_GPIO_CTRL:
2255 { 917 {
2256 int i; 918 int i;
@@ -2314,17 +976,6 @@ int libertas_do_ioctl(struct net_device *dev, struct ifreq *req, int cmd)
2314 wrq->u.data.length = gpio->header.len; 976 wrq->u.data.length = gpio->header.len;
2315 } 977 }
2316 break; 978 break;
2317 case WLAN_ADAPT_RATESET:
2318 ret = wlan_adapt_rateset(priv, wrq);
2319 break;
2320 case WLAN_INACTIVITY_TIMEOUT:
2321 ret = wlan_inactivity_timeout(priv, wrq);
2322 break;
2323 case WLANSNR:
2324 ret = wlan_get_snr(priv, wrq);
2325 break;
2326 case WLAN_GET_RXINFO:
2327 ret = wlan_get_rxinfo(priv, wrq);
2328 } 979 }
2329 break; 980 break;
2330 981
diff --git a/drivers/net/wireless/libertas/join.c b/drivers/net/wireless/libertas/join.c
index 2292c14a1531..ec40d32183ed 100644
--- a/drivers/net/wireless/libertas/join.c
+++ b/drivers/net/wireless/libertas/join.c
@@ -96,20 +96,6 @@ int libertas_send_deauth(wlan_private * priv)
96 return ret; 96 return ret;
97} 97}
98 98
99int libertas_do_adhocstop_ioctl(wlan_private * priv)
100{
101 wlan_adapter *adapter = priv->adapter;
102 int ret = 0;
103
104 if (adapter->mode == IW_MODE_ADHOC &&
105 adapter->connect_status == libertas_connected)
106 ret = libertas_stop_adhoc_network(priv);
107 else
108 ret = -ENOTSUPP;
109
110 return ret;
111}
112
113/** 99/**
114 * @brief Associate to a specific BSS discovered in a scan 100 * @brief Associate to a specific BSS discovered in a scan
115 * 101 *
@@ -262,127 +248,6 @@ int libertas_send_deauthentication(wlan_private * priv)
262} 248}
263 249
264/** 250/**
265 * @brief Set Idle Off
266 *
267 * @param priv A pointer to wlan_private structure
268 * @return 0 --success, otherwise fail
269 */
270int libertas_idle_off(wlan_private * priv)
271{
272 wlan_adapter *adapter = priv->adapter;
273 int ret = 0;
274 const u8 zeromac[] = { 0, 0, 0, 0, 0, 0 };
275 int i;
276
277 ENTER();
278
279 if (adapter->connect_status == libertas_disconnected) {
280 if (adapter->mode == IW_MODE_INFRA) {
281 if (memcmp(adapter->previousbssid, zeromac,
282 sizeof(zeromac)) != 0) {
283
284 lbs_pr_debug(1, "Previous SSID = %s\n",
285 adapter->previousssid.ssid);
286 lbs_pr_debug(1, "Previous BSSID = "
287 "%02x:%02x:%02x:%02x:%02x:%02x:\n",
288 adapter->previousbssid[0],
289 adapter->previousbssid[1],
290 adapter->previousbssid[2],
291 adapter->previousbssid[3],
292 adapter->previousbssid[4],
293 adapter->previousbssid[5]);
294
295 i = libertas_find_SSID_in_list(adapter,
296 &adapter->previousssid,
297 adapter->previousbssid,
298 adapter->mode);
299
300 if (i < 0) {
301 libertas_send_specific_BSSID_scan(priv,
302 adapter->
303 previousbssid,
304 1);
305 i = libertas_find_SSID_in_list(adapter,
306 &adapter->
307 previousssid,
308 adapter->
309 previousbssid,
310 adapter->mode);
311 }
312
313 if (i < 0) {
314 /* If the BSSID could not be found, try just the SSID */
315 i = libertas_find_SSID_in_list(adapter,
316 &adapter->
317 previousssid, NULL,
318 adapter->mode);
319 }
320
321 if (i < 0) {
322 libertas_send_specific_SSID_scan(priv,
323 &adapter->
324 previousssid,
325 1);
326 i = libertas_find_SSID_in_list(adapter,
327 &adapter->
328 previousssid, NULL,
329 adapter->mode);
330 }
331
332 if (i >= 0) {
333 ret =
334 wlan_associate(priv,
335 &adapter->
336 scantable[i]);
337 }
338 }
339 } else if (adapter->mode == IW_MODE_ADHOC) {
340 ret = libertas_prepare_and_send_command(priv,
341 cmd_802_11_ad_hoc_start,
342 0,
343 cmd_option_waitforrsp,
344 0, &adapter->previousssid);
345 }
346 }
347 /* else it is connected */
348
349 lbs_pr_debug(1, "\nwlanidle is off");
350 LEAVE();
351 return ret;
352}
353
354/**
355 * @brief Set Idle On
356 *
357 * @param priv A pointer to wlan_private structure
358 * @return 0 --success, otherwise fail
359 */
360int libertas_idle_on(wlan_private * priv)
361{
362 wlan_adapter *adapter = priv->adapter;
363 int ret = 0;
364
365 if (adapter->connect_status == libertas_connected) {
366 if (adapter->mode == IW_MODE_INFRA) {
367 lbs_pr_debug(1, "Previous SSID = %s\n",
368 adapter->previousssid.ssid);
369 memmove(&adapter->previousssid,
370 &adapter->curbssparams.ssid,
371 sizeof(struct WLAN_802_11_SSID));
372 libertas_send_deauth(priv);
373
374 } else if (adapter->mode == IW_MODE_ADHOC) {
375 ret = libertas_stop_adhoc_network(priv);
376 }
377
378 }
379
380 lbs_pr_debug(1, "\nwlanidle is on");
381
382 return ret;
383}
384
385/**
386 * @brief This function prepares command of authenticate. 251 * @brief This function prepares command of authenticate.
387 * 252 *
388 * @param priv A pointer to wlan_private structure 253 * @param priv A pointer to wlan_private structure
diff --git a/drivers/net/wireless/libertas/join.h b/drivers/net/wireless/libertas/join.h
index 0e6d9288506d..115f5a8ba346 100644
--- a/drivers/net/wireless/libertas/join.h
+++ b/drivers/net/wireless/libertas/join.h
@@ -37,10 +37,6 @@ extern int libertas_ret_80211_disassociate(wlan_private * priv,
37extern int libertas_ret_80211_associate(wlan_private * priv, 37extern int libertas_ret_80211_associate(wlan_private * priv,
38 struct cmd_ds_command *resp); 38 struct cmd_ds_command *resp);
39 39
40extern int libertas_idle_on(wlan_private * priv);
41extern int libertas_idle_off(wlan_private * priv);
42
43extern int libertas_do_adhocstop_ioctl(wlan_private * priv);
44extern int libertas_reassociation_thread(void *data); 40extern int libertas_reassociation_thread(void *data);
45 41
46struct WLAN_802_11_SSID; 42struct WLAN_802_11_SSID;
diff --git a/drivers/net/wireless/libertas/wext.c b/drivers/net/wireless/libertas/wext.c
index c62ffcd214c2..69f52b6e59c8 100644
--- a/drivers/net/wireless/libertas/wext.c
+++ b/drivers/net/wireless/libertas/wext.c
@@ -986,137 +986,18 @@ static const struct iw_priv_args wlan_private_args[] = {
986 /* 986 /*
987 * { cmd, set_args, get_args, name } 987 * { cmd, set_args, get_args, name }
988 */ 988 */
989 {
990 WLANSCAN_TYPE,
991 IW_PRIV_TYPE_CHAR | 8,
992 IW_PRIV_TYPE_CHAR | 8,
993 "scantype"},
994
995 {
996 WLAN_SETINT_GETINT,
997 IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1,
998 IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1,
999 ""},
1000 {
1001 WLANNF,
1002 IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1,
1003 IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1,
1004 "getNF"},
1005 {
1006 WLANRSSI,
1007 IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1,
1008 IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1,
1009 "getRSSI"},
1010 {
1011 WLANENABLE11D,
1012 IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1,
1013 IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1,
1014 "enable11d"},
1015 {
1016 WLANADHOCGRATE,
1017 IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1,
1018 IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1,
1019 "adhocgrate"},
1020
1021 {
1022 WLAN_SUBCMD_SET_PRESCAN,
1023 IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1,
1024 IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1,
1025 "prescan"},
1026 {
1027 WLAN_SETONEINT_GETONEINT,
1028 IW_PRIV_TYPE_INT | 1,
1029 IW_PRIV_TYPE_INT | 1,
1030 ""},
1031 {
1032 WLAN_BEACON_INTERVAL,
1033 IW_PRIV_TYPE_INT | 1,
1034 IW_PRIV_TYPE_INT | 1,
1035 "bcninterval"},
1036 {
1037 WLAN_LISTENINTRVL,
1038 IW_PRIV_TYPE_INT | 1,
1039 IW_PRIV_TYPE_INT | 1,
1040 "lolisteninter"},
1041 {
1042 WLAN_TXCONTROL,
1043 IW_PRIV_TYPE_INT | 1,
1044 IW_PRIV_TYPE_INT | 1,
1045 "txcontrol"},
1046 {
1047 WLAN_NULLPKTINTERVAL,
1048 IW_PRIV_TYPE_INT | 1,
1049 IW_PRIV_TYPE_INT | 1,
1050 "psnullinterval"},
1051 /* Using iwpriv sub-command feature */ 989 /* Using iwpriv sub-command feature */
1052 { 990 {
1053 WLAN_SETONEINT_GETNONE, /* IOCTL: 24 */ 991 WLAN_SETONEINT_GETNONE, /* IOCTL: 24 */
1054 IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 992 IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1,
1055 IW_PRIV_TYPE_NONE, 993 IW_PRIV_TYPE_NONE,
1056 ""}, 994 ""},
1057
1058 {
1059 WLAN_SUBCMD_SETRXANTENNA,
1060 IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1,
1061 IW_PRIV_TYPE_NONE,
1062 "setrxant"},
1063 {
1064 WLAN_SUBCMD_SETTXANTENNA,
1065 IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1,
1066 IW_PRIV_TYPE_NONE,
1067 "settxant"},
1068 {
1069 WLANSETENCRYPTIONMODE,
1070 IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1,
1071 IW_PRIV_TYPE_NONE,
1072 "encryptionmode",
1073 },
1074 { 995 {
1075 WLANSETREGION, 996 WLANSETREGION,
1076 IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 997 IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1,
1077 IW_PRIV_TYPE_NONE, 998 IW_PRIV_TYPE_NONE,
1078 "setregioncode"}, 999 "setregioncode"},
1079 { 1000 {
1080 WLAN_SET_LISTEN_INTERVAL,
1081 IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1,
1082 IW_PRIV_TYPE_NONE,
1083 "setlisteninter"},
1084 {
1085 WLAN_SET_MULTIPLE_DTIM,
1086 IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1,
1087 IW_PRIV_TYPE_NONE,
1088 "setmultipledtim"},
1089 {
1090 WLAN_SET_ATIM_WINDOW,
1091 IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1,
1092 IW_PRIV_TYPE_NONE,
1093 "atimwindow"},
1094 {
1095 WLANSETBCNAVG,
1096 IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1,
1097 IW_PRIV_TYPE_NONE,
1098 "setbcnavg"},
1099 {
1100 WLANSETDATAAVG,
1101 IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1,
1102 IW_PRIV_TYPE_NONE,
1103 "setdataavg"},
1104 {
1105 WLAN_SET_LINKMODE,
1106 IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1,
1107 IW_PRIV_TYPE_NONE,
1108 "linkmode"},
1109 {
1110 WLAN_SET_RADIOMODE,
1111 IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1,
1112 IW_PRIV_TYPE_NONE,
1113 "radiomode"},
1114 {
1115 WLAN_SET_DEBUGMODE,
1116 IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1,
1117 IW_PRIV_TYPE_NONE,
1118 "debugmode"},
1119 {
1120 WLAN_SUBCMD_MESH_SET_TTL, 1001 WLAN_SUBCMD_MESH_SET_TTL,
1121 IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 1002 IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1,
1122 IW_PRIV_TYPE_NONE, 1003 IW_PRIV_TYPE_NONE,
@@ -1132,41 +1013,6 @@ static const struct iw_priv_args wlan_private_args[] = {
1132 IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 1013 IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1,
1133 "getregioncode"}, 1014 "getregioncode"},
1134 { 1015 {
1135 WLAN_GET_LISTEN_INTERVAL,
1136 IW_PRIV_TYPE_NONE,
1137 IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1,
1138 "getlisteninter"},
1139 {
1140 WLAN_GET_MULTIPLE_DTIM,
1141 IW_PRIV_TYPE_NONE,
1142 IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1,
1143 "getmultipledtim"},
1144 {
1145 WLAN_GET_TX_RATE,
1146 IW_PRIV_TYPE_NONE,
1147 IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1,
1148 "gettxrate"},
1149 {
1150 WLANGETBCNAVG,
1151 IW_PRIV_TYPE_NONE,
1152 IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1,
1153 "getbcnavg"},
1154 {
1155 WLAN_GET_LINKMODE,
1156 IW_PRIV_TYPE_NONE,
1157 IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1,
1158 "get_linkmode"},
1159 {
1160 WLAN_GET_RADIOMODE,
1161 IW_PRIV_TYPE_NONE,
1162 IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1,
1163 "get_radiomode"},
1164 {
1165 WLAN_GET_DEBUGMODE,
1166 IW_PRIV_TYPE_NONE,
1167 IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1,
1168 "get_debugmode"},
1169 {
1170 WLAN_SUBCMD_FWT_CLEANUP, 1016 WLAN_SUBCMD_FWT_CLEANUP,
1171 IW_PRIV_TYPE_NONE, 1017 IW_PRIV_TYPE_NONE,
1172 IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 1018 IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1,
@@ -1182,61 +1028,11 @@ static const struct iw_priv_args wlan_private_args[] = {
1182 IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 1028 IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1,
1183 "mesh_get_ttl"}, 1029 "mesh_get_ttl"},
1184 { 1030 {
1185 WLAN_SETNONE_GETTWELVE_CHAR,
1186 IW_PRIV_TYPE_NONE,
1187 IW_PRIV_TYPE_CHAR | 12,
1188 ""},
1189 {
1190 WLAN_SUBCMD_GETRXANTENNA,
1191 IW_PRIV_TYPE_NONE,
1192 IW_PRIV_TYPE_CHAR | 12,
1193 "getrxant"},
1194 {
1195 WLAN_SUBCMD_GETTXANTENNA,
1196 IW_PRIV_TYPE_NONE,
1197 IW_PRIV_TYPE_CHAR | 12,
1198 "gettxant"},
1199 {
1200 WLAN_GET_TSF,
1201 IW_PRIV_TYPE_NONE,
1202 IW_PRIV_TYPE_CHAR | 12,
1203 "gettsf"},
1204 {
1205 WLAN_SETNONE_GETNONE, 1031 WLAN_SETNONE_GETNONE,
1206 IW_PRIV_TYPE_NONE, 1032 IW_PRIV_TYPE_NONE,
1207 IW_PRIV_TYPE_NONE, 1033 IW_PRIV_TYPE_NONE,
1208 ""}, 1034 ""},
1209 { 1035 {
1210 WLANDEAUTH,
1211 IW_PRIV_TYPE_NONE,
1212 IW_PRIV_TYPE_NONE,
1213 "deauth"},
1214 {
1215 WLANADHOCSTOP,
1216 IW_PRIV_TYPE_NONE,
1217 IW_PRIV_TYPE_NONE,
1218 "adhocstop"},
1219 {
1220 WLANRADIOON,
1221 IW_PRIV_TYPE_NONE,
1222 IW_PRIV_TYPE_NONE,
1223 "radioon"},
1224 {
1225 WLANRADIOOFF,
1226 IW_PRIV_TYPE_NONE,
1227 IW_PRIV_TYPE_NONE,
1228 "radiooff"},
1229 {
1230 WLANWLANIDLEON,
1231 IW_PRIV_TYPE_NONE,
1232 IW_PRIV_TYPE_NONE,
1233 "wlanidle-on"},
1234 {
1235 WLANWLANIDLEOFF,
1236 IW_PRIV_TYPE_NONE,
1237 IW_PRIV_TYPE_NONE,
1238 "wlanidle-off"},
1239 {
1240 WLAN_SUBCMD_FWT_RESET, 1036 WLAN_SUBCMD_FWT_RESET,
1241 IW_PRIV_TYPE_NONE, 1037 IW_PRIV_TYPE_NONE,
1242 IW_PRIV_TYPE_NONE, 1038 IW_PRIV_TYPE_NONE,
@@ -1299,85 +1095,15 @@ static const struct iw_priv_args wlan_private_args[] = {
1299 IW_PRIV_TYPE_CHAR | 128, 1095 IW_PRIV_TYPE_CHAR | 128,
1300 "fwt_list_route"}, 1096 "fwt_list_route"},
1301 { 1097 {
1302 WLANSCAN_MODE,
1303 IW_PRIV_TYPE_CHAR | 128,
1304 IW_PRIV_TYPE_CHAR | 128,
1305 "scanmode"},
1306 {
1307 WLAN_GET_ADHOC_STATUS,
1308 IW_PRIV_TYPE_CHAR | 128,
1309 IW_PRIV_TYPE_CHAR | 128,
1310 "getadhocstatus"},
1311 {
1312 WLAN_SETNONE_GETWORDCHAR,
1313 IW_PRIV_TYPE_NONE,
1314 IW_PRIV_TYPE_CHAR | 128,
1315 ""},
1316 {
1317 WLANGETLOG,
1318 IW_PRIV_TYPE_NONE,
1319 IW_PRIV_TYPE_CHAR | GETLOG_BUFSIZE,
1320 "getlog"},
1321 {
1322 WLAN_SET_GET_SIXTEEN_INT, 1098 WLAN_SET_GET_SIXTEEN_INT,
1323 IW_PRIV_TYPE_INT | 16, 1099 IW_PRIV_TYPE_INT | 16,
1324 IW_PRIV_TYPE_INT | 16, 1100 IW_PRIV_TYPE_INT | 16,
1325 ""}, 1101 ""},
1326 { 1102 {
1327 WLAN_TPCCFG,
1328 IW_PRIV_TYPE_INT | 16,
1329 IW_PRIV_TYPE_INT | 16,
1330 "tpccfg"},
1331 {
1332 WLAN_POWERCFG,
1333 IW_PRIV_TYPE_INT | 16,
1334 IW_PRIV_TYPE_INT | 16,
1335 "powercfg"},
1336 {
1337 WLAN_AUTO_FREQ_SET,
1338 IW_PRIV_TYPE_INT | 16,
1339 IW_PRIV_TYPE_INT | 16,
1340 "setafc"},
1341 {
1342 WLAN_AUTO_FREQ_GET,
1343 IW_PRIV_TYPE_INT | 16,
1344 IW_PRIV_TYPE_INT | 16,
1345 "getafc"},
1346 {
1347 WLAN_SCANPROBES,
1348 IW_PRIV_TYPE_INT | 16,
1349 IW_PRIV_TYPE_INT | 16,
1350 "scanprobes"},
1351 {
1352 WLAN_LED_GPIO_CTRL, 1103 WLAN_LED_GPIO_CTRL,
1353 IW_PRIV_TYPE_INT | 16, 1104 IW_PRIV_TYPE_INT | 16,
1354 IW_PRIV_TYPE_INT | 16, 1105 IW_PRIV_TYPE_INT | 16,
1355 "ledgpio"}, 1106 "ledgpio"},
1356 {
1357 WLAN_ADAPT_RATESET,
1358 IW_PRIV_TYPE_INT | 16,
1359 IW_PRIV_TYPE_INT | 16,
1360 "rateadapt"},
1361 {
1362 WLAN_INACTIVITY_TIMEOUT,
1363 IW_PRIV_TYPE_INT | 16,
1364 IW_PRIV_TYPE_INT | 16,
1365 "inactivityto"},
1366 {
1367 WLANSNR,
1368 IW_PRIV_TYPE_INT | 16,
1369 IW_PRIV_TYPE_INT | 16,
1370 "getSNR"},
1371 {
1372 WLAN_GET_RATE,
1373 IW_PRIV_TYPE_INT | 16,
1374 IW_PRIV_TYPE_INT | 16,
1375 "getrate"},
1376 {
1377 WLAN_GET_RXINFO,
1378 IW_PRIV_TYPE_INT | 16,
1379 IW_PRIV_TYPE_INT | 16,
1380 "getrxinfo"},
1381}; 1107};
1382 1108
1383static struct iw_statistics *wlan_get_wireless_stats(struct net_device *dev) 1109static struct iw_statistics *wlan_get_wireless_stats(struct net_device *dev)
diff --git a/drivers/net/wireless/libertas/wext.h b/drivers/net/wireless/libertas/wext.h
index 39f367c38d90..15cfaaf0797f 100644
--- a/drivers/net/wireless/libertas/wext.h
+++ b/drivers/net/wireless/libertas/wext.h
@@ -10,88 +10,22 @@
10/** PRIVATE CMD ID */ 10/** PRIVATE CMD ID */
11#define WLANIOCTL SIOCIWFIRSTPRIV 11#define WLANIOCTL SIOCIWFIRSTPRIV
12 12
13#define WLANSETWPAIE (WLANIOCTL + 0)
14
15#define WLAN_SETINT_GETINT (WLANIOCTL + 7)
16#define WLANNF 1
17#define WLANRSSI 2
18#define WLANENABLE11D 5
19#define WLANADHOCGRATE 6
20#define WLAN_SUBCMD_SET_PRESCAN 11
21
22#define WLAN_SETNONE_GETNONE (WLANIOCTL + 8) 13#define WLAN_SETNONE_GETNONE (WLANIOCTL + 8)
23#define WLANDEAUTH 1
24#define WLANRADIOON 2
25#define WLANRADIOOFF 3
26#define WLANREMOVEADHOCAES 4
27#define WLANADHOCSTOP 5
28#define WLANCIPHERTEST 6
29#define WLANCRYPTOTEST 7
30
31#define WLANWLANIDLEON 10
32#define WLANWLANIDLEOFF 11
33#define WLAN_SUBCMD_BT_RESET 13 14#define WLAN_SUBCMD_BT_RESET 13
34#define WLAN_SUBCMD_FWT_RESET 14 15#define WLAN_SUBCMD_FWT_RESET 14
35 16
36#define WLANGETLOG (WLANIOCTL + 9)
37#define GETLOG_BUFSIZE 300
38
39#define WLANSCAN_TYPE (WLANIOCTL + 11)
40
41#define WLAN_SETNONE_GETONEINT (WLANIOCTL + 15) 17#define WLAN_SETNONE_GETONEINT (WLANIOCTL + 15)
42#define WLANGETREGION 1 18#define WLANGETREGION 1
43#define WLAN_GET_LISTEN_INTERVAL 2
44#define WLAN_GET_MULTIPLE_DTIM 3
45#define WLAN_GET_TX_RATE 4
46#define WLANGETBCNAVG 5
47 19
48#define WLAN_GET_LINKMODE 6
49#define WLAN_GET_RADIOMODE 7
50#define WLAN_GET_DEBUGMODE 8
51#define WLAN_SUBCMD_FWT_CLEANUP 15 20#define WLAN_SUBCMD_FWT_CLEANUP 15
52#define WLAN_SUBCMD_FWT_TIME 16 21#define WLAN_SUBCMD_FWT_TIME 16
53#define WLAN_SUBCMD_MESH_GET_TTL 17 22#define WLAN_SUBCMD_MESH_GET_TTL 17
54 23
55#define WLANREGCFRDWR (WLANIOCTL + 18)
56
57#define WLAN_SETNONE_GETTWELVE_CHAR (WLANIOCTL + 19)
58#define WLAN_SUBCMD_GETRXANTENNA 1
59#define WLAN_SUBCMD_GETTXANTENNA 2
60#define WLAN_GET_TSF 3
61
62#define WLAN_SETNONE_GETWORDCHAR (WLANIOCTL + 21)
63#define WLANGETADHOCAES 1
64
65#define WLAN_SETONEINT_GETONEINT (WLANIOCTL + 23)
66#define WLAN_BEACON_INTERVAL 1
67#define WLAN_LISTENINTRVL 4
68
69#define WLAN_TXCONTROL 6
70#define WLAN_NULLPKTINTERVAL 7
71
72#define WLAN_SETONEINT_GETNONE (WLANIOCTL + 24) 24#define WLAN_SETONEINT_GETNONE (WLANIOCTL + 24)
73#define WLAN_SUBCMD_SETRXANTENNA 1
74#define WLAN_SUBCMD_SETTXANTENNA 2
75#define WLANSETAUTHALG 5
76#define WLANSET8021XAUTHALG 6
77#define WLANSETENCRYPTIONMODE 7
78#define WLANSETREGION 8 25#define WLANSETREGION 8
79#define WLAN_SET_LISTEN_INTERVAL 9
80
81#define WLAN_SET_MULTIPLE_DTIM 10
82#define WLAN_SET_ATIM_WINDOW 11
83#define WLANSETBCNAVG 13
84#define WLANSETDATAAVG 14
85#define WLAN_SET_LINKMODE 15
86#define WLAN_SET_RADIOMODE 16
87#define WLAN_SET_DEBUGMODE 17
88#define WLAN_SUBCMD_MESH_SET_TTL 18 26#define WLAN_SUBCMD_MESH_SET_TTL 18
89 27
90#define WLAN_SET128CHAR_GET128CHAR (WLANIOCTL + 25) 28#define WLAN_SET128CHAR_GET128CHAR (WLANIOCTL + 25)
91#define WLANSCAN_MODE 6
92
93#define WLAN_GET_ADHOC_STATUS 9
94
95#define WLAN_SUBCMD_BT_ADD 18 29#define WLAN_SUBCMD_BT_ADD 18
96#define WLAN_SUBCMD_BT_DEL 19 30#define WLAN_SUBCMD_BT_DEL 19
97#define WLAN_SUBCMD_BT_LIST 20 31#define WLAN_SUBCMD_BT_LIST 20
@@ -103,27 +37,8 @@
103#define WLAN_SUBCMD_FWT_LIST_ROUTE 26 37#define WLAN_SUBCMD_FWT_LIST_ROUTE 26
104 38
105#define WLAN_SET_GET_SIXTEEN_INT (WLANIOCTL + 29) 39#define WLAN_SET_GET_SIXTEEN_INT (WLANIOCTL + 29)
106#define WLAN_TPCCFG 1
107#define WLAN_POWERCFG 2
108
109#define WLAN_AUTO_FREQ_SET 3
110#define WLAN_AUTO_FREQ_GET 4
111#define WLAN_LED_GPIO_CTRL 5 40#define WLAN_LED_GPIO_CTRL 5
112#define WLAN_SCANPROBES 6
113#define WLAN_ADAPT_RATESET 8
114#define WLAN_INACTIVITY_TIMEOUT 9
115#define WLANSNR 10
116#define WLAN_GET_RATE 11
117#define WLAN_GET_RXINFO 12
118
119#define WLANCMD52RDWR (WLANIOCTL + 30)
120#define WLANCMD53RDWR (WLANIOCTL + 31)
121#define CMD53BUFLEN 32
122 41
123#define REG_MAC 0x19
124#define REG_BBP 0x1a
125#define REG_RF 0x1b
126#define REG_EEPROM 0x59
127#define WLAN_LINKMODE_802_3 0 42#define WLAN_LINKMODE_802_3 0
128#define WLAN_LINKMODE_802_11 2 43#define WLAN_LINKMODE_802_11 2
129#define WLAN_RADIOMODE_NONE 0 44#define WLAN_RADIOMODE_NONE 0