1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
|
/*******************************************************************************
* Agere Systems Inc.
* Wireless device driver for Linux (wlags49).
*
* Copyright (c) 1998-2003 Agere Systems Inc.
* All rights reserved.
* http://www.agere.com
*
* Initially developed by TriplePoint, Inc.
* http://www.triplepoint.com
*
*------------------------------------------------------------------------------
*
* Header for defintions and macros internal to the drvier.
*
*------------------------------------------------------------------------------
*
* SOFTWARE LICENSE
*
* This software is provided subject to the following terms and conditions,
* which you should read carefully before using the software. Using this
* software indicates your acceptance of these terms and conditions. If you do
* not agree with these terms and conditions, do not use the software.
*
* Copyright © 2003 Agere Systems Inc.
* All rights reserved.
*
* Redistribution and use in source or binary forms, with or without
* modifications, are permitted provided that the following conditions are met:
*
* . Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following Disclaimer as comments in the code as
* well as in the documentation and/or other materials provided with the
* distribution.
*
* . Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following Disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* . Neither the name of Agere Systems Inc. nor the names of the contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* Disclaimer
*
* THIS SOFTWARE IS PROVIDED AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES,
* INCLUDING, BUT NOT LIMITED TO, INFRINGEMENT AND THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ANY
* USE, MODIFICATION OR DISTRIBUTION OF THIS SOFTWARE IS SOLELY AT THE USERS OWN
* RISK. IN NO EVENT SHALL AGERE SYSTEMS INC. OR CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, INCLUDING, BUT NOT LIMITED TO, CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
* DAMAGE.
*
******************************************************************************/
#ifndef __WAVELAN2_H__
#define __WAVELAN2_H__
/*******************************************************************************
* include files
******************************************************************************/
#ifdef BUS_PCMCIA
#include <pcmcia/cistpl.h>
#include <pcmcia/cisreg.h>
#include <pcmcia/ciscode.h>
#include <pcmcia/ds.h>
#endif // BUS_PCMCIA
#include <linux/wireless.h>
#include <net/iw_handler.h>
#include <linux/list.h>
#include <linux/interrupt.h>
/*******************************************************************************
* constant definitions
******************************************************************************/
#define p_u8 __u8
#define p_s8 __s8
#define p_u16 __u16
#define p_s16 __s16
#define p_u32 __u32
#define p_s32 __s32
#define p_char char
#define MAX_KEY_LEN (2 + (13 * 2)) // 0x plus 13 hex digit pairs
#define MB_SIZE 1024
#define MAX_ENC_LEN 104
#define MAX_SCAN_TIME_SEC 8
#define MAX_NAPS 32
#define CFG_MB_INFO 0x0820 //Mail Box Info Block
#define NUM_WDS_PORTS 6
#define WVLAN_MAX_LOOKAHEAD (HCF_MAX_MSG+46) /* as per s0005MIC_4.doc */
/* Min/Max/Default Parameter Values */
#if 0 //;? (HCF_TYPE) & HCF_TYPE_AP
//;? why this difference depending on compile option, seems to me it should depend on runtime if anything
#define PARM_DEFAULT_SSID "LinuxAP"
#else
#define PARM_DEFAULT_SSID "ANY"
#endif // HCF_TYPE_AP
#define PARM_MIN_NAME_LEN 1
#define PARM_MAX_NAME_LEN 32
/* The following definitions pertain to module and profile parameters */
// #define PARM_AP_MODE APMode
// #define PARM_NAME_AP_MODE TEXT("APMode")
// #define PARM_DEFAULT_AP_MODE FALSE
#define PARM_AUTHENTICATION Authentication
#define PARM_NAME_AUTHENTICATION TEXT("Authentication")
#define PARM_MIN_AUTHENTICATION 1
#define PARM_MAX_AUTHENTICATION 2
#define PARM_DEFAULT_AUTHENTICATION 1
#define PARM_AUTH_KEY_MGMT_SUITE AuthKeyMgmtSuite
#define PARM_NAME_AUTH_KEY_MGMT_SUITE TEXT("AuthKeyMgmtSuite")
#define PARM_MIN_AUTH_KEY_MGMT_SUITE 0
#define PARM_MAX_AUTH_KEY_MGMT_SUITE 4
#define PARM_DEFAULT_AUTH_KEY_MGMT_SUITE 0
#define PARM_BRSC_2GHZ BRSC2GHz
#define PARM_NAME_BRSC_2GHZ TEXT("BRSC2GHz")
#define PARM_MIN_BRSC 0x0000
#define PARM_MAX_BRSC 0x0FFF
#define PARM_DEFAULT_BRSC_2GHZ 0x000F
#define PARM_BRSC_5GHZ BRSC5GHz
#define PARM_NAME_BRSC_5GHZ TEXT("BRSC5GHz")
#define PARM_DEFAULT_BRSC_5GHZ 0x0150
#define PARM_COEXISTENCE Coexistence
#define PARM_NAME_COEXISTENCE TEXT("Coexistence")
#define PARM_MIN_COEXISTENCE 0x0000
#define PARM_MAX_COEXISTENCE 0x0007
#define PARM_DEFAULT_COEXISTENCE 0x0000
#define PARM_CONFIGURED Configured
#define PARM_NAME_CONFIGURED TEXT("Configured")
#define PARM_CONNECTION_CONTROL ConnectionControl
#define PARM_NAME_CONNECTION_CONTROL TEXT("ConnectionControl")
#define PARM_MIN_CONNECTION_CONTROL 0
#define PARM_MAX_CONNECTION_CONTROL 3
#define PARM_DEFAULT_CONNECTION_CONTROL 2
#define PARM_CREATE_IBSS CreateIBSS
#define PARM_NAME_CREATE_IBSS TEXT("CreateIBSS")
#define PARM_DEFAULT_CREATE_IBSS FALSE
#define PARM_DEFAULT_CREATE_IBSS_STR "N"
#define PARM_DEBUG_FLAG DebugFlag
#define PARM_NAME_DEBUG_FLAG TEXT("DebugFlag")
#define PARM_MIN_DEBUG_FLAG 0
#define PARM_MAX_DEBUG_FLAG 0xFFFF
#define PARM_DEFAULT_DEBUG_FLAG 0xFFFF
#define PARM_DESIRED_SSID DesiredSSID
#define PARM_NAME_DESIRED_SSID TEXT("DesiredSSID")
#define PARM_DOWNLOAD_FIRMWARE DownloadFirmware
#define PARM_NAME_DOWNLOAD_FIRMWARE TEXT("DownloadFirmware")
#define PARM_DRIVER_ENABLE DriverEnable
#define PARM_NAME_DRIVER_ENABLE TEXT("DriverEnable")
#define PARM_DEFAULT_DRIVER_ENABLE TRUE
#define PARM_ENABLE_ENCRYPTION EnableEncryption
#define PARM_NAME_ENABLE_ENCRYPTION TEXT("EnableEncryption")
#define PARM_MIN_ENABLE_ENCRYPTION 0
#define PARM_MAX_ENABLE_ENCRYPTION 7
#define PARM_DEFAULT_ENABLE_ENCRYPTION 0
#define PARM_ENCRYPTION Encryption
#define PARM_NAME_ENCRYPTION TEXT("Encryption")
#define PARM_EXCLUDE_UNENCRYPTED ExcludeUnencrypted
#define PARM_NAME_EXCLUDE_UNENCRYPTED TEXT("ExcludeUnencrypted")
#define PARM_DEFAULT_EXCLUDE_UNENCRYPTED TRUE
#define PARM_DEFAULT_EXCLUDE_UNENCRYPTED_STR "N"
#define PARM_INTRA_BSS_RELAY IntraBSSRelay
#define PARM_NAME_INTRA_BSS_RELAY TEXT("IntraBSSRelay")
#define PARM_DEFAULT_INTRA_BSS_RELAY TRUE
#define PARM_DEFAULT_INTRA_BSS_RELAY_STR "Y"
#define PARM_KEY1 Key1
#define PARM_NAME_KEY1 TEXT("Key1")
#define PARM_KEY2 Key2
#define PARM_NAME_KEY2 TEXT("Key2")
#define PARM_KEY3 Key3
#define PARM_NAME_KEY3 TEXT("Key3")
#define PARM_KEY4 Key4
#define PARM_NAME_KEY4 TEXT("Key4")
//;? #define PARM_KEY_FORMAT AsciiHex
//;? #define PARM_NAME_KEY_FORMAT TEXT("AsciiHex")
#define PARM_LOAD_BALANCING LoadBalancing
#define PARM_NAME_LOAD_BALANCING TEXT("LoadBalancing")
#define PARM_DEFAULT_LOAD_BALANCING TRUE
#define PARM_DEFAULT_LOAD_BALANCING_STR "Y"
#define PARM_MAX_DATA_LENGTH MaxDataLength
#define PARM_NAME_MAX_DATA_LENGTH TEXT("MaxDataLength")
#define PARM_MAX_SLEEP MaxSleepDuration
#define PARM_NAME_MAX_SLEEP TEXT("MaxSleepDuration")
#define PARM_MIN_MAX_PM_SLEEP 1 //;?names nearly right?
#define PARM_MAX_MAX_PM_SLEEP 65535
#define PARM_DEFAULT_MAX_PM_SLEEP 100
#define PARM_MEDIUM_DISTRIBUTION MediumDistribution
#define PARM_NAME_MEDIUM_DISTRIBUTION TEXT("MediumDistribution")
#define PARM_DEFAULT_MEDIUM_DISTRIBUTION TRUE
#define PARM_DEFAULT_MEDIUM_DISTRIBUTION_STR "Y"
#define PARM_MICROWAVE_ROBUSTNESS MicroWaveRobustness
#define PARM_NAME_MICROWAVE_ROBUSTNESS TEXT("MicroWaveRobustness")
#define PARM_DEFAULT_MICROWAVE_ROBUSTNESS FALSE
#define PARM_DEFAULT_MICROWAVE_ROBUSTNESS_STR "N"
#define PARM_MULTICAST_PM_BUFFERING MulticastPMBuffering
#define PARM_NAME_MULTICAST_PM_BUFFERING TEXT("MulticastPMBuffering")
#define PARM_DEFAULT_MULTICAST_PM_BUFFERING TRUE
#define PARM_DEFAULT_MULTICAST_PM_BUFFERING_STR "Y"
#define PARM_MULTICAST_RATE MulticastRate
#define PARM_NAME_MULTICAST_RATE TEXT("MulticastRate")
#ifdef WARP
#define PARM_MIN_MULTICAST_RATE 0x0001
#define PARM_MAX_MULTICAST_RATE 0x0fff
#define PARM_DEFAULT_MULTICAST_RATE_2GHZ 0x0004
#define PARM_DEFAULT_MULTICAST_RATE_5GHZ 0x0010
#else
#define PARM_MIN_MULTICAST_RATE 0x0001
#define PARM_MAX_MULTICAST_RATE 0x0004
#define PARM_DEFAULT_MULTICAST_RATE_2GHZ 0x0002
#define PARM_DEFAULT_MULTICAST_RATE_5GHZ 0x0000
#endif // WARP
#define PARM_MULTICAST_RX MulticastReceive
#define PARM_NAME_MULTICAST_RX TEXT("MulticastReceive")
#define PARM_DEFAULT_MULTICAST_RX TRUE
#define PARM_DEFAULT_MULTICAST_RX_STR "Y"
#define PARM_NETWORK_ADDR NetworkAddress
#define PARM_NAME_NETWORK_ADDR TEXT("NetworkAddress")
#define PARM_DEFAULT_NETWORK_ADDR { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF }
#define PARM_NETWORK_TYPE NetworkType
#define PARM_NAME_NETWORK_TYPE TEXT("NetworkType")
#define PARM_DEFAULT_NETWORK_TYPE 0
#define PARM_OWN_ATIM_WINDOW OwnATIMWindow
#define PARM_NAME_OWN_ATIM_WINDOW TEXT("OwnATIMWindow")
#define PARM_MIN_OWN_ATIM_WINDOW 0
#define PARM_MAX_OWN_ATIM_WINDOW 100
#define PARM_DEFAULT_OWN_ATIM_WINDOW 0
#define PARM_OWN_BEACON_INTERVAL OwnBeaconInterval
#define PARM_NAME_OWN_BEACON_INTERVAL TEXT("OwnBeaconInterval")
#define PARM_MIN_OWN_BEACON_INTERVAL 20
#define PARM_MAX_OWN_BEACON_INTERVAL 200
#define PARM_DEFAULT_OWN_BEACON_INTERVAL 100
#define PARM_OWN_CHANNEL OwnChannel
#define PARM_NAME_OWN_CHANNEL TEXT("OwnChannel")
#define PARM_MIN_OWN_CHANNEL 1
#define PARM_MAX_OWN_CHANNEL 161
#define PARM_DEFAULT_OWN_CHANNEL 10
#define PARM_OWN_DTIM_PERIOD OwnDTIMPeriod
#define PARM_NAME_OWN_DTIM_PERIOD TEXT("OwnDTIMPeriod")
#define PARM_MIN_OWN_DTIM_PERIOD 1
#define PARM_MAX_OWN_DTIM_PERIOD 65535
#define PARM_DEFAULT_OWN_DTIM_PERIOD 1
#define PARM_OWN_NAME OwnName
#define PARM_NAME_OWN_NAME TEXT("OwnName")
#define PARM_DEFAULT_OWN_NAME "Linux"
#define PARM_OWN_SSID OwnSSID
#define PARM_NAME_OWN_SSID TEXT("OwnSSID")
#define PARM_PM_ENABLED PMEnabled
#define PARM_NAME_PM_ENABLED TEXT("PMEnabled")
#define PARM_MAX_PM_ENABLED 3
#define PARM_PMEPS PMEPS
#define PARM_NAME_PMEPS TEXT("PMEPS")
#define PARM_PM_HOLDOVER_DURATION PMHoldoverDuration
#define PARM_NAME_PM_HOLDOVER_DURATION TEXT("PMHoldoverDuration")
#define PARM_MIN_PM_HOLDOVER_DURATION 1
#define PARM_MAX_PM_HOLDOVER_DURATION 1000
#define PARM_DEFAULT_PM_HOLDOVER_DURATION 100
#define PARM_PM_MODE PowerMode
#define PARM_NAME_PM_MODE TEXT("PowerMode")
#define PARM_PORT_TYPE PortType
#define PARM_NAME_PORT_TYPE TEXT("PortType")
#define PARM_MIN_PORT_TYPE 1
#define PARM_MAX_PORT_TYPE 3<
|