1 /* src/prism2/driver/prism2mib.c
3 * Management request for mibset/mibget
5 * Copyright (C) 1999 AbsoluteValue Systems, Inc. All Rights Reserved.
6 * --------------------------------------------------------------------
10 * The contents of this file are subject to the Mozilla Public
11 * License Version 1.1 (the "License"); you may not use this file
12 * except in compliance with the License. You may obtain a copy of
13 * the License at http://www.mozilla.org/MPL/
15 * Software distributed under the License is distributed on an "AS
16 * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
17 * implied. See the License for the specific language governing
18 * rights and limitations under the License.
20 * Alternatively, the contents of this file may be used under the
21 * terms of the GNU Public License version 2 (the "GPL"), in which
22 * case the provisions of the GPL are applicable instead of the
23 * above. If you wish to allow the use of your version of this file
24 * only under the terms of the GPL and not to allow others to use
25 * your version of this file under the MPL, indicate your decision
26 * by deleting the provisions above and replace them with the notice
27 * and other provisions required by the GPL. If you do not delete
28 * the provisions above, a recipient may use your version of this
29 * file under either the MPL or the GPL.
31 * --------------------------------------------------------------------
33 * Inquiries regarding the linux-wlan Open Source project can be
36 * AbsoluteValue Systems Inc.
38 * http://www.linux-wlan.com
40 * --------------------------------------------------------------------
42 * Portions of the development of this software were funded by
43 * Intersil Corporation as part of PRISM(R) chipset product development.
45 * --------------------------------------------------------------------
47 * The functions in this file handle the mibset/mibget management
50 * --------------------------------------------------------------------
53 /*================================================================*/
55 #define WLAN_DBVAR prism2_debug
60 #include <linux/version.h>
62 #include <linux/module.h>
63 #include <linux/kernel.h>
64 #include <linux/sched.h>
65 #include <linux/types.h>
66 #include <linux/slab.h>
67 #include <linux/wireless.h>
68 #include <linux/netdevice.h>
70 #include <linux/delay.h>
71 #include <asm/byteorder.h>
73 #include "wlan_compat.h"
75 //#if (WLAN_HOSTIF == WLAN_PCMCIA)
76 //#include <pcmcia/version.h>
77 //#include <pcmcia/cs_types.h>
78 //#include <pcmcia/cs.h>
79 //#include <pcmcia/cistpl.h>
80 //#include <pcmcia/ds.h>
81 //#include <pcmcia/cisreg.h>
84 //#if ((WLAN_HOSTIF == WLAN_PLX) || (WLAN_HOSTIF == WLAN_PCI))
85 //#include <linux/ioport.h>
86 //#include <linux/pci.h>
89 //#if (WLAN_HOSTIF == WLAN_USB)
90 #include <linux/usb.h>
93 /*================================================================*/
94 /* Project Includes */
96 #include "p80211types.h"
97 #include "p80211hdr.h"
98 #include "p80211mgmt.h"
99 #include "p80211conv.h"
100 #include "p80211msg.h"
101 #include "p80211netdev.h"
102 #include "p80211metadef.h"
103 #include "p80211metastruct.h"
105 #include "prism2mgmt.h"
107 /*================================================================*/
108 /* Local Constants */
110 #define MIB_TMP_MAXLEN 200 /* Max length of RID record (in bytes). */
112 /*================================================================*/
115 #define F_AP 0x1 /* MIB is supported on Access Points. */
116 #define F_STA 0x2 /* MIB is supported on stations. */
117 #define F_READ 0x4 /* MIB may be read. */
118 #define F_WRITE 0x8 /* MIB may be written. */
120 typedef struct mibrec
127 int (*func)(struct mibrec *mib,
129 wlandevice_t *wlandev,
131 p80211msg_dot11req_mibset_t *msg,
135 /*================================================================*/
136 /* Local Function Declarations */
138 static int prism2mib_bytestr2pstr(
141 wlandevice_t *wlandev,
143 p80211msg_dot11req_mibset_t *msg,
146 static int prism2mib_bytearea2pstr(
149 wlandevice_t *wlandev,
151 p80211msg_dot11req_mibset_t *msg,
154 static int prism2mib_uint32(
157 wlandevice_t *wlandev,
159 p80211msg_dot11req_mibset_t *msg,
162 static int prism2mib_uint32array(
165 wlandevice_t *wlandev,
167 p80211msg_dot11req_mibset_t *msg,
170 static int prism2mib_uint32offset(
173 wlandevice_t *wlandev,
175 p80211msg_dot11req_mibset_t *msg,
178 static int prism2mib_truth(
181 wlandevice_t *wlandev,
183 p80211msg_dot11req_mibset_t *msg,
186 static int prism2mib_preamble(
189 wlandevice_t *wlandev,
191 p80211msg_dot11req_mibset_t *msg,
194 static int prism2mib_flag(
197 wlandevice_t *wlandev,
199 p80211msg_dot11req_mibset_t *msg,
202 static int prism2mib_appcfinfoflag(
205 wlandevice_t *wlandev,
207 p80211msg_dot11req_mibset_t *msg,
210 static int prism2mib_regulatorydomains(
213 wlandevice_t *wlandev,
215 p80211msg_dot11req_mibset_t *msg,
218 static int prism2mib_wepdefaultkey(
221 wlandevice_t *wlandev,
223 p80211msg_dot11req_mibset_t *msg,
226 static int prism2mib_powermanagement(
229 wlandevice_t *wlandev,
231 p80211msg_dot11req_mibset_t *msg,
234 static int prism2mib_privacyinvoked(
237 wlandevice_t *wlandev,
239 p80211msg_dot11req_mibset_t *msg,
242 static int prism2mib_excludeunencrypted(
245 wlandevice_t *wlandev,
247 p80211msg_dot11req_mibset_t *msg,
250 static int prism2mib_fragmentationthreshold(
253 wlandevice_t *wlandev,
255 p80211msg_dot11req_mibset_t *msg,
258 static int prism2mib_operationalrateset(
261 wlandevice_t *wlandev,
263 p80211msg_dot11req_mibset_t *msg,
266 static int prism2mib_groupaddress(
269 wlandevice_t *wlandev,
271 p80211msg_dot11req_mibset_t *msg,
274 static int prism2mib_fwid(
277 wlandevice_t *wlandev,
279 p80211msg_dot11req_mibset_t *msg,
282 static int prism2mib_authalg(
285 wlandevice_t *wlandev,
287 p80211msg_dot11req_mibset_t *msg,
290 static int prism2mib_authalgenable(
293 wlandevice_t *wlandev,
295 p80211msg_dot11req_mibset_t *msg,
298 static int prism2mib_priv(
301 wlandevice_t *wlandev,
303 p80211msg_dot11req_mibset_t *msg,
306 static void prism2mib_priv_authlist(
308 prism2sta_authlist_t *list);
310 static void prism2mib_priv_accessmode(
314 static void prism2mib_priv_accessallow(
316 p80211macarray_t *macarray);
318 static void prism2mib_priv_accessdeny(
320 p80211macarray_t *macarray);
322 static void prism2mib_priv_deauthenticate(
326 /*================================================================*/
327 /* Local Static Definitions */
329 static mibrec_t mibtab[] = {
333 { DIDmib_dot11smt_dot11StationConfigTable_dot11StationID,
334 F_AP | F_STA | F_READ | F_WRITE,
335 HFA384x_RID_CNFOWNMACADDR, HFA384x_RID_CNFOWNMACADDR_LEN, 0,
336 prism2mib_bytearea2pstr },
337 { DIDmib_dot11smt_dot11StationConfigTable_dot11MediumOccupancyLimit,
338 F_AP | F_READ | F_WRITE,
339 HFA384x_RID_CNFAPPCFINFO, HFA384x_RID_CNFAPPCFINFO_LEN, 0,
340 prism2mib_uint32offset },
341 { DIDmib_dot11smt_dot11StationConfigTable_dot11CFPollable,
343 HFA384x_RID_CFPOLLABLE, 0, 0,
345 { DIDmib_dot11smt_dot11StationConfigTable_dot11CFPPeriod,
346 F_AP | F_READ | F_WRITE,
347 HFA384x_RID_CNFAPPCFINFO, HFA384x_RID_CNFAPPCFINFO_LEN, 1,
348 prism2mib_uint32offset },
349 { DIDmib_dot11smt_dot11StationConfigTable_dot11CFPMaxDuration,
350 F_AP | F_READ | F_WRITE,
351 HFA384x_RID_CNFAPPCFINFO, HFA384x_RID_CNFAPPCFINFO_LEN, 2,
352 prism2mib_uint32offset },
353 { DIDmib_dot11smt_dot11StationConfigTable_dot11AuthenticationResponseTimeOut,
354 F_STA | F_READ | F_WRITE,
355 HFA384x_RID_CNFAUTHRSPTIMEOUT, 0, 0,
357 { DIDmib_dot11smt_dot11StationConfigTable_dot11PrivacyOptionImplemented,
358 F_AP | F_STA | F_READ,
359 HFA384x_RID_PRIVACYOPTIMP, 0, 0,
361 { DIDmib_dot11smt_dot11StationConfigTable_dot11PowerManagementMode,
362 F_STA | F_READ | F_WRITE,
363 HFA384x_RID_CNFPMENABLED, 0, 0,
364 prism2mib_powermanagement },
365 { DIDmib_dot11smt_dot11StationConfigTable_dot11DesiredSSID,
366 F_STA | F_READ | F_WRITE,
367 HFA384x_RID_CNFDESIREDSSID, HFA384x_RID_CNFDESIREDSSID_LEN, 0,
368 prism2mib_bytestr2pstr },
369 { DIDmib_dot11smt_dot11StationConfigTable_dot11DesiredBSSType,
370 F_STA | F_READ | F_WRITE,
373 { DIDmib_dot11smt_dot11StationConfigTable_dot11OperationalRateSet,
374 F_STA | F_READ | F_WRITE,
375 HFA384x_RID_TXRATECNTL, 0, 0,
376 prism2mib_operationalrateset },
377 { DIDmib_dot11smt_dot11StationConfigTable_dot11OperationalRateSet,
378 F_AP | F_READ | F_WRITE,
379 HFA384x_RID_TXRATECNTL0, 0, 0,
380 prism2mib_operationalrateset },
381 { DIDmib_dot11smt_dot11StationConfigTable_dot11BeaconPeriod,
382 F_AP | F_READ | F_WRITE,
383 HFA384x_RID_CNFAPBCNINT, 0, 0,
385 { DIDmib_dot11smt_dot11StationConfigTable_dot11DTIMPeriod,
386 F_AP | F_STA | F_READ | F_WRITE,
387 HFA384x_RID_CNFOWNDTIMPER, 0, 0,
389 { DIDmib_dot11smt_dot11StationConfigTable_dot11AssociationResponseTimeOut,
390 F_AP | F_STA | F_READ,
391 HFA384x_RID_PROTOCOLRSPTIME, 0, 0,
393 { DIDmib_dot11smt_dot11AuthenticationAlgorithmsTable_dot11AuthenticationAlgorithm1,
394 F_AP | F_STA | F_READ,
397 { DIDmib_dot11smt_dot11AuthenticationAlgorithmsTable_dot11AuthenticationAlgorithm2,
398 F_AP | F_STA | F_READ,
401 { DIDmib_dot11smt_dot11AuthenticationAlgorithmsTable_dot11AuthenticationAlgorithm3,
402 F_AP | F_STA | F_READ,
405 { DIDmib_dot11smt_dot11AuthenticationAlgorithmsTable_dot11AuthenticationAlgorithm4,
406 F_AP | F_STA | F_READ,
409 { DIDmib_dot11smt_dot11AuthenticationAlgorithmsTable_dot11AuthenticationAlgorithm5,
410 F_AP | F_STA | F_READ,
413 { DIDmib_dot11smt_dot11AuthenticationAlgorithmsTable_dot11AuthenticationAlgorithm6,
414 F_AP | F_STA | F_READ,
417 { DIDmib_dot11smt_dot11AuthenticationAlgorithmsTable_dot11AuthenticationAlgorithmsEnable1,
418 F_AP | F_STA | F_READ | F_WRITE,
420 prism2mib_authalgenable },
421 { DIDmib_dot11smt_dot11AuthenticationAlgorithmsTable_dot11AuthenticationAlgorithmsEnable2,
422 F_AP | F_STA | F_READ | F_WRITE,
424 prism2mib_authalgenable },
425 { DIDmib_dot11smt_dot11AuthenticationAlgorithmsTable_dot11AuthenticationAlgorithmsEnable3,
426 F_AP | F_STA | F_READ | F_WRITE,
428 prism2mib_authalgenable },
429 { DIDmib_dot11smt_dot11AuthenticationAlgorithmsTable_dot11AuthenticationAlgorithmsEnable4,
430 F_AP | F_STA | F_READ | F_WRITE,
432 prism2mib_authalgenable },
433 { DIDmib_dot11smt_dot11AuthenticationAlgorithmsTable_dot11AuthenticationAlgorithmsEnable5,
434 F_AP | F_STA | F_READ | F_WRITE,
436 prism2mib_authalgenable },
437 { DIDmib_dot11smt_dot11AuthenticationAlgorithmsTable_dot11AuthenticationAlgorithmsEnable6,
438 F_AP | F_STA | F_READ | F_WRITE,
440 prism2mib_authalgenable },
441 { DIDmib_dot11smt_dot11WEPDefaultKeysTable_dot11WEPDefaultKey0,
442 F_AP | F_STA | F_WRITE,
443 HFA384x_RID_CNFWEPDEFAULTKEY0, 0, 0,
444 prism2mib_wepdefaultkey },
445 { DIDmib_dot11smt_dot11WEPDefaultKeysTable_dot11WEPDefaultKey1,
446 F_AP | F_STA | F_WRITE,
447 HFA384x_RID_CNFWEPDEFAULTKEY1, 0, 0,
448 prism2mib_wepdefaultkey },
449 { DIDmib_dot11smt_dot11WEPDefaultKeysTable_dot11WEPDefaultKey2,
450 F_AP | F_STA | F_WRITE,
451 HFA384x_RID_CNFWEPDEFAULTKEY2, 0, 0,
452 prism2mib_wepdefaultkey },
453 { DIDmib_dot11smt_dot11WEPDefaultKeysTable_dot11WEPDefaultKey3,
454 F_AP | F_STA | F_WRITE,
455 HFA384x_RID_CNFWEPDEFAULTKEY3, 0, 0,
456 prism2mib_wepdefaultkey },
457 { DIDmib_dot11smt_dot11PrivacyTable_dot11PrivacyInvoked,
458 F_AP | F_STA | F_READ | F_WRITE,
459 HFA384x_RID_CNFWEPFLAGS, HFA384x_WEPFLAGS_PRIVINVOKED, 0,
460 prism2mib_privacyinvoked },
461 { DIDmib_dot11smt_dot11PrivacyTable_dot11WEPDefaultKeyID,
462 F_AP | F_STA | F_READ | F_WRITE,
463 HFA384x_RID_CNFWEPDEFAULTKEYID, 0, 0,
465 { DIDmib_dot11smt_dot11PrivacyTable_dot11ExcludeUnencrypted,
466 F_AP | F_STA | F_READ | F_WRITE,
467 HFA384x_RID_CNFWEPFLAGS, HFA384x_WEPFLAGS_EXCLUDE, 0,
468 prism2mib_excludeunencrypted },
469 { DIDmib_dot11phy_dot11PhyOperationTable_dot11ShortPreambleEnabled,
470 F_AP | F_STA | F_READ | F_WRITE,
471 HFA384x_RID_CNFSHORTPREAMBLE, 0, 0,
472 prism2mib_preamble },
476 { DIDmib_dot11mac_dot11OperationTable_dot11MACAddress,
477 F_AP | F_STA | F_READ | F_WRITE,
478 HFA384x_RID_CNFOWNMACADDR, HFA384x_RID_CNFOWNMACADDR_LEN, 0,
479 prism2mib_bytearea2pstr },
480 { DIDmib_dot11mac_dot11OperationTable_dot11RTSThreshold,
481 F_STA | F_READ | F_WRITE,
482 HFA384x_RID_RTSTHRESH, 0, 0,
484 { DIDmib_dot11mac_dot11OperationTable_dot11RTSThreshold,
485 F_AP | F_READ | F_WRITE,
486 HFA384x_RID_RTSTHRESH0, 0, 0,
488 { DIDmib_dot11mac_dot11OperationTable_dot11ShortRetryLimit,
489 F_AP | F_STA | F_READ,
490 HFA384x_RID_SHORTRETRYLIMIT, 0, 0,
492 { DIDmib_dot11mac_dot11OperationTable_dot11LongRetryLimit,
493 F_AP | F_STA | F_READ,
494 HFA384x_RID_LONGRETRYLIMIT, 0, 0,
496 { DIDmib_dot11mac_dot11OperationTable_dot11FragmentationThreshold,
497 F_STA | F_READ | F_WRITE,
498 HFA384x_RID_FRAGTHRESH, 0, 0,
499 prism2mib_fragmentationthreshold },
500 { DIDmib_dot11mac_dot11OperationTable_dot11FragmentationThreshold,
501 F_AP | F_READ | F_WRITE,
502 HFA384x_RID_FRAGTHRESH0, 0, 0,
503 prism2mib_fragmentationthreshold },
504 { DIDmib_dot11mac_dot11OperationTable_dot11MaxTransmitMSDULifetime,
505 F_AP | F_STA | F_READ,
506 HFA384x_RID_MAXTXLIFETIME, 0, 0,
508 { DIDmib_dot11mac_dot11OperationTable_dot11MaxReceiveLifetime,
509 F_AP | F_STA | F_READ,
510 HFA384x_RID_MAXRXLIFETIME, 0, 0,
512 { DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address1,
513 F_STA | F_READ | F_WRITE,
515 prism2mib_groupaddress },
516 { DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address2,
517 F_STA | F_READ | F_WRITE,
519 prism2mib_groupaddress },
520 { DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address3,
521 F_STA | F_READ | F_WRITE,
523 prism2mib_groupaddress },
524 { DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address4,
525 F_STA | F_READ | F_WRITE,
527 prism2mib_groupaddress },
528 { DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address5,
529 F_STA | F_READ | F_WRITE,
531 prism2mib_groupaddress },
532 { DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address6,
533 F_STA | F_READ | F_WRITE,
535 prism2mib_groupaddress },
536 { DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address7,
537 F_STA | F_READ | F_WRITE,
539 prism2mib_groupaddress },
540 { DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address8,
541 F_STA | F_READ | F_WRITE,
543 prism2mib_groupaddress },
544 { DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address9,
545 F_STA | F_READ | F_WRITE,
547 prism2mib_groupaddress },
548 { DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address10,
549 F_STA | F_READ | F_WRITE,
551 prism2mib_groupaddress },
552 { DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address11,
553 F_STA | F_READ | F_WRITE,
555 prism2mib_groupaddress },
556 { DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address12,
557 F_STA | F_READ | F_WRITE,
559 prism2mib_groupaddress },
560 { DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address13,
561 F_STA | F_READ | F_WRITE,
563 prism2mib_groupaddress },
564 { DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address14,
565 F_STA | F_READ | F_WRITE,
567 prism2mib_groupaddress },
568 { DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address15,
569 F_STA | F_READ | F_WRITE,
571 prism2mib_groupaddress },
572 { DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address16,
573 F_STA | F_READ | F_WRITE,
575 prism2mib_groupaddress },
576 { DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address17,
577 F_STA | F_READ | F_WRITE,
579 prism2mib_groupaddress },
580 { DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address18,
581 F_STA | F_READ | F_WRITE,
583 prism2mib_groupaddress },
584 { DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address19,
585 F_STA | F_READ | F_WRITE,
587 prism2mib_groupaddress },
588 { DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address20,
589 F_STA | F_READ | F_WRITE,
591 prism2mib_groupaddress },
592 { DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address21,
593 F_STA | F_READ | F_WRITE,
595 prism2mib_groupaddress },
596 { DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address22,
597 F_STA | F_READ | F_WRITE,
599 prism2mib_groupaddress },
600 { DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address23,
601 F_STA | F_READ | F_WRITE,
603 prism2mib_groupaddress },
604 { DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address24,
605 F_STA | F_READ | F_WRITE,
607 prism2mib_groupaddress },
608 { DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address25,
609 F_STA | F_READ | F_WRITE,
611 prism2mib_groupaddress },
612 { DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address26,
613 F_STA | F_READ | F_WRITE,
615 prism2mib_groupaddress },
616 { DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address27,
617 F_STA | F_READ | F_WRITE,
619 prism2mib_groupaddress },
620 { DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address28,
621 F_STA | F_READ | F_WRITE,
623 prism2mib_groupaddress },
624 { DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address29,
625 F_STA | F_READ | F_WRITE,
627 prism2mib_groupaddress },
628 { DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address30,
629 F_STA | F_READ | F_WRITE,
631 prism2mib_groupaddress },
632 { DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address31,
633 F_STA | F_READ | F_WRITE,
635 prism2mib_groupaddress },
636 { DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address32,
637 F_STA | F_READ | F_WRITE,
639 prism2mib_groupaddress },
643 { DIDmib_dot11phy_dot11PhyOperationTable_dot11PHYType,
644 F_AP | F_STA | F_READ,
645 HFA384x_RID_PHYTYPE, 0, 0,
647 { DIDmib_dot11phy_dot11PhyOperationTable_dot11TempType,
648 F_AP | F_STA | F_READ,
649 HFA384x_RID_TEMPTYPE, 0, 0,
651 { DIDmib_dot11phy_dot11PhyDSSSTable_dot11CurrentChannel,
653 HFA384x_RID_CURRENTCHANNEL, 0, 0,
655 { DIDmib_dot11phy_dot11PhyDSSSTable_dot11CurrentChannel,
657 HFA384x_RID_CNFOWNCHANNEL, 0, 0,
659 { DIDmib_dot11phy_dot11PhyDSSSTable_dot11CurrentCCAMode,
660 F_AP | F_STA | F_READ,
661 HFA384x_RID_CCAMODE, 0, 0,
666 { DIDmib_p2_p2Table_p2MMTx,
667 F_AP | F_STA | F_READ | F_WRITE,
670 { DIDmib_p2_p2Table_p2EarlyBeacon,
671 F_AP | F_READ | F_WRITE,
673 prism2mib_appcfinfoflag },
674 { DIDmib_p2_p2Table_p2ReceivedFrameStatistics,
675 F_AP | F_STA | F_READ,
678 { DIDmib_p2_p2Table_p2CommunicationTallies,
679 F_AP | F_STA | F_READ,
682 { DIDmib_p2_p2Table_p2Authenticated,
686 { DIDmib_p2_p2Table_p2Associated,
690 { DIDmib_p2_p2Table_p2PowerSaveUserCount,
694 { DIDmib_p2_p2Table_p2Comment,
695 F_AP | F_STA | F_READ | F_WRITE,
698 { DIDmib_p2_p2Table_p2AccessMode,
699 F_AP | F_READ | F_WRITE,
702 { DIDmib_p2_p2Table_p2AccessAllow,
703 F_AP | F_READ | F_WRITE,
706 { DIDmib_p2_p2Table_p2AccessDeny,
707 F_AP | F_READ | F_WRITE,
710 { DIDmib_p2_p2Table_p2ChannelInfoResults,
717 { DIDmib_p2_p2Static_p2CnfPortType,
718 F_STA | F_READ | F_WRITE,
719 HFA384x_RID_CNFPORTTYPE, 0, 0,
721 { DIDmib_p2_p2Static_p2CnfOwnMACAddress,
722 F_AP | F_STA | F_READ | F_WRITE,
723 HFA384x_RID_CNFOWNMACADDR, HFA384x_RID_CNFOWNMACADDR_LEN, 0,
724 prism2mib_bytearea2pstr },
725 { DIDmib_p2_p2Static_p2CnfDesiredSSID,
726 F_STA | F_READ | F_WRITE,
727 HFA384x_RID_CNFDESIREDSSID, HFA384x_RID_CNFDESIREDSSID_LEN, 0,
728 prism2mib_bytestr2pstr },
729 { DIDmib_p2_p2Static_p2CnfOwnChannel,
730 F_AP | F_STA | F_READ | F_WRITE,
731 HFA384x_RID_CNFOWNCHANNEL, 0, 0,
733 { DIDmib_p2_p2Static_p2CnfOwnSSID,
734 F_AP | F_STA | F_READ | F_WRITE,
735 HFA384x_RID_CNFOWNSSID, HFA384x_RID_CNFOWNSSID_LEN, 0,
736 prism2mib_bytestr2pstr },
737 { DIDmib_p2_p2Static_p2CnfOwnATIMWindow,
738 F_STA | F_READ | F_WRITE,
739 HFA384x_RID_CNFOWNATIMWIN, 0, 0,
741 { DIDmib_p2_p2Static_p2CnfSystemScale,
742 F_AP | F_STA | F_READ | F_WRITE,
743 HFA384x_RID_CNFSYSSCALE, 0, 0,
745 { DIDmib_p2_p2Static_p2CnfMaxDataLength,
746 F_AP | F_STA | F_READ | F_WRITE,
747 HFA384x_RID_CNFMAXDATALEN, 0, 0,
749 { DIDmib_p2_p2Static_p2CnfWDSAddress,
750 F_STA | F_READ | F_WRITE,
751 HFA384x_RID_CNFWDSADDR, HFA384x_RID_CNFWDSADDR_LEN, 0,
752 prism2mib_bytearea2pstr },
753 { DIDmib_p2_p2Static_p2CnfPMEnabled,
754 F_STA | F_READ | F_WRITE,
755 HFA384x_RID_CNFPMENABLED, 0, 0,
757 { DIDmib_p2_p2Static_p2CnfPMEPS,
758 F_STA | F_READ | F_WRITE,
759 HFA384x_RID_CNFPMEPS, 0, 0,
761 { DIDmib_p2_p2Static_p2CnfMulticastReceive,
762 F_STA | F_READ | F_WRITE,
763 HFA384x_RID_CNFMULTICASTRX, 0, 0,
765 { DIDmib_p2_p2Static_p2CnfMaxSleepDuration,
766 F_STA | F_READ | F_WRITE,
767 HFA384x_RID_CNFMAXSLEEPDUR, 0, 0,
769 { DIDmib_p2_p2Static_p2CnfPMHoldoverDuration,
770 F_STA | F_READ | F_WRITE,
771 HFA384x_RID_CNFPMHOLDDUR, 0, 0,
773 { DIDmib_p2_p2Static_p2CnfOwnName,
774 F_AP | F_STA | F_READ | F_WRITE,
775 HFA384x_RID_CNFOWNNAME, HFA384x_RID_CNFOWNNAME_LEN, 0,
776 prism2mib_bytestr2pstr },
777 { DIDmib_p2_p2Static_p2CnfOwnDTIMPeriod,
778 F_AP | F_STA | F_READ | F_WRITE,
779 HFA384x_RID_CNFOWNDTIMPER, 0, 0,
781 { DIDmib_p2_p2Static_p2CnfWDSAddress1,
782 F_AP | F_READ | F_WRITE,
783 HFA384x_RID_CNFWDSADDR1, HFA384x_RID_CNFWDSADDR1_LEN, 0,
784 prism2mib_bytearea2pstr },
785 { DIDmib_p2_p2Static_p2CnfWDSAddress2,
786 F_AP | F_READ | F_WRITE,
787 HFA384x_RID_CNFWDSADDR2, HFA384x_RID_CNFWDSADDR2_LEN, 0,
788 prism2mib_bytearea2pstr },
789 { DIDmib_p2_p2Static_p2CnfWDSAddress3,
790 F_AP | F_READ | F_WRITE,
791 HFA384x_RID_CNFWDSADDR3, HFA384x_RID_CNFWDSADDR3_LEN, 0,
792 prism2mib_bytearea2pstr },
793 { DIDmib_p2_p2Static_p2CnfWDSAddress4,
794 F_AP | F_READ | F_WRITE,
795 HFA384x_RID_CNFWDSADDR4, HFA384x_RID_CNFWDSADDR4_LEN, 0,
796 prism2mib_bytearea2pstr },
797 { DIDmib_p2_p2Static_p2CnfWDSAddress5,
798 F_AP | F_READ | F_WRITE,
799 HFA384x_RID_CNFWDSADDR5, HFA384x_RID_CNFWDSADDR5_LEN, 0,
800 prism2mib_bytearea2pstr },
801 { DIDmib_p2_p2Static_p2CnfWDSAddress6,
802 F_AP | F_READ | F_WRITE,
803 HFA384x_RID_CNFWDSADDR6, HFA384x_RID_CNFWDSADDR6_LEN, 0,
804 prism2mib_bytearea2pstr },
805 { DIDmib_p2_p2Static_p2CnfMulticastPMBuffering,
806 F_AP | F_READ | F_WRITE,
807 HFA384x_RID_CNFMCASTPMBUFF, 0, 0,
809 { DIDmib_p2_p2Static_p2CnfWEPDefaultKeyID,
810 F_AP | F_STA | F_READ | F_WRITE,
811 HFA384x_RID_CNFWEPDEFAULTKEYID, 0, 0,
813 { DIDmib_p2_p2Static_p2CnfWEPDefaultKey0,
814 F_AP | F_STA | F_WRITE,
815 HFA384x_RID_CNFWEPDEFAULTKEY0, 0, 0,
816 prism2mib_wepdefaultkey },
817 { DIDmib_p2_p2Static_p2CnfWEPDefaultKey1,
818 F_AP | F_STA | F_WRITE,
819 HFA384x_RID_CNFWEPDEFAULTKEY1, 0, 0,
820 prism2mib_wepdefaultkey },
821 { DIDmib_p2_p2Static_p2CnfWEPDefaultKey2,
822 F_AP | F_STA | F_WRITE,
823 HFA384x_RID_CNFWEPDEFAULTKEY2, 0, 0,
824 prism2mib_wepdefaultkey },
825 { DIDmib_p2_p2Static_p2CnfWEPDefaultKey3,
826 F_AP | F_STA | F_WRITE,
827 HFA384x_RID_CNFWEPDEFAULTKEY3, 0, 0,
828 prism2mib_wepdefaultkey },
829 { DIDmib_p2_p2Static_p2CnfWEPFlags,
830 F_AP | F_STA | F_READ | F_WRITE,
831 HFA384x_RID_CNFWEPFLAGS, 0, 0,
833 { DIDmib_p2_p2Static_p2CnfAuthentication,
834 F_AP | F_STA | F_READ | F_WRITE,
835 HFA384x_RID_CNFAUTHENTICATION, 0, 0,
837 { DIDmib_p2_p2Static_p2CnfMaxAssociatedStations,
838 F_AP | F_READ | F_WRITE,
839 HFA384x_RID_CNFMAXASSOCSTATIONS, 0, 0,
841 { DIDmib_p2_p2Static_p2CnfTxControl,
842 F_AP | F_STA | F_READ | F_WRITE,
843 HFA384x_RID_CNFTXCONTROL, 0, 0,
845 { DIDmib_p2_p2Static_p2CnfRoamingMode,
846 F_STA | F_READ | F_WRITE,
847 HFA384x_RID_CNFROAMINGMODE, 0, 0,
849 { DIDmib_p2_p2Static_p2CnfHostAuthentication,
850 F_AP | F_READ | F_WRITE,
851 HFA384x_RID_CNFHOSTAUTHASSOC, 0, 0,
853 { DIDmib_p2_p2Static_p2CnfRcvCrcError,
854 F_AP | F_STA | F_READ | F_WRITE,
855 HFA384x_RID_CNFRCVCRCERROR, 0, 0,
857 { DIDmib_p2_p2Static_p2CnfAltRetryCount,
858 F_AP | F_STA | F_READ | F_WRITE,
859 HFA384x_RID_CNFALTRETRYCNT, 0, 0,
861 { DIDmib_p2_p2Static_p2CnfBeaconInterval,
862 F_AP | F_READ | F_WRITE,
863 HFA384x_RID_CNFAPBCNINT, 0, 0,
865 { DIDmib_p2_p2Static_p2CnfMediumOccupancyLimit,
866 F_AP | F_READ | F_WRITE,
867 HFA384x_RID_CNFAPPCFINFO, HFA384x_RID_CNFAPPCFINFO_LEN, 0,
868 prism2mib_uint32offset },
869 { DIDmib_p2_p2Static_p2CnfCFPPeriod,
870 F_AP | F_READ | F_WRITE,
871 HFA384x_RID_CNFAPPCFINFO, HFA384x_RID_CNFAPPCFINFO_LEN, 1,
872 prism2mib_uint32offset },
873 { DIDmib_p2_p2Static_p2CnfCFPMaxDuration,
874 F_AP | F_READ | F_WRITE,
875 HFA384x_RID_CNFAPPCFINFO, HFA384x_RID_CNFAPPCFINFO_LEN, 2,
876 prism2mib_uint32offset },
877 { DIDmib_p2_p2Static_p2CnfCFPFlags,
878 F_AP | F_READ | F_WRITE,
879 HFA384x_RID_CNFAPPCFINFO, HFA384x_RID_CNFAPPCFINFO_LEN, 3,
880 prism2mib_uint32offset },
881 { DIDmib_p2_p2Static_p2CnfSTAPCFInfo,
882 F_STA | F_READ | F_WRITE,
883 HFA384x_RID_CNFSTAPCFINFO, 0, 0,
885 { DIDmib_p2_p2Static_p2CnfPriorityQUsage,
886 F_AP | F_STA | F_READ | F_WRITE,
887 HFA384x_RID_CNFPRIORITYQUSAGE, HFA384x_RID_CNFPRIOQUSAGE_LEN, 0,
888 prism2mib_uint32array },
889 { DIDmib_p2_p2Static_p2CnfTIMCtrl,
890 F_AP | F_STA | F_READ | F_WRITE,
891 HFA384x_RID_CNFTIMCTRL, 0, 0,
893 { DIDmib_p2_p2Static_p2CnfThirty2Tally,
894 F_AP | F_STA | F_READ | F_WRITE,
895 HFA384x_RID_CNFTHIRTY2TALLY, 0, 0,
897 { DIDmib_p2_p2Static_p2CnfEnhSecurity,
898 F_AP | F_READ | F_WRITE,
899 HFA384x_RID_CNFENHSECURITY, 0, 0,
901 { DIDmib_p2_p2Static_p2CnfShortPreamble,
902 F_AP | F_STA | F_READ | F_WRITE,
903 HFA384x_RID_CNFSHORTPREAMBLE, 0, 0,
904 prism2mib_preamble },
905 { DIDmib_p2_p2Static_p2CnfExcludeLongPreamble,
906 F_AP | F_READ | F_WRITE,
907 HFA384x_RID_CNFEXCLONGPREAMBLE, 0, 0,
909 { DIDmib_p2_p2Static_p2CnfAuthenticationRspTO,
910 F_STA | F_READ | F_WRITE,
911 HFA384x_RID_CNFAUTHRSPTIMEOUT, 0, 0,
913 { DIDmib_p2_p2Static_p2CnfBasicRates,
914 F_AP | F_STA | F_READ | F_WRITE,
915 HFA384x_RID_CNFBASICRATES, 0, 0,
917 { DIDmib_p2_p2Static_p2CnfSupportedRates,
918 F_AP | F_STA | F_READ | F_WRITE,
919 HFA384x_RID_CNFSUPPRATES, 0, 0,
922 /* p2Dynamic MIB's */
924 { DIDmib_p2_p2Dynamic_p2CreateIBSS,
925 F_STA | F_READ | F_WRITE,
926 HFA384x_RID_CREATEIBSS, 0, 0,
928 { DIDmib_p2_p2Dynamic_p2FragmentationThreshold,
929 F_STA | F_READ | F_WRITE,
930 HFA384x_RID_FRAGTHRESH, 0, 0,
931 prism2mib_fragmentationthreshold },
932 { DIDmib_p2_p2Dynamic_p2RTSThreshold,
933 F_STA | F_READ | F_WRITE,
934 HFA384x_RID_RTSTHRESH, 0, 0,
936 { DIDmib_p2_p2Dynamic_p2TxRateControl,
937 F_STA | F_READ | F_WRITE,
938 HFA384x_RID_TXRATECNTL, 0, 0,
940 { DIDmib_p2_p2Dynamic_p2PromiscuousMode,
941 F_STA | F_READ | F_WRITE,
942 HFA384x_RID_PROMISCMODE, 0, 0,
944 { DIDmib_p2_p2Dynamic_p2FragmentationThreshold0,
945 F_AP | F_READ | F_WRITE,
946 HFA384x_RID_FRAGTHRESH0, 0, 0,
947 prism2mib_fragmentationthreshold },
948 { DIDmib_p2_p2Dynamic_p2FragmentationThreshold1,
949 F_AP | F_READ | F_WRITE,
950 HFA384x_RID_FRAGTHRESH1, 0, 0,
951 prism2mib_fragmentationthreshold },
952 { DIDmib_p2_p2Dynamic_p2FragmentationThreshold2,
953 F_AP | F_READ | F_WRITE,
954 HFA384x_RID_FRAGTHRESH2, 0, 0,
955 prism2mib_fragmentationthreshold },
956 { DIDmib_p2_p2Dynamic_p2FragmentationThreshold3,
957 F_AP | F_READ | F_WRITE,
958 HFA384x_RID_FRAGTHRESH3, 0, 0,
959 prism2mib_fragmentationthreshold },
960 { DIDmib_p2_p2Dynamic_p2FragmentationThreshold4,
961 F_AP | F_READ | F_WRITE,
962 HFA384x_RID_FRAGTHRESH4, 0, 0,
963 prism2mib_fragmentationthreshold },
964 { DIDmib_p2_p2Dynamic_p2FragmentationThreshold5,
965 F_AP | F_READ | F_WRITE,
966 HFA384x_RID_FRAGTHRESH5, 0, 0,
967 prism2mib_fragmentationthreshold },
968 { DIDmib_p2_p2Dynamic_p2FragmentationThreshold6,
969 F_AP | F_READ | F_WRITE,
970 HFA384x_RID_FRAGTHRESH6, 0, 0,
971 prism2mib_fragmentationthreshold },
972 { DIDmib_p2_p2Dynamic_p2RTSThreshold0,
973 F_AP | F_READ | F_WRITE,
974 HFA384x_RID_RTSTHRESH0, 0, 0,
976 { DIDmib_p2_p2Dynamic_p2RTSThreshold1,
977 F_AP | F_READ | F_WRITE,
978 HFA384x_RID_RTSTHRESH1, 0, 0,
980 { DIDmib_p2_p2Dynamic_p2RTSThreshold2,
981 F_AP | F_READ | F_WRITE,
982 HFA384x_RID_RTSTHRESH2, 0, 0,
984 { DIDmib_p2_p2Dynamic_p2RTSThreshold3,
985 F_AP | F_READ | F_WRITE,
986 HFA384x_RID_RTSTHRESH3, 0, 0,
988 { DIDmib_p2_p2Dynamic_p2RTSThreshold4,
989 F_AP | F_READ | F_WRITE,
990 HFA384x_RID_RTSTHRESH4, 0, 0,
992 { DIDmib_p2_p2Dynamic_p2RTSThreshold5,
993 F_AP | F_READ | F_WRITE,
994 HFA384x_RID_RTSTHRESH5, 0, 0,
996 { DIDmib_p2_p2Dynamic_p2RTSThreshold6,
997 F_AP | F_READ | F_WRITE,
998 HFA384x_RID_RTSTHRESH6, 0, 0,
1000 { DIDmib_p2_p2Dynamic_p2TxRateControl0,
1001 F_AP | F_READ | F_WRITE,
1002 HFA384x_RID_TXRATECNTL0, 0, 0,
1004 { DIDmib_p2_p2Dynamic_p2TxRateControl1,
1005 F_AP | F_READ | F_WRITE,
1006 HFA384x_RID_TXRATECNTL1, 0, 0,
1008 { DIDmib_p2_p2Dynamic_p2TxRateControl2,
1009 F_AP | F_READ | F_WRITE,
1010 HFA384x_RID_TXRATECNTL2, 0, 0,
1012 { DIDmib_p2_p2Dynamic_p2TxRateControl3,
1013 F_AP | F_READ | F_WRITE,
1014 HFA384x_RID_TXRATECNTL3, 0, 0,
1016 { DIDmib_p2_p2Dynamic_p2TxRateControl4,
1017 F_AP | F_READ | F_WRITE,
1018 HFA384x_RID_TXRATECNTL4, 0, 0,
1020 { DIDmib_p2_p2Dynamic_p2TxRateControl5,
1021 F_AP | F_READ | F_WRITE,
1022 HFA384x_RID_TXRATECNTL5, 0, 0,
1024 { DIDmib_p2_p2Dynamic_p2TxRateControl6,
1025 F_AP | F_READ | F_WRITE,
1026 HFA384x_RID_TXRATECNTL6, 0, 0,
1029 /* p2Behavior MIB's */
1031 { DIDmib_p2_p2Behavior_p2TickTime,
1032 F_AP | F_STA | F_READ | F_WRITE,
1033 HFA384x_RID_ITICKTIME, 0, 0,
1038 { DIDmib_p2_p2NIC_p2MaxLoadTime,
1039 F_AP | F_STA | F_READ,
1040 HFA384x_RID_MAXLOADTIME, 0, 0,
1042 { DIDmib_p2_p2NIC_p2DLBufferPage,
1043 F_AP | F_STA | F_READ,
1044 HFA384x_RID_DOWNLOADBUFFER, HFA384x_RID_DOWNLOADBUFFER_LEN, 0,
1045 prism2mib_uint32offset },
1046 { DIDmib_p2_p2NIC_p2DLBufferOffset,
1047 F_AP | F_STA | F_READ,
1048 HFA384x_RID_DOWNLOADBUFFER, HFA384x_RID_DOWNLOADBUFFER_LEN, 1,
1049 prism2mib_uint32offset },
1050 { DIDmib_p2_p2NIC_p2DLBufferLength,
1051 F_AP | F_STA | F_READ,
1052 HFA384x_RID_DOWNLOADBUFFER, HFA384x_RID_DOWNLOADBUFFER_LEN, 2,
1053 prism2mib_uint32offset },
1054 { DIDmib_p2_p2NIC_p2PRIIdentity,
1055 F_AP | F_STA | F_READ,
1056 HFA384x_RID_PRIIDENTITY, HFA384x_RID_PRIIDENTITY_LEN, 0,
1057 prism2mib_uint32array },
1058 { DIDmib_p2_p2NIC_p2PRISupRange,
1059 F_AP | F_STA | F_READ,
1060 HFA384x_RID_PRISUPRANGE, HFA384x_RID_PRISUPRANGE_LEN, 0,
1061 prism2mib_uint32array },
1062 { DIDmib_p2_p2NIC_p2CFIActRanges,
1063 F_AP | F_STA | F_READ,
1064 HFA384x_RID_PRI_CFIACTRANGES, HFA384x_RID_CFIACTRANGES_LEN, 0,
1065 prism2mib_uint32array },
1066 { DIDmib_p2_p2NIC_p2BuildSequence,
1067 F_AP | F_STA | F_READ,
1068 HFA384x_RID_BUILDSEQ, HFA384x_RID_BUILDSEQ_LEN, 0,
1069 prism2mib_uint32array },
1070 { DIDmib_p2_p2NIC_p2PrimaryFWID,
1071 F_AP | F_STA | F_READ,
1074 { DIDmib_p2_p2NIC_p2SecondaryFWID,
1075 F_AP | F_STA | F_READ,
1078 { DIDmib_p2_p2NIC_p2TertiaryFWID,
1082 { DIDmib_p2_p2NIC_p2NICSerialNumber,
1083 F_AP | F_STA | F_READ,
1084 HFA384x_RID_NICSERIALNUMBER, HFA384x_RID_NICSERIALNUMBER_LEN, 0,
1085 prism2mib_bytearea2pstr },
1086 { DIDmib_p2_p2NIC_p2NICIdentity,
1087 F_AP | F_STA | F_READ,
1088 HFA384x_RID_NICIDENTITY, HFA384x_RID_NICIDENTITY_LEN, 0,
1089 prism2mib_uint32array },
1090 { DIDmib_p2_p2NIC_p2MFISupRange,
1091 F_AP | F_STA | F_READ,
1092 HFA384x_RID_MFISUPRANGE, HFA384x_RID_MFISUPRANGE_LEN, 0,
1093 prism2mib_uint32array },
1094 { DIDmib_p2_p2NIC_p2CFISupRange,
1095 F_AP | F_STA | F_READ,
1096 HFA384x_RID_CFISUPRANGE, HFA384x_RID_CFISUPRANGE_LEN, 0,
1097 prism2mib_uint32array },
1098 { DIDmib_p2_p2NIC_p2ChannelList,
1099 F_AP | F_STA | F_READ,
1100 HFA384x_RID_CHANNELLIST, 0, 0,
1102 { DIDmib_p2_p2NIC_p2RegulatoryDomains,
1103 F_AP | F_STA | F_READ,
1104 HFA384x_RID_REGULATORYDOMAINS, HFA384x_RID_REGULATORYDOMAINS_LEN, 0,
1105 prism2mib_regulatorydomains },
1106 { DIDmib_p2_p2NIC_p2TempType,
1107 F_AP | F_STA | F_READ,
1108 HFA384x_RID_TEMPTYPE, 0, 0,
1110 { DIDmib_p2_p2NIC_p2STAIdentity,
1111 F_AP | F_STA | F_READ,
1112 HFA384x_RID_STAIDENTITY, HFA384x_RID_STAIDENTITY_LEN, 0,
1113 prism2mib_uint32array },
1114 { DIDmib_p2_p2NIC_p2STASupRange,
1115 F_AP | F_STA | F_READ,
1116 HFA384x_RID_STASUPRANGE, HFA384x_RID_STASUPRANGE_LEN, 0,
1117 prism2mib_uint32array },
1118 { DIDmib_p2_p2NIC_p2MFIActRanges,
1119 F_AP | F_STA | F_READ,
1120 HFA384x_RID_STA_MFIACTRANGES, HFA384x_RID_MFIACTRANGES_LEN, 0,
1121 prism2mib_uint32array },
1122 { DIDmib_p2_p2NIC_p2STACFIActRanges,
1123 F_AP | F_STA | F_READ,
1124 HFA384x_RID_STA_CFIACTRANGES, HFA384x_RID_CFIACTRANGES2_LEN, 0,
1125 prism2mib_uint32array },
1129 { DIDmib_p2_p2MAC_p2PortStatus,
1131 HFA384x_RID_PORTSTATUS, 0, 0,
1133 { DIDmib_p2_p2MAC_p2CurrentSSID,
1135 HFA384x_RID_CURRENTSSID, HFA384x_RID_CURRENTSSID_LEN, 0,
1136 prism2mib_bytestr2pstr },
1137 { DIDmib_p2_p2MAC_p2CurrentBSSID,
1139 HFA384x_RID_CURRENTBSSID, HFA384x_RID_CURRENTBSSID_LEN, 0,
1140 prism2mib_bytearea2pstr },
1141 { DIDmib_p2_p2MAC_p2CommsQuality,
1143 HFA384x_RID_COMMSQUALITY, HFA384x_RID_COMMSQUALITY_LEN, 0,
1144 prism2mib_uint32array },
1145 { DIDmib_p2_p2MAC_p2CommsQualityCQ,
1147 HFA384x_RID_COMMSQUALITY, HFA384x_RID_COMMSQUALITY_LEN, 0,
1148 prism2mib_uint32offset },
1149 { DIDmib_p2_p2MAC_p2CommsQualityASL,
1151 HFA384x_RID_COMMSQUALITY, HFA384x_RID_COMMSQUALITY_LEN, 1,
1152 prism2mib_uint32offset },
1153 { DIDmib_p2_p2MAC_p2CommsQualityANL,
1155 HFA384x_RID_COMMSQUALITY, HFA384x_RID_COMMSQUALITY_LEN, 2,
1156 prism2mib_uint32offset },
1157 { DIDmib_p2_p2MAC_p2dbmCommsQuality,
1159 HFA384x_RID_DBMCOMMSQUALITY, HFA384x_RID_DBMCOMMSQUALITY_LEN, 0,
1160 prism2mib_uint32array },
1161 { DIDmib_p2_p2MAC_p2dbmCommsQualityCQ,
1163 HFA384x_RID_COMMSQUALITY, HFA384x_RID_COMMSQUALITY_LEN, 0,
1164 prism2mib_uint32offset },
1165 { DIDmib_p2_p2MAC_p2dbmCommsQualityASL,
1167 HFA384x_RID_COMMSQUALITY, HFA384x_RID_COMMSQUALITY_LEN, 1,
1168 prism2mib_uint32offset },
1169 { DIDmib_p2_p2MAC_p2dbmCommsQualityANL,
1171 HFA384x_RID_COMMSQUALITY, HFA384x_RID_COMMSQUALITY_LEN, 2,
1172 prism2mib_uint32offset },
1173 { DIDmib_p2_p2MAC_p2CurrentTxRate,
1175 HFA384x_RID_CURRENTTXRATE, 0, 0,
1177 { DIDmib_p2_p2MAC_p2CurrentBeaconInterval,
1178 F_AP | F_STA | F_READ,
1179 HFA384x_RID_CURRENTBCNINT, 0, 0,
1181 { DIDmib_p2_p2MAC_p2StaCurrentScaleThresholds,
1183 HFA384x_RID_CURRENTSCALETHRESH, HFA384x_RID_STACURSCALETHRESH_LEN, 0,
1184 prism2mib_uint32array },
1185 { DIDmib_p2_p2MAC_p2APCurrentScaleThresholds,
1187 HFA384x_RID_CURRENTSCALETHRESH, HFA384x_RID_APCURSCALETHRESH_LEN, 0,
1188 prism2mib_uint32array },
1189 { DIDmib_p2_p2MAC_p2ProtocolRspTime,
1190 F_AP | F_STA | F_READ,
1191 HFA384x_RID_PROTOCOLRSPTIME, 0, 0,
1193 { DIDmib_p2_p2MAC_p2ShortRetryLimit,
1194 F_AP | F_STA | F_READ,
1195 HFA384x_RID_SHORTRETRYLIMIT, 0, 0,
1197 { DIDmib_p2_p2MAC_p2LongRetryLimit,
1198 F_AP | F_STA | F_READ,
1199 HFA384x_RID_LONGRETRYLIMIT, 0, 0,
1201 { DIDmib_p2_p2MAC_p2MaxTransmitLifetime,
1202 F_AP | F_STA | F_READ,
1203 HFA384x_RID_MAXTXLIFETIME, 0, 0,
1205 { DIDmib_p2_p2MAC_p2MaxReceiveLifetime,
1206 F_AP | F_STA | F_READ,
1207 HFA384x_RID_MAXRXLIFETIME, 0, 0,
1209 { DIDmib_p2_p2MAC_p2CFPollable,
1211 HFA384x_RID_CFPOLLABLE, 0, 0,
1213 { DIDmib_p2_p2MAC_p2AuthenticationAlgorithms,
1214 F_AP | F_STA | F_READ,
1215 HFA384x_RID_AUTHALGORITHMS, HFA384x_RID_AUTHALGORITHMS_LEN, 0,
1216 prism2mib_uint32array },
1217 { DIDmib_p2_p2MAC_p2PrivacyOptionImplemented,
1218 F_AP | F_STA | F_READ,
1219 HFA384x_RID_PRIVACYOPTIMP, 0, 0,
1221 { DIDmib_p2_p2MAC_p2CurrentTxRate1,
1223 HFA384x_RID_CURRENTTXRATE1, 0, 0,
1225 { DIDmib_p2_p2MAC_p2CurrentTxRate2,
1227 HFA384x_RID_CURRENTTXRATE2, 0, 0,
1229 { DIDmib_p2_p2MAC_p2CurrentTxRate3,
1231 HFA384x_RID_CURRENTTXRATE3, 0, 0,
1233 { DIDmib_p2_p2MAC_p2CurrentTxRate4,
1235 HFA384x_RID_CURRENTTXRATE4, 0, 0,
1237 { DIDmib_p2_p2MAC_p2CurrentTxRate5,
1239 HFA384x_RID_CURRENTTXRATE5, 0, 0,
1241 { DIDmib_p2_p2MAC_p2CurrentTxRate6,
1243 HFA384x_RID_CURRENTTXRATE6, 0, 0,
1245 { DIDmib_p2_p2MAC_p2OwnMACAddress,
1247 HFA384x_RID_OWNMACADDRESS, HFA384x_RID_OWNMACADDRESS_LEN, 0,
1248 prism2mib_bytearea2pstr },
1252 { DIDmib_p2_p2Modem_p2PHYType,
1253 F_AP | F_STA | F_READ,
1254 HFA384x_RID_PHYTYPE, 0, 0,
1256 { DIDmib_p2_p2Modem_p2CurrentChannel,
1257 F_AP | F_STA | F_READ,
1258 HFA384x_RID_CURRENTCHANNEL, 0, 0,
1260 { DIDmib_p2_p2Modem_p2CurrentPowerState,
1261 F_AP | F_STA | F_READ,
1262 HFA384x_RID_CURRENTPOWERSTATE, 0, 0,
1264 { DIDmib_p2_p2Modem_p2CCAMode,
1265 F_AP | F_STA | F_READ,
1266 HFA384x_RID_CCAMODE, 0, 0,
1268 { DIDmib_p2_p2Modem_p2TxPowerMax,
1269 F_AP | F_STA | F_READ | F_WRITE,
1270 HFA384x_RID_TXPOWERMAX, 0, 0,
1272 { DIDmib_dot11phy_dot11PhyTxPowerTable_dot11CurrentTxPowerLevel,
1273 F_AP | F_STA | F_READ | F_WRITE,
1274 HFA384x_RID_TXPOWERMAX, 0, 0,
1276 { DIDmib_p2_p2Modem_p2SupportedDataRates,
1277 F_AP | F_STA | F_READ,
1278 HFA384x_RID_SUPPORTEDDATARATES, HFA384x_RID_SUPPORTEDDATARATES_LEN, 0,
1279 prism2mib_bytestr2pstr },
1281 /* And finally, lnx mibs */
1282 { DIDmib_lnx_lnxConfigTable_lnxRSNAIE,
1283 F_STA | F_READ | F_WRITE,
1284 HFA384x_RID_CNFWPADATA, 0, 0,
1286 { 0, 0, 0, 0, 0, NULL}};
1288 /*----------------------------------------------------------------
1289 These MIB's are not supported at this time:
1291 DIDmib_dot11phy_dot11PhyOperationTable_dot11ChannelAgilityPresent
1292 DIDmib_dot11phy_dot11PhyOperationTable_dot11ChannelAgilityEnabled
1293 DIDmib_dot11phy_dot11PhyDSSSTable_dot11PBCCOptionImplemented
1294 DIDmib_dot11phy_dot11RegDomainsSupportedTable_dot11RegDomainsSupportIndex
1295 DIDmib_dot11phy_dot11SupportedDataRatesTxTable_dot11SupportedDataRatesTxIndex
1296 DIDmib_dot11phy_dot11SupportedDataRatesTxTable_dot11SupportedDataRatesTxValue
1297 DIDmib_dot11phy_dot11SupportedDataRatesRxTable_dot11SupportedDataRatesRxIndex
1298 DIDmib_dot11phy_dot11SupportedDataRatesRxTable_dot11SupportedDataRatesRxValue
1300 DIDmib_dot11phy_dot11RegDomainsSupportedTable_dot11RegDomainsSupportValue
1301 TODO: need to investigate why wlan has this as enumerated and Prism2 has this
1304 DIDmib_dot11phy_dot11PhyDSSSTable_dot11ShortPreambleOptionImplemented
1305 TODO: Find out the firmware version number(s) for identifying
1306 whether the firmware is capable of short preamble. TRUE or FALSE
1307 will be returned based on the version of the firmware.
1309 WEP Key mappings aren't supported in the f/w.
1310 DIDmib_dot11smt_dot11WEPKeyMappingsTable_dot11WEPKeyMappingIndex
1311 DIDmib_dot11smt_dot11WEPKeyMappingsTable_dot11WEPKeyMappingAddress
1312 DIDmib_dot11smt_dot11WEPKeyMappingsTable_dot11WEPKeyMappingWEPOn
1313 DIDmib_dot11smt_dot11WEPKeyMappingsTable_dot11WEPKeyMappingValue
1314 DIDmib_dot11smt_dot11PrivacyTable_dot11WEPKeyMappingLength
1316 TODO: implement counters.
1317 DIDmib_dot11smt_dot11PrivacyTable_dot11WEPICVErrorCount
1318 DIDmib_dot11smt_dot11PrivacyTable_dot11WEPExcludedCount
1319 DIDmib_dot11mac_dot11CountersTable_dot11TransmittedFragmentCount
1320 DIDmib_dot11mac_dot11CountersTable_dot11MulticastTransmittedFrameCount
1321 DIDmib_dot11mac_dot11CountersTable_dot11FailedCount
1322 DIDmib_dot11mac_dot11CountersTable_dot11RetryCount
1323 DIDmib_dot11mac_dot11CountersTable_dot11MultipleRetryCount
1324 DIDmib_dot11mac_dot11CountersTable_dot11FrameDuplicateCount
1325 DIDmib_dot11mac_dot11CountersTable_dot11RTSSuccessCount
1326 DIDmib_dot11mac_dot11CountersTable_dot11RTSFailureCount
1327 DIDmib_dot11mac_dot11CountersTable_dot11ACKFailureCount
1328 DIDmib_dot11mac_dot11CountersTable_dot11ReceivedFragmentCount
1329 DIDmib_dot11mac_dot11CountersTable_dot11MulticastReceivedFrameCount
1330 DIDmib_dot11mac_dot11CountersTable_dot11FCSErrorCount
1331 DIDmib_dot11mac_dot11CountersTable_dot11TransmittedFrameCount
1332 DIDmib_dot11mac_dot11CountersTable_dot11WEPUndecryptableCount
1334 TODO: implement sane values for these.
1335 DIDmib_dot11mac_dot11OperationTable_dot11ManufacturerID
1336 DIDmib_dot11mac_dot11OperationTable_dot11ProductID
1338 Not too worried about these at the moment.
1339 DIDmib_dot11phy_dot11PhyAntennaTable_dot11CurrentTxAntenna
1340 DIDmib_dot11phy_dot11PhyAntennaTable_dot11DiversitySupport
1341 DIDmib_dot11phy_dot11PhyAntennaTable_dot11CurrentRxAntenna
1342 DIDmib_dot11phy_dot11PhyTxPowerTable_dot11NumberSupportedPowerLevels
1343 DIDmib_dot11phy_dot11PhyTxPowerTable_dot11TxPowerLevel1
1344 DIDmib_dot11phy_dot11PhyTxPowerTable_dot11TxPowerLevel2
1345 DIDmib_dot11phy_dot11PhyTxPowerTable_dot11TxPowerLevel3
1346 DIDmib_dot11phy_dot11PhyTxPowerTable_dot11TxPowerLevel4
1347 DIDmib_dot11phy_dot11PhyTxPowerTable_dot11TxPowerLevel5
1348 DIDmib_dot11phy_dot11PhyTxPowerTable_dot11TxPowerLevel6
1349 DIDmib_dot11phy_dot11PhyTxPowerTable_dot11TxPowerLevel7
1350 DIDmib_dot11phy_dot11PhyTxPowerTable_dot11TxPowerLevel8
1351 DIDmib_dot11phy_dot11PhyTxPowerTable_dot11CurrentTxPowerLevel
1353 Ummm, FH and IR don't apply
1354 DIDmib_dot11phy_dot11PhyFHSSTable_dot11HopTime
1355 DIDmib_dot11phy_dot11PhyFHSSTable_dot11CurrentChannelNumber
1356 DIDmib_dot11phy_dot11PhyFHSSTable_dot11MaxDwellTime
1357 DIDmib_dot11phy_dot11PhyFHSSTable_dot11CurrentDwellTime
1358 DIDmib_dot11phy_dot11PhyFHSSTable_dot11CurrentSet
1359 DIDmib_dot11phy_dot11PhyFHSSTable_dot11CurrentPattern
1360 DIDmib_dot11phy_dot11PhyFHSSTable_dot11CurrentIndex
1361 DIDmib_dot11phy_dot11PhyDSSSTable_dot11CCAModeSupported
1362 DIDmib_dot11phy_dot11PhyDSSSTable_dot11EDThreshold
1363 DIDmib_dot11phy_dot11PhyIRTable_dot11CCAWatchdogTimerMax
1364 DIDmib_dot11phy_dot11PhyIRTable_dot11CCAWatchdogCountMax
1365 DIDmib_dot11phy_dot11PhyIRTable_dot11CCAWatchdogTimerMin
1366 DIDmib_dot11phy_dot11PhyIRTable_dot11CCAWatchdogCountMin
1368 We just don't have enough antennas right now to worry about this.
1369 DIDmib_dot11phy_dot11AntennasListTable_dot11AntennaListIndex
1370 DIDmib_dot11phy_dot11AntennasListTable_dot11SupportedTxAntenna
1371 DIDmib_dot11phy_dot11AntennasListTable_dot11SupportedRxAntenna
1372 DIDmib_dot11phy_dot11AntennasListTable_dot11DiversitySelectionRx
1374 ------------------------------------------------------------------*/
1376 /*================================================================*/
1377 /* Function Definitions */
1379 /*----------------------------------------------------------------
1380 * prism2mgmt_mibset_mibget
1382 * Set the value of a mib item.
1385 * wlandev wlan device structure
1386 * msgp ptr to msg buffer
1389 * 0 success and done
1390 * <0 success, but we're waiting for something to finish.
1391 * >0 an error occurred while handling the message.
1395 * process thread (usually)
1397 ----------------------------------------------------------------*/
1399 int prism2mgmt_mibset_mibget(wlandevice_t *wlandev, void *msgp)
1401 hfa384x_t *hw = wlandev->priv;
1406 p80211msg_dot11req_mibset_t *msg = msgp;
1407 p80211itemd_t *mibitem;
1411 msg->resultcode.status = P80211ENUM_msgitem_status_data_ok;
1412 msg->resultcode.data = P80211ENUM_resultcode_success;
1415 ** Determine if this is an Access Point or a station.
1418 which = hw->ap ? F_AP : F_STA;
1421 ** Find the MIB in the MIB table. Note that a MIB may be in the
1422 ** table twice...once for an AP and once for a station. Make sure
1423 ** to get the correct one. Note that DID=0 marks the end of the
1427 mibitem = (p80211itemd_t *) msg->mibattribute.data;
1429 for (mib = mibtab; mib->did != 0; mib++)
1430 if (mib->did == mibitem->did && (mib->flag & which))
1433 if (mib->did == 0) {
1434 msg->resultcode.data = P80211ENUM_resultcode_not_supported;
1439 ** Determine if this is a "mibget" or a "mibset". If this is a
1440 ** "mibget", then make sure that the MIB may be read. Otherwise,
1441 ** this is a "mibset" so make make sure that the MIB may be written.
1444 isget = (msg->msgcode == DIDmsg_dot11req_mibget);
1447 if (!(mib->flag & F_READ)) {
1448 msg->resultcode.data =
1449 P80211ENUM_resultcode_cant_get_writeonly_mib;
1453 if (!(mib->flag & F_WRITE)) {
1454 msg->resultcode.data =
1455 P80211ENUM_resultcode_cant_set_readonly_mib;
1461 ** Execute the MIB function. If things worked okay, then make
1462 ** sure that the MIB function also worked okay. If so, and this
1463 ** is a "mibget", then the status value must be set for both the
1464 ** "mibattribute" parameter and the mib item within the data
1465 ** portion of the "mibattribute".
1468 result = mib->func(mib, isget, wlandev, hw, msg,
1469 (void *) mibitem->data);
1471 if (msg->resultcode.data == P80211ENUM_resultcode_success) {
1473 WLAN_LOG_DEBUG(1, "get/set failure, result=%d\n",
1475 msg->resultcode.data =
1476 P80211ENUM_resultcode_implementation_failure;
1479 msg->mibattribute.status =
1480 P80211ENUM_msgitem_status_data_ok;
1482 P80211ENUM_msgitem_status_data_ok;
1493 /*----------------------------------------------------------------
1494 * prism2mib_bytestr2pstr
1496 * Get/set pstr data to/from a byte string.
1498 * MIB record parameters:
1499 * parm1 Prism2 RID value.
1500 * parm2 Number of bytes of RID data.
1505 * isget MIBGET/MIBSET flag.
1506 * wlandev wlan device structure.
1507 * priv "priv" structure.
1508 * hw "hw" structure.
1509 * msg Message structure.
1516 ----------------------------------------------------------------*/
1518 static int prism2mib_bytestr2pstr(
1521 wlandevice_t *wlandev,
1523 p80211msg_dot11req_mibset_t *msg,
1527 p80211pstrd_t *pstr = (p80211pstrd_t*) data;
1528 UINT8 bytebuf[MIB_TMP_MAXLEN];
1529 hfa384x_bytestr_t *p2bytestr = (hfa384x_bytestr_t*) bytebuf;
1534 result = hfa384x_drvr_getconfig(hw, mib->parm1, bytebuf, mib->parm2);
1535 prism2mgmt_bytestr2pstr(p2bytestr, pstr);
1537 memset(bytebuf, 0, mib->parm2);
1538 prism2mgmt_pstr2bytestr(p2bytestr, pstr);
1539 result = hfa384x_drvr_setconfig(hw, mib->parm1, bytebuf, mib->parm2);
1546 /*----------------------------------------------------------------
1547 * prism2mib_bytearea2pstr
1549 * Get/set pstr data to/from a byte area.
1551 * MIB record parameters:
1552 * parm1 Prism2 RID value.
1553 * parm2 Number of bytes of RID data.
1558 * isget MIBGET/MIBSET flag.
1559 * wlandev wlan device structure.
1560 * priv "priv" structure.
1561 * hw "hw" structure.
1562 * msg Message structure.
1569 ----------------------------------------------------------------*/
1571 static int prism2mib_bytearea2pstr(
1574 wlandevice_t *wlandev,
1576 p80211msg_dot11req_mibset_t *msg,
1580 p80211pstrd_t *pstr = (p80211pstrd_t*) data;
1581 UINT8 bytebuf[MIB_TMP_MAXLEN];
1586 result = hfa384x_drvr_getconfig(hw, mib->parm1, bytebuf, mib->parm2);
1587 prism2mgmt_bytearea2pstr(bytebuf, pstr, mib->parm2);
1589 memset(bytebuf, 0, mib->parm2);
1590 prism2mgmt_pstr2bytearea(bytebuf, pstr);
1591 result = hfa384x_drvr_setconfig(hw, mib->parm1, bytebuf, mib->parm2);
1598 /*----------------------------------------------------------------
1601 * Get/set uint32 data.
1603 * MIB record parameters:
1604 * parm1 Prism2 RID value.
1610 * isget MIBGET/MIBSET flag.
1611 * wlandev wlan device structure.
1612 * priv "priv" structure.
1613 * hw "hw" structure.
1614 * msg Message structure.
1621 ----------------------------------------------------------------*/
1623 static int prism2mib_uint32(
1626 wlandevice_t *wlandev,
1628 p80211msg_dot11req_mibset_t *msg,
1632 UINT32 *uint32 = (UINT32*) data;
1633 UINT8 bytebuf[MIB_TMP_MAXLEN];
1634 UINT16 *wordbuf = (UINT16*) bytebuf;
1639 result = hfa384x_drvr_getconfig16(hw, mib->parm1, wordbuf);
1641 /* [MSM] Removed, getconfig16 returns the value in host order.
1642 * prism2mgmt_prism2int2p80211int(wordbuf, uint32);
1645 /* [MSM] Removed, setconfig16 expects host order.
1646 * prism2mgmt_p80211int2prism2int(wordbuf, uint32);
1649 result = hfa384x_drvr_setconfig16(hw, mib->parm1, *wordbuf);
1656 /*----------------------------------------------------------------
1657 * prism2mib_uint32array
1659 * Get/set an array of uint32 data.
1661 * MIB record parameters:
1662 * parm1 Prism2 RID value.
1663 * parm2 Number of bytes of RID data.
1668 * isget MIBGET/MIBSET flag.
1669 * wlandev wlan device structure.
1670 * priv "priv" structure.
1671 * hw "hw" structure.
1672 * msg Message structure.
1679 ----------------------------------------------------------------*/
1681 static int prism2mib_uint32array(
1684 wlandevice_t *wlandev,
1686 p80211msg_dot11req_mibset_t *msg,
1690 UINT32 *uint32 = (UINT32 *) data;
1691 UINT8 bytebuf[MIB_TMP_MAXLEN];
1692 UINT16 *wordbuf = (UINT16*) bytebuf;
1697 cnt = mib->parm2 / sizeof(UINT16);
1700 result = hfa384x_drvr_getconfig(hw, mib->parm1, wordbuf, mib->parm2);
1701 for (i = 0; i < cnt; i++)
1702 prism2mgmt_prism2int2p80211int(wordbuf+i, uint32+i);
1704 for (i = 0; i < cnt; i++)
1705 prism2mgmt_p80211int2prism2int(wordbuf+i, uint32+i);
1706 result = hfa384x_drvr_setconfig(hw, mib->parm1, wordbuf, mib->parm2);
1713 /*----------------------------------------------------------------
1714 * prism2mib_uint32offset
1716 * Get/set a single element in an array of uint32 data.
1718 * MIB record parameters:
1719 * parm1 Prism2 RID value.
1720 * parm2 Number of bytes of RID data.
1721 * parm3 Element index.
1725 * isget MIBGET/MIBSET flag.
1726 * wlandev wlan device structure.
1727 * priv "priv" structure.
1728 * hw "hw" structure.
1729 * msg Message structure.
1736 ----------------------------------------------------------------*/
1738 static int prism2mib_uint32offset(
1741 wlandevice_t *wlandev,
1743 p80211msg_dot11req_mibset_t *msg,
1747 UINT32 *uint32 = (UINT32*) data;
1748 UINT8 bytebuf[MIB_TMP_MAXLEN];
1749 UINT16 *wordbuf = (UINT16*) bytebuf;
1754 cnt = mib->parm2 / sizeof(UINT16);
1756 result = hfa384x_drvr_getconfig(hw, mib->parm1, wordbuf, mib->parm2);
1759 if (mib->parm3 < cnt)
1760 prism2mgmt_prism2int2p80211int(wordbuf+mib->parm3, uint32);
1764 if (mib->parm3 < cnt) {
1765 prism2mgmt_p80211int2prism2int(wordbuf+mib->parm3, uint32);
1766 result = hfa384x_drvr_setconfig(hw, mib->parm1, wordbuf, mib->parm2);
1775 /*----------------------------------------------------------------
1778 * Get/set truth data.
1780 * MIB record parameters:
1781 * parm1 Prism2 RID value.
1787 * isget MIBGET/MIBSET flag.
1788 * wlandev wlan device structure.
1789 * priv "priv" structure.
1790 * hw "hw" structure.
1791 * msg Message structure.
1798 ----------------------------------------------------------------*/
1800 static int prism2mib_truth(
1803 wlandevice_t *wlandev,
1805 p80211msg_dot11req_mibset_t *msg,
1809 UINT32 *uint32 = (UINT32*) data;
1810 UINT8 bytebuf[MIB_TMP_MAXLEN];
1811 UINT16 *wordbuf = (UINT16*) bytebuf;
1816 result = hfa384x_drvr_getconfig16(hw, mib->parm1, wordbuf);
1817 *uint32 = (*wordbuf) ?
1818 P80211ENUM_truth_true : P80211ENUM_truth_false;
1820 *wordbuf = ((*uint32) == P80211ENUM_truth_true) ? 1 : 0;
1821 result = hfa384x_drvr_setconfig16(hw, mib->parm1, *wordbuf);
1828 /*----------------------------------------------------------------
1833 * MIB record parameters:
1834 * parm1 Prism2 RID value.
1835 * parm2 Bit to get/set.
1840 * isget MIBGET/MIBSET flag.
1841 * wlandev wlan device structure.
1842 * priv "priv" structure.
1843 * hw "hw" structure.
1844 * msg Message structure.
1851 ----------------------------------------------------------------*/
1853 static int prism2mib_flag(
1856 wlandevice_t *wlandev,
1858 p80211msg_dot11req_mibset_t *msg,
1862 UINT32 *uint32 = (UINT32*) data;
1863 UINT8 bytebuf[MIB_TMP_MAXLEN];
1864 UINT16 *wordbuf = (UINT16*) bytebuf;
1869 result = hfa384x_drvr_getconfig16(hw, mib->parm1, wordbuf);
1871 /* [MSM] Removed, getconfig16 returns the value in host order.
1872 * prism2mgmt_prism2int2p80211int(wordbuf, &flags);
1876 *uint32 = (flags & mib->parm2) ?
1877 P80211ENUM_truth_true : P80211ENUM_truth_false;
1879 if ((*uint32) == P80211ENUM_truth_true)
1880 flags |= mib->parm2;
1882 flags &= ~mib->parm2;
1883 /* [MSM] Removed, setconfig16 expects host order.
1884 * prism2mgmt_p80211int2prism2int(wordbuf, &flags);
1887 result = hfa384x_drvr_setconfig16(hw, mib->parm1, *wordbuf);
1895 /*----------------------------------------------------------------
1896 * prism2mib_appcfinfoflag
1898 * Get/set a single flag in the APPCFINFO record.
1900 * MIB record parameters:
1901 * parm1 Bit to get/set.
1907 * isget MIBGET/MIBSET flag.
1908 * wlandev wlan device structure.
1909 * priv "priv" structure.
1910 * hw "hw" structure.
1911 * msg Message structure.
1918 ----------------------------------------------------------------*/
1920 static int prism2mib_appcfinfoflag(
1923 wlandevice_t *wlandev,
1925 p80211msg_dot11req_mibset_t *msg,
1929 UINT32 *uint32 = (UINT32*) data;
1930 UINT8 bytebuf[MIB_TMP_MAXLEN];
1931 UINT16 *wordbuf = (UINT16*) bytebuf;
1936 result = hfa384x_drvr_getconfig(hw, HFA384x_RID_CNFAPPCFINFO,
1937 bytebuf, HFA384x_RID_CNFAPPCFINFO_LEN);
1940 *uint32 = (hfa384x2host_16(wordbuf[3]) & mib->parm1) ?
1941 P80211ENUM_truth_true : P80211ENUM_truth_false;
1943 word = hfa384x2host_16(wordbuf[3]);
1944 word = ((*uint32) == P80211ENUM_truth_true) ?
1945 (word | mib->parm1) : (word & ~mib->parm1);
1946 wordbuf[3] = host2hfa384x_16(word);
1947 result = hfa384x_drvr_setconfig(hw, HFA384x_RID_CNFAPPCFINFO,
1948 bytebuf, HFA384x_RID_CNFAPPCFINFO_LEN);
1956 /*----------------------------------------------------------------
1957 * prism2mib_regulatorydomains
1959 * Get regulatory domain data.
1961 * MIB record parameters:
1962 * parm1 Prism2 RID value.
1963 * parm2 Number of bytes of RID data.
1968 * isget MIBGET/MIBSET flag.
1969 * wlandev wlan device structure.
1970 * priv "priv" structure.
1971 * hw "hw" structure.
1972 * msg Message structure.
1979 ----------------------------------------------------------------*/
1981 static int prism2mib_regulatorydomains(
1984 wlandevice_t *wlandev,
1986 p80211msg_dot11req_mibset_t *msg,
1991 p80211pstrd_t *pstr = (p80211pstrd_t*) data;
1992 UINT8 bytebuf[MIB_TMP_MAXLEN];
1993 UINT16 *wordbuf = (UINT16*) bytebuf;
2000 result = hfa384x_drvr_getconfig(hw, mib->parm1, wordbuf, mib->parm2);
2001 prism2mgmt_prism2int2p80211int(wordbuf, &cnt);
2002 pstr->len = (UINT8) cnt;
2003 memcpy(pstr->data, &wordbuf[1], pstr->len);
2010 /*----------------------------------------------------------------
2011 * prism2mib_wepdefaultkey
2013 * Get/set WEP default keys.
2015 * MIB record parameters:
2016 * parm1 Prism2 RID value.
2017 * parm2 Number of bytes of RID data.
2022 * isget MIBGET/MIBSET flag.
2023 * wlandev wlan device structure.
2024 * priv "priv" structure.
2025 * hw "hw" structure.
2026 * msg Message structure.
2033 ----------------------------------------------------------------*/
2035 static int prism2mib_wepdefaultkey(
2038 wlandevice_t *wlandev,
2040 p80211msg_dot11req_mibset_t *msg,
2044 p80211pstrd_t *pstr = (p80211pstrd_t*) data;
2045 UINT8 bytebuf[MIB_TMP_MAXLEN];
2051 result = 0; /* Should never happen. */
2053 len = (pstr->len > 5) ? HFA384x_RID_CNFWEP128DEFAULTKEY_LEN :
2054 HFA384x_RID_CNFWEPDEFAULTKEY_LEN;
2055 memset(bytebuf, 0, len);
2056 prism2mgmt_pstr2bytearea(bytebuf, pstr);
2057 result = hfa384x_drvr_setconfig(hw, mib->parm1, bytebuf, len);
2064 /*----------------------------------------------------------------
2065 * prism2mib_powermanagement
2067 * Get/set 802.11 power management value. Note that this is defined differently
2068 * by 802.11 and Prism2:
2070 * Meaning 802.11 Prism2
2074 * MIB record parameters:
2075 * parm1 Prism2 RID value.
2081 * isget MIBGET/MIBSET flag.
2082 * wlandev wlan device structure.
2083 * priv "priv" structure.
2084 * hw "hw" structure.
2085 * msg Message structure.
2092 ----------------------------------------------------------------*/
2094 static int prism2mib_powermanagement(
2097 wlandevice_t *wlandev,
2099 p80211msg_dot11req_mibset_t *msg,
2103 UINT32 *uint32 = (UINT32*) data;
2109 result = prism2mib_uint32(mib, isget, wlandev, hw, msg, &value);
2110 *uint32 = (value == 0) ? 1 : 2;
2112 value = ((*uint32) == 1) ? 0 : 1;
2113 result = prism2mib_uint32(mib, isget, wlandev, hw, msg, &value);
2120 /*----------------------------------------------------------------
2121 * prism2mib_preamble
2123 * Get/set Prism2 short preamble
2125 * MIB record parameters:
2126 * parm1 Prism2 RID value.
2132 * isget MIBGET/MIBSET flag.
2133 * wlandev wlan device structure.
2134 * priv "priv" structure.
2135 * hw "hw" structure.
2136 * msg Message structure.
2143 ----------------------------------------------------------------*/
2145 static int prism2mib_preamble(
2148 wlandevice_t *wlandev,
2150 p80211msg_dot11req_mibset_t *msg,
2154 UINT32 *uint32 = (UINT32*) data;
2155 UINT8 bytebuf[MIB_TMP_MAXLEN];
2156 UINT16 *wordbuf = (UINT16*) bytebuf;
2161 result = hfa384x_drvr_getconfig16(hw, mib->parm1, wordbuf);
2165 result = hfa384x_drvr_setconfig16(hw, mib->parm1, *wordbuf);
2172 /*----------------------------------------------------------------
2173 * prism2mib_privacyinvoked
2175 * Get/set the dot11PrivacyInvoked value.
2177 * MIB record parameters:
2178 * parm1 Prism2 RID value.
2179 * parm2 Bit value for PrivacyInvoked flag.
2184 * isget MIBGET/MIBSET flag.
2185 * wlandev wlan device structure.
2186 * priv "priv" structure.
2187 * hw "hw" structure.
2188 * msg Message structure.
2195 ----------------------------------------------------------------*/
2197 static int prism2mib_privacyinvoked(
2200 wlandevice_t *wlandev,
2202 p80211msg_dot11req_mibset_t *msg,
2209 if (wlandev->hostwep & HOSTWEP_DECRYPT) {
2210 if (wlandev->hostwep & HOSTWEP_DECRYPT)
2211 mib->parm2 |= HFA384x_WEPFLAGS_DISABLE_RXCRYPT;
2212 if (wlandev->hostwep & HOSTWEP_ENCRYPT)
2213 mib->parm2 |= HFA384x_WEPFLAGS_DISABLE_TXCRYPT;
2216 result = prism2mib_flag(mib, isget, wlandev, hw, msg, data);
2222 /*----------------------------------------------------------------
2223 * prism2mib_excludeunencrypted
2225 * Get/set the dot11ExcludeUnencrypted value.
2227 * MIB record parameters:
2228 * parm1 Prism2 RID value.
2229 * parm2 Bit value for ExcludeUnencrypted flag.
2234 * isget MIBGET/MIBSET flag.
2235 * wlandev wlan device structure.
2236 * priv "priv" structure.
2237 * hw "hw" structure.
2238 * msg Message structure.
2245 ----------------------------------------------------------------*/
2247 static int prism2mib_excludeunencrypted(
2250 wlandevice_t *wlandev,
2252 p80211msg_dot11req_mibset_t *msg,
2259 result = prism2mib_flag(mib, isget, wlandev, hw, msg, data);
2265 /*----------------------------------------------------------------
2266 * prism2mib_fragmentationthreshold
2268 * Get/set the fragmentation threshold.
2270 * MIB record parameters:
2271 * parm1 Prism2 RID value.
2277 * isget MIBGET/MIBSET flag.
2278 * wlandev wlan device structure.
2279 * priv "priv" structure.
2280 * hw "hw" structure.
2281 * msg Message structure.
2288 ----------------------------------------------------------------*/
2290 static int prism2mib_fragmentationthreshold(
2293 wlandevice_t *wlandev,
2295 p80211msg_dot11req_mibset_t *msg,
2299 UINT32 *uint32 = (UINT32*) data;
2304 if ((*uint32) % 2) {
2305 WLAN_LOG_WARNING("Attempt to set odd number "
2306 "FragmentationThreshold\n");
2307 msg->resultcode.data = P80211ENUM_resultcode_not_supported;
2311 result = prism2mib_uint32(mib, isget, wlandev, hw, msg, data);
2317 /*----------------------------------------------------------------
2318 * prism2mib_operationalrateset
2320 * Get/set the operational rate set.
2322 * MIB record parameters:
2323 * parm1 Prism2 RID value.
2329 * isget MIBGET/MIBSET flag.
2330 * wlandev wlan device structure.
2331 * priv "priv" structure.
2332 * hw "hw" structure.
2333 * msg Message structure.
2340 ----------------------------------------------------------------*/
2342 static int prism2mib_operationalrateset(
2345 wlandevice_t *wlandev,
2347 p80211msg_dot11req_mibset_t *msg,
2351 p80211pstrd_t *pstr = (p80211pstrd_t *) data;
2352 UINT8 bytebuf[MIB_TMP_MAXLEN];
2353 UINT16 *wordbuf = (UINT16*) bytebuf;
2358 result = hfa384x_drvr_getconfig16(hw, mib->parm1, wordbuf);
2359 prism2mgmt_get_oprateset(wordbuf, pstr);
2361 prism2mgmt_set_oprateset(wordbuf, pstr);
2362 result = hfa384x_drvr_setconfig16(hw, mib->parm1, *wordbuf);
2363 result = hfa384x_drvr_setconfig16(hw, HFA384x_RID_CNFSUPPRATES, *wordbuf);
2370 /*----------------------------------------------------------------
2371 * prism2mib_groupaddress
2373 * Get/set the dot11GroupAddressesTable.
2375 * MIB record parameters:
2382 * isget MIBGET/MIBSET flag.
2383 * wlandev wlan device structure.
2384 * priv "priv" structure.
2385 * hw "hw" structure.
2386 * msg Message structure.
2393 ----------------------------------------------------------------*/
2395 static int prism2mib_groupaddress(
2398 wlandevice_t *wlandev,
2400 p80211msg_dot11req_mibset_t *msg,
2404 p80211pstrd_t *pstr = (p80211pstrd_t *) data;
2405 UINT8 bytebuf[MIB_TMP_MAXLEN];
2410 /* TODO: fix this. f/w doesn't support mcast filters */
2413 prism2mgmt_get_grpaddr(mib->did, pstr, hw);
2417 result = prism2mgmt_set_grpaddr(mib->did, bytebuf, pstr, hw);
2419 msg->resultcode.data = P80211ENUM_resultcode_not_supported;
2423 if (hw->dot11_grpcnt <= MAX_PRISM2_GRP_ADDR) {
2424 len = hw->dot11_grpcnt * WLAN_ADDR_LEN;
2425 memcpy(bytebuf, hw->dot11_grp_addr[0], len);
2426 result = hfa384x_drvr_setconfig(hw, HFA384x_RID_GROUPADDR, bytebuf, len);
2429 ** Turn off promiscuous mode if count is equal to MAX. We may
2430 ** have been at a higher count in promiscuous mode and need to
2434 /* but only if we're not already in promisc mode. :) */
2435 if ((hw->dot11_grpcnt == MAX_PRISM2_GRP_ADDR) &&
2436 !( wlandev->netdev->flags & IFF_PROMISC)) {
2437 result = hfa384x_drvr_setconfig16(hw,
2438 HFA384x_RID_PROMISCMODE, 0);
2443 ** Clear group addresses in card and set to promiscuous mode.
2446 memset(bytebuf, 0, sizeof(bytebuf));
2447 result = hfa384x_drvr_setconfig(hw, HFA384x_RID_GROUPADDR,
2450 result = hfa384x_drvr_setconfig16(hw,
2451 HFA384x_RID_PROMISCMODE, 1);
2459 /*----------------------------------------------------------------
2462 * Get the firmware ID.
2464 * MIB record parameters:
2471 * isget MIBGET/MIBSET flag.
2472 * wlandev wlan device structure.
2473 * priv "priv" structure.
2474 * hw "hw" structure.
2475 * msg Message structure.
2482 ----------------------------------------------------------------*/
2484 static int prism2mib_fwid(
2487 wlandevice_t *wlandev,
2489 p80211msg_dot11req_mibset_t *msg,
2493 p80211pstrd_t *pstr = (p80211pstrd_t *) data;
2494 hfa384x_FWID_t fwid;
2499 result = hfa384x_drvr_getconfig(hw, HFA384x_RID_FWID,
2500 &fwid, HFA384x_RID_FWID_LEN);
2501 if (mib->did == DIDmib_p2_p2NIC_p2PrimaryFWID) {
2502 fwid.primary[HFA384x_FWID_LEN - 1] = '\0';
2503 pstr->len = strlen(fwid.primary);
2504 memcpy(pstr->data, fwid.primary, pstr->len);
2506 fwid.secondary[HFA384x_FWID_LEN - 1] = '\0';
2507 pstr->len = strlen(fwid.secondary);
2508 memcpy(pstr->data, fwid.secondary, pstr->len);
2511 result = 0; /* Should never happen. */
2517 /*----------------------------------------------------------------
2520 * Get values from the AuhtenticationAlgorithmsTable.
2522 * MIB record parameters:
2523 * parm1 Table index (1-6).
2529 * isget MIBGET/MIBSET flag.
2530 * wlandev wlan device structure.
2531 * priv "priv" structure.
2532 * hw "hw" structure.
2533 * msg Message structure.
2540 ----------------------------------------------------------------*/
2542 static int prism2mib_authalg(
2545 wlandevice_t *wlandev,
2547 p80211msg_dot11req_mibset_t *msg,
2550 UINT32 *uint32 = (UINT32*) data;
2554 /* MSM: pkx supplied code that code queries RID FD4D....but the f/w's
2555 * results are bogus. Therefore, we have to simulate the appropriate
2556 * results here in the driver based on our knowledge of existing MAC
2557 * features. That's the whole point behind this ugly function.
2561 msg->resultcode.data = P80211ENUM_resultcode_success;
2562 switch (mib->parm1) {
2563 case 1: /* Open System */
2564 *uint32 = P80211ENUM_authalg_opensystem;
2566 case 2: /* SharedKey */
2567 *uint32 = P80211ENUM_authalg_sharedkey;
2571 msg->resultcode.data = P80211ENUM_resultcode_not_supported;
2580 /*----------------------------------------------------------------
2581 * prism2mib_authalgenable
2583 * Get/set the enable values from the AuhtenticationAlgorithmsTable.
2585 * MIB record parameters:
2586 * parm1 Table index (1-6).
2592 * isget MIBGET/MIBSET flag.
2593 * wlandev wlan device structure.
2594 * priv "priv" structure.
2595 * hw "hw" structure.
2596 * msg Message structure.
2603 ----------------------------------------------------------------*/
2605 static int prism2mib_authalgenable(
2608 wlandevice_t *wlandev,
2610 p80211msg_dot11req_mibset_t *msg,
2614 UINT32 *uint32 = (UINT32*) data;
2622 index = mib->parm1 - 1;
2624 result = hfa384x_drvr_getconfig16( hw,
2625 HFA384x_RID_CNFAUTHENTICATION, &cnf_auth);
2626 WLAN_LOG_DEBUG(2,"cnfAuthentication0=%d, index=%d\n", cnf_auth, index);
2629 if ( index == 0 || index == 1 ) {
2630 *uint32 = (cnf_auth & (1<<index)) ?
2631 P80211ENUM_truth_true: P80211ENUM_truth_false;
2633 *uint32 = P80211ENUM_truth_false;
2634 msg->resultcode.data = P80211ENUM_resultcode_not_supported;
2637 if ( index == 0 || index == 1 ) {
2639 if (*uint32==P80211ENUM_truth_true ) {
2644 result = hfa384x_drvr_setconfig16( hw,
2645 HFA384x_RID_CNFAUTHENTICATION, cnf_auth);
2646 WLAN_LOG_DEBUG(2,"cnfAuthentication:=%d\n", cnf_auth);
2648 WLAN_LOG_DEBUG(1,"Unable to set p2cnfAuthentication to %d\n", cnf_auth);
2649 msg->resultcode.data = P80211ENUM_resultcode_implementation_failure;
2652 msg->resultcode.data = P80211ENUM_resultcode_not_supported;
2660 /*----------------------------------------------------------------
2663 * Get/set values in the "priv" data structure.
2665 * MIB record parameters:
2672 * isget MIBGET/MIBSET flag.
2673 * wlandev wlan device structure.
2674 * priv "priv" structure.
2675 * hw "hw" structure.
2676 * msg Message structure.
2683 ----------------------------------------------------------------*/
2685 static int prism2mib_priv(
2688 wlandevice_t *wlandev,
2690 p80211msg_dot11req_mibset_t *msg,
2693 UINT32 *uint32 = (UINT32*) data;
2694 p80211pstrd_t *pstr = (p80211pstrd_t*) data;
2695 p80211macarray_t *macarray = (p80211macarray_t *) data;
2697 int i, cnt, result, done;
2699 prism2sta_authlist_t old;
2702 ** "test" is a lot longer than necessary but who cares? ...as long as
2703 ** it is long enough!
2706 UINT8 test[sizeof(wlandev->rx) + sizeof(hw->tallies)];
2711 case DIDmib_p2_p2Table_p2ReceivedFrameStatistics:
2714 ** Note: The values in this record are changed by the
2715 ** interrupt handler and therefore cannot be guaranteed
2716 ** to be stable while they are being copied. However,
2717 ** the interrupt handler will take priority over this
2718 ** code. Hence, if the same values are copied twice,
2719 ** then we are ensured that the values have not been
2720 ** changed. If they have, then just try again. Don't
2721 ** try more than 10 times...if we still haven't got it,
2722 ** then the values we do have are probably good enough.
2723 ** This scheme for copying values is used in order to
2724 ** prevent having to block the interrupt handler while
2725 ** we copy the values.
2729 for (i = 0; i < 10; i++) {
2730 memcpy(data, &wlandev->rx, sizeof(wlandev->rx));
2731 memcpy(test, &wlandev->rx, sizeof(wlandev->rx));
2732 if (memcmp(data, test, sizeof(wlandev->rx)) == 0) break;
2737 case DIDmib_p2_p2Table_p2CommunicationTallies:
2740 ** Note: The values in this record are changed by the
2741 ** interrupt handler and therefore cannot be guaranteed
2742 ** to be stable while they are being copied. See the
2743 ** note above about copying values.
2747 result = hfa384x_drvr_commtallies(hw);
2749 /* ?????? We need to wait a bit here for the */
2750 /* tallies to get updated. ?????? */
2751 /* MSM: TODO: The right way to do this is to
2752 * add a "commtallie" wait queue to the
2753 * priv structure that gets run every time
2754 * we receive a commtally info frame.
2755 * This process would sleep on that
2756 * queue and get awakened when the
2757 * the requested info frame arrives.
2758 * Don't have time to do and test this
2762 /* Ugh, this is nasty. */
2763 for (i = 0; i < 10; i++) {
2766 sizeof(hw->tallies));
2769 sizeof(hw->tallies));
2772 sizeof(hw->tallies)) == 0)
2779 case DIDmib_p2_p2Table_p2Authenticated:
2782 prism2mib_priv_authlist(hw, &old);
2785 for (i = 0; i < old.cnt; i++) {
2786 if (!old.assoc[i]) {
2787 memcpy(macarray->data[macarray->cnt], old.addr[i], WLAN_ADDR_LEN);
2795 case DIDmib_p2_p2Table_p2Associated:
2798 prism2mib_priv_authlist(hw, &old);
2801 for (i = 0; i < old.cnt; i++) {
2803 memcpy(macarray->data[macarray->cnt], old.addr[i], WLAN_ADDR_LEN);
2811 case DIDmib_p2_p2Table_p2PowerSaveUserCount:
2814 *uint32 = hw->psusercount;
2818 case DIDmib_p2_p2Table_p2Comment:
2821 pstr->len = strlen(hw->comment);
2822 memcpy(pstr->data, hw->comment, pstr->len);
2825 if (cnt < 0) cnt = 0;
2826 if (cnt >= sizeof(hw->comment))
2827 cnt = sizeof(hw->comment)-1;
2828 memcpy(hw->comment, pstr->data, cnt);
2829 pstr->data[cnt] = '\0';
2834 case DIDmib_p2_p2Table_p2AccessMode:
2837 *uint32 = hw->accessmode;
2839 prism2mib_priv_accessmode(hw, *uint32);
2843 case DIDmib_p2_p2Table_p2AccessAllow:
2846 macarray->cnt = hw->allow.cnt;
2847 memcpy(macarray->data, hw->allow.addr,
2848 macarray->cnt*WLAN_ADDR_LEN);
2850 prism2mib_priv_accessallow(hw, macarray);
2855 case DIDmib_p2_p2Table_p2AccessDeny:
2858 macarray->cnt = hw->deny.cnt;
2859 memcpy(macarray->data, hw->deny.addr,
2860 macarray->cnt*WLAN_ADDR_LEN);
2862 prism2mib_priv_accessdeny(hw, macarray);
2867 case DIDmib_p2_p2Table_p2ChannelInfoResults:
2870 done = atomic_read(&hw->channel_info.done);
2872 msg->resultcode.status = P80211ENUM_msgitem_status_no_value;
2876 msg->resultcode.status = P80211ENUM_msgitem_status_incomplete_itemdata;
2880 for (i = 0; i < 14; i++, uint32 += 5) {
2882 uint32[1] = hw->channel_info.results.result[i].anl;
2883 uint32[2] = hw->channel_info.results.result[i].pnl;
2884 uint32[3] = (hw->channel_info.results.result[i].active & HFA384x_CHINFORESULT_BSSACTIVE) ? 1 : 0;
2885 uint32[4] = (hw->channel_info.results.result[i].active & HFA384x_CHINFORESULT_PCFACTIVE) ? 1 : 0;
2891 case DIDmib_dot11smt_dot11StationConfigTable_dot11DesiredBSSType:
2894 *uint32 = hw->dot11_desired_bss_type;
2896 hw->dot11_desired_bss_type = *uint32;
2900 case DIDmib_lnx_lnxConfigTable_lnxRSNAIE: {
2901 hfa384x_WPAData_t wpa;
2903 hfa384x_drvr_getconfig( hw, HFA384x_RID_CNFWPADATA,
2904 (UINT8 *) &wpa, sizeof(wpa));
2905 pstr->len = hfa384x2host_16(wpa.datalen);
2906 memcpy(pstr->data, wpa.data, pstr->len);
2908 wpa.datalen = host2hfa384x_16(pstr->len);
2909 memcpy(wpa.data, pstr->data, pstr->len);
2911 result = hfa384x_drvr_setconfig(hw, HFA384x_RID_CNFWPADATA,
2912 (UINT8 *) &wpa, sizeof(wpa));
2917 WLAN_LOG_ERROR("Unhandled DID 0x%08x\n", mib->did);
2924 /*----------------------------------------------------------------
2925 * prism2mib_priv_authlist
2927 * Get a copy of the list of authenticated stations.
2930 * priv "priv" structure.
2931 * list List of authenticated stations.
2936 ----------------------------------------------------------------*/
2938 static void prism2mib_priv_authlist(
2940 prism2sta_authlist_t *list)
2942 prism2sta_authlist_t test;
2948 ** Note: The values in this record are changed by the interrupt
2949 ** handler and therefore cannot be guaranteed to be stable while
2950 ** they are being copied. However, the interrupt handler will
2951 ** take priority over this code. Hence, if the same values are
2952 ** copied twice, then we are ensured that the values have not
2953 ** been changed. If they have, then just try again. Don't try
2954 ** more than 10 times...the list of authenticated stations is
2955 ** unlikely to be changing frequently enough that we can't get
2956 ** a snapshot in 10 tries. Don't try more than this so that we
2957 ** don't risk locking-up for long periods of time. If we still
2958 ** haven't got the snapshot, then generate an error message and
2959 ** return an empty list (since this is the only valid list that
2960 ** we can guarentee). This scheme for copying values is used in
2961 ** order to prevent having to block the interrupt handler while
2962 ** we copy the values.
2965 for (i = 0; i < 10; i++) {
2966 memcpy(list, &hw->authlist, sizeof(prism2sta_authlist_t));
2967 memcpy(&test, &hw->authlist, sizeof(prism2sta_authlist_t));
2968 if (memcmp(list, &test, sizeof(prism2sta_authlist_t)) == 0)
2974 WLAN_LOG_ERROR("Could not obtain snapshot of authenticated stations.\n");
2981 /*----------------------------------------------------------------
2982 * prism2mib_priv_accessmode
2984 * Set the Access Mode.
2987 * priv "priv" structure.
2988 * hw "hw" structure.
2989 * mode New access mode.
2994 ----------------------------------------------------------------*/
2996 static void prism2mib_priv_accessmode(
3000 prism2sta_authlist_t old;
3007 ** If the mode is not changing or it is changing to "All", then it's
3008 ** okay to go ahead without a lot of messing around. Otherwise, the
3009 ** access mode is changing in a way that may leave some stations
3010 ** authenticated which should not be authenticated. It will be
3011 ** necessary to de-authenticate these stations.
3014 if (mode == WLAN_ACCESS_ALL || mode == hw->accessmode) {
3015 hw->accessmode = mode;
3020 ** Switch to the new access mode. Once this is done, then the interrupt
3021 ** handler (which uses this value) will be prevented from authenticating
3022 ** ADDITIONAL stations which should not be authenticated. Then get a
3023 ** copy of the current list of authenticated stations.
3026 hw->accessmode = mode;
3028 prism2mib_priv_authlist(hw, &old);
3031 ** Now go through the list of previously authenticated stations (some
3032 ** of which might de-authenticate themselves while we are processing it
3033 ** but that is okay). Any station which no longer matches the access
3034 ** mode, must be de-authenticated.
3037 for (i = 0; i < old.cnt; i++) {
3040 if (mode == WLAN_ACCESS_NONE)
3043 if (mode == WLAN_ACCESS_ALLOW) {
3044 for (j = 0; j < hw->allow.cnt; j++)
3045 if (memcmp(addr, hw->allow.addr[j],
3046 WLAN_ADDR_LEN) == 0)
3048 deauth = (j >= hw->allow.cnt);
3050 for (j = 0; j < hw->deny.cnt; j++)
3051 if (memcmp(addr, hw->deny.addr[j],
3052 WLAN_ADDR_LEN) == 0)
3054 deauth = (j < hw->deny.cnt);
3058 if (deauth) prism2mib_priv_deauthenticate(hw, addr);
3065 /*----------------------------------------------------------------
3066 * prism2mib_priv_accessallow
3068 * Change the list of allowed MAC addresses.
3071 * priv "priv" structure.
3072 * hw "hw" structure.
3073 * macarray New array of MAC addresses.
3078 ----------------------------------------------------------------*/
3080 static void prism2mib_priv_accessallow(
3082 p80211macarray_t *macarray)
3084 prism2sta_authlist_t old;
3090 ** Change the access list. Note that the interrupt handler may be in
3091 ** the middle of using the access list!!! Since the interrupt handler
3092 ** will always have priority over this process and this is the only
3093 ** process that will modify the list, this problem can be handled as
3096 ** 1. Set the "modify" flag.
3097 ** 2. Change the first copy of the list.
3098 ** 3. Clear the "modify" flag.
3099 ** 4. Change the backup copy of the list.
3101 ** The interrupt handler will check the "modify" flag. If NOT set, then
3102 ** the first copy of the list is valid and may be used. Otherwise, the
3103 ** first copy is being changed but the backup copy is valid and may be
3104 ** used. Doing things this way prevents having to have the interrupt
3105 ** handler block while the list is being updated.
3108 hw->allow.modify = 1;
3110 hw->allow.cnt = macarray->cnt;
3111 memcpy(hw->allow.addr, macarray->data, macarray->cnt*WLAN_ADDR_LEN);
3113 hw->allow.modify = 0;
3115 hw->allow.cnt1 = macarray->cnt;
3116 memcpy(hw->allow.addr1, macarray->data, macarray->cnt*WLAN_ADDR_LEN);
3119 ** If the current access mode is "Allow", then changing the access
3120 ** list may leave some stations authenticated which should not be
3121 ** authenticated. It will be necessary to de-authenticate these
3122 ** stations. Otherwise, the list can be changed without a lot of fuss.
3125 if (hw->accessmode == WLAN_ACCESS_ALLOW) {
3128 ** Go through the list of authenticated stations (some of
3129 ** which might de-authenticate themselves while we are
3130 ** processing it but that is okay). Any station which is
3131 ** no longer in the list of allowed stations, must be
3132 ** de-authenticated.
3135 prism2mib_priv_authlist(hw, &old);
3137 for (i = 0; i < old.cnt; i++) {
3138 for (j = 0; j < hw->allow.cnt; j++)
3139 if (memcmp(old.addr[i], hw->allow.addr[j],
3140 WLAN_ADDR_LEN) == 0)
3142 if (j >= hw->allow.cnt)
3143 prism2mib_priv_deauthenticate(hw, old.addr[i]);
3151 /*----------------------------------------------------------------
3152 * prism2mib_priv_accessdeny
3154 * Change the list of denied MAC addresses.
3157 * priv "priv" structure.
3158 * hw "hw" structure.
3159 * macarray New array of MAC addresses.
3164 ----------------------------------------------------------------*/
3166 static void prism2mib_priv_accessdeny(
3168 p80211macarray_t *macarray)
3170 prism2sta_authlist_t old;
3176 ** Change the access list. Note that the interrupt handler may be in
3177 ** the middle of using the access list!!! Since the interrupt handler
3178 ** will always have priority over this process and this is the only
3179 ** process that will modify the list, this problem can be handled as
3182 ** 1. Set the "modify" flag.
3183 ** 2. Change the first copy of the list.
3184 ** 3. Clear the "modify" flag.
3185 ** 4. Change the backup copy of the list.
3187 ** The interrupt handler will check the "modify" flag. If NOT set, then
3188 ** the first copy of the list is valid and may be used. Otherwise, the
3189 ** first copy is being changed but the backup copy is valid and may be
3190 ** used. Doing things this way prevents having to have the interrupt
3191 ** handler block while the list is being updated.
3194 hw->deny.modify = 1;
3196 hw->deny.cnt = macarray->cnt;
3197 memcpy(hw->deny.addr, macarray->data, macarray->cnt*WLAN_ADDR_LEN);
3199 hw->deny.modify = 0;
3201 hw->deny.cnt1 = macarray->cnt;
3202 memcpy(hw->deny.addr1, macarray->data, macarray->cnt*WLAN_ADDR_LEN);
3205 ** If the current access mode is "Deny", then changing the access
3206 ** list may leave some stations authenticated which should not be
3207 ** authenticated. It will be necessary to de-authenticate these
3208 ** stations. Otherwise, the list can be changed without a lot of fuss.
3211 if (hw->accessmode == WLAN_ACCESS_DENY) {
3214 ** Go through the list of authenticated stations (some of
3215 ** which might de-authenticate themselves while we are
3216 ** processing it but that is okay). Any station which is
3217 ** now in the list of denied stations, must be de-authenticated.
3220 prism2mib_priv_authlist(hw, &old);
3222 for (i = 0; i < old.cnt; i++)
3223 for (j = 0; j < hw->deny.cnt; j++)
3224 if (memcmp(old.addr[i], hw->deny.addr[j],
3225 WLAN_ADDR_LEN) == 0) {
3226 prism2mib_priv_deauthenticate(hw, old.addr[i]);
3235 /*----------------------------------------------------------------
3236 * prism2mib_priv_deauthenticate
3238 * De-authenticate a station. This is done by sending a HandoverAddress
3239 * information frame to the firmware. This should work, according to
3243 * priv "priv" structure.
3244 * hw "hw" structure.
3245 * addr MAC address of station to be de-authenticated.
3250 ----------------------------------------------------------------*/
3252 static void prism2mib_priv_deauthenticate(
3257 hfa384x_drvr_handover(hw, addr);
3263 /*----------------------------------------------------------------
3264 * prism2mgmt_pstr2bytestr
3266 * Convert the pstr data in the WLAN message structure into an hfa384x
3267 * byte string format.
3270 * bytestr hfa384x byte string data type
3271 * pstr wlan message data
3276 ----------------------------------------------------------------*/
3278 void prism2mgmt_pstr2bytestr(hfa384x_bytestr_t *bytestr, p80211pstrd_t *pstr)
3282 bytestr->len = host2hfa384x_16((UINT16)(pstr->len));
3283 memcpy(bytestr->data, pstr->data, pstr->len);
3288 /*----------------------------------------------------------------
3289 * prism2mgmt_pstr2bytearea
3291 * Convert the pstr data in the WLAN message structure into an hfa384x
3295 * bytearea hfa384x byte area data type
3296 * pstr wlan message data
3301 ----------------------------------------------------------------*/
3303 void prism2mgmt_pstr2bytearea(UINT8 *bytearea, p80211pstrd_t *pstr)
3307 memcpy(bytearea, pstr->data, pstr->len);
3312 /*----------------------------------------------------------------
3313 * prism2mgmt_bytestr2pstr
3315 * Convert the data in an hfa384x byte string format into a
3316 * pstr in the WLAN message.
3319 * bytestr hfa384x byte string data type
3325 ----------------------------------------------------------------*/
3327 void prism2mgmt_bytestr2pstr(hfa384x_bytestr_t *bytestr, p80211pstrd_t *pstr)
3331 pstr->len = (UINT8)(hfa384x2host_16((UINT16)(bytestr->len)));
3332 memcpy(pstr->data, bytestr->data, pstr->len);
3337 /*----------------------------------------------------------------
3338 * prism2mgmt_bytearea2pstr
3340 * Convert the data in an hfa384x byte area format into a pstr
3341 * in the WLAN message.
3344 * bytearea hfa384x byte area data type
3350 ----------------------------------------------------------------*/
3352 void prism2mgmt_bytearea2pstr(UINT8 *bytearea, p80211pstrd_t *pstr, int len)
3356 pstr->len = (UINT8)len;
3357 memcpy(pstr->data, bytearea, len);
3362 /*----------------------------------------------------------------
3363 * prism2mgmt_prism2int2p80211int
3365 * Convert an hfa384x integer into a wlan integer
3368 * prism2enum pointer to hfa384x integer
3369 * wlanenum pointer to p80211 integer
3374 ----------------------------------------------------------------*/
3376 void prism2mgmt_prism2int2p80211int(UINT16 *prism2int, UINT32 *wlanint)
3380 *wlanint = (UINT32)hfa384x2host_16(*prism2int);
3385 /*----------------------------------------------------------------
3386 * prism2mgmt_p80211int2prism2int
3388 * Convert a wlan integer into an hfa384x integer
3391 * prism2enum pointer to hfa384x integer
3392 * wlanenum pointer to p80211 integer
3397 ----------------------------------------------------------------*/
3399 void prism2mgmt_p80211int2prism2int(UINT16 *prism2int, UINT32 *wlanint)
3403 *prism2int = host2hfa384x_16((UINT16)(*wlanint));
3408 /*----------------------------------------------------------------
3409 * prism2mgmt_prism2enum2p80211enum
3411 * Convert the hfa384x enumerated int into a p80211 enumerated int
3414 * prism2enum pointer to hfa384x integer
3415 * wlanenum pointer to p80211 integer
3416 * rid hfa384x record id
3421 ----------------------------------------------------------------*/
3422 void prism2mgmt_prism2enum2p80211enum(UINT16 *prism2enum, UINT32 *wlanenum, UINT16 rid)
3426 /* At the moment, the need for this functionality hasn't
3427 presented itself. All the wlan enumerated values are
3428 a 1-to-1 match against the Prism2 enumerated values*/
3434 /*----------------------------------------------------------------
3435 * prism2mgmt_p80211enum2prism2enum
3437 * Convert the p80211 enumerated int into an hfa384x enumerated int
3440 * prism2enum pointer to hfa384x integer
3441 * wlanenum pointer to p80211 integer
3442 * rid hfa384x record id
3447 ----------------------------------------------------------------*/
3448 void prism2mgmt_p80211enum2prism2enum(UINT16 *prism2enum, UINT32 *wlanenum, UINT16 rid)
3452 /* At the moment, the need for this functionality hasn't
3453 presented itself. All the wlan enumerated values are
3454 a 1-to-1 match against the Prism2 enumerated values*/
3461 /*----------------------------------------------------------------
3462 * prism2mgmt_get_oprateset
3464 * Convert the hfa384x bit area into a wlan octet string.
3467 * rate Prism2 bit area
3468 * pstr wlan octet string
3473 ----------------------------------------------------------------*/
3474 void prism2mgmt_get_oprateset(UINT16 *rate, p80211pstrd_t *pstr)
3482 datarate = pstr->data;
3485 if ( BIT0 & (*rate) ) {
3487 *datarate = (UINT8)2;
3492 if ( BIT1 & (*rate) ) {
3494 *datarate = (UINT8)4;
3499 if ( BIT2 & (*rate) ) {
3501 *datarate = (UINT8)11;
3506 if ( BIT3 & (*rate) ) {
3508 *datarate = (UINT8)22;
3520 /*----------------------------------------------------------------
3521 * prism2mgmt_set_oprateset
3523 * Convert the wlan octet string into an hfa384x bit area.
3526 * rate Prism2 bit area
3527 * pstr wlan octet string
3532 ----------------------------------------------------------------*/
3533 void prism2mgmt_set_oprateset(UINT16 *rate, p80211pstrd_t *pstr)
3542 datarate = pstr->data;
3544 for ( i=0; i < pstr->len; i++, datarate++ ) {
3545 switch (*datarate) {
3546 case 2: /* 1 Mbps */
3549 case 4: /* 2 Mbps */
3552 case 11: /* 5.5 Mbps */
3555 case 22: /* 11 Mbps */
3559 WLAN_LOG_DEBUG(1, "Unrecoginzed Rate of %d\n",
3571 /*----------------------------------------------------------------
3572 * prism2mgmt_get_grpaddr
3574 * Retrieves a particular group address from the list of
3579 * pstr wlan octet string
3580 * priv prism2 driver private data structure
3585 ----------------------------------------------------------------*/
3586 void prism2mgmt_get_grpaddr(UINT32 did, p80211pstrd_t *pstr,
3593 index = prism2mgmt_get_grpaddr_index(did);
3596 pstr->len = WLAN_ADDR_LEN;
3597 memcpy(pstr->data, hw->dot11_grp_addr[index],
3607 /*----------------------------------------------------------------
3608 * prism2mgmt_set_grpaddr
3610 * Convert the wlan octet string into an hfa384x bit area.
3621 ----------------------------------------------------------------*/
3622 int prism2mgmt_set_grpaddr(UINT32 did, UINT8 *prism2buf,
3623 p80211pstrd_t *pstr, hfa384x_t *hw )
3625 UINT8 no_addr[WLAN_ADDR_LEN];
3630 memset(no_addr, 0, WLAN_ADDR_LEN);
3631 if (memcmp(no_addr, pstr->data, WLAN_ADDR_LEN) != 0) {
3634 ** The address is NOT 0 so we are "adding" an address to the
3635 ** group address list. Check to make sure we aren't trying
3636 ** to add more than the maximum allowed number of group
3637 ** addresses in the list. The new address is added to the
3638 ** end of the list regardless of the DID used to add the
3642 if (hw->dot11_grpcnt >= MAX_GRP_ADDR) return(-1);
3644 memcpy(hw->dot11_grp_addr[hw->dot11_grpcnt], pstr->data,
3646 hw->dot11_grpcnt += 1;
3650 ** The address is 0. Interpret this as "deleting" an address
3651 ** from the group address list. Get the address index from
3652 ** the DID. If this is within the range of used addresses,
3653 ** then delete the specified address by shifting all following
3654 ** addresses down. Then clear the last address (which should
3655 ** now be unused). If the address index is NOT within the
3656 ** range of used addresses, then just ignore the address.
3659 index = prism2mgmt_get_grpaddr_index(did);
3660 if (index >= 0 && index < hw->dot11_grpcnt) {
3661 hw->dot11_grpcnt -= 1;
3662 memmove(hw->dot11_grp_addr[index],
3663 hw->dot11_grp_addr[index + 1],
3664 ((hw->dot11_grpcnt)-index) * WLAN_ADDR_LEN);
3665 memset(hw->dot11_grp_addr[hw->dot11_grpcnt], 0,
3675 /*----------------------------------------------------------------
3676 * prism2mgmt_get_grpaddr_index
3678 * Gets the index in the group address list based on the did.
3685 * < 0 If not valid did
3687 ----------------------------------------------------------------*/
3688 int prism2mgmt_get_grpaddr_index( UINT32 did )
3697 case DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address1:
3700 case DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address2:
3703 case DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address3:
3706 case DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address4:
3709 case DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address5:
3712 case DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address6:
3715 case DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address7:
3718 case DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address8:
3721 case DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address9:
3724 case DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address10:
3727 case DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address11:
3730 case DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address12:
3733 case DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address13:
3736 case DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address14:
3739 case DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address15:
3742 case DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address16:
3745 case DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address17:
3748 case DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address18:
3751 case DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address19:
3754 case DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address20:
3757 case DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address21:
3760 case DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address22:
3763 case DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address23:
3766 case DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address24:
3769 case DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address25:
3772 case DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address26:
3775 case DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address27:
3778 case DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address28:
3781 case DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address29:
3784 case DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address30:
3787 case DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address31:
3790 case DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address32: