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 #include "wlan_compat.h"
95 /*================================================================*/
96 /* Project Includes */
98 #include "p80211types.h"
99 #include "p80211hdr.h"
100 #include "p80211mgmt.h"
101 #include "p80211conv.h"
102 #include "p80211msg.h"
103 #include "p80211netdev.h"
104 #include "p80211metadef.h"
105 #include "p80211metastruct.h"
107 #include "prism2mgmt.h"
109 /*================================================================*/
110 /* Local Constants */
112 #define MIB_TMP_MAXLEN 200 /* Max length of RID record (in bytes). */
114 /*================================================================*/
117 #define F_AP 0x1 /* MIB is supported on Access Points. */
118 #define F_STA 0x2 /* MIB is supported on stations. */
119 #define F_READ 0x4 /* MIB may be read. */
120 #define F_WRITE 0x8 /* MIB may be written. */
122 typedef struct mibrec
129 int (*func)(struct mibrec *mib,
131 wlandevice_t *wlandev,
133 p80211msg_dot11req_mibset_t *msg,
137 /*================================================================*/
138 /* Local Function Declarations */
140 static int prism2mib_bytestr2pstr(
143 wlandevice_t *wlandev,
145 p80211msg_dot11req_mibset_t *msg,
148 static int prism2mib_bytearea2pstr(
151 wlandevice_t *wlandev,
153 p80211msg_dot11req_mibset_t *msg,
156 static int prism2mib_uint32(
159 wlandevice_t *wlandev,
161 p80211msg_dot11req_mibset_t *msg,
164 static int prism2mib_uint32array(
167 wlandevice_t *wlandev,
169 p80211msg_dot11req_mibset_t *msg,
172 static int prism2mib_uint32offset(
175 wlandevice_t *wlandev,
177 p80211msg_dot11req_mibset_t *msg,
180 static int prism2mib_truth(
183 wlandevice_t *wlandev,
185 p80211msg_dot11req_mibset_t *msg,
188 static int prism2mib_preamble(
191 wlandevice_t *wlandev,
193 p80211msg_dot11req_mibset_t *msg,
196 static int prism2mib_flag(
199 wlandevice_t *wlandev,
201 p80211msg_dot11req_mibset_t *msg,
204 static int prism2mib_appcfinfoflag(
207 wlandevice_t *wlandev,
209 p80211msg_dot11req_mibset_t *msg,
212 static int prism2mib_regulatorydomains(
215 wlandevice_t *wlandev,
217 p80211msg_dot11req_mibset_t *msg,
220 static int prism2mib_wepdefaultkey(
223 wlandevice_t *wlandev,
225 p80211msg_dot11req_mibset_t *msg,
228 static int prism2mib_powermanagement(
231 wlandevice_t *wlandev,
233 p80211msg_dot11req_mibset_t *msg,
236 static int prism2mib_privacyinvoked(
239 wlandevice_t *wlandev,
241 p80211msg_dot11req_mibset_t *msg,
244 static int prism2mib_excludeunencrypted(
247 wlandevice_t *wlandev,
249 p80211msg_dot11req_mibset_t *msg,
252 static int prism2mib_fragmentationthreshold(
255 wlandevice_t *wlandev,
257 p80211msg_dot11req_mibset_t *msg,
260 static int prism2mib_operationalrateset(
263 wlandevice_t *wlandev,
265 p80211msg_dot11req_mibset_t *msg,
268 static int prism2mib_groupaddress(
271 wlandevice_t *wlandev,
273 p80211msg_dot11req_mibset_t *msg,
276 static int prism2mib_fwid(
279 wlandevice_t *wlandev,
281 p80211msg_dot11req_mibset_t *msg,
284 static int prism2mib_authalg(
287 wlandevice_t *wlandev,
289 p80211msg_dot11req_mibset_t *msg,
292 static int prism2mib_authalgenable(
295 wlandevice_t *wlandev,
297 p80211msg_dot11req_mibset_t *msg,
300 static int prism2mib_priv(
303 wlandevice_t *wlandev,
305 p80211msg_dot11req_mibset_t *msg,
308 static void prism2mib_priv_authlist(
310 prism2sta_authlist_t *list);
312 static void prism2mib_priv_accessmode(
316 static void prism2mib_priv_accessallow(
318 p80211macarray_t *macarray);
320 static void prism2mib_priv_accessdeny(
322 p80211macarray_t *macarray);
324 static void prism2mib_priv_deauthenticate(
328 /*================================================================*/
329 /* Local Static Definitions */
331 static mibrec_t mibtab[] = {
335 { DIDmib_dot11smt_dot11StationConfigTable_dot11StationID,
336 F_AP | F_STA | F_READ | F_WRITE,
337 HFA384x_RID_CNFOWNMACADDR, HFA384x_RID_CNFOWNMACADDR_LEN, 0,
338 prism2mib_bytearea2pstr },
339 { DIDmib_dot11smt_dot11StationConfigTable_dot11MediumOccupancyLimit,
340 F_AP | F_READ | F_WRITE,
341 HFA384x_RID_CNFAPPCFINFO, HFA384x_RID_CNFAPPCFINFO_LEN, 0,
342 prism2mib_uint32offset },
343 { DIDmib_dot11smt_dot11StationConfigTable_dot11CFPollable,
345 HFA384x_RID_CFPOLLABLE, 0, 0,
347 { DIDmib_dot11smt_dot11StationConfigTable_dot11CFPPeriod,
348 F_AP | F_READ | F_WRITE,
349 HFA384x_RID_CNFAPPCFINFO, HFA384x_RID_CNFAPPCFINFO_LEN, 1,
350 prism2mib_uint32offset },
351 { DIDmib_dot11smt_dot11StationConfigTable_dot11CFPMaxDuration,
352 F_AP | F_READ | F_WRITE,
353 HFA384x_RID_CNFAPPCFINFO, HFA384x_RID_CNFAPPCFINFO_LEN, 2,
354 prism2mib_uint32offset },
355 { DIDmib_dot11smt_dot11StationConfigTable_dot11AuthenticationResponseTimeOut,
356 F_STA | F_READ | F_WRITE,
357 HFA384x_RID_CNFAUTHRSPTIMEOUT, 0, 0,
359 { DIDmib_dot11smt_dot11StationConfigTable_dot11PrivacyOptionImplemented,
360 F_AP | F_STA | F_READ,
361 HFA384x_RID_PRIVACYOPTIMP, 0, 0,
363 { DIDmib_dot11smt_dot11StationConfigTable_dot11PowerManagementMode,
364 F_STA | F_READ | F_WRITE,
365 HFA384x_RID_CNFPMENABLED, 0, 0,
366 prism2mib_powermanagement },
367 { DIDmib_dot11smt_dot11StationConfigTable_dot11DesiredSSID,
368 F_STA | F_READ | F_WRITE,
369 HFA384x_RID_CNFDESIREDSSID, HFA384x_RID_CNFDESIREDSSID_LEN, 0,
370 prism2mib_bytestr2pstr },
371 { DIDmib_dot11smt_dot11StationConfigTable_dot11DesiredBSSType,
372 F_STA | F_READ | F_WRITE,
375 { DIDmib_dot11smt_dot11StationConfigTable_dot11OperationalRateSet,
376 F_STA | F_READ | F_WRITE,
377 HFA384x_RID_TXRATECNTL, 0, 0,
378 prism2mib_operationalrateset },
379 { DIDmib_dot11smt_dot11StationConfigTable_dot11OperationalRateSet,
380 F_AP | F_READ | F_WRITE,
381 HFA384x_RID_TXRATECNTL0, 0, 0,
382 prism2mib_operationalrateset },
383 { DIDmib_dot11smt_dot11StationConfigTable_dot11BeaconPeriod,
384 F_AP | F_READ | F_WRITE,
385 HFA384x_RID_CNFAPBCNINT, 0, 0,
387 { DIDmib_dot11smt_dot11StationConfigTable_dot11DTIMPeriod,
388 F_AP | F_STA | F_READ | F_WRITE,
389 HFA384x_RID_CNFOWNDTIMPER, 0, 0,
391 { DIDmib_dot11smt_dot11StationConfigTable_dot11AssociationResponseTimeOut,
392 F_AP | F_STA | F_READ,
393 HFA384x_RID_PROTOCOLRSPTIME, 0, 0,
395 { DIDmib_dot11smt_dot11AuthenticationAlgorithmsTable_dot11AuthenticationAlgorithm1,
396 F_AP | F_STA | F_READ,
399 { DIDmib_dot11smt_dot11AuthenticationAlgorithmsTable_dot11AuthenticationAlgorithm2,
400 F_AP | F_STA | F_READ,
403 { DIDmib_dot11smt_dot11AuthenticationAlgorithmsTable_dot11AuthenticationAlgorithm3,
404 F_AP | F_STA | F_READ,
407 { DIDmib_dot11smt_dot11AuthenticationAlgorithmsTable_dot11AuthenticationAlgorithm4,
408 F_AP | F_STA | F_READ,
411 { DIDmib_dot11smt_dot11AuthenticationAlgorithmsTable_dot11AuthenticationAlgorithm5,
412 F_AP | F_STA | F_READ,
415 { DIDmib_dot11smt_dot11AuthenticationAlgorithmsTable_dot11AuthenticationAlgorithm6,
416 F_AP | F_STA | F_READ,
419 { DIDmib_dot11smt_dot11AuthenticationAlgorithmsTable_dot11AuthenticationAlgorithmsEnable1,
420 F_AP | F_STA | F_READ | F_WRITE,
422 prism2mib_authalgenable },
423 { DIDmib_dot11smt_dot11AuthenticationAlgorithmsTable_dot11AuthenticationAlgorithmsEnable2,
424 F_AP | F_STA | F_READ | F_WRITE,
426 prism2mib_authalgenable },
427 { DIDmib_dot11smt_dot11AuthenticationAlgorithmsTable_dot11AuthenticationAlgorithmsEnable3,
428 F_AP | F_STA | F_READ | F_WRITE,
430 prism2mib_authalgenable },
431 { DIDmib_dot11smt_dot11AuthenticationAlgorithmsTable_dot11AuthenticationAlgorithmsEnable4,
432 F_AP | F_STA | F_READ | F_WRITE,
434 prism2mib_authalgenable },
435 { DIDmib_dot11smt_dot11AuthenticationAlgorithmsTable_dot11AuthenticationAlgorithmsEnable5,
436 F_AP | F_STA | F_READ | F_WRITE,
438 prism2mib_authalgenable },
439 { DIDmib_dot11smt_dot11AuthenticationAlgorithmsTable_dot11AuthenticationAlgorithmsEnable6,
440 F_AP | F_STA | F_READ | F_WRITE,
442 prism2mib_authalgenable },
443 { DIDmib_dot11smt_dot11WEPDefaultKeysTable_dot11WEPDefaultKey0,
444 F_AP | F_STA | F_WRITE,
445 HFA384x_RID_CNFWEPDEFAULTKEY0, 0, 0,
446 prism2mib_wepdefaultkey },
447 { DIDmib_dot11smt_dot11WEPDefaultKeysTable_dot11WEPDefaultKey1,
448 F_AP | F_STA | F_WRITE,
449 HFA384x_RID_CNFWEPDEFAULTKEY1, 0, 0,
450 prism2mib_wepdefaultkey },
451 { DIDmib_dot11smt_dot11WEPDefaultKeysTable_dot11WEPDefaultKey2,
452 F_AP | F_STA | F_WRITE,
453 HFA384x_RID_CNFWEPDEFAULTKEY2, 0, 0,
454 prism2mib_wepdefaultkey },
455 { DIDmib_dot11smt_dot11WEPDefaultKeysTable_dot11WEPDefaultKey3,
456 F_AP | F_STA | F_WRITE,
457 HFA384x_RID_CNFWEPDEFAULTKEY3, 0, 0,
458 prism2mib_wepdefaultkey },
459 { DIDmib_dot11smt_dot11PrivacyTable_dot11PrivacyInvoked,
460 F_AP | F_STA | F_READ | F_WRITE,
461 HFA384x_RID_CNFWEPFLAGS, HFA384x_WEPFLAGS_PRIVINVOKED, 0,
462 prism2mib_privacyinvoked },
463 { DIDmib_dot11smt_dot11PrivacyTable_dot11WEPDefaultKeyID,
464 F_AP | F_STA | F_READ | F_WRITE,
465 HFA384x_RID_CNFWEPDEFAULTKEYID, 0, 0,
467 { DIDmib_dot11smt_dot11PrivacyTable_dot11ExcludeUnencrypted,
468 F_AP | F_STA | F_READ | F_WRITE,
469 HFA384x_RID_CNFWEPFLAGS, HFA384x_WEPFLAGS_EXCLUDE, 0,
470 prism2mib_excludeunencrypted },
471 { DIDmib_dot11phy_dot11PhyOperationTable_dot11ShortPreambleEnabled,
472 F_AP | F_STA | F_READ | F_WRITE,
473 HFA384x_RID_CNFSHORTPREAMBLE, 0, 0,
474 prism2mib_preamble },
478 { DIDmib_dot11mac_dot11OperationTable_dot11MACAddress,
479 F_AP | F_STA | F_READ | F_WRITE,
480 HFA384x_RID_CNFOWNMACADDR, HFA384x_RID_CNFOWNMACADDR_LEN, 0,
481 prism2mib_bytearea2pstr },
482 { DIDmib_dot11mac_dot11OperationTable_dot11RTSThreshold,
483 F_STA | F_READ | F_WRITE,
484 HFA384x_RID_RTSTHRESH, 0, 0,
486 { DIDmib_dot11mac_dot11OperationTable_dot11RTSThreshold,
487 F_AP | F_READ | F_WRITE,
488 HFA384x_RID_RTSTHRESH0, 0, 0,
490 { DIDmib_dot11mac_dot11OperationTable_dot11ShortRetryLimit,
491 F_AP | F_STA | F_READ,
492 HFA384x_RID_SHORTRETRYLIMIT, 0, 0,
494 { DIDmib_dot11mac_dot11OperationTable_dot11LongRetryLimit,
495 F_AP | F_STA | F_READ,
496 HFA384x_RID_LONGRETRYLIMIT, 0, 0,
498 { DIDmib_dot11mac_dot11OperationTable_dot11FragmentationThreshold,
499 F_STA | F_READ | F_WRITE,
500 HFA384x_RID_FRAGTHRESH, 0, 0,
501 prism2mib_fragmentationthreshold },
502 { DIDmib_dot11mac_dot11OperationTable_dot11FragmentationThreshold,
503 F_AP | F_READ | F_WRITE,
504 HFA384x_RID_FRAGTHRESH0, 0, 0,
505 prism2mib_fragmentationthreshold },
506 { DIDmib_dot11mac_dot11OperationTable_dot11MaxTransmitMSDULifetime,
507 F_AP | F_STA | F_READ,
508 HFA384x_RID_MAXTXLIFETIME, 0, 0,
510 { DIDmib_dot11mac_dot11OperationTable_dot11MaxReceiveLifetime,
511 F_AP | F_STA | F_READ,
512 HFA384x_RID_MAXRXLIFETIME, 0, 0,
514 { DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address1,
515 F_STA | F_READ | F_WRITE,
517 prism2mib_groupaddress },
518 { DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address2,
519 F_STA | F_READ | F_WRITE,
521 prism2mib_groupaddress },
522 { DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address3,
523 F_STA | F_READ | F_WRITE,
525 prism2mib_groupaddress },
526 { DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address4,
527 F_STA | F_READ | F_WRITE,
529 prism2mib_groupaddress },
530 { DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address5,
531 F_STA | F_READ | F_WRITE,
533 prism2mib_groupaddress },
534 { DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address6,
535 F_STA | F_READ | F_WRITE,
537 prism2mib_groupaddress },
538 { DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address7,
539 F_STA | F_READ | F_WRITE,
541 prism2mib_groupaddress },
542 { DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address8,
543 F_STA | F_READ | F_WRITE,
545 prism2mib_groupaddress },
546 { DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address9,
547 F_STA | F_READ | F_WRITE,
549 prism2mib_groupaddress },
550 { DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address10,
551 F_STA | F_READ | F_WRITE,
553 prism2mib_groupaddress },
554 { DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address11,
555 F_STA | F_READ | F_WRITE,
557 prism2mib_groupaddress },
558 { DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address12,
559 F_STA | F_READ | F_WRITE,
561 prism2mib_groupaddress },
562 { DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address13,
563 F_STA | F_READ | F_WRITE,
565 prism2mib_groupaddress },
566 { DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address14,
567 F_STA | F_READ | F_WRITE,
569 prism2mib_groupaddress },
570 { DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address15,
571 F_STA | F_READ | F_WRITE,
573 prism2mib_groupaddress },
574 { DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address16,
575 F_STA | F_READ | F_WRITE,
577 prism2mib_groupaddress },
578 { DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address17,
579 F_STA | F_READ | F_WRITE,
581 prism2mib_groupaddress },
582 { DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address18,
583 F_STA | F_READ | F_WRITE,
585 prism2mib_groupaddress },
586 { DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address19,
587 F_STA | F_READ | F_WRITE,
589 prism2mib_groupaddress },
590 { DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address20,
591 F_STA | F_READ | F_WRITE,
593 prism2mib_groupaddress },
594 { DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address21,
595 F_STA | F_READ | F_WRITE,
597 prism2mib_groupaddress },
598 { DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address22,
599 F_STA | F_READ | F_WRITE,
601 prism2mib_groupaddress },
602 { DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address23,
603 F_STA | F_READ | F_WRITE,
605 prism2mib_groupaddress },
606 { DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address24,
607 F_STA | F_READ | F_WRITE,
609 prism2mib_groupaddress },
610 { DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address25,
611 F_STA | F_READ | F_WRITE,
613 prism2mib_groupaddress },
614 { DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address26,
615 F_STA | F_READ | F_WRITE,
617 prism2mib_groupaddress },
618 { DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address27,
619 F_STA | F_READ | F_WRITE,
621 prism2mib_groupaddress },
622 { DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address28,
623 F_STA | F_READ | F_WRITE,
625 prism2mib_groupaddress },
626 { DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address29,
627 F_STA | F_READ | F_WRITE,
629 prism2mib_groupaddress },
630 { DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address30,
631 F_STA | F_READ | F_WRITE,
633 prism2mib_groupaddress },
634 { DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address31,
635 F_STA | F_READ | F_WRITE,
637 prism2mib_groupaddress },
638 { DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address32,
639 F_STA | F_READ | F_WRITE,
641 prism2mib_groupaddress },
645 { DIDmib_dot11phy_dot11PhyOperationTable_dot11PHYType,
646 F_AP | F_STA | F_READ,
647 HFA384x_RID_PHYTYPE, 0, 0,
649 { DIDmib_dot11phy_dot11PhyOperationTable_dot11TempType,
650 F_AP | F_STA | F_READ,
651 HFA384x_RID_TEMPTYPE, 0, 0,
653 { DIDmib_dot11phy_dot11PhyDSSSTable_dot11CurrentChannel,
655 HFA384x_RID_CURRENTCHANNEL, 0, 0,
657 { DIDmib_dot11phy_dot11PhyDSSSTable_dot11CurrentChannel,
659 HFA384x_RID_CNFOWNCHANNEL, 0, 0,
661 { DIDmib_dot11phy_dot11PhyDSSSTable_dot11CurrentCCAMode,
662 F_AP | F_STA | F_READ,
663 HFA384x_RID_CCAMODE, 0, 0,
668 { DIDmib_p2_p2Table_p2MMTx,
669 F_AP | F_STA | F_READ | F_WRITE,
672 { DIDmib_p2_p2Table_p2EarlyBeacon,
673 F_AP | F_READ | F_WRITE,
675 prism2mib_appcfinfoflag },
676 { DIDmib_p2_p2Table_p2ReceivedFrameStatistics,
677 F_AP | F_STA | F_READ,
680 { DIDmib_p2_p2Table_p2CommunicationTallies,
681 F_AP | F_STA | F_READ,
684 { DIDmib_p2_p2Table_p2Authenticated,
688 { DIDmib_p2_p2Table_p2Associated,
692 { DIDmib_p2_p2Table_p2PowerSaveUserCount,
696 { DIDmib_p2_p2Table_p2Comment,
697 F_AP | F_STA | F_READ | F_WRITE,
700 { DIDmib_p2_p2Table_p2AccessMode,
701 F_AP | F_READ | F_WRITE,
704 { DIDmib_p2_p2Table_p2AccessAllow,
705 F_AP | F_READ | F_WRITE,
708 { DIDmib_p2_p2Table_p2AccessDeny,
709 F_AP | F_READ | F_WRITE,
712 { DIDmib_p2_p2Table_p2ChannelInfoResults,
719 { DIDmib_p2_p2Static_p2CnfPortType,
720 F_STA | F_READ | F_WRITE,
721 HFA384x_RID_CNFPORTTYPE, 0, 0,
723 { DIDmib_p2_p2Static_p2CnfOwnMACAddress,
724 F_AP | F_STA | F_READ | F_WRITE,
725 HFA384x_RID_CNFOWNMACADDR, HFA384x_RID_CNFOWNMACADDR_LEN, 0,
726 prism2mib_bytearea2pstr },
727 { DIDmib_p2_p2Static_p2CnfDesiredSSID,
728 F_STA | F_READ | F_WRITE,
729 HFA384x_RID_CNFDESIREDSSID, HFA384x_RID_CNFDESIREDSSID_LEN, 0,
730 prism2mib_bytestr2pstr },
731 { DIDmib_p2_p2Static_p2CnfOwnChannel,
732 F_AP | F_STA | F_READ | F_WRITE,
733 HFA384x_RID_CNFOWNCHANNEL, 0, 0,
735 { DIDmib_p2_p2Static_p2CnfOwnSSID,
736 F_AP | F_STA | F_READ | F_WRITE,
737 HFA384x_RID_CNFOWNSSID, HFA384x_RID_CNFOWNSSID_LEN, 0,
738 prism2mib_bytestr2pstr },
739 { DIDmib_p2_p2Static_p2CnfOwnATIMWindow,
740 F_STA | F_READ | F_WRITE,
741 HFA384x_RID_CNFOWNATIMWIN, 0, 0,
743 { DIDmib_p2_p2Static_p2CnfSystemScale,
744 F_AP | F_STA | F_READ | F_WRITE,
745 HFA384x_RID_CNFSYSSCALE, 0, 0,
747 { DIDmib_p2_p2Static_p2CnfMaxDataLength,
748 F_AP | F_STA | F_READ | F_WRITE,
749 HFA384x_RID_CNFMAXDATALEN, 0, 0,
751 { DIDmib_p2_p2Static_p2CnfWDSAddress,
752 F_STA | F_READ | F_WRITE,
753 HFA384x_RID_CNFWDSADDR, HFA384x_RID_CNFWDSADDR_LEN, 0,
754 prism2mib_bytearea2pstr },
755 { DIDmib_p2_p2Static_p2CnfPMEnabled,
756 F_STA | F_READ | F_WRITE,
757 HFA384x_RID_CNFPMENABLED, 0, 0,
759 { DIDmib_p2_p2Static_p2CnfPMEPS,
760 F_STA | F_READ | F_WRITE,
761 HFA384x_RID_CNFPMEPS, 0, 0,
763 { DIDmib_p2_p2Static_p2CnfMulticastReceive,
764 F_STA | F_READ | F_WRITE,
765 HFA384x_RID_CNFMULTICASTRX, 0, 0,
767 { DIDmib_p2_p2Static_p2CnfMaxSleepDuration,
768 F_STA | F_READ | F_WRITE,
769 HFA384x_RID_CNFMAXSLEEPDUR, 0, 0,
771 { DIDmib_p2_p2Static_p2CnfPMHoldoverDuration,
772 F_STA | F_READ | F_WRITE,
773 HFA384x_RID_CNFPMHOLDDUR, 0, 0,
775 { DIDmib_p2_p2Static_p2CnfOwnName,
776 F_AP | F_STA | F_READ | F_WRITE,
777 HFA384x_RID_CNFOWNNAME, HFA384x_RID_CNFOWNNAME_LEN, 0,
778 prism2mib_bytestr2pstr },
779 { DIDmib_p2_p2Static_p2CnfOwnDTIMPeriod,
780 F_AP | F_STA | F_READ | F_WRITE,
781 HFA384x_RID_CNFOWNDTIMPER, 0, 0,
783 { DIDmib_p2_p2Static_p2CnfWDSAddress1,
784 F_AP | F_READ | F_WRITE,
785 HFA384x_RID_CNFWDSADDR1, HFA384x_RID_CNFWDSADDR1_LEN, 0,
786 prism2mib_bytearea2pstr },
787 { DIDmib_p2_p2Static_p2CnfWDSAddress2,
788 F_AP | F_READ | F_WRITE,
789 HFA384x_RID_CNFWDSADDR2, HFA384x_RID_CNFWDSADDR2_LEN, 0,
790 prism2mib_bytearea2pstr },
791 { DIDmib_p2_p2Static_p2CnfWDSAddress3,
792 F_AP | F_READ | F_WRITE,
793 HFA384x_RID_CNFWDSADDR3, HFA384x_RID_CNFWDSADDR3_LEN, 0,
794 prism2mib_bytearea2pstr },
795 { DIDmib_p2_p2Static_p2CnfWDSAddress4,
796 F_AP | F_READ | F_WRITE,
797 HFA384x_RID_CNFWDSADDR4, HFA384x_RID_CNFWDSADDR4_LEN, 0,
798 prism2mib_bytearea2pstr },
799 { DIDmib_p2_p2Static_p2CnfWDSAddress5,
800 F_AP | F_READ | F_WRITE,
801 HFA384x_RID_CNFWDSADDR5, HFA384x_RID_CNFWDSADDR5_LEN, 0,
802 prism2mib_bytearea2pstr },
803 { DIDmib_p2_p2Static_p2CnfWDSAddress6,
804 F_AP | F_READ | F_WRITE,
805 HFA384x_RID_CNFWDSADDR6, HFA384x_RID_CNFWDSADDR6_LEN, 0,
806 prism2mib_bytearea2pstr },
807 { DIDmib_p2_p2Static_p2CnfMulticastPMBuffering,
808 F_AP | F_READ | F_WRITE,
809 HFA384x_RID_CNFMCASTPMBUFF, 0, 0,
811 { DIDmib_p2_p2Static_p2CnfWEPDefaultKeyID,
812 F_AP | F_STA | F_READ | F_WRITE,
813 HFA384x_RID_CNFWEPDEFAULTKEYID, 0, 0,
815 { DIDmib_p2_p2Static_p2CnfWEPDefaultKey0,
816 F_AP | F_STA | F_WRITE,
817 HFA384x_RID_CNFWEPDEFAULTKEY0, 0, 0,
818 prism2mib_wepdefaultkey },
819 { DIDmib_p2_p2Static_p2CnfWEPDefaultKey1,
820 F_AP | F_STA | F_WRITE,
821 HFA384x_RID_CNFWEPDEFAULTKEY1, 0, 0,
822 prism2mib_wepdefaultkey },
823 { DIDmib_p2_p2Static_p2CnfWEPDefaultKey2,
824 F_AP | F_STA | F_WRITE,
825 HFA384x_RID_CNFWEPDEFAULTKEY2, 0, 0,
826 prism2mib_wepdefaultkey },
827 { DIDmib_p2_p2Static_p2CnfWEPDefaultKey3,
828 F_AP | F_STA | F_WRITE,
829 HFA384x_RID_CNFWEPDEFAULTKEY3, 0, 0,
830 prism2mib_wepdefaultkey },
831 { DIDmib_p2_p2Static_p2CnfWEPFlags,
832 F_AP | F_STA | F_READ | F_WRITE,
833 HFA384x_RID_CNFWEPFLAGS, 0, 0,
835 { DIDmib_p2_p2Static_p2CnfAuthentication,
836 F_AP | F_STA | F_READ | F_WRITE,
837 HFA384x_RID_CNFAUTHENTICATION, 0, 0,
839 { DIDmib_p2_p2Static_p2CnfMaxAssociatedStations,
840 F_AP | F_READ | F_WRITE,
841 HFA384x_RID_CNFMAXASSOCSTATIONS, 0, 0,
843 { DIDmib_p2_p2Static_p2CnfTxControl,
844 F_AP | F_STA | F_READ | F_WRITE,
845 HFA384x_RID_CNFTXCONTROL, 0, 0,
847 { DIDmib_p2_p2Static_p2CnfRoamingMode,
848 F_STA | F_READ | F_WRITE,
849 HFA384x_RID_CNFROAMINGMODE, 0, 0,
851 { DIDmib_p2_p2Static_p2CnfHostAuthentication,
852 F_AP | F_READ | F_WRITE,
853 HFA384x_RID_CNFHOSTAUTHASSOC, 0, 0,
855 { DIDmib_p2_p2Static_p2CnfRcvCrcError,
856 F_AP | F_STA | F_READ | F_WRITE,
857 HFA384x_RID_CNFRCVCRCERROR, 0, 0,
859 { DIDmib_p2_p2Static_p2CnfAltRetryCount,
860 F_AP | F_STA | F_READ | F_WRITE,
861 HFA384x_RID_CNFALTRETRYCNT, 0, 0,
863 { DIDmib_p2_p2Static_p2CnfBeaconInterval,
864 F_AP | F_READ | F_WRITE,
865 HFA384x_RID_CNFAPBCNINT, 0, 0,
867 { DIDmib_p2_p2Static_p2CnfMediumOccupancyLimit,
868 F_AP | F_READ | F_WRITE,
869 HFA384x_RID_CNFAPPCFINFO, HFA384x_RID_CNFAPPCFINFO_LEN, 0,
870 prism2mib_uint32offset },
871 { DIDmib_p2_p2Static_p2CnfCFPPeriod,
872 F_AP | F_READ | F_WRITE,
873 HFA384x_RID_CNFAPPCFINFO, HFA384x_RID_CNFAPPCFINFO_LEN, 1,
874 prism2mib_uint32offset },
875 { DIDmib_p2_p2Static_p2CnfCFPMaxDuration,
876 F_AP | F_READ | F_WRITE,
877 HFA384x_RID_CNFAPPCFINFO, HFA384x_RID_CNFAPPCFINFO_LEN, 2,
878 prism2mib_uint32offset },
879 { DIDmib_p2_p2Static_p2CnfCFPFlags,
880 F_AP | F_READ | F_WRITE,
881 HFA384x_RID_CNFAPPCFINFO, HFA384x_RID_CNFAPPCFINFO_LEN, 3,
882 prism2mib_uint32offset },
883 { DIDmib_p2_p2Static_p2CnfSTAPCFInfo,
884 F_STA | F_READ | F_WRITE,
885 HFA384x_RID_CNFSTAPCFINFO, 0, 0,
887 { DIDmib_p2_p2Static_p2CnfPriorityQUsage,
888 F_AP | F_STA | F_READ | F_WRITE,
889 HFA384x_RID_CNFPRIORITYQUSAGE, HFA384x_RID_CNFPRIOQUSAGE_LEN, 0,
890 prism2mib_uint32array },
891 { DIDmib_p2_p2Static_p2CnfTIMCtrl,
892 F_AP | F_STA | F_READ | F_WRITE,
893 HFA384x_RID_CNFTIMCTRL, 0, 0,
895 { DIDmib_p2_p2Static_p2CnfThirty2Tally,
896 F_AP | F_STA | F_READ | F_WRITE,
897 HFA384x_RID_CNFTHIRTY2TALLY, 0, 0,
899 { DIDmib_p2_p2Static_p2CnfEnhSecurity,
900 F_AP | F_READ | F_WRITE,
901 HFA384x_RID_CNFENHSECURITY, 0, 0,
903 { DIDmib_p2_p2Static_p2CnfShortPreamble,
904 F_AP | F_STA | F_READ | F_WRITE,
905 HFA384x_RID_CNFSHORTPREAMBLE, 0, 0,
906 prism2mib_preamble },
907 { DIDmib_p2_p2Static_p2CnfExcludeLongPreamble,
908 F_AP | F_READ | F_WRITE,
909 HFA384x_RID_CNFEXCLONGPREAMBLE, 0, 0,
911 { DIDmib_p2_p2Static_p2CnfAuthenticationRspTO,
912 F_STA | F_READ | F_WRITE,
913 HFA384x_RID_CNFAUTHRSPTIMEOUT, 0, 0,
915 { DIDmib_p2_p2Static_p2CnfBasicRates,
916 F_AP | F_STA | F_READ | F_WRITE,
917 HFA384x_RID_CNFBASICRATES, 0, 0,
919 { DIDmib_p2_p2Static_p2CnfSupportedRates,
920 F_AP | F_STA | F_READ | F_WRITE,
921 HFA384x_RID_CNFSUPPRATES, 0, 0,
924 /* p2Dynamic MIB's */
926 { DIDmib_p2_p2Dynamic_p2CreateIBSS,
927 F_STA | F_READ | F_WRITE,
928 HFA384x_RID_CREATEIBSS, 0, 0,
930 { DIDmib_p2_p2Dynamic_p2FragmentationThreshold,
931 F_STA | F_READ | F_WRITE,
932 HFA384x_RID_FRAGTHRESH, 0, 0,
933 prism2mib_fragmentationthreshold },
934 { DIDmib_p2_p2Dynamic_p2RTSThreshold,
935 F_STA | F_READ | F_WRITE,
936 HFA384x_RID_RTSTHRESH, 0, 0,
938 { DIDmib_p2_p2Dynamic_p2TxRateControl,
939 F_STA | F_READ | F_WRITE,
940 HFA384x_RID_TXRATECNTL, 0, 0,
942 { DIDmib_p2_p2Dynamic_p2PromiscuousMode,
943 F_STA | F_READ | F_WRITE,
944 HFA384x_RID_PROMISCMODE, 0, 0,
946 { DIDmib_p2_p2Dynamic_p2FragmentationThreshold0,
947 F_AP | F_READ | F_WRITE,
948 HFA384x_RID_FRAGTHRESH0, 0, 0,
949 prism2mib_fragmentationthreshold },
950 { DIDmib_p2_p2Dynamic_p2FragmentationThreshold1,
951 F_AP | F_READ | F_WRITE,
952 HFA384x_RID_FRAGTHRESH1, 0, 0,
953 prism2mib_fragmentationthreshold },
954 { DIDmib_p2_p2Dynamic_p2FragmentationThreshold2,
955 F_AP | F_READ | F_WRITE,
956 HFA384x_RID_FRAGTHRESH2, 0, 0,
957 prism2mib_fragmentationthreshold },
958 { DIDmib_p2_p2Dynamic_p2FragmentationThreshold3,
959 F_AP | F_READ | F_WRITE,
960 HFA384x_RID_FRAGTHRESH3, 0, 0,
961 prism2mib_fragmentationthreshold },
962 { DIDmib_p2_p2Dynamic_p2FragmentationThreshold4,
963 F_AP | F_READ | F_WRITE,
964 HFA384x_RID_FRAGTHRESH4, 0, 0,
965 prism2mib_fragmentationthreshold },
966 { DIDmib_p2_p2Dynamic_p2FragmentationThreshold5,
967 F_AP | F_READ | F_WRITE,
968 HFA384x_RID_FRAGTHRESH5, 0, 0,
969 prism2mib_fragmentationthreshold },
970 { DIDmib_p2_p2Dynamic_p2FragmentationThreshold6,
971 F_AP | F_READ | F_WRITE,
972 HFA384x_RID_FRAGTHRESH6, 0, 0,
973 prism2mib_fragmentationthreshold },
974 { DIDmib_p2_p2Dynamic_p2RTSThreshold0,
975 F_AP | F_READ | F_WRITE,
976 HFA384x_RID_RTSTHRESH0, 0, 0,
978 { DIDmib_p2_p2Dynamic_p2RTSThreshold1,
979 F_AP | F_READ | F_WRITE,
980 HFA384x_RID_RTSTHRESH1, 0, 0,
982 { DIDmib_p2_p2Dynamic_p2RTSThreshold2,
983 F_AP | F_READ | F_WRITE,
984 HFA384x_RID_RTSTHRESH2, 0, 0,
986 { DIDmib_p2_p2Dynamic_p2RTSThreshold3,
987 F_AP | F_READ | F_WRITE,
988 HFA384x_RID_RTSTHRESH3, 0, 0,
990 { DIDmib_p2_p2Dynamic_p2RTSThreshold4,
991 F_AP | F_READ | F_WRITE,
992 HFA384x_RID_RTSTHRESH4, 0, 0,
994 { DIDmib_p2_p2Dynamic_p2RTSThreshold5,
995 F_AP | F_READ | F_WRITE,
996 HFA384x_RID_RTSTHRESH5, 0, 0,
998 { DIDmib_p2_p2Dynamic_p2RTSThreshold6,
999 F_AP | F_READ | F_WRITE,
1000 HFA384x_RID_RTSTHRESH6, 0, 0,
1002 { DIDmib_p2_p2Dynamic_p2TxRateControl0,
1003 F_AP | F_READ | F_WRITE,
1004 HFA384x_RID_TXRATECNTL0, 0, 0,
1006 { DIDmib_p2_p2Dynamic_p2TxRateControl1,
1007 F_AP | F_READ | F_WRITE,
1008 HFA384x_RID_TXRATECNTL1, 0, 0,
1010 { DIDmib_p2_p2Dynamic_p2TxRateControl2,
1011 F_AP | F_READ | F_WRITE,
1012 HFA384x_RID_TXRATECNTL2, 0, 0,
1014 { DIDmib_p2_p2Dynamic_p2TxRateControl3,
1015 F_AP | F_READ | F_WRITE,
1016 HFA384x_RID_TXRATECNTL3, 0, 0,
1018 { DIDmib_p2_p2Dynamic_p2TxRateControl4,
1019 F_AP | F_READ | F_WRITE,
1020 HFA384x_RID_TXRATECNTL4, 0, 0,
1022 { DIDmib_p2_p2Dynamic_p2TxRateControl5,
1023 F_AP | F_READ | F_WRITE,
1024 HFA384x_RID_TXRATECNTL5, 0, 0,
1026 { DIDmib_p2_p2Dynamic_p2TxRateControl6,
1027 F_AP | F_READ | F_WRITE,
1028 HFA384x_RID_TXRATECNTL6, 0, 0,
1031 /* p2Behavior MIB's */
1033 { DIDmib_p2_p2Behavior_p2TickTime,
1034 F_AP | F_STA | F_READ | F_WRITE,
1035 HFA384x_RID_ITICKTIME, 0, 0,
1040 { DIDmib_p2_p2NIC_p2MaxLoadTime,
1041 F_AP | F_STA | F_READ,
1042 HFA384x_RID_MAXLOADTIME, 0, 0,
1044 { DIDmib_p2_p2NIC_p2DLBufferPage,
1045 F_AP | F_STA | F_READ,
1046 HFA384x_RID_DOWNLOADBUFFER, HFA384x_RID_DOWNLOADBUFFER_LEN, 0,
1047 prism2mib_uint32offset },
1048 { DIDmib_p2_p2NIC_p2DLBufferOffset,
1049 F_AP | F_STA | F_READ,
1050 HFA384x_RID_DOWNLOADBUFFER, HFA384x_RID_DOWNLOADBUFFER_LEN, 1,
1051 prism2mib_uint32offset },
1052 { DIDmib_p2_p2NIC_p2DLBufferLength,
1053 F_AP | F_STA | F_READ,
1054 HFA384x_RID_DOWNLOADBUFFER, HFA384x_RID_DOWNLOADBUFFER_LEN, 2,
1055 prism2mib_uint32offset },
1056 { DIDmib_p2_p2NIC_p2PRIIdentity,
1057 F_AP | F_STA | F_READ,
1058 HFA384x_RID_PRIIDENTITY, HFA384x_RID_PRIIDENTITY_LEN, 0,
1059 prism2mib_uint32array },
1060 { DIDmib_p2_p2NIC_p2PRISupRange,
1061 F_AP | F_STA | F_READ,
1062 HFA384x_RID_PRISUPRANGE, HFA384x_RID_PRISUPRANGE_LEN, 0,
1063 prism2mib_uint32array },
1064 { DIDmib_p2_p2NIC_p2CFIActRanges,
1065 F_AP | F_STA | F_READ,
1066 HFA384x_RID_PRI_CFIACTRANGES, HFA384x_RID_CFIACTRANGES_LEN, 0,
1067 prism2mib_uint32array },
1068 { DIDmib_p2_p2NIC_p2BuildSequence,
1069 F_AP | F_STA | F_READ,
1070 HFA384x_RID_BUILDSEQ, HFA384x_RID_BUILDSEQ_LEN, 0,
1071 prism2mib_uint32array },
1072 { DIDmib_p2_p2NIC_p2PrimaryFWID,
1073 F_AP | F_STA | F_READ,
1076 { DIDmib_p2_p2NIC_p2SecondaryFWID,
1077 F_AP | F_STA | F_READ,
1080 { DIDmib_p2_p2NIC_p2TertiaryFWID,
1084 { DIDmib_p2_p2NIC_p2NICSerialNumber,
1085 F_AP | F_STA | F_READ,
1086 HFA384x_RID_NICSERIALNUMBER, HFA384x_RID_NICSERIALNUMBER_LEN, 0,
1087 prism2mib_bytearea2pstr },
1088 { DIDmib_p2_p2NIC_p2NICIdentity,
1089 F_AP | F_STA | F_READ,
1090 HFA384x_RID_NICIDENTITY, HFA384x_RID_NICIDENTITY_LEN, 0,
1091 prism2mib_uint32array },
1092 { DIDmib_p2_p2NIC_p2MFISupRange,
1093 F_AP | F_STA | F_READ,
1094 HFA384x_RID_MFISUPRANGE, HFA384x_RID_MFISUPRANGE_LEN, 0,
1095 prism2mib_uint32array },
1096 { DIDmib_p2_p2NIC_p2CFISupRange,
1097 F_AP | F_STA | F_READ,
1098 HFA384x_RID_CFISUPRANGE, HFA384x_RID_CFISUPRANGE_LEN, 0,
1099 prism2mib_uint32array },
1100 { DIDmib_p2_p2NIC_p2ChannelList,
1101 F_AP | F_STA | F_READ,
1102 HFA384x_RID_CHANNELLIST, 0, 0,
1104 { DIDmib_p2_p2NIC_p2RegulatoryDomains,
1105 F_AP | F_STA | F_READ,
1106 HFA384x_RID_REGULATORYDOMAINS, HFA384x_RID_REGULATORYDOMAINS_LEN, 0,
1107 prism2mib_regulatorydomains },
1108 { DIDmib_p2_p2NIC_p2TempType,
1109 F_AP | F_STA | F_READ,
1110 HFA384x_RID_TEMPTYPE, 0, 0,
1112 { DIDmib_p2_p2NIC_p2STAIdentity,
1113 F_AP | F_STA | F_READ,
1114 HFA384x_RID_STAIDENTITY, HFA384x_RID_STAIDENTITY_LEN, 0,
1115 prism2mib_uint32array },
1116 { DIDmib_p2_p2NIC_p2STASupRange,
1117 F_AP | F_STA | F_READ,
1118 HFA384x_RID_STASUPRANGE, HFA384x_RID_STASUPRANGE_LEN, 0,
1119 prism2mib_uint32array },
1120 { DIDmib_p2_p2NIC_p2MFIActRanges,
1121 F_AP | F_STA | F_READ,
1122 HFA384x_RID_STA_MFIACTRANGES, HFA384x_RID_MFIACTRANGES_LEN, 0,
1123 prism2mib_uint32array },
1124 { DIDmib_p2_p2NIC_p2STACFIActRanges,
1125 F_AP | F_STA | F_READ,
1126 HFA384x_RID_STA_CFIACTRANGES, HFA384x_RID_CFIACTRANGES2_LEN, 0,
1127 prism2mib_uint32array },
1131 { DIDmib_p2_p2MAC_p2PortStatus,
1133 HFA384x_RID_PORTSTATUS, 0, 0,
1135 { DIDmib_p2_p2MAC_p2CurrentSSID,
1137 HFA384x_RID_CURRENTSSID, HFA384x_RID_CURRENTSSID_LEN, 0,
1138 prism2mib_bytestr2pstr },
1139 { DIDmib_p2_p2MAC_p2CurrentBSSID,
1141 HFA384x_RID_CURRENTBSSID, HFA384x_RID_CURRENTBSSID_LEN, 0,
1142 prism2mib_bytearea2pstr },
1143 { DIDmib_p2_p2MAC_p2CommsQuality,
1145 HFA384x_RID_COMMSQUALITY, HFA384x_RID_COMMSQUALITY_LEN, 0,
1146 prism2mib_uint32array },
1147 { DIDmib_p2_p2MAC_p2CommsQualityCQ,
1149 HFA384x_RID_COMMSQUALITY, HFA384x_RID_COMMSQUALITY_LEN, 0,
1150 prism2mib_uint32offset },
1151 { DIDmib_p2_p2MAC_p2CommsQualityASL,
1153 HFA384x_RID_COMMSQUALITY, HFA384x_RID_COMMSQUALITY_LEN, 1,
1154 prism2mib_uint32offset },
1155 { DIDmib_p2_p2MAC_p2CommsQualityANL,
1157 HFA384x_RID_COMMSQUALITY, HFA384x_RID_COMMSQUALITY_LEN, 2,
1158 prism2mib_uint32offset },
1159 { DIDmib_p2_p2MAC_p2dbmCommsQuality,
1161 HFA384x_RID_DBMCOMMSQUALITY, HFA384x_RID_DBMCOMMSQUALITY_LEN, 0,
1162 prism2mib_uint32array },
1163 { DIDmib_p2_p2MAC_p2dbmCommsQualityCQ,
1165 HFA384x_RID_COMMSQUALITY, HFA384x_RID_COMMSQUALITY_LEN, 0,
1166 prism2mib_uint32offset },
1167 { DIDmib_p2_p2MAC_p2dbmCommsQualityASL,
1169 HFA384x_RID_COMMSQUALITY, HFA384x_RID_COMMSQUALITY_LEN, 1,
1170 prism2mib_uint32offset },
1171 { DIDmib_p2_p2MAC_p2dbmCommsQualityANL,
1173 HFA384x_RID_COMMSQUALITY, HFA384x_RID_COMMSQUALITY_LEN, 2,
1174 prism2mib_uint32offset },
1175 { DIDmib_p2_p2MAC_p2CurrentTxRate,
1177 HFA384x_RID_CURRENTTXRATE, 0, 0,
1179 { DIDmib_p2_p2MAC_p2CurrentBeaconInterval,
1180 F_AP | F_STA | F_READ,
1181 HFA384x_RID_CURRENTBCNINT, 0, 0,
1183 { DIDmib_p2_p2MAC_p2StaCurrentScaleThresholds,
1185 HFA384x_RID_CURRENTSCALETHRESH, HFA384x_RID_STACURSCALETHRESH_LEN, 0,
1186 prism2mib_uint32array },
1187 { DIDmib_p2_p2MAC_p2APCurrentScaleThresholds,
1189 HFA384x_RID_CURRENTSCALETHRESH, HFA384x_RID_APCURSCALETHRESH_LEN, 0,
1190 prism2mib_uint32array },
1191 { DIDmib_p2_p2MAC_p2ProtocolRspTime,
1192 F_AP | F_STA | F_READ,
1193 HFA384x_RID_PROTOCOLRSPTIME, 0, 0,
1195 { DIDmib_p2_p2MAC_p2ShortRetryLimit,
1196 F_AP | F_STA | F_READ,
1197 HFA384x_RID_SHORTRETRYLIMIT, 0, 0,
1199 { DIDmib_p2_p2MAC_p2LongRetryLimit,
1200 F_AP | F_STA | F_READ,
1201 HFA384x_RID_LONGRETRYLIMIT, 0, 0,
1203 { DIDmib_p2_p2MAC_p2MaxTransmitLifetime,
1204 F_AP | F_STA | F_READ,
1205 HFA384x_RID_MAXTXLIFETIME, 0, 0,
1207 { DIDmib_p2_p2MAC_p2MaxReceiveLifetime,
1208 F_AP | F_STA | F_READ,
1209 HFA384x_RID_MAXRXLIFETIME, 0, 0,
1211 { DIDmib_p2_p2MAC_p2CFPollable,
1213 HFA384x_RID_CFPOLLABLE, 0, 0,
1215 { DIDmib_p2_p2MAC_p2AuthenticationAlgorithms,
1216 F_AP | F_STA | F_READ,
1217 HFA384x_RID_AUTHALGORITHMS, HFA384x_RID_AUTHALGORITHMS_LEN, 0,
1218 prism2mib_uint32array },
1219 { DIDmib_p2_p2MAC_p2PrivacyOptionImplemented,
1220 F_AP | F_STA | F_READ,
1221 HFA384x_RID_PRIVACYOPTIMP, 0, 0,
1223 { DIDmib_p2_p2MAC_p2CurrentTxRate1,
1225 HFA384x_RID_CURRENTTXRATE1, 0, 0,
1227 { DIDmib_p2_p2MAC_p2CurrentTxRate2,
1229 HFA384x_RID_CURRENTTXRATE2, 0, 0,
1231 { DIDmib_p2_p2MAC_p2CurrentTxRate3,
1233 HFA384x_RID_CURRENTTXRATE3, 0, 0,
1235 { DIDmib_p2_p2MAC_p2CurrentTxRate4,
1237 HFA384x_RID_CURRENTTXRATE4, 0, 0,
1239 { DIDmib_p2_p2MAC_p2CurrentTxRate5,
1241 HFA384x_RID_CURRENTTXRATE5, 0, 0,
1243 { DIDmib_p2_p2MAC_p2CurrentTxRate6,
1245 HFA384x_RID_CURRENTTXRATE6, 0, 0,
1247 { DIDmib_p2_p2MAC_p2OwnMACAddress,
1249 HFA384x_RID_OWNMACADDRESS, HFA384x_RID_OWNMACADDRESS_LEN, 0,
1250 prism2mib_bytearea2pstr },
1254 { DIDmib_p2_p2Modem_p2PHYType,
1255 F_AP | F_STA | F_READ,
1256 HFA384x_RID_PHYTYPE, 0, 0,
1258 { DIDmib_p2_p2Modem_p2CurrentChannel,
1259 F_AP | F_STA | F_READ,
1260 HFA384x_RID_CURRENTCHANNEL, 0, 0,
1262 { DIDmib_p2_p2Modem_p2CurrentPowerState,
1263 F_AP | F_STA | F_READ,
1264 HFA384x_RID_CURRENTPOWERSTATE, 0, 0,
1266 { DIDmib_p2_p2Modem_p2CCAMode,
1267 F_AP | F_STA | F_READ,
1268 HFA384x_RID_CCAMODE, 0, 0,
1270 { DIDmib_p2_p2Modem_p2TxPowerMax,
1271 F_AP | F_STA | F_READ | F_WRITE,
1272 HFA384x_RID_TXPOWERMAX, 0, 0,
1274 { DIDmib_dot11phy_dot11PhyTxPowerTable_dot11CurrentTxPowerLevel,
1275 F_AP | F_STA | F_READ | F_WRITE,
1276 HFA384x_RID_TXPOWERMAX, 0, 0,
1278 { DIDmib_p2_p2Modem_p2SupportedDataRates,
1279 F_AP | F_STA | F_READ,
1280 HFA384x_RID_SUPPORTEDDATARATES, HFA384x_RID_SUPPORTEDDATARATES_LEN, 0,
1281 prism2mib_bytestr2pstr },
1283 /* And finally, lnx mibs */
1284 { DIDmib_lnx_lnxConfigTable_lnxRSNAIE,
1285 F_STA | F_READ | F_WRITE,
1286 HFA384x_RID_CNFWPADATA, 0, 0,
1288 { 0, 0, 0, 0, 0, NULL}};
1290 /*----------------------------------------------------------------
1291 These MIB's are not supported at this time:
1293 DIDmib_dot11phy_dot11PhyOperationTable_dot11ChannelAgilityPresent
1294 DIDmib_dot11phy_dot11PhyOperationTable_dot11ChannelAgilityEnabled
1295 DIDmib_dot11phy_dot11PhyDSSSTable_dot11PBCCOptionImplemented
1296 DIDmib_dot11phy_dot11RegDomainsSupportedTable_dot11RegDomainsSupportIndex
1297 DIDmib_dot11phy_dot11SupportedDataRatesTxTable_dot11SupportedDataRatesTxIndex
1298 DIDmib_dot11phy_dot11SupportedDataRatesTxTable_dot11SupportedDataRatesTxValue
1299 DIDmib_dot11phy_dot11SupportedDataRatesRxTable_dot11SupportedDataRatesRxIndex
1300 DIDmib_dot11phy_dot11SupportedDataRatesRxTable_dot11SupportedDataRatesRxValue
1302 DIDmib_dot11phy_dot11RegDomainsSupportedTable_dot11RegDomainsSupportValue
1303 TODO: need to investigate why wlan has this as enumerated and Prism2 has this
1306 DIDmib_dot11phy_dot11PhyDSSSTable_dot11ShortPreambleOptionImplemented
1307 TODO: Find out the firmware version number(s) for identifying
1308 whether the firmware is capable of short preamble. TRUE or FALSE
1309 will be returned based on the version of the firmware.
1311 WEP Key mappings aren't supported in the f/w.
1312 DIDmib_dot11smt_dot11WEPKeyMappingsTable_dot11WEPKeyMappingIndex
1313 DIDmib_dot11smt_dot11WEPKeyMappingsTable_dot11WEPKeyMappingAddress
1314 DIDmib_dot11smt_dot11WEPKeyMappingsTable_dot11WEPKeyMappingWEPOn
1315 DIDmib_dot11smt_dot11WEPKeyMappingsTable_dot11WEPKeyMappingValue
1316 DIDmib_dot11smt_dot11PrivacyTable_dot11WEPKeyMappingLength
1318 TODO: implement counters.
1319 DIDmib_dot11smt_dot11PrivacyTable_dot11WEPICVErrorCount
1320 DIDmib_dot11smt_dot11PrivacyTable_dot11WEPExcludedCount
1321 DIDmib_dot11mac_dot11CountersTable_dot11TransmittedFragmentCount
1322 DIDmib_dot11mac_dot11CountersTable_dot11MulticastTransmittedFrameCount
1323 DIDmib_dot11mac_dot11CountersTable_dot11FailedCount
1324 DIDmib_dot11mac_dot11CountersTable_dot11RetryCount
1325 DIDmib_dot11mac_dot11CountersTable_dot11MultipleRetryCount
1326 DIDmib_dot11mac_dot11CountersTable_dot11FrameDuplicateCount
1327 DIDmib_dot11mac_dot11CountersTable_dot11RTSSuccessCount
1328 DIDmib_dot11mac_dot11CountersTable_dot11RTSFailureCount
1329 DIDmib_dot11mac_dot11CountersTable_dot11ACKFailureCount
1330 DIDmib_dot11mac_dot11CountersTable_dot11ReceivedFragmentCount
1331 DIDmib_dot11mac_dot11CountersTable_dot11MulticastReceivedFrameCount
1332 DIDmib_dot11mac_dot11CountersTable_dot11FCSErrorCount
1333 DIDmib_dot11mac_dot11CountersTable_dot11TransmittedFrameCount
1334 DIDmib_dot11mac_dot11CountersTable_dot11WEPUndecryptableCount
1336 TODO: implement sane values for these.
1337 DIDmib_dot11mac_dot11OperationTable_dot11ManufacturerID
1338 DIDmib_dot11mac_dot11OperationTable_dot11ProductID
1340 Not too worried about these at the moment.
1341 DIDmib_dot11phy_dot11PhyAntennaTable_dot11CurrentTxAntenna
1342 DIDmib_dot11phy_dot11PhyAntennaTable_dot11DiversitySupport
1343 DIDmib_dot11phy_dot11PhyAntennaTable_dot11CurrentRxAntenna
1344 DIDmib_dot11phy_dot11PhyTxPowerTable_dot11NumberSupportedPowerLevels
1345 DIDmib_dot11phy_dot11PhyTxPowerTable_dot11TxPowerLevel1
1346 DIDmib_dot11phy_dot11PhyTxPowerTable_dot11TxPowerLevel2
1347 DIDmib_dot11phy_dot11PhyTxPowerTable_dot11TxPowerLevel3
1348 DIDmib_dot11phy_dot11PhyTxPowerTable_dot11TxPowerLevel4
1349 DIDmib_dot11phy_dot11PhyTxPowerTable_dot11TxPowerLevel5
1350 DIDmib_dot11phy_dot11PhyTxPowerTable_dot11TxPowerLevel6
1351 DIDmib_dot11phy_dot11PhyTxPowerTable_dot11TxPowerLevel7
1352 DIDmib_dot11phy_dot11PhyTxPowerTable_dot11TxPowerLevel8
1353 DIDmib_dot11phy_dot11PhyTxPowerTable_dot11CurrentTxPowerLevel
1355 Ummm, FH and IR don't apply
1356 DIDmib_dot11phy_dot11PhyFHSSTable_dot11HopTime
1357 DIDmib_dot11phy_dot11PhyFHSSTable_dot11CurrentChannelNumber
1358 DIDmib_dot11phy_dot11PhyFHSSTable_dot11MaxDwellTime
1359 DIDmib_dot11phy_dot11PhyFHSSTable_dot11CurrentDwellTime
1360 DIDmib_dot11phy_dot11PhyFHSSTable_dot11CurrentSet
1361 DIDmib_dot11phy_dot11PhyFHSSTable_dot11CurrentPattern
1362 DIDmib_dot11phy_dot11PhyFHSSTable_dot11CurrentIndex
1363 DIDmib_dot11phy_dot11PhyDSSSTable_dot11CCAModeSupported
1364 DIDmib_dot11phy_dot11PhyDSSSTable_dot11EDThreshold
1365 DIDmib_dot11phy_dot11PhyIRTable_dot11CCAWatchdogTimerMax
1366 DIDmib_dot11phy_dot11PhyIRTable_dot11CCAWatchdogCountMax
1367 DIDmib_dot11phy_dot11PhyIRTable_dot11CCAWatchdogTimerMin
1368 DIDmib_dot11phy_dot11PhyIRTable_dot11CCAWatchdogCountMin
1370 We just don't have enough antennas right now to worry about this.
1371 DIDmib_dot11phy_dot11AntennasListTable_dot11AntennaListIndex
1372 DIDmib_dot11phy_dot11AntennasListTable_dot11SupportedTxAntenna
1373 DIDmib_dot11phy_dot11AntennasListTable_dot11SupportedRxAntenna
1374 DIDmib_dot11phy_dot11AntennasListTable_dot11DiversitySelectionRx
1376 ------------------------------------------------------------------*/
1378 /*================================================================*/
1379 /* Function Definitions */
1381 /*----------------------------------------------------------------
1382 * prism2mgmt_mibset_mibget
1384 * Set the value of a mib item.
1387 * wlandev wlan device structure
1388 * msgp ptr to msg buffer
1391 * 0 success and done
1392 * <0 success, but we're waiting for something to finish.
1393 * >0 an error occurred while handling the message.
1397 * process thread (usually)
1399 ----------------------------------------------------------------*/
1401 int prism2mgmt_mibset_mibget(wlandevice_t *wlandev, void *msgp)
1403 hfa384x_t *hw = wlandev->priv;
1408 p80211msg_dot11req_mibset_t *msg = msgp;
1409 p80211itemd_t *mibitem;
1413 msg->resultcode.status = P80211ENUM_msgitem_status_data_ok;
1414 msg->resultcode.data = P80211ENUM_resultcode_success;
1417 ** Determine if this is an Access Point or a station.
1420 which = hw->ap ? F_AP : F_STA;
1423 ** Find the MIB in the MIB table. Note that a MIB may be in the
1424 ** table twice...once for an AP and once for a station. Make sure
1425 ** to get the correct one. Note that DID=0 marks the end of the
1429 mibitem = (p80211itemd_t *) msg->mibattribute.data;
1431 for (mib = mibtab; mib->did != 0; mib++)
1432 if (mib->did == mibitem->did && (mib->flag & which))
1435 if (mib->did == 0) {
1436 msg->resultcode.data = P80211ENUM_resultcode_not_supported;
1441 ** Determine if this is a "mibget" or a "mibset". If this is a
1442 ** "mibget", then make sure that the MIB may be read. Otherwise,
1443 ** this is a "mibset" so make make sure that the MIB may be written.
1446 isget = (msg->msgcode == DIDmsg_dot11req_mibget);
1449 if (!(mib->flag & F_READ)) {
1450 msg->resultcode.data =
1451 P80211ENUM_resultcode_cant_get_writeonly_mib;
1455 if (!(mib->flag & F_WRITE)) {
1456 msg->resultcode.data =
1457 P80211ENUM_resultcode_cant_set_readonly_mib;
1463 ** Execute the MIB function. If things worked okay, then make
1464 ** sure that the MIB function also worked okay. If so, and this
1465 ** is a "mibget", then the status value must be set for both the
1466 ** "mibattribute" parameter and the mib item within the data
1467 ** portion of the "mibattribute".
1470 result = mib->func(mib, isget, wlandev, hw, msg,
1471 (void *) mibitem->data);
1473 if (msg->resultcode.data == P80211ENUM_resultcode_success) {
1475 WLAN_LOG_DEBUG(1, "get/set failure, result=%d\n",
1477 msg->resultcode.data =
1478 P80211ENUM_resultcode_implementation_failure;
1481 msg->mibattribute.status =
1482 P80211ENUM_msgitem_status_data_ok;
1484 P80211ENUM_msgitem_status_data_ok;
1495 /*----------------------------------------------------------------
1496 * prism2mib_bytestr2pstr
1498 * Get/set pstr data to/from a byte string.
1500 * MIB record parameters:
1501 * parm1 Prism2 RID value.
1502 * parm2 Number of bytes of RID data.
1507 * isget MIBGET/MIBSET flag.
1508 * wlandev wlan device structure.
1509 * priv "priv" structure.
1510 * hw "hw" structure.
1511 * msg Message structure.
1518 ----------------------------------------------------------------*/
1520 static int prism2mib_bytestr2pstr(
1523 wlandevice_t *wlandev,
1525 p80211msg_dot11req_mibset_t *msg,
1529 p80211pstrd_t *pstr = (p80211pstrd_t*) data;
1530 UINT8 bytebuf[MIB_TMP_MAXLEN];
1531 hfa384x_bytestr_t *p2bytestr = (hfa384x_bytestr_t*) bytebuf;
1536 result = hfa384x_drvr_getconfig(hw, mib->parm1, bytebuf, mib->parm2);
1537 prism2mgmt_bytestr2pstr(p2bytestr, pstr);
1539 memset(bytebuf, 0, mib->parm2);
1540 prism2mgmt_pstr2bytestr(p2bytestr, pstr);
1541 result = hfa384x_drvr_setconfig(hw, mib->parm1, bytebuf, mib->parm2);
1548 /*----------------------------------------------------------------
1549 * prism2mib_bytearea2pstr
1551 * Get/set pstr data to/from a byte area.
1553 * MIB record parameters:
1554 * parm1 Prism2 RID value.
1555 * parm2 Number of bytes of RID data.
1560 * isget MIBGET/MIBSET flag.
1561 * wlandev wlan device structure.
1562 * priv "priv" structure.
1563 * hw "hw" structure.
1564 * msg Message structure.
1571 ----------------------------------------------------------------*/
1573 static int prism2mib_bytearea2pstr(
1576 wlandevice_t *wlandev,
1578 p80211msg_dot11req_mibset_t *msg,
1582 p80211pstrd_t *pstr = (p80211pstrd_t*) data;
1583 UINT8 bytebuf[MIB_TMP_MAXLEN];
1588 result = hfa384x_drvr_getconfig(hw, mib->parm1, bytebuf, mib->parm2);
1589 prism2mgmt_bytearea2pstr(bytebuf, pstr, mib->parm2);
1591 memset(bytebuf, 0, mib->parm2);
1592 prism2mgmt_pstr2bytearea(bytebuf, pstr);
1593 result = hfa384x_drvr_setconfig(hw, mib->parm1, bytebuf, mib->parm2);
1600 /*----------------------------------------------------------------
1603 * Get/set uint32 data.
1605 * MIB record parameters:
1606 * parm1 Prism2 RID value.
1612 * isget MIBGET/MIBSET flag.
1613 * wlandev wlan device structure.
1614 * priv "priv" structure.
1615 * hw "hw" structure.
1616 * msg Message structure.
1623 ----------------------------------------------------------------*/
1625 static int prism2mib_uint32(
1628 wlandevice_t *wlandev,
1630 p80211msg_dot11req_mibset_t *msg,
1634 UINT32 *uint32 = (UINT32*) data;
1635 UINT8 bytebuf[MIB_TMP_MAXLEN];
1636 UINT16 *wordbuf = (UINT16*) bytebuf;
1641 result = hfa384x_drvr_getconfig16(hw, mib->parm1, wordbuf);
1643 /* [MSM] Removed, getconfig16 returns the value in host order.
1644 * prism2mgmt_prism2int2p80211int(wordbuf, uint32);
1647 /* [MSM] Removed, setconfig16 expects host order.
1648 * prism2mgmt_p80211int2prism2int(wordbuf, uint32);
1651 result = hfa384x_drvr_setconfig16(hw, mib->parm1, *wordbuf);
1658 /*----------------------------------------------------------------
1659 * prism2mib_uint32array
1661 * Get/set an array of uint32 data.
1663 * MIB record parameters:
1664 * parm1 Prism2 RID value.
1665 * parm2 Number of bytes of RID data.
1670 * isget MIBGET/MIBSET flag.
1671 * wlandev wlan device structure.
1672 * priv "priv" structure.
1673 * hw "hw" structure.
1674 * msg Message structure.
1681 ----------------------------------------------------------------*/
1683 static int prism2mib_uint32array(
1686 wlandevice_t *wlandev,
1688 p80211msg_dot11req_mibset_t *msg,
1692 UINT32 *uint32 = (UINT32 *) data;
1693 UINT8 bytebuf[MIB_TMP_MAXLEN];
1694 UINT16 *wordbuf = (UINT16*) bytebuf;
1699 cnt = mib->parm2 / sizeof(UINT16);
1702 result = hfa384x_drvr_getconfig(hw, mib->parm1, wordbuf, mib->parm2);
1703 for (i = 0; i < cnt; i++)
1704 prism2mgmt_prism2int2p80211int(wordbuf+i, uint32+i);
1706 for (i = 0; i < cnt; i++)
1707 prism2mgmt_p80211int2prism2int(wordbuf+i, uint32+i);
1708 result = hfa384x_drvr_setconfig(hw, mib->parm1, wordbuf, mib->parm2);
1715 /*----------------------------------------------------------------
1716 * prism2mib_uint32offset
1718 * Get/set a single element in an array of uint32 data.
1720 * MIB record parameters:
1721 * parm1 Prism2 RID value.
1722 * parm2 Number of bytes of RID data.
1723 * parm3 Element index.
1727 * isget MIBGET/MIBSET flag.
1728 * wlandev wlan device structure.
1729 * priv "priv" structure.
1730 * hw "hw" structure.
1731 * msg Message structure.
1738 ----------------------------------------------------------------*/
1740 static int prism2mib_uint32offset(
1743 wlandevice_t *wlandev,
1745 p80211msg_dot11req_mibset_t *msg,
1749 UINT32 *uint32 = (UINT32*) data;
1750 UINT8 bytebuf[MIB_TMP_MAXLEN];
1751 UINT16 *wordbuf = (UINT16*) bytebuf;
1756 cnt = mib->parm2 / sizeof(UINT16);
1758 result = hfa384x_drvr_getconfig(hw, mib->parm1, wordbuf, mib->parm2);
1761 if (mib->parm3 < cnt)
1762 prism2mgmt_prism2int2p80211int(wordbuf+mib->parm3, uint32);
1766 if (mib->parm3 < cnt) {
1767 prism2mgmt_p80211int2prism2int(wordbuf+mib->parm3, uint32);
1768 result = hfa384x_drvr_setconfig(hw, mib->parm1, wordbuf, mib->parm2);
1777 /*----------------------------------------------------------------
1780 * Get/set truth data.
1782 * MIB record parameters:
1783 * parm1 Prism2 RID value.
1789 * isget MIBGET/MIBSET flag.
1790 * wlandev wlan device structure.
1791 * priv "priv" structure.
1792 * hw "hw" structure.
1793 * msg Message structure.
1800 ----------------------------------------------------------------*/
1802 static int prism2mib_truth(
1805 wlandevice_t *wlandev,
1807 p80211msg_dot11req_mibset_t *msg,
1811 UINT32 *uint32 = (UINT32*) data;
1812 UINT8 bytebuf[MIB_TMP_MAXLEN];
1813 UINT16 *wordbuf = (UINT16*) bytebuf;
1818 result = hfa384x_drvr_getconfig16(hw, mib->parm1, wordbuf);
1819 *uint32 = (*wordbuf) ?
1820 P80211ENUM_truth_true : P80211ENUM_truth_false;
1822 *wordbuf = ((*uint32) == P80211ENUM_truth_true) ? 1 : 0;
1823 result = hfa384x_drvr_setconfig16(hw, mib->parm1, *wordbuf);
1830 /*----------------------------------------------------------------
1835 * MIB record parameters:
1836 * parm1 Prism2 RID value.
1837 * parm2 Bit to get/set.
1842 * isget MIBGET/MIBSET flag.
1843 * wlandev wlan device structure.
1844 * priv "priv" structure.
1845 * hw "hw" structure.
1846 * msg Message structure.
1853 ----------------------------------------------------------------*/
1855 static int prism2mib_flag(
1858 wlandevice_t *wlandev,
1860 p80211msg_dot11req_mibset_t *msg,
1864 UINT32 *uint32 = (UINT32*) data;
1865 UINT8 bytebuf[MIB_TMP_MAXLEN];
1866 UINT16 *wordbuf = (UINT16*) bytebuf;
1871 result = hfa384x_drvr_getconfig16(hw, mib->parm1, wordbuf);
1873 /* [MSM] Removed, getconfig16 returns the value in host order.
1874 * prism2mgmt_prism2int2p80211int(wordbuf, &flags);
1878 *uint32 = (flags & mib->parm2) ?
1879 P80211ENUM_truth_true : P80211ENUM_truth_false;
1881 if ((*uint32) == P80211ENUM_truth_true)
1882 flags |= mib->parm2;
1884 flags &= ~mib->parm2;
1885 /* [MSM] Removed, setconfig16 expects host order.
1886 * prism2mgmt_p80211int2prism2int(wordbuf, &flags);
1889 result = hfa384x_drvr_setconfig16(hw, mib->parm1, *wordbuf);
1897 /*----------------------------------------------------------------
1898 * prism2mib_appcfinfoflag
1900 * Get/set a single flag in the APPCFINFO record.
1902 * MIB record parameters:
1903 * parm1 Bit to get/set.
1909 * isget MIBGET/MIBSET flag.
1910 * wlandev wlan device structure.
1911 * priv "priv" structure.
1912 * hw "hw" structure.
1913 * msg Message structure.
1920 ----------------------------------------------------------------*/
1922 static int prism2mib_appcfinfoflag(
1925 wlandevice_t *wlandev,
1927 p80211msg_dot11req_mibset_t *msg,
1931 UINT32 *uint32 = (UINT32*) data;
1932 UINT8 bytebuf[MIB_TMP_MAXLEN];
1933 UINT16 *wordbuf = (UINT16*) bytebuf;
1938 result = hfa384x_drvr_getconfig(hw, HFA384x_RID_CNFAPPCFINFO,
1939 bytebuf, HFA384x_RID_CNFAPPCFINFO_LEN);
1942 *uint32 = (hfa384x2host_16(wordbuf[3]) & mib->parm1) ?
1943 P80211ENUM_truth_true : P80211ENUM_truth_false;
1945 word = hfa384x2host_16(wordbuf[3]);
1946 word = ((*uint32) == P80211ENUM_truth_true) ?
1947 (word | mib->parm1) : (word & ~mib->parm1);
1948 wordbuf[3] = host2hfa384x_16(word);
1949 result = hfa384x_drvr_setconfig(hw, HFA384x_RID_CNFAPPCFINFO,
1950 bytebuf, HFA384x_RID_CNFAPPCFINFO_LEN);
1958 /*----------------------------------------------------------------
1959 * prism2mib_regulatorydomains
1961 * Get regulatory domain data.
1963 * MIB record parameters:
1964 * parm1 Prism2 RID value.
1965 * parm2 Number of bytes of RID data.
1970 * isget MIBGET/MIBSET flag.
1971 * wlandev wlan device structure.
1972 * priv "priv" structure.
1973 * hw "hw" structure.
1974 * msg Message structure.
1981 ----------------------------------------------------------------*/
1983 static int prism2mib_regulatorydomains(
1986 wlandevice_t *wlandev,
1988 p80211msg_dot11req_mibset_t *msg,
1993 p80211pstrd_t *pstr = (p80211pstrd_t*) data;
1994 UINT8 bytebuf[MIB_TMP_MAXLEN];
1995 UINT16 *wordbuf = (UINT16*) bytebuf;
2002 result = hfa384x_drvr_getconfig(hw, mib->parm1, wordbuf, mib->parm2);
2003 prism2mgmt_prism2int2p80211int(wordbuf, &cnt);
2004 pstr->len = (UINT8) cnt;
2005 memcpy(pstr->data, &wordbuf[1], pstr->len);
2012 /*----------------------------------------------------------------
2013 * prism2mib_wepdefaultkey
2015 * Get/set WEP default keys.
2017 * MIB record parameters:
2018 * parm1 Prism2 RID value.
2019 * parm2 Number of bytes of RID data.
2024 * isget MIBGET/MIBSET flag.
2025 * wlandev wlan device structure.
2026 * priv "priv" structure.
2027 * hw "hw" structure.
2028 * msg Message structure.
2035 ----------------------------------------------------------------*/
2037 static int prism2mib_wepdefaultkey(
2040 wlandevice_t *wlandev,
2042 p80211msg_dot11req_mibset_t *msg,
2046 p80211pstrd_t *pstr = (p80211pstrd_t*) data;
2047 UINT8 bytebuf[MIB_TMP_MAXLEN];
2053 result = 0; /* Should never happen. */
2055 len = (pstr->len > 5) ? HFA384x_RID_CNFWEP128DEFAULTKEY_LEN :
2056 HFA384x_RID_CNFWEPDEFAULTKEY_LEN;
2057 memset(bytebuf, 0, len);
2058 prism2mgmt_pstr2bytearea(bytebuf, pstr);
2059 result = hfa384x_drvr_setconfig(hw, mib->parm1, bytebuf, len);
2066 /*----------------------------------------------------------------
2067 * prism2mib_powermanagement
2069 * Get/set 802.11 power management value. Note that this is defined differently
2070 * by 802.11 and Prism2:
2072 * Meaning 802.11 Prism2
2076 * MIB record parameters:
2077 * parm1 Prism2 RID value.
2083 * isget MIBGET/MIBSET flag.
2084 * wlandev wlan device structure.
2085 * priv "priv" structure.
2086 * hw "hw" structure.
2087 * msg Message structure.
2094 ----------------------------------------------------------------*/
2096 static int prism2mib_powermanagement(
2099 wlandevice_t *wlandev,
2101 p80211msg_dot11req_mibset_t *msg,
2105 UINT32 *uint32 = (UINT32*) data;
2111 result = prism2mib_uint32(mib, isget, wlandev, hw, msg, &value);
2112 *uint32 = (value == 0) ? 1 : 2;
2114 value = ((*uint32) == 1) ? 0 : 1;
2115 result = prism2mib_uint32(mib, isget, wlandev, hw, msg, &value);
2122 /*----------------------------------------------------------------
2123 * prism2mib_preamble
2125 * Get/set Prism2 short preamble
2127 * MIB record parameters:
2128 * parm1 Prism2 RID value.
2134 * isget MIBGET/MIBSET flag.
2135 * wlandev wlan device structure.
2136 * priv "priv" structure.
2137 * hw "hw" structure.
2138 * msg Message structure.
2145 ----------------------------------------------------------------*/
2147 static int prism2mib_preamble(
2150 wlandevice_t *wlandev,
2152 p80211msg_dot11req_mibset_t *msg,
2156 UINT32 *uint32 = (UINT32*) data;
2157 UINT8 bytebuf[MIB_TMP_MAXLEN];
2158 UINT16 *wordbuf = (UINT16*) bytebuf;
2163 result = hfa384x_drvr_getconfig16(hw, mib->parm1, wordbuf);
2167 result = hfa384x_drvr_setconfig16(hw, mib->parm1, *wordbuf);
2174 /*----------------------------------------------------------------
2175 * prism2mib_privacyinvoked
2177 * Get/set the dot11PrivacyInvoked value.
2179 * MIB record parameters:
2180 * parm1 Prism2 RID value.
2181 * parm2 Bit value for PrivacyInvoked flag.
2186 * isget MIBGET/MIBSET flag.
2187 * wlandev wlan device structure.
2188 * priv "priv" structure.
2189 * hw "hw" structure.
2190 * msg Message structure.
2197 ----------------------------------------------------------------*/
2199 static int prism2mib_privacyinvoked(
2202 wlandevice_t *wlandev,
2204 p80211msg_dot11req_mibset_t *msg,
2211 if (wlandev->hostwep & HOSTWEP_DECRYPT) {
2212 if (wlandev->hostwep & HOSTWEP_DECRYPT)
2213 mib->parm2 |= HFA384x_WEPFLAGS_DISABLE_RXCRYPT;
2214 if (wlandev->hostwep & HOSTWEP_ENCRYPT)
2215 mib->parm2 |= HFA384x_WEPFLAGS_DISABLE_TXCRYPT;
2218 result = prism2mib_flag(mib, isget, wlandev, hw, msg, data);
2224 /*----------------------------------------------------------------
2225 * prism2mib_excludeunencrypted
2227 * Get/set the dot11ExcludeUnencrypted value.
2229 * MIB record parameters:
2230 * parm1 Prism2 RID value.
2231 * parm2 Bit value for ExcludeUnencrypted flag.
2236 * isget MIBGET/MIBSET flag.
2237 * wlandev wlan device structure.
2238 * priv "priv" structure.
2239 * hw "hw" structure.
2240 * msg Message structure.
2247 ----------------------------------------------------------------*/
2249 static int prism2mib_excludeunencrypted(
2252 wlandevice_t *wlandev,
2254 p80211msg_dot11req_mibset_t *msg,
2261 result = prism2mib_flag(mib, isget, wlandev, hw, msg, data);
2267 /*----------------------------------------------------------------
2268 * prism2mib_fragmentationthreshold
2270 * Get/set the fragmentation threshold.
2272 * MIB record parameters:
2273 * parm1 Prism2 RID value.
2279 * isget MIBGET/MIBSET flag.
2280 * wlandev wlan device structure.
2281 * priv "priv" structure.
2282 * hw "hw" structure.
2283 * msg Message structure.
2290 ----------------------------------------------------------------*/
2292 static int prism2mib_fragmentationthreshold(
2295 wlandevice_t *wlandev,
2297 p80211msg_dot11req_mibset_t *msg,
2301 UINT32 *uint32 = (UINT32*) data;
2306 if ((*uint32) % 2) {
2307 WLAN_LOG_WARNING("Attempt to set odd number "
2308 "FragmentationThreshold\n");
2309 msg->resultcode.data = P80211ENUM_resultcode_not_supported;
2313 result = prism2mib_uint32(mib, isget, wlandev, hw, msg, data);
2319 /*----------------------------------------------------------------
2320 * prism2mib_operationalrateset
2322 * Get/set the operational rate set.
2324 * MIB record parameters:
2325 * parm1 Prism2 RID value.
2331 * isget MIBGET/MIBSET flag.
2332 * wlandev wlan device structure.
2333 * priv "priv" structure.
2334 * hw "hw" structure.
2335 * msg Message structure.
2342 ----------------------------------------------------------------*/
2344 static int prism2mib_operationalrateset(
2347 wlandevice_t *wlandev,
2349 p80211msg_dot11req_mibset_t *msg,
2353 p80211pstrd_t *pstr = (p80211pstrd_t *) data;
2354 UINT8 bytebuf[MIB_TMP_MAXLEN];
2355 UINT16 *wordbuf = (UINT16*) bytebuf;
2360 result = hfa384x_drvr_getconfig16(hw, mib->parm1, wordbuf);
2361 prism2mgmt_get_oprateset(wordbuf, pstr);
2363 prism2mgmt_set_oprateset(wordbuf, pstr);
2364 result = hfa384x_drvr_setconfig16(hw, mib->parm1, *wordbuf);
2365 result = hfa384x_drvr_setconfig16(hw, HFA384x_RID_CNFSUPPRATES, *wordbuf);
2372 /*----------------------------------------------------------------
2373 * prism2mib_groupaddress
2375 * Get/set the dot11GroupAddressesTable.
2377 * MIB record parameters:
2384 * isget MIBGET/MIBSET flag.
2385 * wlandev wlan device structure.
2386 * priv "priv" structure.
2387 * hw "hw" structure.
2388 * msg Message structure.
2395 ----------------------------------------------------------------*/
2397 static int prism2mib_groupaddress(
2400 wlandevice_t *wlandev,
2402 p80211msg_dot11req_mibset_t *msg,
2406 p80211pstrd_t *pstr = (p80211pstrd_t *) data;
2407 UINT8 bytebuf[MIB_TMP_MAXLEN];
2412 /* TODO: fix this. f/w doesn't support mcast filters */
2415 prism2mgmt_get_grpaddr(mib->did, pstr, hw);
2419 result = prism2mgmt_set_grpaddr(mib->did, bytebuf, pstr, hw);
2421 msg->resultcode.data = P80211ENUM_resultcode_not_supported;
2425 if (hw->dot11_grpcnt <= MAX_PRISM2_GRP_ADDR) {
2426 len = hw->dot11_grpcnt * WLAN_ADDR_LEN;
2427 memcpy(bytebuf, hw->dot11_grp_addr[0], len);
2428 result = hfa384x_drvr_setconfig(hw, HFA384x_RID_GROUPADDR, bytebuf, len);
2431 ** Turn off promiscuous mode if count is equal to MAX. We may
2432 ** have been at a higher count in promiscuous mode and need to
2436 /* but only if we're not already in promisc mode. :) */
2437 if ((hw->dot11_grpcnt == MAX_PRISM2_GRP_ADDR) &&
2438 !( wlandev->netdev->flags & IFF_PROMISC)) {
2439 result = hfa384x_drvr_setconfig16(hw,
2440 HFA384x_RID_PROMISCMODE, 0);
2445 ** Clear group addresses in card and set to promiscuous mode.
2448 memset(bytebuf, 0, sizeof(bytebuf));
2449 result = hfa384x_drvr_setconfig(hw, HFA384x_RID_GROUPADDR,
2452 result = hfa384x_drvr_setconfig16(hw,
2453 HFA384x_RID_PROMISCMODE, 1);
2461 /*----------------------------------------------------------------
2464 * Get the firmware ID.
2466 * MIB record parameters:
2473 * isget MIBGET/MIBSET flag.
2474 * wlandev wlan device structure.
2475 * priv "priv" structure.
2476 * hw "hw" structure.
2477 * msg Message structure.
2484 ----------------------------------------------------------------*/
2486 static int prism2mib_fwid(
2489 wlandevice_t *wlandev,
2491 p80211msg_dot11req_mibset_t *msg,
2495 p80211pstrd_t *pstr = (p80211pstrd_t *) data;
2496 hfa384x_FWID_t fwid;
2501 result = hfa384x_drvr_getconfig(hw, HFA384x_RID_FWID,
2502 &fwid, HFA384x_RID_FWID_LEN);
2503 if (mib->did == DIDmib_p2_p2NIC_p2PrimaryFWID) {
2504 fwid.primary[HFA384x_FWID_LEN - 1] = '\0';
2505 pstr->len = strlen(fwid.primary);
2506 memcpy(pstr->data, fwid.primary, pstr->len);
2508 fwid.secondary[HFA384x_FWID_LEN - 1] = '\0';
2509 pstr->len = strlen(fwid.secondary);
2510 memcpy(pstr->data, fwid.secondary, pstr->len);
2513 result = 0; /* Should never happen. */
2519 /*----------------------------------------------------------------
2522 * Get values from the AuhtenticationAlgorithmsTable.
2524 * MIB record parameters:
2525 * parm1 Table index (1-6).
2531 * isget MIBGET/MIBSET flag.
2532 * wlandev wlan device structure.
2533 * priv "priv" structure.
2534 * hw "hw" structure.
2535 * msg Message structure.
2542 ----------------------------------------------------------------*/
2544 static int prism2mib_authalg(
2547 wlandevice_t *wlandev,
2549 p80211msg_dot11req_mibset_t *msg,
2552 UINT32 *uint32 = (UINT32*) data;
2556 /* MSM: pkx supplied code that code queries RID FD4D....but the f/w's
2557 * results are bogus. Therefore, we have to simulate the appropriate
2558 * results here in the driver based on our knowledge of existing MAC
2559 * features. That's the whole point behind this ugly function.
2563 msg->resultcode.data = P80211ENUM_resultcode_success;
2564 switch (mib->parm1) {
2565 case 1: /* Open System */
2566 *uint32 = P80211ENUM_authalg_opensystem;
2568 case 2: /* SharedKey */
2569 *uint32 = P80211ENUM_authalg_sharedkey;
2573 msg->resultcode.data = P80211ENUM_resultcode_not_supported;
2582 /*----------------------------------------------------------------
2583 * prism2mib_authalgenable
2585 * Get/set the enable values from the AuhtenticationAlgorithmsTable.
2587 * MIB record parameters:
2588 * parm1 Table index (1-6).
2594 * isget MIBGET/MIBSET flag.
2595 * wlandev wlan device structure.
2596 * priv "priv" structure.
2597 * hw "hw" structure.
2598 * msg Message structure.
2605 ----------------------------------------------------------------*/
2607 static int prism2mib_authalgenable(
2610 wlandevice_t *wlandev,
2612 p80211msg_dot11req_mibset_t *msg,
2616 UINT32 *uint32 = (UINT32*) data;
2624 index = mib->parm1 - 1;
2626 result = hfa384x_drvr_getconfig16( hw,
2627 HFA384x_RID_CNFAUTHENTICATION, &cnf_auth);
2628 WLAN_LOG_DEBUG(2,"cnfAuthentication0=%d, index=%d\n", cnf_auth, index);
2631 if ( index == 0 || index == 1 ) {
2632 *uint32 = (cnf_auth & (1<<index)) ?
2633 P80211ENUM_truth_true: P80211ENUM_truth_false;
2635 *uint32 = P80211ENUM_truth_false;
2636 msg->resultcode.data = P80211ENUM_resultcode_not_supported;
2639 if ( index == 0 || index == 1 ) {
2641 if (*uint32==P80211ENUM_truth_true ) {
2646 result = hfa384x_drvr_setconfig16( hw,
2647 HFA384x_RID_CNFAUTHENTICATION, cnf_auth);
2648 WLAN_LOG_DEBUG(2,"cnfAuthentication:=%d\n", cnf_auth);
2650 WLAN_LOG_DEBUG(1,"Unable to set p2cnfAuthentication to %d\n", cnf_auth);
2651 msg->resultcode.data = P80211ENUM_resultcode_implementation_failure;
2654 msg->resultcode.data = P80211ENUM_resultcode_not_supported;
2662 /*----------------------------------------------------------------
2665 * Get/set values in the "priv" data structure.
2667 * MIB record parameters:
2674 * isget MIBGET/MIBSET flag.
2675 * wlandev wlan device structure.
2676 * priv "priv" structure.
2677 * hw "hw" structure.
2678 * msg Message structure.
2685 ----------------------------------------------------------------*/
2687 static int prism2mib_priv(
2690 wlandevice_t *wlandev,
2692 p80211msg_dot11req_mibset_t *msg,
2695 UINT32 *uint32 = (UINT32*) data;
2696 p80211pstrd_t *pstr = (p80211pstrd_t*) data;
2697 p80211macarray_t *macarray = (p80211macarray_t *) data;
2699 int i, cnt, result, done;
2701 prism2sta_authlist_t old;
2704 ** "test" is a lot longer than necessary but who cares? ...as long as
2705 ** it is long enough!
2708 UINT8 test[sizeof(wlandev->rx) + sizeof(hw->tallies)];
2713 case DIDmib_p2_p2Table_p2ReceivedFrameStatistics:
2716 ** Note: The values in this record are changed by the
2717 ** interrupt handler and therefore cannot be guaranteed
2718 ** to be stable while they are being copied. However,
2719 ** the interrupt handler will take priority over this
2720 ** code. Hence, if the same values are copied twice,
2721 ** then we are ensured that the values have not been
2722 ** changed. If they have, then just try again. Don't
2723 ** try more than 10 times...if we still haven't got it,
2724 ** then the values we do have are probably good enough.
2725 ** This scheme for copying values is used in order to
2726 ** prevent having to block the interrupt handler while
2727 ** we copy the values.
2731 for (i = 0; i < 10; i++) {
2732 memcpy(data, &wlandev->rx, sizeof(wlandev->rx));
2733 memcpy(test, &wlandev->rx, sizeof(wlandev->rx));
2734 if (memcmp(data, test, sizeof(wlandev->rx)) == 0) break;
2739 case DIDmib_p2_p2Table_p2CommunicationTallies:
2742 ** Note: The values in this record are changed by the
2743 ** interrupt handler and therefore cannot be guaranteed
2744 ** to be stable while they are being copied. See the
2745 ** note above about copying values.
2749 result = hfa384x_drvr_commtallies(hw);
2751 /* ?????? We need to wait a bit here for the */
2752 /* tallies to get updated. ?????? */
2753 /* MSM: TODO: The right way to do this is to
2754 * add a "commtallie" wait queue to the
2755 * priv structure that gets run every time
2756 * we receive a commtally info frame.
2757 * This process would sleep on that
2758 * queue and get awakened when the
2759 * the requested info frame arrives.
2760 * Don't have time to do and test this
2764 /* Ugh, this is nasty. */
2765 for (i = 0; i < 10; i++) {
2768 sizeof(hw->tallies));
2771 sizeof(hw->tallies));
2774 sizeof(hw->tallies)) == 0)
2781 case DIDmib_p2_p2Table_p2Authenticated:
2784 prism2mib_priv_authlist(hw, &old);
2787 for (i = 0; i < old.cnt; i++) {
2788 if (!old.assoc[i]) {
2789 memcpy(macarray->data[macarray->cnt], old.addr[i], WLAN_ADDR_LEN);
2797 case DIDmib_p2_p2Table_p2Associated:
2800 prism2mib_priv_authlist(hw, &old);
2803 for (i = 0; i < old.cnt; i++) {
2805 memcpy(macarray->data[macarray->cnt], old.addr[i], WLAN_ADDR_LEN);
2813 case DIDmib_p2_p2Table_p2PowerSaveUserCount:
2816 *uint32 = hw->psusercount;
2820 case DIDmib_p2_p2Table_p2Comment:
2823 pstr->len = strlen(hw->comment);
2824 memcpy(pstr->data, hw->comment, pstr->len);
2827 if (cnt < 0) cnt = 0;
2828 if (cnt >= sizeof(hw->comment))
2829 cnt = sizeof(hw->comment)-1;
2830 memcpy(hw->comment, pstr->data, cnt);
2831 pstr->data[cnt] = '\0';
2836 case DIDmib_p2_p2Table_p2AccessMode:
2839 *uint32 = hw->accessmode;
2841 prism2mib_priv_accessmode(hw, *uint32);
2845 case DIDmib_p2_p2Table_p2AccessAllow:
2848 macarray->cnt = hw->allow.cnt;
2849 memcpy(macarray->data, hw->allow.addr,
2850 macarray->cnt*WLAN_ADDR_LEN);
2852 prism2mib_priv_accessallow(hw, macarray);
2857 case DIDmib_p2_p2Table_p2AccessDeny:
2860 macarray->cnt = hw->deny.cnt;
2861 memcpy(macarray->data, hw->deny.addr,
2862 macarray->cnt*WLAN_ADDR_LEN);
2864 prism2mib_priv_accessdeny(hw, macarray);
2869 case DIDmib_p2_p2Table_p2ChannelInfoResults:
2872 done = atomic_read(&hw->channel_info.done);
2874 msg->resultcode.status = P80211ENUM_msgitem_status_no_value;
2878 msg->resultcode.status = P80211ENUM_msgitem_status_incomplete_itemdata;
2882 for (i = 0; i < 14; i++, uint32 += 5) {
2884 uint32[1] = hw->channel_info.results.result[i].anl;
2885 uint32[2] = hw->channel_info.results.result[i].pnl;
2886 uint32[3] = (hw->channel_info.results.result[i].active & HFA384x_CHINFORESULT_BSSACTIVE) ? 1 : 0;
2887 uint32[4] = (hw->channel_info.results.result[i].active & HFA384x_CHINFORESULT_PCFACTIVE) ? 1 : 0;
2893 case DIDmib_dot11smt_dot11StationConfigTable_dot11DesiredBSSType:
2896 *uint32 = hw->dot11_desired_bss_type;
2898 hw->dot11_desired_bss_type = *uint32;
2902 case DIDmib_lnx_lnxConfigTable_lnxRSNAIE: {
2903 hfa384x_WPAData_t wpa;
2905 hfa384x_drvr_getconfig( hw, HFA384x_RID_CNFWPADATA,
2906 (UINT8 *) &wpa, sizeof(wpa));
2907 pstr->len = hfa384x2host_16(wpa.datalen);
2908 memcpy(pstr->data, wpa.data, pstr->len);
2910 wpa.datalen = host2hfa384x_16(pstr->len);
2911 memcpy(wpa.data, pstr->data, pstr->len);
2913 result = hfa384x_drvr_setconfig(hw, HFA384x_RID_CNFWPADATA,
2914 (UINT8 *) &wpa, sizeof(wpa));
2919 WLAN_LOG_ERROR("Unhandled DID 0x%08x\n", mib->did);
2926 /*----------------------------------------------------------------
2927 * prism2mib_priv_authlist
2929 * Get a copy of the list of authenticated stations.
2932 * priv "priv" structure.
2933 * list List of authenticated stations.
2938 ----------------------------------------------------------------*/
2940 static void prism2mib_priv_authlist(
2942 prism2sta_authlist_t *list)
2944 prism2sta_authlist_t test;
2950 ** Note: The values in this record are changed by the interrupt
2951 ** handler and therefore cannot be guaranteed to be stable while
2952 ** they are being copied. However, the interrupt handler will
2953 ** take priority over this code. Hence, if the same values are
2954 ** copied twice, then we are ensured that the values have not
2955 ** been changed. If they have, then just try again. Don't try
2956 ** more than 10 times...the list of authenticated stations is
2957 ** unlikely to be changing frequently enough that we can't get
2958 ** a snapshot in 10 tries. Don't try more than this so that we
2959 ** don't risk locking-up for long periods of time. If we still
2960 ** haven't got the snapshot, then generate an error message and
2961 ** return an empty list (since this is the only valid list that
2962 ** we can guarentee). This scheme for copying values is used in
2963 ** order to prevent having to block the interrupt handler while
2964 ** we copy the values.
2967 for (i = 0; i < 10; i++) {
2968 memcpy(list, &hw->authlist, sizeof(prism2sta_authlist_t));
2969 memcpy(&test, &hw->authlist, sizeof(prism2sta_authlist_t));
2970 if (memcmp(list, &test, sizeof(prism2sta_authlist_t)) == 0)
2976 WLAN_LOG_ERROR("Could not obtain snapshot of authenticated stations.\n");
2983 /*----------------------------------------------------------------
2984 * prism2mib_priv_accessmode
2986 * Set the Access Mode.
2989 * priv "priv" structure.
2990 * hw "hw" structure.
2991 * mode New access mode.
2996 ----------------------------------------------------------------*/
2998 static void prism2mib_priv_accessmode(
3002 prism2sta_authlist_t old;
3009 ** If the mode is not changing or it is changing to "All", then it's
3010 ** okay to go ahead without a lot of messing around. Otherwise, the
3011 ** access mode is changing in a way that may leave some stations
3012 ** authenticated which should not be authenticated. It will be
3013 ** necessary to de-authenticate these stations.
3016 if (mode == WLAN_ACCESS_ALL || mode == hw->accessmode) {
3017 hw->accessmode = mode;
3022 ** Switch to the new access mode. Once this is done, then the interrupt
3023 ** handler (which uses this value) will be prevented from authenticating
3024 ** ADDITIONAL stations which should not be authenticated. Then get a
3025 ** copy of the current list of authenticated stations.
3028 hw->accessmode = mode;
3030 prism2mib_priv_authlist(hw, &old);
3033 ** Now go through the list of previously authenticated stations (some
3034 ** of which might de-authenticate themselves while we are processing it
3035 ** but that is okay). Any station which no longer matches the access
3036 ** mode, must be de-authenticated.
3039 for (i = 0; i < old.cnt; i++) {
3042 if (mode == WLAN_ACCESS_NONE)
3045 if (mode == WLAN_ACCESS_ALLOW) {
3046 for (j = 0; j < hw->allow.cnt; j++)
3047 if (memcmp(addr, hw->allow.addr[j],
3048 WLAN_ADDR_LEN) == 0)
3050 deauth = (j >= hw->allow.cnt);
3052 for (j = 0; j < hw->deny.cnt; j++)
3053 if (memcmp(addr, hw->deny.addr[j],
3054 WLAN_ADDR_LEN) == 0)
3056 deauth = (j < hw->deny.cnt);
3060 if (deauth) prism2mib_priv_deauthenticate(hw, addr);
3067 /*----------------------------------------------------------------
3068 * prism2mib_priv_accessallow
3070 * Change the list of allowed MAC addresses.
3073 * priv "priv" structure.
3074 * hw "hw" structure.
3075 * macarray New array of MAC addresses.
3080 ----------------------------------------------------------------*/
3082 static void prism2mib_priv_accessallow(
3084 p80211macarray_t *macarray)
3086 prism2sta_authlist_t old;
3092 ** Change the access list. Note that the interrupt handler may be in
3093 ** the middle of using the access list!!! Since the interrupt handler
3094 ** will always have priority over this process and this is the only
3095 ** process that will modify the list, this problem can be handled as
3098 ** 1. Set the "modify" flag.
3099 ** 2. Change the first copy of the list.
3100 ** 3. Clear the "modify" flag.
3101 ** 4. Change the backup copy of the list.
3103 ** The interrupt handler will check the "modify" flag. If NOT set, then
3104 ** the first copy of the list is valid and may be used. Otherwise, the
3105 ** first copy is being changed but the backup copy is valid and may be
3106 ** used. Doing things this way prevents having to have the interrupt
3107 ** handler block while the list is being updated.
3110 hw->allow.modify = 1;
3112 hw->allow.cnt = macarray->cnt;
3113 memcpy(hw->allow.addr, macarray->data, macarray->cnt*WLAN_ADDR_LEN);
3115 hw->allow.modify = 0;
3117 hw->allow.cnt1 = macarray->cnt;
3118 memcpy(hw->allow.addr1, macarray->data, macarray->cnt*WLAN_ADDR_LEN);
3121 ** If the current access mode is "Allow", then changing the access
3122 ** list may leave some stations authenticated which should not be
3123 ** authenticated. It will be necessary to de-authenticate these
3124 ** stations. Otherwise, the list can be changed without a lot of fuss.
3127 if (hw->accessmode == WLAN_ACCESS_ALLOW) {
3130 ** Go through the list of authenticated stations (some of
3131 ** which might de-authenticate themselves while we are
3132 ** processing it but that is okay). Any station which is
3133 ** no longer in the list of allowed stations, must be
3134 ** de-authenticated.
3137 prism2mib_priv_authlist(hw, &old);
3139 for (i = 0; i < old.cnt; i++) {
3140 for (j = 0; j < hw->allow.cnt; j++)
3141 if (memcmp(old.addr[i], hw->allow.addr[j],
3142 WLAN_ADDR_LEN) == 0)
3144 if (j >= hw->allow.cnt)
3145 prism2mib_priv_deauthenticate(hw, old.addr[i]);
3153 /*----------------------------------------------------------------
3154 * prism2mib_priv_accessdeny
3156 * Change the list of denied MAC addresses.
3159 * priv "priv" structure.
3160 * hw "hw" structure.
3161 * macarray New array of MAC addresses.
3166 ----------------------------------------------------------------*/
3168 static void prism2mib_priv_accessdeny(
3170 p80211macarray_t *macarray)
3172 prism2sta_authlist_t old;
3178 ** Change the access list. Note that the interrupt handler may be in
3179 ** the middle of using the access list!!! Since the interrupt handler
3180 ** will always have priority over this process and this is the only
3181 ** process that will modify the list, this problem can be handled as
3184 ** 1. Set the "modify" flag.
3185 ** 2. Change the first copy of the list.
3186 ** 3. Clear the "modify" flag.
3187 ** 4. Change the backup copy of the list.
3189 ** The interrupt handler will check the "modify" flag. If NOT set, then
3190 ** the first copy of the list is valid and may be used. Otherwise, the
3191 ** first copy is being changed but the backup copy is valid and may be
3192 ** used. Doing things this way prevents having to have the interrupt
3193 ** handler block while the list is being updated.
3196 hw->deny.modify = 1;
3198 hw->deny.cnt = macarray->cnt;
3199 memcpy(hw->deny.addr, macarray->data, macarray->cnt*WLAN_ADDR_LEN);
3201 hw->deny.modify = 0;
3203 hw->deny.cnt1 = macarray->cnt;
3204 memcpy(hw->deny.addr1, macarray->data, macarray->cnt*WLAN_ADDR_LEN);
3207 ** If the current access mode is "Deny", then changing the access
3208 ** list may leave some stations authenticated which should not be
3209 ** authenticated. It will be necessary to de-authenticate these
3210 ** stations. Otherwise, the list can be changed without a lot of fuss.
3213 if (hw->accessmode == WLAN_ACCESS_DENY) {
3216 ** Go through the list of authenticated stations (some of
3217 ** which might de-authenticate themselves while we are
3218 ** processing it but that is okay). Any station which is
3219 ** now in the list of denied stations, must be de-authenticated.
3222 prism2mib_priv_authlist(hw, &old);
3224 for (i = 0; i < old.cnt; i++)
3225 for (j = 0; j < hw->deny.cnt; j++)
3226 if (memcmp(old.addr[i], hw->deny.addr[j],
3227 WLAN_ADDR_LEN) == 0) {
3228 prism2mib_priv_deauthenticate(hw, old.addr[i]);
3237 /*----------------------------------------------------------------
3238 * prism2mib_priv_deauthenticate
3240 * De-authenticate a station. This is done by sending a HandoverAddress
3241 * information frame to the firmware. This should work, according to
3245 * priv "priv" structure.
3246 * hw "hw" structure.
3247 * addr MAC address of station to be de-authenticated.
3252 ----------------------------------------------------------------*/
3254 static void prism2mib_priv_deauthenticate(
3259 hfa384x_drvr_handover(hw, addr);
3265 /*----------------------------------------------------------------
3266 * prism2mgmt_pstr2bytestr
3268 * Convert the pstr data in the WLAN message structure into an hfa384x
3269 * byte string format.
3272 * bytestr hfa384x byte string data type
3273 * pstr wlan message data
3278 ----------------------------------------------------------------*/
3280 void prism2mgmt_pstr2bytestr(hfa384x_bytestr_t *bytestr, p80211pstrd_t *pstr)
3284 bytestr->len = host2hfa384x_16((UINT16)(pstr->len));
3285 memcpy(bytestr->data, pstr->data, pstr->len);
3290 /*----------------------------------------------------------------
3291 * prism2mgmt_pstr2bytearea
3293 * Convert the pstr data in the WLAN message structure into an hfa384x
3297 * bytearea hfa384x byte area data type
3298 * pstr wlan message data
3303 ----------------------------------------------------------------*/
3305 void prism2mgmt_pstr2bytearea(UINT8 *bytearea, p80211pstrd_t *pstr)
3309 memcpy(bytearea, pstr->data, pstr->len);
3314 /*----------------------------------------------------------------
3315 * prism2mgmt_bytestr2pstr
3317 * Convert the data in an hfa384x byte string format into a
3318 * pstr in the WLAN message.
3321 * bytestr hfa384x byte string data type
3327 ----------------------------------------------------------------*/
3329 void prism2mgmt_bytestr2pstr(hfa384x_bytestr_t *bytestr, p80211pstrd_t *pstr)
3333 pstr->len = (UINT8)(hfa384x2host_16((UINT16)(bytestr->len)));
3334 memcpy(pstr->data, bytestr->data, pstr->len);
3339 /*----------------------------------------------------------------
3340 * prism2mgmt_bytearea2pstr
3342 * Convert the data in an hfa384x byte area format into a pstr
3343 * in the WLAN message.
3346 * bytearea hfa384x byte area data type
3352 ----------------------------------------------------------------*/
3354 void prism2mgmt_bytearea2pstr(UINT8 *bytearea, p80211pstrd_t *pstr, int len)
3358 pstr->len = (UINT8)len;
3359 memcpy(pstr->data, bytearea, len);
3364 /*----------------------------------------------------------------
3365 * prism2mgmt_prism2int2p80211int
3367 * Convert an hfa384x integer into a wlan integer
3370 * prism2enum pointer to hfa384x integer
3371 * wlanenum pointer to p80211 integer
3376 ----------------------------------------------------------------*/
3378 void prism2mgmt_prism2int2p80211int(UINT16 *prism2int, UINT32 *wlanint)
3382 *wlanint = (UINT32)hfa384x2host_16(*prism2int);
3387 /*----------------------------------------------------------------
3388 * prism2mgmt_p80211int2prism2int
3390 * Convert a wlan integer into an hfa384x integer
3393 * prism2enum pointer to hfa384x integer
3394 * wlanenum pointer to p80211 integer
3399 ----------------------------------------------------------------*/
3401 void prism2mgmt_p80211int2prism2int(UINT16 *prism2int, UINT32 *wlanint)
3405 *prism2int = host2hfa384x_16((UINT16)(*wlanint));
3410 /*----------------------------------------------------------------
3411 * prism2mgmt_prism2enum2p80211enum
3413 * Convert the hfa384x enumerated int into a p80211 enumerated int
3416 * prism2enum pointer to hfa384x integer
3417 * wlanenum pointer to p80211 integer
3418 * rid hfa384x record id
3423 ----------------------------------------------------------------*/
3424 void prism2mgmt_prism2enum2p80211enum(UINT16 *prism2enum, UINT32 *wlanenum, UINT16 rid)
3428 /* At the moment, the need for this functionality hasn't
3429 presented itself. All the wlan enumerated values are
3430 a 1-to-1 match against the Prism2 enumerated values*/
3436 /*----------------------------------------------------------------
3437 * prism2mgmt_p80211enum2prism2enum
3439 * Convert the p80211 enumerated int into an hfa384x enumerated int
3442 * prism2enum pointer to hfa384x integer
3443 * wlanenum pointer to p80211 integer
3444 * rid hfa384x record id
3449 ----------------------------------------------------------------*/
3450 void prism2mgmt_p80211enum2prism2enum(UINT16 *prism2enum, UINT32 *wlanenum, UINT16 rid)
3454 /* At the moment, the need for this functionality hasn't
3455 presented itself. All the wlan enumerated values are
3456 a 1-to-1 match against the Prism2 enumerated values*/
3463 /*----------------------------------------------------------------
3464 * prism2mgmt_get_oprateset
3466 * Convert the hfa384x bit area into a wlan octet string.
3469 * rate Prism2 bit area
3470 * pstr wlan octet string
3475 ----------------------------------------------------------------*/
3476 void prism2mgmt_get_oprateset(UINT16 *rate, p80211pstrd_t *pstr)
3484 datarate = pstr->data;
3487 if ( BIT0 & (*rate) ) {
3489 *datarate = (UINT8)2;
3494 if ( BIT1 & (*rate) ) {
3496 *datarate = (UINT8)4;
3501 if ( BIT2 & (*rate) ) {
3503 *datarate = (UINT8)11;
3508 if ( BIT3 & (*rate) ) {
3510 *datarate = (UINT8)22;
3522 /*----------------------------------------------------------------
3523 * prism2mgmt_set_oprateset
3525 * Convert the wlan octet string into an hfa384x bit area.
3528 * rate Prism2 bit area
3529 * pstr wlan octet string
3534 ----------------------------------------------------------------*/
3535 void prism2mgmt_set_oprateset(UINT16 *rate, p80211pstrd_t *pstr)
3544 datarate = pstr->data;
3546 for ( i=0; i < pstr->len; i++, datarate++ ) {
3547 switch (*datarate) {
3548 case 2: /* 1 Mbps */
3551 case 4: /* 2 Mbps */
3554 case 11: /* 5.5 Mbps */
3557 case 22: /* 11 Mbps */
3561 WLAN_LOG_DEBUG(1, "Unrecoginzed Rate of %d\n",
3573 /*----------------------------------------------------------------
3574 * prism2mgmt_get_grpaddr
3576 * Retrieves a particular group address from the list of
3581 * pstr wlan octet string
3582 * priv prism2 driver private data structure
3587 ----------------------------------------------------------------*/
3588 void prism2mgmt_get_grpaddr(UINT32 did, p80211pstrd_t *pstr,
3595 index = prism2mgmt_get_grpaddr_index(did);
3598 pstr->len = WLAN_ADDR_LEN;
3599 memcpy(pstr->data, hw->dot11_grp_addr[index],
3609 /*----------------------------------------------------------------
3610 * prism2mgmt_set_grpaddr
3612 * Convert the wlan octet string into an hfa384x bit area.
3623 ----------------------------------------------------------------*/
3624 int prism2mgmt_set_grpaddr(UINT32 did, UINT8 *prism2buf,
3625 p80211pstrd_t *pstr, hfa384x_t *hw )
3627 UINT8 no_addr[WLAN_ADDR_LEN];
3632 memset(no_addr, 0, WLAN_ADDR_LEN);
3633 if (memcmp(no_addr, pstr->data, WLAN_ADDR_LEN) != 0) {
3636 ** The address is NOT 0 so we are "adding" an address to the
3637 ** group address list. Check to make sure we aren't trying
3638 ** to add more than the maximum allowed number of group
3639 ** addresses in the list. The new address is added to the
3640 ** end of the list regardless of the DID used to add the
3644 if (hw->dot11_grpcnt >= MAX_GRP_ADDR) return(-1);
3646 memcpy(hw->dot11_grp_addr[hw->dot11_grpcnt], pstr->data,
3648 hw->dot11_grpcnt += 1;
3652 ** The address is 0. Interpret this as "deleting" an address
3653 ** from the group address list. Get the address index from
3654 ** the DID. If this is within the range of used addresses,
3655 ** then delete the specified address by shifting all following
3656 ** addresses down. Then clear the last address (which should
3657 ** now be unused). If the address index is NOT within the
3658 ** range of used addresses, then just ignore the address.
3661 index = prism2mgmt_get_grpaddr_index(did);
3662 if (index >= 0 && index < hw->dot11_grpcnt) {
3663 hw->dot11_grpcnt -= 1;
3664 memmove(hw->dot11_grp_addr[index],
3665 hw->dot11_grp_addr[index + 1],
3666 ((hw->dot11_grpcnt)-index) * WLAN_ADDR_LEN);
3667 memset(hw->dot11_grp_addr[hw->dot11_grpcnt], 0,
3677 /*----------------------------------------------------------------
3678 * prism2mgmt_get_grpaddr_index
3680 * Gets the index in the group address list based on the did.
3687 * < 0 If not valid did
3689 ----------------------------------------------------------------*/
3690 int prism2mgmt_get_grpaddr_index( UINT32 did )
3699 case DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address1:
3702 case DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address2:
3705 case DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address3:
3708 case DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address4:
3711 case DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address5:
3714 case DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address6:
3717 case DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address7:
3720 case DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address8:
3723 case DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address9:
3726 case DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address10:
3729 case DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address11:
3732 case DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address12:
3735 case DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address13:
3738 case DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address14:
3741 case DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address15:
3744 case DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address16:
3747 case DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address17:
3750 case DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address18:
3753 case DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address19:
3756 case DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address20:
3759 case DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address21:
3762 case DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address22:
3765 case DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address23:
3768 case DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address24:
3771 case DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address25:
3774 case DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address26:
3777 case DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address27:
3780 case DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address28:
3783 case DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address29:
3786 case DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address30:
3789 case DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address31:
3792 case DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address32: