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>
72 #include <linux/usb.h>
74 /*================================================================*/
75 /* Project Includes */
77 #include "p80211types.h"
78 #include "p80211hdr.h"
79 #include "p80211mgmt.h"
80 #include "p80211conv.h"
81 #include "p80211msg.h"
82 #include "p80211netdev.h"
83 #include "p80211metadef.h"
84 #include "p80211metastruct.h"
86 #include "prism2mgmt.h"
88 /*================================================================*/
91 #define MIB_TMP_MAXLEN 200 /* Max length of RID record (in bytes). */
93 /*================================================================*/
96 #define F_AP 0x1 /* MIB is supported on Access Points. */
97 #define F_STA 0x2 /* MIB is supported on stations. */
98 #define F_READ 0x4 /* MIB may be read. */
99 #define F_WRITE 0x8 /* MIB may be written. */
101 typedef struct mibrec
108 int (*func)(struct mibrec *mib,
110 wlandevice_t *wlandev,
112 p80211msg_dot11req_mibset_t *msg,
116 /*================================================================*/
117 /* Local Function Declarations */
119 static int prism2mib_bytestr2pstr(
122 wlandevice_t *wlandev,
124 p80211msg_dot11req_mibset_t *msg,
127 static int prism2mib_bytearea2pstr(
130 wlandevice_t *wlandev,
132 p80211msg_dot11req_mibset_t *msg,
135 static int prism2mib_uint32(
138 wlandevice_t *wlandev,
140 p80211msg_dot11req_mibset_t *msg,
143 static int prism2mib_uint32array(
146 wlandevice_t *wlandev,
148 p80211msg_dot11req_mibset_t *msg,
151 static int prism2mib_uint32offset(
154 wlandevice_t *wlandev,
156 p80211msg_dot11req_mibset_t *msg,
159 static int prism2mib_truth(
162 wlandevice_t *wlandev,
164 p80211msg_dot11req_mibset_t *msg,
167 static int prism2mib_preamble(
170 wlandevice_t *wlandev,
172 p80211msg_dot11req_mibset_t *msg,
175 static int prism2mib_flag(
178 wlandevice_t *wlandev,
180 p80211msg_dot11req_mibset_t *msg,
183 static int prism2mib_appcfinfoflag(
186 wlandevice_t *wlandev,
188 p80211msg_dot11req_mibset_t *msg,
191 static int prism2mib_regulatorydomains(
194 wlandevice_t *wlandev,
196 p80211msg_dot11req_mibset_t *msg,
199 static int prism2mib_wepdefaultkey(
202 wlandevice_t *wlandev,
204 p80211msg_dot11req_mibset_t *msg,
207 static int prism2mib_powermanagement(
210 wlandevice_t *wlandev,
212 p80211msg_dot11req_mibset_t *msg,
215 static int prism2mib_privacyinvoked(
218 wlandevice_t *wlandev,
220 p80211msg_dot11req_mibset_t *msg,
223 static int prism2mib_excludeunencrypted(
226 wlandevice_t *wlandev,
228 p80211msg_dot11req_mibset_t *msg,
231 static int prism2mib_fragmentationthreshold(
234 wlandevice_t *wlandev,
236 p80211msg_dot11req_mibset_t *msg,
239 static int prism2mib_operationalrateset(
242 wlandevice_t *wlandev,
244 p80211msg_dot11req_mibset_t *msg,
247 static int prism2mib_groupaddress(
250 wlandevice_t *wlandev,
252 p80211msg_dot11req_mibset_t *msg,
255 static int prism2mib_fwid(
258 wlandevice_t *wlandev,
260 p80211msg_dot11req_mibset_t *msg,
263 static int prism2mib_authalg(
266 wlandevice_t *wlandev,
268 p80211msg_dot11req_mibset_t *msg,
271 static int prism2mib_authalgenable(
274 wlandevice_t *wlandev,
276 p80211msg_dot11req_mibset_t *msg,
279 static int prism2mib_priv(
282 wlandevice_t *wlandev,
284 p80211msg_dot11req_mibset_t *msg,
287 static void prism2mib_priv_authlist(
289 prism2sta_authlist_t *list);
291 static void prism2mib_priv_accessmode(
295 static void prism2mib_priv_accessallow(
297 p80211macarray_t *macarray);
299 static void prism2mib_priv_accessdeny(
301 p80211macarray_t *macarray);
303 static void prism2mib_priv_deauthenticate(
307 /*================================================================*/
308 /* Local Static Definitions */
310 static mibrec_t mibtab[] = {
314 { DIDmib_dot11smt_dot11StationConfigTable_dot11StationID,
315 F_AP | F_STA | F_READ | F_WRITE,
316 HFA384x_RID_CNFOWNMACADDR, HFA384x_RID_CNFOWNMACADDR_LEN, 0,
317 prism2mib_bytearea2pstr },
318 { DIDmib_dot11smt_dot11StationConfigTable_dot11MediumOccupancyLimit,
319 F_AP | F_READ | F_WRITE,
320 HFA384x_RID_CNFAPPCFINFO, HFA384x_RID_CNFAPPCFINFO_LEN, 0,
321 prism2mib_uint32offset },
322 { DIDmib_dot11smt_dot11StationConfigTable_dot11CFPollable,
324 HFA384x_RID_CFPOLLABLE, 0, 0,
326 { DIDmib_dot11smt_dot11StationConfigTable_dot11CFPPeriod,
327 F_AP | F_READ | F_WRITE,
328 HFA384x_RID_CNFAPPCFINFO, HFA384x_RID_CNFAPPCFINFO_LEN, 1,
329 prism2mib_uint32offset },
330 { DIDmib_dot11smt_dot11StationConfigTable_dot11CFPMaxDuration,
331 F_AP | F_READ | F_WRITE,
332 HFA384x_RID_CNFAPPCFINFO, HFA384x_RID_CNFAPPCFINFO_LEN, 2,
333 prism2mib_uint32offset },
334 { DIDmib_dot11smt_dot11StationConfigTable_dot11AuthenticationResponseTimeOut,
335 F_STA | F_READ | F_WRITE,
336 HFA384x_RID_CNFAUTHRSPTIMEOUT, 0, 0,
338 { DIDmib_dot11smt_dot11StationConfigTable_dot11PrivacyOptionImplemented,
339 F_AP | F_STA | F_READ,
340 HFA384x_RID_PRIVACYOPTIMP, 0, 0,
342 { DIDmib_dot11smt_dot11StationConfigTable_dot11PowerManagementMode,
343 F_STA | F_READ | F_WRITE,
344 HFA384x_RID_CNFPMENABLED, 0, 0,
345 prism2mib_powermanagement },
346 { DIDmib_dot11smt_dot11StationConfigTable_dot11DesiredSSID,
347 F_STA | F_READ | F_WRITE,
348 HFA384x_RID_CNFDESIREDSSID, HFA384x_RID_CNFDESIREDSSID_LEN, 0,
349 prism2mib_bytestr2pstr },
350 { DIDmib_dot11smt_dot11StationConfigTable_dot11DesiredBSSType,
351 F_STA | F_READ | F_WRITE,
354 { DIDmib_dot11smt_dot11StationConfigTable_dot11OperationalRateSet,
355 F_STA | F_READ | F_WRITE,
356 HFA384x_RID_TXRATECNTL, 0, 0,
357 prism2mib_operationalrateset },
358 { DIDmib_dot11smt_dot11StationConfigTable_dot11OperationalRateSet,
359 F_AP | F_READ | F_WRITE,
360 HFA384x_RID_TXRATECNTL0, 0, 0,
361 prism2mib_operationalrateset },
362 { DIDmib_dot11smt_dot11StationConfigTable_dot11BeaconPeriod,
363 F_AP | F_READ | F_WRITE,
364 HFA384x_RID_CNFAPBCNINT, 0, 0,
366 { DIDmib_dot11smt_dot11StationConfigTable_dot11DTIMPeriod,
367 F_AP | F_STA | F_READ | F_WRITE,
368 HFA384x_RID_CNFOWNDTIMPER, 0, 0,
370 { DIDmib_dot11smt_dot11StationConfigTable_dot11AssociationResponseTimeOut,
371 F_AP | F_STA | F_READ,
372 HFA384x_RID_PROTOCOLRSPTIME, 0, 0,
374 { DIDmib_dot11smt_dot11AuthenticationAlgorithmsTable_dot11AuthenticationAlgorithm1,
375 F_AP | F_STA | F_READ,
378 { DIDmib_dot11smt_dot11AuthenticationAlgorithmsTable_dot11AuthenticationAlgorithm2,
379 F_AP | F_STA | F_READ,
382 { DIDmib_dot11smt_dot11AuthenticationAlgorithmsTable_dot11AuthenticationAlgorithm3,
383 F_AP | F_STA | F_READ,
386 { DIDmib_dot11smt_dot11AuthenticationAlgorithmsTable_dot11AuthenticationAlgorithm4,
387 F_AP | F_STA | F_READ,
390 { DIDmib_dot11smt_dot11AuthenticationAlgorithmsTable_dot11AuthenticationAlgorithm5,
391 F_AP | F_STA | F_READ,
394 { DIDmib_dot11smt_dot11AuthenticationAlgorithmsTable_dot11AuthenticationAlgorithm6,
395 F_AP | F_STA | F_READ,
398 { DIDmib_dot11smt_dot11AuthenticationAlgorithmsTable_dot11AuthenticationAlgorithmsEnable1,
399 F_AP | F_STA | F_READ | F_WRITE,
401 prism2mib_authalgenable },
402 { DIDmib_dot11smt_dot11AuthenticationAlgorithmsTable_dot11AuthenticationAlgorithmsEnable2,
403 F_AP | F_STA | F_READ | F_WRITE,
405 prism2mib_authalgenable },
406 { DIDmib_dot11smt_dot11AuthenticationAlgorithmsTable_dot11AuthenticationAlgorithmsEnable3,
407 F_AP | F_STA | F_READ | F_WRITE,
409 prism2mib_authalgenable },
410 { DIDmib_dot11smt_dot11AuthenticationAlgorithmsTable_dot11AuthenticationAlgorithmsEnable4,
411 F_AP | F_STA | F_READ | F_WRITE,
413 prism2mib_authalgenable },
414 { DIDmib_dot11smt_dot11AuthenticationAlgorithmsTable_dot11AuthenticationAlgorithmsEnable5,
415 F_AP | F_STA | F_READ | F_WRITE,
417 prism2mib_authalgenable },
418 { DIDmib_dot11smt_dot11AuthenticationAlgorithmsTable_dot11AuthenticationAlgorithmsEnable6,
419 F_AP | F_STA | F_READ | F_WRITE,
421 prism2mib_authalgenable },
422 { DIDmib_dot11smt_dot11WEPDefaultKeysTable_dot11WEPDefaultKey0,
423 F_AP | F_STA | F_WRITE,
424 HFA384x_RID_CNFWEPDEFAULTKEY0, 0, 0,
425 prism2mib_wepdefaultkey },
426 { DIDmib_dot11smt_dot11WEPDefaultKeysTable_dot11WEPDefaultKey1,
427 F_AP | F_STA | F_WRITE,
428 HFA384x_RID_CNFWEPDEFAULTKEY1, 0, 0,
429 prism2mib_wepdefaultkey },
430 { DIDmib_dot11smt_dot11WEPDefaultKeysTable_dot11WEPDefaultKey2,
431 F_AP | F_STA | F_WRITE,
432 HFA384x_RID_CNFWEPDEFAULTKEY2, 0, 0,
433 prism2mib_wepdefaultkey },
434 { DIDmib_dot11smt_dot11WEPDefaultKeysTable_dot11WEPDefaultKey3,
435 F_AP | F_STA | F_WRITE,
436 HFA384x_RID_CNFWEPDEFAULTKEY3, 0, 0,
437 prism2mib_wepdefaultkey },
438 { DIDmib_dot11smt_dot11PrivacyTable_dot11PrivacyInvoked,
439 F_AP | F_STA | F_READ | F_WRITE,
440 HFA384x_RID_CNFWEPFLAGS, HFA384x_WEPFLAGS_PRIVINVOKED, 0,
441 prism2mib_privacyinvoked },
442 { DIDmib_dot11smt_dot11PrivacyTable_dot11WEPDefaultKeyID,
443 F_AP | F_STA | F_READ | F_WRITE,
444 HFA384x_RID_CNFWEPDEFAULTKEYID, 0, 0,
446 { DIDmib_dot11smt_dot11PrivacyTable_dot11ExcludeUnencrypted,
447 F_AP | F_STA | F_READ | F_WRITE,
448 HFA384x_RID_CNFWEPFLAGS, HFA384x_WEPFLAGS_EXCLUDE, 0,
449 prism2mib_excludeunencrypted },
450 { DIDmib_dot11phy_dot11PhyOperationTable_dot11ShortPreambleEnabled,
451 F_AP | F_STA | F_READ | F_WRITE,
452 HFA384x_RID_CNFSHORTPREAMBLE, 0, 0,
453 prism2mib_preamble },
457 { DIDmib_dot11mac_dot11OperationTable_dot11MACAddress,
458 F_AP | F_STA | F_READ | F_WRITE,
459 HFA384x_RID_CNFOWNMACADDR, HFA384x_RID_CNFOWNMACADDR_LEN, 0,
460 prism2mib_bytearea2pstr },
461 { DIDmib_dot11mac_dot11OperationTable_dot11RTSThreshold,
462 F_STA | F_READ | F_WRITE,
463 HFA384x_RID_RTSTHRESH, 0, 0,
465 { DIDmib_dot11mac_dot11OperationTable_dot11RTSThreshold,
466 F_AP | F_READ | F_WRITE,
467 HFA384x_RID_RTSTHRESH0, 0, 0,
469 { DIDmib_dot11mac_dot11OperationTable_dot11ShortRetryLimit,
470 F_AP | F_STA | F_READ,
471 HFA384x_RID_SHORTRETRYLIMIT, 0, 0,
473 { DIDmib_dot11mac_dot11OperationTable_dot11LongRetryLimit,
474 F_AP | F_STA | F_READ,
475 HFA384x_RID_LONGRETRYLIMIT, 0, 0,
477 { DIDmib_dot11mac_dot11OperationTable_dot11FragmentationThreshold,
478 F_STA | F_READ | F_WRITE,
479 HFA384x_RID_FRAGTHRESH, 0, 0,
480 prism2mib_fragmentationthreshold },
481 { DIDmib_dot11mac_dot11OperationTable_dot11FragmentationThreshold,
482 F_AP | F_READ | F_WRITE,
483 HFA384x_RID_FRAGTHRESH0, 0, 0,
484 prism2mib_fragmentationthreshold },
485 { DIDmib_dot11mac_dot11OperationTable_dot11MaxTransmitMSDULifetime,
486 F_AP | F_STA | F_READ,
487 HFA384x_RID_MAXTXLIFETIME, 0, 0,
489 { DIDmib_dot11mac_dot11OperationTable_dot11MaxReceiveLifetime,
490 F_AP | F_STA | F_READ,
491 HFA384x_RID_MAXRXLIFETIME, 0, 0,
493 { DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address1,
494 F_STA | F_READ | F_WRITE,
496 prism2mib_groupaddress },
497 { DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address2,
498 F_STA | F_READ | F_WRITE,
500 prism2mib_groupaddress },
501 { DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address3,
502 F_STA | F_READ | F_WRITE,
504 prism2mib_groupaddress },
505 { DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address4,
506 F_STA | F_READ | F_WRITE,
508 prism2mib_groupaddress },
509 { DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address5,
510 F_STA | F_READ | F_WRITE,
512 prism2mib_groupaddress },
513 { DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address6,
514 F_STA | F_READ | F_WRITE,
516 prism2mib_groupaddress },
517 { DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address7,
518 F_STA | F_READ | F_WRITE,
520 prism2mib_groupaddress },
521 { DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address8,
522 F_STA | F_READ | F_WRITE,
524 prism2mib_groupaddress },
525 { DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address9,
526 F_STA | F_READ | F_WRITE,
528 prism2mib_groupaddress },
529 { DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address10,
530 F_STA | F_READ | F_WRITE,
532 prism2mib_groupaddress },
533 { DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address11,
534 F_STA | F_READ | F_WRITE,
536 prism2mib_groupaddress },
537 { DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address12,
538 F_STA | F_READ | F_WRITE,
540 prism2mib_groupaddress },
541 { DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address13,
542 F_STA | F_READ | F_WRITE,
544 prism2mib_groupaddress },
545 { DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address14,
546 F_STA | F_READ | F_WRITE,
548 prism2mib_groupaddress },
549 { DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address15,
550 F_STA | F_READ | F_WRITE,
552 prism2mib_groupaddress },
553 { DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address16,
554 F_STA | F_READ | F_WRITE,
556 prism2mib_groupaddress },
557 { DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address17,
558 F_STA | F_READ | F_WRITE,
560 prism2mib_groupaddress },
561 { DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address18,
562 F_STA | F_READ | F_WRITE,
564 prism2mib_groupaddress },
565 { DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address19,
566 F_STA | F_READ | F_WRITE,
568 prism2mib_groupaddress },
569 { DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address20,
570 F_STA | F_READ | F_WRITE,
572 prism2mib_groupaddress },
573 { DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address21,
574 F_STA | F_READ | F_WRITE,
576 prism2mib_groupaddress },
577 { DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address22,
578 F_STA | F_READ | F_WRITE,
580 prism2mib_groupaddress },
581 { DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address23,
582 F_STA | F_READ | F_WRITE,
584 prism2mib_groupaddress },
585 { DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address24,
586 F_STA | F_READ | F_WRITE,
588 prism2mib_groupaddress },
589 { DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address25,
590 F_STA | F_READ | F_WRITE,
592 prism2mib_groupaddress },
593 { DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address26,
594 F_STA | F_READ | F_WRITE,
596 prism2mib_groupaddress },
597 { DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address27,
598 F_STA | F_READ | F_WRITE,
600 prism2mib_groupaddress },
601 { DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address28,
602 F_STA | F_READ | F_WRITE,
604 prism2mib_groupaddress },
605 { DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address29,
606 F_STA | F_READ | F_WRITE,
608 prism2mib_groupaddress },
609 { DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address30,
610 F_STA | F_READ | F_WRITE,
612 prism2mib_groupaddress },
613 { DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address31,
614 F_STA | F_READ | F_WRITE,
616 prism2mib_groupaddress },
617 { DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address32,
618 F_STA | F_READ | F_WRITE,
620 prism2mib_groupaddress },
624 { DIDmib_dot11phy_dot11PhyOperationTable_dot11PHYType,
625 F_AP | F_STA | F_READ,
626 HFA384x_RID_PHYTYPE, 0, 0,
628 { DIDmib_dot11phy_dot11PhyOperationTable_dot11TempType,
629 F_AP | F_STA | F_READ,
630 HFA384x_RID_TEMPTYPE, 0, 0,
632 { DIDmib_dot11phy_dot11PhyDSSSTable_dot11CurrentChannel,
634 HFA384x_RID_CURRENTCHANNEL, 0, 0,
636 { DIDmib_dot11phy_dot11PhyDSSSTable_dot11CurrentChannel,
638 HFA384x_RID_CNFOWNCHANNEL, 0, 0,
640 { DIDmib_dot11phy_dot11PhyDSSSTable_dot11CurrentCCAMode,
641 F_AP | F_STA | F_READ,
642 HFA384x_RID_CCAMODE, 0, 0,
647 { DIDmib_p2_p2Table_p2MMTx,
648 F_AP | F_STA | F_READ | F_WRITE,
651 { DIDmib_p2_p2Table_p2EarlyBeacon,
652 F_AP | F_READ | F_WRITE,
654 prism2mib_appcfinfoflag },
655 { DIDmib_p2_p2Table_p2ReceivedFrameStatistics,
656 F_AP | F_STA | F_READ,
659 { DIDmib_p2_p2Table_p2CommunicationTallies,
660 F_AP | F_STA | F_READ,
663 { DIDmib_p2_p2Table_p2Authenticated,
667 { DIDmib_p2_p2Table_p2Associated,
671 { DIDmib_p2_p2Table_p2PowerSaveUserCount,
675 { DIDmib_p2_p2Table_p2Comment,
676 F_AP | F_STA | F_READ | F_WRITE,
679 { DIDmib_p2_p2Table_p2AccessMode,
680 F_AP | F_READ | F_WRITE,
683 { DIDmib_p2_p2Table_p2AccessAllow,
684 F_AP | F_READ | F_WRITE,
687 { DIDmib_p2_p2Table_p2AccessDeny,
688 F_AP | F_READ | F_WRITE,
691 { DIDmib_p2_p2Table_p2ChannelInfoResults,
698 { DIDmib_p2_p2Static_p2CnfPortType,
699 F_STA | F_READ | F_WRITE,
700 HFA384x_RID_CNFPORTTYPE, 0, 0,
702 { DIDmib_p2_p2Static_p2CnfOwnMACAddress,
703 F_AP | F_STA | F_READ | F_WRITE,
704 HFA384x_RID_CNFOWNMACADDR, HFA384x_RID_CNFOWNMACADDR_LEN, 0,
705 prism2mib_bytearea2pstr },
706 { DIDmib_p2_p2Static_p2CnfDesiredSSID,
707 F_STA | F_READ | F_WRITE,
708 HFA384x_RID_CNFDESIREDSSID, HFA384x_RID_CNFDESIREDSSID_LEN, 0,
709 prism2mib_bytestr2pstr },
710 { DIDmib_p2_p2Static_p2CnfOwnChannel,
711 F_AP | F_STA | F_READ | F_WRITE,
712 HFA384x_RID_CNFOWNCHANNEL, 0, 0,
714 { DIDmib_p2_p2Static_p2CnfOwnSSID,
715 F_AP | F_STA | F_READ | F_WRITE,
716 HFA384x_RID_CNFOWNSSID, HFA384x_RID_CNFOWNSSID_LEN, 0,
717 prism2mib_bytestr2pstr },
718 { DIDmib_p2_p2Static_p2CnfOwnATIMWindow,
719 F_STA | F_READ | F_WRITE,
720 HFA384x_RID_CNFOWNATIMWIN, 0, 0,
722 { DIDmib_p2_p2Static_p2CnfSystemScale,
723 F_AP | F_STA | F_READ | F_WRITE,
724 HFA384x_RID_CNFSYSSCALE, 0, 0,
726 { DIDmib_p2_p2Static_p2CnfMaxDataLength,
727 F_AP | F_STA | F_READ | F_WRITE,
728 HFA384x_RID_CNFMAXDATALEN, 0, 0,
730 { DIDmib_p2_p2Static_p2CnfWDSAddress,
731 F_STA | F_READ | F_WRITE,
732 HFA384x_RID_CNFWDSADDR, HFA384x_RID_CNFWDSADDR_LEN, 0,
733 prism2mib_bytearea2pstr },
734 { DIDmib_p2_p2Static_p2CnfPMEnabled,
735 F_STA | F_READ | F_WRITE,
736 HFA384x_RID_CNFPMENABLED, 0, 0,
738 { DIDmib_p2_p2Static_p2CnfPMEPS,
739 F_STA | F_READ | F_WRITE,
740 HFA384x_RID_CNFPMEPS, 0, 0,
742 { DIDmib_p2_p2Static_p2CnfMulticastReceive,
743 F_STA | F_READ | F_WRITE,
744 HFA384x_RID_CNFMULTICASTRX, 0, 0,
746 { DIDmib_p2_p2Static_p2CnfMaxSleepDuration,
747 F_STA | F_READ | F_WRITE,
748 HFA384x_RID_CNFMAXSLEEPDUR, 0, 0,
750 { DIDmib_p2_p2Static_p2CnfPMHoldoverDuration,
751 F_STA | F_READ | F_WRITE,
752 HFA384x_RID_CNFPMHOLDDUR, 0, 0,
754 { DIDmib_p2_p2Static_p2CnfOwnName,
755 F_AP | F_STA | F_READ | F_WRITE,
756 HFA384x_RID_CNFOWNNAME, HFA384x_RID_CNFOWNNAME_LEN, 0,
757 prism2mib_bytestr2pstr },
758 { DIDmib_p2_p2Static_p2CnfOwnDTIMPeriod,
759 F_AP | F_STA | F_READ | F_WRITE,
760 HFA384x_RID_CNFOWNDTIMPER, 0, 0,
762 { DIDmib_p2_p2Static_p2CnfWDSAddress1,
763 F_AP | F_READ | F_WRITE,
764 HFA384x_RID_CNFWDSADDR1, HFA384x_RID_CNFWDSADDR1_LEN, 0,
765 prism2mib_bytearea2pstr },
766 { DIDmib_p2_p2Static_p2CnfWDSAddress2,
767 F_AP | F_READ | F_WRITE,
768 HFA384x_RID_CNFWDSADDR2, HFA384x_RID_CNFWDSADDR2_LEN, 0,
769 prism2mib_bytearea2pstr },
770 { DIDmib_p2_p2Static_p2CnfWDSAddress3,
771 F_AP | F_READ | F_WRITE,
772 HFA384x_RID_CNFWDSADDR3, HFA384x_RID_CNFWDSADDR3_LEN, 0,
773 prism2mib_bytearea2pstr },
774 { DIDmib_p2_p2Static_p2CnfWDSAddress4,
775 F_AP | F_READ | F_WRITE,
776 HFA384x_RID_CNFWDSADDR4, HFA384x_RID_CNFWDSADDR4_LEN, 0,
777 prism2mib_bytearea2pstr },
778 { DIDmib_p2_p2Static_p2CnfWDSAddress5,
779 F_AP | F_READ | F_WRITE,
780 HFA384x_RID_CNFWDSADDR5, HFA384x_RID_CNFWDSADDR5_LEN, 0,
781 prism2mib_bytearea2pstr },
782 { DIDmib_p2_p2Static_p2CnfWDSAddress6,
783 F_AP | F_READ | F_WRITE,
784 HFA384x_RID_CNFWDSADDR6, HFA384x_RID_CNFWDSADDR6_LEN, 0,
785 prism2mib_bytearea2pstr },
786 { DIDmib_p2_p2Static_p2CnfMulticastPMBuffering,
787 F_AP | F_READ | F_WRITE,
788 HFA384x_RID_CNFMCASTPMBUFF, 0, 0,
790 { DIDmib_p2_p2Static_p2CnfWEPDefaultKeyID,
791 F_AP | F_STA | F_READ | F_WRITE,
792 HFA384x_RID_CNFWEPDEFAULTKEYID, 0, 0,
794 { DIDmib_p2_p2Static_p2CnfWEPDefaultKey0,
795 F_AP | F_STA | F_WRITE,
796 HFA384x_RID_CNFWEPDEFAULTKEY0, 0, 0,
797 prism2mib_wepdefaultkey },
798 { DIDmib_p2_p2Static_p2CnfWEPDefaultKey1,
799 F_AP | F_STA | F_WRITE,
800 HFA384x_RID_CNFWEPDEFAULTKEY1, 0, 0,
801 prism2mib_wepdefaultkey },
802 { DIDmib_p2_p2Static_p2CnfWEPDefaultKey2,
803 F_AP | F_STA | F_WRITE,
804 HFA384x_RID_CNFWEPDEFAULTKEY2, 0, 0,
805 prism2mib_wepdefaultkey },
806 { DIDmib_p2_p2Static_p2CnfWEPDefaultKey3,
807 F_AP | F_STA | F_WRITE,
808 HFA384x_RID_CNFWEPDEFAULTKEY3, 0, 0,
809 prism2mib_wepdefaultkey },
810 { DIDmib_p2_p2Static_p2CnfWEPFlags,
811 F_AP | F_STA | F_READ | F_WRITE,
812 HFA384x_RID_CNFWEPFLAGS, 0, 0,
814 { DIDmib_p2_p2Static_p2CnfAuthentication,
815 F_AP | F_STA | F_READ | F_WRITE,
816 HFA384x_RID_CNFAUTHENTICATION, 0, 0,
818 { DIDmib_p2_p2Static_p2CnfMaxAssociatedStations,
819 F_AP | F_READ | F_WRITE,
820 HFA384x_RID_CNFMAXASSOCSTATIONS, 0, 0,
822 { DIDmib_p2_p2Static_p2CnfTxControl,
823 F_AP | F_STA | F_READ | F_WRITE,
824 HFA384x_RID_CNFTXCONTROL, 0, 0,
826 { DIDmib_p2_p2Static_p2CnfRoamingMode,
827 F_STA | F_READ | F_WRITE,
828 HFA384x_RID_CNFROAMINGMODE, 0, 0,
830 { DIDmib_p2_p2Static_p2CnfHostAuthentication,
831 F_AP | F_READ | F_WRITE,
832 HFA384x_RID_CNFHOSTAUTHASSOC, 0, 0,
834 { DIDmib_p2_p2Static_p2CnfRcvCrcError,
835 F_AP | F_STA | F_READ | F_WRITE,
836 HFA384x_RID_CNFRCVCRCERROR, 0, 0,
838 { DIDmib_p2_p2Static_p2CnfAltRetryCount,
839 F_AP | F_STA | F_READ | F_WRITE,
840 HFA384x_RID_CNFALTRETRYCNT, 0, 0,
842 { DIDmib_p2_p2Static_p2CnfBeaconInterval,
843 F_AP | F_READ | F_WRITE,
844 HFA384x_RID_CNFAPBCNINT, 0, 0,
846 { DIDmib_p2_p2Static_p2CnfMediumOccupancyLimit,
847 F_AP | F_READ | F_WRITE,
848 HFA384x_RID_CNFAPPCFINFO, HFA384x_RID_CNFAPPCFINFO_LEN, 0,
849 prism2mib_uint32offset },
850 { DIDmib_p2_p2Static_p2CnfCFPPeriod,
851 F_AP | F_READ | F_WRITE,
852 HFA384x_RID_CNFAPPCFINFO, HFA384x_RID_CNFAPPCFINFO_LEN, 1,
853 prism2mib_uint32offset },
854 { DIDmib_p2_p2Static_p2CnfCFPMaxDuration,
855 F_AP | F_READ | F_WRITE,
856 HFA384x_RID_CNFAPPCFINFO, HFA384x_RID_CNFAPPCFINFO_LEN, 2,
857 prism2mib_uint32offset },
858 { DIDmib_p2_p2Static_p2CnfCFPFlags,
859 F_AP | F_READ | F_WRITE,
860 HFA384x_RID_CNFAPPCFINFO, HFA384x_RID_CNFAPPCFINFO_LEN, 3,
861 prism2mib_uint32offset },
862 { DIDmib_p2_p2Static_p2CnfSTAPCFInfo,
863 F_STA | F_READ | F_WRITE,
864 HFA384x_RID_CNFSTAPCFINFO, 0, 0,
866 { DIDmib_p2_p2Static_p2CnfPriorityQUsage,
867 F_AP | F_STA | F_READ | F_WRITE,
868 HFA384x_RID_CNFPRIORITYQUSAGE, HFA384x_RID_CNFPRIOQUSAGE_LEN, 0,
869 prism2mib_uint32array },
870 { DIDmib_p2_p2Static_p2CnfTIMCtrl,
871 F_AP | F_STA | F_READ | F_WRITE,
872 HFA384x_RID_CNFTIMCTRL, 0, 0,
874 { DIDmib_p2_p2Static_p2CnfThirty2Tally,
875 F_AP | F_STA | F_READ | F_WRITE,
876 HFA384x_RID_CNFTHIRTY2TALLY, 0, 0,
878 { DIDmib_p2_p2Static_p2CnfEnhSecurity,
879 F_AP | F_READ | F_WRITE,
880 HFA384x_RID_CNFENHSECURITY, 0, 0,
882 { DIDmib_p2_p2Static_p2CnfShortPreamble,
883 F_AP | F_STA | F_READ | F_WRITE,
884 HFA384x_RID_CNFSHORTPREAMBLE, 0, 0,
885 prism2mib_preamble },
886 { DIDmib_p2_p2Static_p2CnfExcludeLongPreamble,
887 F_AP | F_READ | F_WRITE,
888 HFA384x_RID_CNFEXCLONGPREAMBLE, 0, 0,
890 { DIDmib_p2_p2Static_p2CnfAuthenticationRspTO,
891 F_STA | F_READ | F_WRITE,
892 HFA384x_RID_CNFAUTHRSPTIMEOUT, 0, 0,
894 { DIDmib_p2_p2Static_p2CnfBasicRates,
895 F_AP | F_STA | F_READ | F_WRITE,
896 HFA384x_RID_CNFBASICRATES, 0, 0,
898 { DIDmib_p2_p2Static_p2CnfSupportedRates,
899 F_AP | F_STA | F_READ | F_WRITE,
900 HFA384x_RID_CNFSUPPRATES, 0, 0,
903 /* p2Dynamic MIB's */
905 { DIDmib_p2_p2Dynamic_p2CreateIBSS,
906 F_STA | F_READ | F_WRITE,
907 HFA384x_RID_CREATEIBSS, 0, 0,
909 { DIDmib_p2_p2Dynamic_p2FragmentationThreshold,
910 F_STA | F_READ | F_WRITE,
911 HFA384x_RID_FRAGTHRESH, 0, 0,
912 prism2mib_fragmentationthreshold },
913 { DIDmib_p2_p2Dynamic_p2RTSThreshold,
914 F_STA | F_READ | F_WRITE,
915 HFA384x_RID_RTSTHRESH, 0, 0,
917 { DIDmib_p2_p2Dynamic_p2TxRateControl,
918 F_STA | F_READ | F_WRITE,
919 HFA384x_RID_TXRATECNTL, 0, 0,
921 { DIDmib_p2_p2Dynamic_p2PromiscuousMode,
922 F_STA | F_READ | F_WRITE,
923 HFA384x_RID_PROMISCMODE, 0, 0,
925 { DIDmib_p2_p2Dynamic_p2FragmentationThreshold0,
926 F_AP | F_READ | F_WRITE,
927 HFA384x_RID_FRAGTHRESH0, 0, 0,
928 prism2mib_fragmentationthreshold },
929 { DIDmib_p2_p2Dynamic_p2FragmentationThreshold1,
930 F_AP | F_READ | F_WRITE,
931 HFA384x_RID_FRAGTHRESH1, 0, 0,
932 prism2mib_fragmentationthreshold },
933 { DIDmib_p2_p2Dynamic_p2FragmentationThreshold2,
934 F_AP | F_READ | F_WRITE,
935 HFA384x_RID_FRAGTHRESH2, 0, 0,
936 prism2mib_fragmentationthreshold },
937 { DIDmib_p2_p2Dynamic_p2FragmentationThreshold3,
938 F_AP | F_READ | F_WRITE,
939 HFA384x_RID_FRAGTHRESH3, 0, 0,
940 prism2mib_fragmentationthreshold },
941 { DIDmib_p2_p2Dynamic_p2FragmentationThreshold4,
942 F_AP | F_READ | F_WRITE,
943 HFA384x_RID_FRAGTHRESH4, 0, 0,
944 prism2mib_fragmentationthreshold },
945 { DIDmib_p2_p2Dynamic_p2FragmentationThreshold5,
946 F_AP | F_READ | F_WRITE,
947 HFA384x_RID_FRAGTHRESH5, 0, 0,
948 prism2mib_fragmentationthreshold },
949 { DIDmib_p2_p2Dynamic_p2FragmentationThreshold6,
950 F_AP | F_READ | F_WRITE,
951 HFA384x_RID_FRAGTHRESH6, 0, 0,
952 prism2mib_fragmentationthreshold },
953 { DIDmib_p2_p2Dynamic_p2RTSThreshold0,
954 F_AP | F_READ | F_WRITE,
955 HFA384x_RID_RTSTHRESH0, 0, 0,
957 { DIDmib_p2_p2Dynamic_p2RTSThreshold1,
958 F_AP | F_READ | F_WRITE,
959 HFA384x_RID_RTSTHRESH1, 0, 0,
961 { DIDmib_p2_p2Dynamic_p2RTSThreshold2,
962 F_AP | F_READ | F_WRITE,
963 HFA384x_RID_RTSTHRESH2, 0, 0,
965 { DIDmib_p2_p2Dynamic_p2RTSThreshold3,
966 F_AP | F_READ | F_WRITE,
967 HFA384x_RID_RTSTHRESH3, 0, 0,
969 { DIDmib_p2_p2Dynamic_p2RTSThreshold4,
970 F_AP | F_READ | F_WRITE,
971 HFA384x_RID_RTSTHRESH4, 0, 0,
973 { DIDmib_p2_p2Dynamic_p2RTSThreshold5,
974 F_AP | F_READ | F_WRITE,
975 HFA384x_RID_RTSTHRESH5, 0, 0,
977 { DIDmib_p2_p2Dynamic_p2RTSThreshold6,
978 F_AP | F_READ | F_WRITE,
979 HFA384x_RID_RTSTHRESH6, 0, 0,
981 { DIDmib_p2_p2Dynamic_p2TxRateControl0,
982 F_AP | F_READ | F_WRITE,
983 HFA384x_RID_TXRATECNTL0, 0, 0,
985 { DIDmib_p2_p2Dynamic_p2TxRateControl1,
986 F_AP | F_READ | F_WRITE,
987 HFA384x_RID_TXRATECNTL1, 0, 0,
989 { DIDmib_p2_p2Dynamic_p2TxRateControl2,
990 F_AP | F_READ | F_WRITE,
991 HFA384x_RID_TXRATECNTL2, 0, 0,
993 { DIDmib_p2_p2Dynamic_p2TxRateControl3,
994 F_AP | F_READ | F_WRITE,
995 HFA384x_RID_TXRATECNTL3, 0, 0,
997 { DIDmib_p2_p2Dynamic_p2TxRateControl4,
998 F_AP | F_READ | F_WRITE,
999 HFA384x_RID_TXRATECNTL4, 0, 0,
1001 { DIDmib_p2_p2Dynamic_p2TxRateControl5,
1002 F_AP | F_READ | F_WRITE,
1003 HFA384x_RID_TXRATECNTL5, 0, 0,
1005 { DIDmib_p2_p2Dynamic_p2TxRateControl6,
1006 F_AP | F_READ | F_WRITE,
1007 HFA384x_RID_TXRATECNTL6, 0, 0,
1010 /* p2Behavior MIB's */
1012 { DIDmib_p2_p2Behavior_p2TickTime,
1013 F_AP | F_STA | F_READ | F_WRITE,
1014 HFA384x_RID_ITICKTIME, 0, 0,
1019 { DIDmib_p2_p2NIC_p2MaxLoadTime,
1020 F_AP | F_STA | F_READ,
1021 HFA384x_RID_MAXLOADTIME, 0, 0,
1023 { DIDmib_p2_p2NIC_p2DLBufferPage,
1024 F_AP | F_STA | F_READ,
1025 HFA384x_RID_DOWNLOADBUFFER, HFA384x_RID_DOWNLOADBUFFER_LEN, 0,
1026 prism2mib_uint32offset },
1027 { DIDmib_p2_p2NIC_p2DLBufferOffset,
1028 F_AP | F_STA | F_READ,
1029 HFA384x_RID_DOWNLOADBUFFER, HFA384x_RID_DOWNLOADBUFFER_LEN, 1,
1030 prism2mib_uint32offset },
1031 { DIDmib_p2_p2NIC_p2DLBufferLength,
1032 F_AP | F_STA | F_READ,
1033 HFA384x_RID_DOWNLOADBUFFER, HFA384x_RID_DOWNLOADBUFFER_LEN, 2,
1034 prism2mib_uint32offset },
1035 { DIDmib_p2_p2NIC_p2PRIIdentity,
1036 F_AP | F_STA | F_READ,
1037 HFA384x_RID_PRIIDENTITY, HFA384x_RID_PRIIDENTITY_LEN, 0,
1038 prism2mib_uint32array },
1039 { DIDmib_p2_p2NIC_p2PRISupRange,
1040 F_AP | F_STA | F_READ,
1041 HFA384x_RID_PRISUPRANGE, HFA384x_RID_PRISUPRANGE_LEN, 0,
1042 prism2mib_uint32array },
1043 { DIDmib_p2_p2NIC_p2CFIActRanges,
1044 F_AP | F_STA | F_READ,
1045 HFA384x_RID_PRI_CFIACTRANGES, HFA384x_RID_CFIACTRANGES_LEN, 0,
1046 prism2mib_uint32array },
1047 { DIDmib_p2_p2NIC_p2BuildSequence,
1048 F_AP | F_STA | F_READ,
1049 HFA384x_RID_BUILDSEQ, HFA384x_RID_BUILDSEQ_LEN, 0,
1050 prism2mib_uint32array },
1051 { DIDmib_p2_p2NIC_p2PrimaryFWID,
1052 F_AP | F_STA | F_READ,
1055 { DIDmib_p2_p2NIC_p2SecondaryFWID,
1056 F_AP | F_STA | F_READ,
1059 { DIDmib_p2_p2NIC_p2TertiaryFWID,
1063 { DIDmib_p2_p2NIC_p2NICSerialNumber,
1064 F_AP | F_STA | F_READ,
1065 HFA384x_RID_NICSERIALNUMBER, HFA384x_RID_NICSERIALNUMBER_LEN, 0,
1066 prism2mib_bytearea2pstr },
1067 { DIDmib_p2_p2NIC_p2NICIdentity,
1068 F_AP | F_STA | F_READ,
1069 HFA384x_RID_NICIDENTITY, HFA384x_RID_NICIDENTITY_LEN, 0,
1070 prism2mib_uint32array },
1071 { DIDmib_p2_p2NIC_p2MFISupRange,
1072 F_AP | F_STA | F_READ,
1073 HFA384x_RID_MFISUPRANGE, HFA384x_RID_MFISUPRANGE_LEN, 0,
1074 prism2mib_uint32array },
1075 { DIDmib_p2_p2NIC_p2CFISupRange,
1076 F_AP | F_STA | F_READ,
1077 HFA384x_RID_CFISUPRANGE, HFA384x_RID_CFISUPRANGE_LEN, 0,
1078 prism2mib_uint32array },
1079 { DIDmib_p2_p2NIC_p2ChannelList,
1080 F_AP | F_STA | F_READ,
1081 HFA384x_RID_CHANNELLIST, 0, 0,
1083 { DIDmib_p2_p2NIC_p2RegulatoryDomains,
1084 F_AP | F_STA | F_READ,
1085 HFA384x_RID_REGULATORYDOMAINS, HFA384x_RID_REGULATORYDOMAINS_LEN, 0,
1086 prism2mib_regulatorydomains },
1087 { DIDmib_p2_p2NIC_p2TempType,
1088 F_AP | F_STA | F_READ,
1089 HFA384x_RID_TEMPTYPE, 0, 0,
1091 { DIDmib_p2_p2NIC_p2STAIdentity,
1092 F_AP | F_STA | F_READ,
1093 HFA384x_RID_STAIDENTITY, HFA384x_RID_STAIDENTITY_LEN, 0,
1094 prism2mib_uint32array },
1095 { DIDmib_p2_p2NIC_p2STASupRange,
1096 F_AP | F_STA | F_READ,
1097 HFA384x_RID_STASUPRANGE, HFA384x_RID_STASUPRANGE_LEN, 0,
1098 prism2mib_uint32array },
1099 { DIDmib_p2_p2NIC_p2MFIActRanges,
1100 F_AP | F_STA | F_READ,
1101 HFA384x_RID_STA_MFIACTRANGES, HFA384x_RID_MFIACTRANGES_LEN, 0,
1102 prism2mib_uint32array },
1103 { DIDmib_p2_p2NIC_p2STACFIActRanges,
1104 F_AP | F_STA | F_READ,
1105 HFA384x_RID_STA_CFIACTRANGES, HFA384x_RID_CFIACTRANGES2_LEN, 0,
1106 prism2mib_uint32array },
1110 { DIDmib_p2_p2MAC_p2PortStatus,
1112 HFA384x_RID_PORTSTATUS, 0, 0,
1114 { DIDmib_p2_p2MAC_p2CurrentSSID,
1116 HFA384x_RID_CURRENTSSID, HFA384x_RID_CURRENTSSID_LEN, 0,
1117 prism2mib_bytestr2pstr },
1118 { DIDmib_p2_p2MAC_p2CurrentBSSID,
1120 HFA384x_RID_CURRENTBSSID, HFA384x_RID_CURRENTBSSID_LEN, 0,
1121 prism2mib_bytearea2pstr },
1122 { DIDmib_p2_p2MAC_p2CommsQuality,
1124 HFA384x_RID_COMMSQUALITY, HFA384x_RID_COMMSQUALITY_LEN, 0,
1125 prism2mib_uint32array },
1126 { DIDmib_p2_p2MAC_p2CommsQualityCQ,
1128 HFA384x_RID_COMMSQUALITY, HFA384x_RID_COMMSQUALITY_LEN, 0,
1129 prism2mib_uint32offset },
1130 { DIDmib_p2_p2MAC_p2CommsQualityASL,
1132 HFA384x_RID_COMMSQUALITY, HFA384x_RID_COMMSQUALITY_LEN, 1,
1133 prism2mib_uint32offset },
1134 { DIDmib_p2_p2MAC_p2CommsQualityANL,
1136 HFA384x_RID_COMMSQUALITY, HFA384x_RID_COMMSQUALITY_LEN, 2,
1137 prism2mib_uint32offset },
1138 { DIDmib_p2_p2MAC_p2dbmCommsQuality,
1140 HFA384x_RID_DBMCOMMSQUALITY, HFA384x_RID_DBMCOMMSQUALITY_LEN, 0,
1141 prism2mib_uint32array },
1142 { DIDmib_p2_p2MAC_p2dbmCommsQualityCQ,
1144 HFA384x_RID_COMMSQUALITY, HFA384x_RID_COMMSQUALITY_LEN, 0,
1145 prism2mib_uint32offset },
1146 { DIDmib_p2_p2MAC_p2dbmCommsQualityASL,
1148 HFA384x_RID_COMMSQUALITY, HFA384x_RID_COMMSQUALITY_LEN, 1,
1149 prism2mib_uint32offset },
1150 { DIDmib_p2_p2MAC_p2dbmCommsQualityANL,
1152 HFA384x_RID_COMMSQUALITY, HFA384x_RID_COMMSQUALITY_LEN, 2,
1153 prism2mib_uint32offset },
1154 { DIDmib_p2_p2MAC_p2CurrentTxRate,
1156 HFA384x_RID_CURRENTTXRATE, 0, 0,
1158 { DIDmib_p2_p2MAC_p2CurrentBeaconInterval,
1159 F_AP | F_STA | F_READ,
1160 HFA384x_RID_CURRENTBCNINT, 0, 0,
1162 { DIDmib_p2_p2MAC_p2StaCurrentScaleThresholds,
1164 HFA384x_RID_CURRENTSCALETHRESH, HFA384x_RID_STACURSCALETHRESH_LEN, 0,
1165 prism2mib_uint32array },
1166 { DIDmib_p2_p2MAC_p2APCurrentScaleThresholds,
1168 HFA384x_RID_CURRENTSCALETHRESH, HFA384x_RID_APCURSCALETHRESH_LEN, 0,
1169 prism2mib_uint32array },
1170 { DIDmib_p2_p2MAC_p2ProtocolRspTime,
1171 F_AP | F_STA | F_READ,
1172 HFA384x_RID_PROTOCOLRSPTIME, 0, 0,
1174 { DIDmib_p2_p2MAC_p2ShortRetryLimit,
1175 F_AP | F_STA | F_READ,
1176 HFA384x_RID_SHORTRETRYLIMIT, 0, 0,
1178 { DIDmib_p2_p2MAC_p2LongRetryLimit,
1179 F_AP | F_STA | F_READ,
1180 HFA384x_RID_LONGRETRYLIMIT, 0, 0,
1182 { DIDmib_p2_p2MAC_p2MaxTransmitLifetime,
1183 F_AP | F_STA | F_READ,
1184 HFA384x_RID_MAXTXLIFETIME, 0, 0,
1186 { DIDmib_p2_p2MAC_p2MaxReceiveLifetime,
1187 F_AP | F_STA | F_READ,
1188 HFA384x_RID_MAXRXLIFETIME, 0, 0,
1190 { DIDmib_p2_p2MAC_p2CFPollable,
1192 HFA384x_RID_CFPOLLABLE, 0, 0,
1194 { DIDmib_p2_p2MAC_p2AuthenticationAlgorithms,
1195 F_AP | F_STA | F_READ,
1196 HFA384x_RID_AUTHALGORITHMS, HFA384x_RID_AUTHALGORITHMS_LEN, 0,
1197 prism2mib_uint32array },
1198 { DIDmib_p2_p2MAC_p2PrivacyOptionImplemented,
1199 F_AP | F_STA | F_READ,
1200 HFA384x_RID_PRIVACYOPTIMP, 0, 0,
1202 { DIDmib_p2_p2MAC_p2CurrentTxRate1,
1204 HFA384x_RID_CURRENTTXRATE1, 0, 0,
1206 { DIDmib_p2_p2MAC_p2CurrentTxRate2,
1208 HFA384x_RID_CURRENTTXRATE2, 0, 0,
1210 { DIDmib_p2_p2MAC_p2CurrentTxRate3,
1212 HFA384x_RID_CURRENTTXRATE3, 0, 0,
1214 { DIDmib_p2_p2MAC_p2CurrentTxRate4,
1216 HFA384x_RID_CURRENTTXRATE4, 0, 0,
1218 { DIDmib_p2_p2MAC_p2CurrentTxRate5,
1220 HFA384x_RID_CURRENTTXRATE5, 0, 0,
1222 { DIDmib_p2_p2MAC_p2CurrentTxRate6,
1224 HFA384x_RID_CURRENTTXRATE6, 0, 0,
1226 { DIDmib_p2_p2MAC_p2OwnMACAddress,
1228 HFA384x_RID_OWNMACADDRESS, HFA384x_RID_OWNMACADDRESS_LEN, 0,
1229 prism2mib_bytearea2pstr },
1233 { DIDmib_p2_p2Modem_p2PHYType,
1234 F_AP | F_STA | F_READ,
1235 HFA384x_RID_PHYTYPE, 0, 0,
1237 { DIDmib_p2_p2Modem_p2CurrentChannel,
1238 F_AP | F_STA | F_READ,
1239 HFA384x_RID_CURRENTCHANNEL, 0, 0,
1241 { DIDmib_p2_p2Modem_p2CurrentPowerState,
1242 F_AP | F_STA | F_READ,
1243 HFA384x_RID_CURRENTPOWERSTATE, 0, 0,
1245 { DIDmib_p2_p2Modem_p2CCAMode,
1246 F_AP | F_STA | F_READ,
1247 HFA384x_RID_CCAMODE, 0, 0,
1249 { DIDmib_p2_p2Modem_p2TxPowerMax,
1250 F_AP | F_STA | F_READ | F_WRITE,
1251 HFA384x_RID_TXPOWERMAX, 0, 0,
1253 { DIDmib_dot11phy_dot11PhyTxPowerTable_dot11CurrentTxPowerLevel,
1254 F_AP | F_STA | F_READ | F_WRITE,
1255 HFA384x_RID_TXPOWERMAX, 0, 0,
1257 { DIDmib_p2_p2Modem_p2SupportedDataRates,
1258 F_AP | F_STA | F_READ,
1259 HFA384x_RID_SUPPORTEDDATARATES, HFA384x_RID_SUPPORTEDDATARATES_LEN, 0,
1260 prism2mib_bytestr2pstr },
1262 /* And finally, lnx mibs */
1263 { DIDmib_lnx_lnxConfigTable_lnxRSNAIE,
1264 F_STA | F_READ | F_WRITE,
1265 HFA384x_RID_CNFWPADATA, 0, 0,
1267 { 0, 0, 0, 0, 0, NULL}};
1269 /*----------------------------------------------------------------
1270 These MIB's are not supported at this time:
1272 DIDmib_dot11phy_dot11PhyOperationTable_dot11ChannelAgilityPresent
1273 DIDmib_dot11phy_dot11PhyOperationTable_dot11ChannelAgilityEnabled
1274 DIDmib_dot11phy_dot11PhyDSSSTable_dot11PBCCOptionImplemented
1275 DIDmib_dot11phy_dot11RegDomainsSupportedTable_dot11RegDomainsSupportIndex
1276 DIDmib_dot11phy_dot11SupportedDataRatesTxTable_dot11SupportedDataRatesTxIndex
1277 DIDmib_dot11phy_dot11SupportedDataRatesTxTable_dot11SupportedDataRatesTxValue
1278 DIDmib_dot11phy_dot11SupportedDataRatesRxTable_dot11SupportedDataRatesRxIndex
1279 DIDmib_dot11phy_dot11SupportedDataRatesRxTable_dot11SupportedDataRatesRxValue
1281 DIDmib_dot11phy_dot11RegDomainsSupportedTable_dot11RegDomainsSupportValue
1282 TODO: need to investigate why wlan has this as enumerated and Prism2 has this
1285 DIDmib_dot11phy_dot11PhyDSSSTable_dot11ShortPreambleOptionImplemented
1286 TODO: Find out the firmware version number(s) for identifying
1287 whether the firmware is capable of short preamble. TRUE or FALSE
1288 will be returned based on the version of the firmware.
1290 WEP Key mappings aren't supported in the f/w.
1291 DIDmib_dot11smt_dot11WEPKeyMappingsTable_dot11WEPKeyMappingIndex
1292 DIDmib_dot11smt_dot11WEPKeyMappingsTable_dot11WEPKeyMappingAddress
1293 DIDmib_dot11smt_dot11WEPKeyMappingsTable_dot11WEPKeyMappingWEPOn
1294 DIDmib_dot11smt_dot11WEPKeyMappingsTable_dot11WEPKeyMappingValue
1295 DIDmib_dot11smt_dot11PrivacyTable_dot11WEPKeyMappingLength
1297 TODO: implement counters.
1298 DIDmib_dot11smt_dot11PrivacyTable_dot11WEPICVErrorCount
1299 DIDmib_dot11smt_dot11PrivacyTable_dot11WEPExcludedCount
1300 DIDmib_dot11mac_dot11CountersTable_dot11TransmittedFragmentCount
1301 DIDmib_dot11mac_dot11CountersTable_dot11MulticastTransmittedFrameCount
1302 DIDmib_dot11mac_dot11CountersTable_dot11FailedCount
1303 DIDmib_dot11mac_dot11CountersTable_dot11RetryCount
1304 DIDmib_dot11mac_dot11CountersTable_dot11MultipleRetryCount
1305 DIDmib_dot11mac_dot11CountersTable_dot11FrameDuplicateCount
1306 DIDmib_dot11mac_dot11CountersTable_dot11RTSSuccessCount
1307 DIDmib_dot11mac_dot11CountersTable_dot11RTSFailureCount
1308 DIDmib_dot11mac_dot11CountersTable_dot11ACKFailureCount
1309 DIDmib_dot11mac_dot11CountersTable_dot11ReceivedFragmentCount
1310 DIDmib_dot11mac_dot11CountersTable_dot11MulticastReceivedFrameCount
1311 DIDmib_dot11mac_dot11CountersTable_dot11FCSErrorCount
1312 DIDmib_dot11mac_dot11CountersTable_dot11TransmittedFrameCount
1313 DIDmib_dot11mac_dot11CountersTable_dot11WEPUndecryptableCount
1315 TODO: implement sane values for these.
1316 DIDmib_dot11mac_dot11OperationTable_dot11ManufacturerID
1317 DIDmib_dot11mac_dot11OperationTable_dot11ProductID
1319 Not too worried about these at the moment.
1320 DIDmib_dot11phy_dot11PhyAntennaTable_dot11CurrentTxAntenna
1321 DIDmib_dot11phy_dot11PhyAntennaTable_dot11DiversitySupport
1322 DIDmib_dot11phy_dot11PhyAntennaTable_dot11CurrentRxAntenna
1323 DIDmib_dot11phy_dot11PhyTxPowerTable_dot11NumberSupportedPowerLevels
1324 DIDmib_dot11phy_dot11PhyTxPowerTable_dot11TxPowerLevel1
1325 DIDmib_dot11phy_dot11PhyTxPowerTable_dot11TxPowerLevel2
1326 DIDmib_dot11phy_dot11PhyTxPowerTable_dot11TxPowerLevel3
1327 DIDmib_dot11phy_dot11PhyTxPowerTable_dot11TxPowerLevel4
1328 DIDmib_dot11phy_dot11PhyTxPowerTable_dot11TxPowerLevel5
1329 DIDmib_dot11phy_dot11PhyTxPowerTable_dot11TxPowerLevel6
1330 DIDmib_dot11phy_dot11PhyTxPowerTable_dot11TxPowerLevel7
1331 DIDmib_dot11phy_dot11PhyTxPowerTable_dot11TxPowerLevel8
1332 DIDmib_dot11phy_dot11PhyTxPowerTable_dot11CurrentTxPowerLevel
1334 Ummm, FH and IR don't apply
1335 DIDmib_dot11phy_dot11PhyFHSSTable_dot11HopTime
1336 DIDmib_dot11phy_dot11PhyFHSSTable_dot11CurrentChannelNumber
1337 DIDmib_dot11phy_dot11PhyFHSSTable_dot11MaxDwellTime
1338 DIDmib_dot11phy_dot11PhyFHSSTable_dot11CurrentDwellTime
1339 DIDmib_dot11phy_dot11PhyFHSSTable_dot11CurrentSet
1340 DIDmib_dot11phy_dot11PhyFHSSTable_dot11CurrentPattern
1341 DIDmib_dot11phy_dot11PhyFHSSTable_dot11CurrentIndex
1342 DIDmib_dot11phy_dot11PhyDSSSTable_dot11CCAModeSupported
1343 DIDmib_dot11phy_dot11PhyDSSSTable_dot11EDThreshold
1344 DIDmib_dot11phy_dot11PhyIRTable_dot11CCAWatchdogTimerMax
1345 DIDmib_dot11phy_dot11PhyIRTable_dot11CCAWatchdogCountMax
1346 DIDmib_dot11phy_dot11PhyIRTable_dot11CCAWatchdogTimerMin
1347 DIDmib_dot11phy_dot11PhyIRTable_dot11CCAWatchdogCountMin
1349 We just don't have enough antennas right now to worry about this.
1350 DIDmib_dot11phy_dot11AntennasListTable_dot11AntennaListIndex
1351 DIDmib_dot11phy_dot11AntennasListTable_dot11SupportedTxAntenna
1352 DIDmib_dot11phy_dot11AntennasListTable_dot11SupportedRxAntenna
1353 DIDmib_dot11phy_dot11AntennasListTable_dot11DiversitySelectionRx
1355 ------------------------------------------------------------------*/
1357 /*================================================================*/
1358 /* Function Definitions */
1360 /*----------------------------------------------------------------
1361 * prism2mgmt_mibset_mibget
1363 * Set the value of a mib item.
1366 * wlandev wlan device structure
1367 * msgp ptr to msg buffer
1370 * 0 success and done
1371 * <0 success, but we're waiting for something to finish.
1372 * >0 an error occurred while handling the message.
1376 * process thread (usually)
1378 ----------------------------------------------------------------*/
1380 int prism2mgmt_mibset_mibget(wlandevice_t *wlandev, void *msgp)
1382 hfa384x_t *hw = wlandev->priv;
1387 p80211msg_dot11req_mibset_t *msg = msgp;
1388 p80211itemd_t *mibitem;
1392 msg->resultcode.status = P80211ENUM_msgitem_status_data_ok;
1393 msg->resultcode.data = P80211ENUM_resultcode_success;
1396 ** Determine if this is an Access Point or a station.
1399 which = hw->ap ? F_AP : F_STA;
1402 ** Find the MIB in the MIB table. Note that a MIB may be in the
1403 ** table twice...once for an AP and once for a station. Make sure
1404 ** to get the correct one. Note that DID=0 marks the end of the
1408 mibitem = (p80211itemd_t *) msg->mibattribute.data;
1410 for (mib = mibtab; mib->did != 0; mib++)
1411 if (mib->did == mibitem->did && (mib->flag & which))
1414 if (mib->did == 0) {
1415 msg->resultcode.data = P80211ENUM_resultcode_not_supported;
1420 ** Determine if this is a "mibget" or a "mibset". If this is a
1421 ** "mibget", then make sure that the MIB may be read. Otherwise,
1422 ** this is a "mibset" so make make sure that the MIB may be written.
1425 isget = (msg->msgcode == DIDmsg_dot11req_mibget);
1428 if (!(mib->flag & F_READ)) {
1429 msg->resultcode.data =
1430 P80211ENUM_resultcode_cant_get_writeonly_mib;
1434 if (!(mib->flag & F_WRITE)) {
1435 msg->resultcode.data =
1436 P80211ENUM_resultcode_cant_set_readonly_mib;
1442 ** Execute the MIB function. If things worked okay, then make
1443 ** sure that the MIB function also worked okay. If so, and this
1444 ** is a "mibget", then the status value must be set for both the
1445 ** "mibattribute" parameter and the mib item within the data
1446 ** portion of the "mibattribute".
1449 result = mib->func(mib, isget, wlandev, hw, msg,
1450 (void *) mibitem->data);
1452 if (msg->resultcode.data == P80211ENUM_resultcode_success) {
1454 WLAN_LOG_DEBUG(1, "get/set failure, result=%d\n",
1456 msg->resultcode.data =
1457 P80211ENUM_resultcode_implementation_failure;
1460 msg->mibattribute.status =
1461 P80211ENUM_msgitem_status_data_ok;
1463 P80211ENUM_msgitem_status_data_ok;
1474 /*----------------------------------------------------------------
1475 * prism2mib_bytestr2pstr
1477 * Get/set pstr data to/from a byte string.
1479 * MIB record parameters:
1480 * parm1 Prism2 RID value.
1481 * parm2 Number of bytes of RID data.
1486 * isget MIBGET/MIBSET flag.
1487 * wlandev wlan device structure.
1488 * priv "priv" structure.
1489 * hw "hw" structure.
1490 * msg Message structure.
1497 ----------------------------------------------------------------*/
1499 static int prism2mib_bytestr2pstr(
1502 wlandevice_t *wlandev,
1504 p80211msg_dot11req_mibset_t *msg,
1508 p80211pstrd_t *pstr = (p80211pstrd_t*) data;
1509 UINT8 bytebuf[MIB_TMP_MAXLEN];
1510 hfa384x_bytestr_t *p2bytestr = (hfa384x_bytestr_t*) bytebuf;
1515 result = hfa384x_drvr_getconfig(hw, mib->parm1, bytebuf, mib->parm2);
1516 prism2mgmt_bytestr2pstr(p2bytestr, pstr);
1518 memset(bytebuf, 0, mib->parm2);
1519 prism2mgmt_pstr2bytestr(p2bytestr, pstr);
1520 result = hfa384x_drvr_setconfig(hw, mib->parm1, bytebuf, mib->parm2);
1527 /*----------------------------------------------------------------
1528 * prism2mib_bytearea2pstr
1530 * Get/set pstr data to/from a byte area.
1532 * MIB record parameters:
1533 * parm1 Prism2 RID value.
1534 * parm2 Number of bytes of RID data.
1539 * isget MIBGET/MIBSET flag.
1540 * wlandev wlan device structure.
1541 * priv "priv" structure.
1542 * hw "hw" structure.
1543 * msg Message structure.
1550 ----------------------------------------------------------------*/
1552 static int prism2mib_bytearea2pstr(
1555 wlandevice_t *wlandev,
1557 p80211msg_dot11req_mibset_t *msg,
1561 p80211pstrd_t *pstr = (p80211pstrd_t*) data;
1562 UINT8 bytebuf[MIB_TMP_MAXLEN];
1567 result = hfa384x_drvr_getconfig(hw, mib->parm1, bytebuf, mib->parm2);
1568 prism2mgmt_bytearea2pstr(bytebuf, pstr, mib->parm2);
1570 memset(bytebuf, 0, mib->parm2);
1571 prism2mgmt_pstr2bytearea(bytebuf, pstr);
1572 result = hfa384x_drvr_setconfig(hw, mib->parm1, bytebuf, mib->parm2);
1579 /*----------------------------------------------------------------
1582 * Get/set uint32 data.
1584 * MIB record parameters:
1585 * parm1 Prism2 RID value.
1591 * isget MIBGET/MIBSET flag.
1592 * wlandev wlan device structure.
1593 * priv "priv" structure.
1594 * hw "hw" structure.
1595 * msg Message structure.
1602 ----------------------------------------------------------------*/
1604 static int prism2mib_uint32(
1607 wlandevice_t *wlandev,
1609 p80211msg_dot11req_mibset_t *msg,
1613 UINT32 *uint32 = (UINT32*) data;
1614 UINT8 bytebuf[MIB_TMP_MAXLEN];
1615 UINT16 *wordbuf = (UINT16*) bytebuf;
1620 result = hfa384x_drvr_getconfig16(hw, mib->parm1, wordbuf);
1622 /* [MSM] Removed, getconfig16 returns the value in host order.
1623 * prism2mgmt_prism2int2p80211int(wordbuf, uint32);
1626 /* [MSM] Removed, setconfig16 expects host order.
1627 * prism2mgmt_p80211int2prism2int(wordbuf, uint32);
1630 result = hfa384x_drvr_setconfig16(hw, mib->parm1, *wordbuf);
1637 /*----------------------------------------------------------------
1638 * prism2mib_uint32array
1640 * Get/set an array of uint32 data.
1642 * MIB record parameters:
1643 * parm1 Prism2 RID value.
1644 * parm2 Number of bytes of RID data.
1649 * isget MIBGET/MIBSET flag.
1650 * wlandev wlan device structure.
1651 * priv "priv" structure.
1652 * hw "hw" structure.
1653 * msg Message structure.
1660 ----------------------------------------------------------------*/
1662 static int prism2mib_uint32array(
1665 wlandevice_t *wlandev,
1667 p80211msg_dot11req_mibset_t *msg,
1671 UINT32 *uint32 = (UINT32 *) data;
1672 UINT8 bytebuf[MIB_TMP_MAXLEN];
1673 UINT16 *wordbuf = (UINT16*) bytebuf;
1678 cnt = mib->parm2 / sizeof(UINT16);
1681 result = hfa384x_drvr_getconfig(hw, mib->parm1, wordbuf, mib->parm2);
1682 for (i = 0; i < cnt; i++)
1683 prism2mgmt_prism2int2p80211int(wordbuf+i, uint32+i);
1685 for (i = 0; i < cnt; i++)
1686 prism2mgmt_p80211int2prism2int(wordbuf+i, uint32+i);
1687 result = hfa384x_drvr_setconfig(hw, mib->parm1, wordbuf, mib->parm2);
1694 /*----------------------------------------------------------------
1695 * prism2mib_uint32offset
1697 * Get/set a single element in an array of uint32 data.
1699 * MIB record parameters:
1700 * parm1 Prism2 RID value.
1701 * parm2 Number of bytes of RID data.
1702 * parm3 Element index.
1706 * isget MIBGET/MIBSET flag.
1707 * wlandev wlan device structure.
1708 * priv "priv" structure.
1709 * hw "hw" structure.
1710 * msg Message structure.
1717 ----------------------------------------------------------------*/
1719 static int prism2mib_uint32offset(
1722 wlandevice_t *wlandev,
1724 p80211msg_dot11req_mibset_t *msg,
1728 UINT32 *uint32 = (UINT32*) data;
1729 UINT8 bytebuf[MIB_TMP_MAXLEN];
1730 UINT16 *wordbuf = (UINT16*) bytebuf;
1735 cnt = mib->parm2 / sizeof(UINT16);
1737 result = hfa384x_drvr_getconfig(hw, mib->parm1, wordbuf, mib->parm2);
1740 if (mib->parm3 < cnt)
1741 prism2mgmt_prism2int2p80211int(wordbuf+mib->parm3, uint32);
1745 if (mib->parm3 < cnt) {
1746 prism2mgmt_p80211int2prism2int(wordbuf+mib->parm3, uint32);
1747 result = hfa384x_drvr_setconfig(hw, mib->parm1, wordbuf, mib->parm2);
1756 /*----------------------------------------------------------------
1759 * Get/set truth data.
1761 * MIB record parameters:
1762 * parm1 Prism2 RID value.
1768 * isget MIBGET/MIBSET flag.
1769 * wlandev wlan device structure.
1770 * priv "priv" structure.
1771 * hw "hw" structure.
1772 * msg Message structure.
1779 ----------------------------------------------------------------*/
1781 static int prism2mib_truth(
1784 wlandevice_t *wlandev,
1786 p80211msg_dot11req_mibset_t *msg,
1790 UINT32 *uint32 = (UINT32*) data;
1791 UINT8 bytebuf[MIB_TMP_MAXLEN];
1792 UINT16 *wordbuf = (UINT16*) bytebuf;
1797 result = hfa384x_drvr_getconfig16(hw, mib->parm1, wordbuf);
1798 *uint32 = (*wordbuf) ?
1799 P80211ENUM_truth_true : P80211ENUM_truth_false;
1801 *wordbuf = ((*uint32) == P80211ENUM_truth_true) ? 1 : 0;
1802 result = hfa384x_drvr_setconfig16(hw, mib->parm1, *wordbuf);
1809 /*----------------------------------------------------------------
1814 * MIB record parameters:
1815 * parm1 Prism2 RID value.
1816 * parm2 Bit to get/set.
1821 * isget MIBGET/MIBSET flag.
1822 * wlandev wlan device structure.
1823 * priv "priv" structure.
1824 * hw "hw" structure.
1825 * msg Message structure.
1832 ----------------------------------------------------------------*/
1834 static int prism2mib_flag(
1837 wlandevice_t *wlandev,
1839 p80211msg_dot11req_mibset_t *msg,
1843 UINT32 *uint32 = (UINT32*) data;
1844 UINT8 bytebuf[MIB_TMP_MAXLEN];
1845 UINT16 *wordbuf = (UINT16*) bytebuf;
1850 result = hfa384x_drvr_getconfig16(hw, mib->parm1, wordbuf);
1852 /* [MSM] Removed, getconfig16 returns the value in host order.
1853 * prism2mgmt_prism2int2p80211int(wordbuf, &flags);
1857 *uint32 = (flags & mib->parm2) ?
1858 P80211ENUM_truth_true : P80211ENUM_truth_false;
1860 if ((*uint32) == P80211ENUM_truth_true)
1861 flags |= mib->parm2;
1863 flags &= ~mib->parm2;
1864 /* [MSM] Removed, setconfig16 expects host order.
1865 * prism2mgmt_p80211int2prism2int(wordbuf, &flags);
1868 result = hfa384x_drvr_setconfig16(hw, mib->parm1, *wordbuf);
1876 /*----------------------------------------------------------------
1877 * prism2mib_appcfinfoflag
1879 * Get/set a single flag in the APPCFINFO record.
1881 * MIB record parameters:
1882 * parm1 Bit to get/set.
1888 * isget MIBGET/MIBSET flag.
1889 * wlandev wlan device structure.
1890 * priv "priv" structure.
1891 * hw "hw" structure.
1892 * msg Message structure.
1899 ----------------------------------------------------------------*/
1901 static int prism2mib_appcfinfoflag(
1904 wlandevice_t *wlandev,
1906 p80211msg_dot11req_mibset_t *msg,
1910 UINT32 *uint32 = (UINT32*) data;
1911 UINT8 bytebuf[MIB_TMP_MAXLEN];
1912 UINT16 *wordbuf = (UINT16*) bytebuf;
1917 result = hfa384x_drvr_getconfig(hw, HFA384x_RID_CNFAPPCFINFO,
1918 bytebuf, HFA384x_RID_CNFAPPCFINFO_LEN);
1921 *uint32 = (hfa384x2host_16(wordbuf[3]) & mib->parm1) ?
1922 P80211ENUM_truth_true : P80211ENUM_truth_false;
1924 word = hfa384x2host_16(wordbuf[3]);
1925 word = ((*uint32) == P80211ENUM_truth_true) ?
1926 (word | mib->parm1) : (word & ~mib->parm1);
1927 wordbuf[3] = host2hfa384x_16(word);
1928 result = hfa384x_drvr_setconfig(hw, HFA384x_RID_CNFAPPCFINFO,
1929 bytebuf, HFA384x_RID_CNFAPPCFINFO_LEN);
1937 /*----------------------------------------------------------------
1938 * prism2mib_regulatorydomains
1940 * Get regulatory domain data.
1942 * MIB record parameters:
1943 * parm1 Prism2 RID value.
1944 * parm2 Number of bytes of RID data.
1949 * isget MIBGET/MIBSET flag.
1950 * wlandev wlan device structure.
1951 * priv "priv" structure.
1952 * hw "hw" structure.
1953 * msg Message structure.
1960 ----------------------------------------------------------------*/
1962 static int prism2mib_regulatorydomains(
1965 wlandevice_t *wlandev,
1967 p80211msg_dot11req_mibset_t *msg,
1972 p80211pstrd_t *pstr = (p80211pstrd_t*) data;
1973 UINT8 bytebuf[MIB_TMP_MAXLEN];
1974 UINT16 *wordbuf = (UINT16*) bytebuf;
1981 result = hfa384x_drvr_getconfig(hw, mib->parm1, wordbuf, mib->parm2);
1982 prism2mgmt_prism2int2p80211int(wordbuf, &cnt);
1983 pstr->len = (UINT8) cnt;
1984 memcpy(pstr->data, &wordbuf[1], pstr->len);
1991 /*----------------------------------------------------------------
1992 * prism2mib_wepdefaultkey
1994 * Get/set WEP default keys.
1996 * MIB record parameters:
1997 * parm1 Prism2 RID value.
1998 * parm2 Number of bytes of RID data.
2003 * isget MIBGET/MIBSET flag.
2004 * wlandev wlan device structure.
2005 * priv "priv" structure.
2006 * hw "hw" structure.
2007 * msg Message structure.
2014 ----------------------------------------------------------------*/
2016 static int prism2mib_wepdefaultkey(
2019 wlandevice_t *wlandev,
2021 p80211msg_dot11req_mibset_t *msg,
2025 p80211pstrd_t *pstr = (p80211pstrd_t*) data;
2026 UINT8 bytebuf[MIB_TMP_MAXLEN];
2032 result = 0; /* Should never happen. */
2034 len = (pstr->len > 5) ? HFA384x_RID_CNFWEP128DEFAULTKEY_LEN :
2035 HFA384x_RID_CNFWEPDEFAULTKEY_LEN;
2036 memset(bytebuf, 0, len);
2037 prism2mgmt_pstr2bytearea(bytebuf, pstr);
2038 result = hfa384x_drvr_setconfig(hw, mib->parm1, bytebuf, len);
2045 /*----------------------------------------------------------------
2046 * prism2mib_powermanagement
2048 * Get/set 802.11 power management value. Note that this is defined differently
2049 * by 802.11 and Prism2:
2051 * Meaning 802.11 Prism2
2055 * MIB record parameters:
2056 * parm1 Prism2 RID value.
2062 * isget MIBGET/MIBSET flag.
2063 * wlandev wlan device structure.
2064 * priv "priv" structure.
2065 * hw "hw" structure.
2066 * msg Message structure.
2073 ----------------------------------------------------------------*/
2075 static int prism2mib_powermanagement(
2078 wlandevice_t *wlandev,
2080 p80211msg_dot11req_mibset_t *msg,
2084 UINT32 *uint32 = (UINT32*) data;
2090 result = prism2mib_uint32(mib, isget, wlandev, hw, msg, &value);
2091 *uint32 = (value == 0) ? 1 : 2;
2093 value = ((*uint32) == 1) ? 0 : 1;
2094 result = prism2mib_uint32(mib, isget, wlandev, hw, msg, &value);
2101 /*----------------------------------------------------------------
2102 * prism2mib_preamble
2104 * Get/set Prism2 short preamble
2106 * MIB record parameters:
2107 * parm1 Prism2 RID value.
2113 * isget MIBGET/MIBSET flag.
2114 * wlandev wlan device structure.
2115 * priv "priv" structure.
2116 * hw "hw" structure.
2117 * msg Message structure.
2124 ----------------------------------------------------------------*/
2126 static int prism2mib_preamble(
2129 wlandevice_t *wlandev,
2131 p80211msg_dot11req_mibset_t *msg,
2135 UINT32 *uint32 = (UINT32*) data;
2136 UINT8 bytebuf[MIB_TMP_MAXLEN];
2137 UINT16 *wordbuf = (UINT16*) bytebuf;
2142 result = hfa384x_drvr_getconfig16(hw, mib->parm1, wordbuf);
2146 result = hfa384x_drvr_setconfig16(hw, mib->parm1, *wordbuf);
2153 /*----------------------------------------------------------------
2154 * prism2mib_privacyinvoked
2156 * Get/set the dot11PrivacyInvoked value.
2158 * MIB record parameters:
2159 * parm1 Prism2 RID value.
2160 * parm2 Bit value for PrivacyInvoked flag.
2165 * isget MIBGET/MIBSET flag.
2166 * wlandev wlan device structure.
2167 * priv "priv" structure.
2168 * hw "hw" structure.
2169 * msg Message structure.
2176 ----------------------------------------------------------------*/
2178 static int prism2mib_privacyinvoked(
2181 wlandevice_t *wlandev,
2183 p80211msg_dot11req_mibset_t *msg,
2190 if (wlandev->hostwep & HOSTWEP_DECRYPT) {
2191 if (wlandev->hostwep & HOSTWEP_DECRYPT)
2192 mib->parm2 |= HFA384x_WEPFLAGS_DISABLE_RXCRYPT;
2193 if (wlandev->hostwep & HOSTWEP_ENCRYPT)
2194 mib->parm2 |= HFA384x_WEPFLAGS_DISABLE_TXCRYPT;
2197 result = prism2mib_flag(mib, isget, wlandev, hw, msg, data);
2203 /*----------------------------------------------------------------
2204 * prism2mib_excludeunencrypted
2206 * Get/set the dot11ExcludeUnencrypted value.
2208 * MIB record parameters:
2209 * parm1 Prism2 RID value.
2210 * parm2 Bit value for ExcludeUnencrypted flag.
2215 * isget MIBGET/MIBSET flag.
2216 * wlandev wlan device structure.
2217 * priv "priv" structure.
2218 * hw "hw" structure.
2219 * msg Message structure.
2226 ----------------------------------------------------------------*/
2228 static int prism2mib_excludeunencrypted(
2231 wlandevice_t *wlandev,
2233 p80211msg_dot11req_mibset_t *msg,
2240 result = prism2mib_flag(mib, isget, wlandev, hw, msg, data);
2246 /*----------------------------------------------------------------
2247 * prism2mib_fragmentationthreshold
2249 * Get/set the fragmentation threshold.
2251 * MIB record parameters:
2252 * parm1 Prism2 RID value.
2258 * isget MIBGET/MIBSET flag.
2259 * wlandev wlan device structure.
2260 * priv "priv" structure.
2261 * hw "hw" structure.
2262 * msg Message structure.
2269 ----------------------------------------------------------------*/
2271 static int prism2mib_fragmentationthreshold(
2274 wlandevice_t *wlandev,
2276 p80211msg_dot11req_mibset_t *msg,
2280 UINT32 *uint32 = (UINT32*) data;
2285 if ((*uint32) % 2) {
2286 WLAN_LOG_WARNING("Attempt to set odd number "
2287 "FragmentationThreshold\n");
2288 msg->resultcode.data = P80211ENUM_resultcode_not_supported;
2292 result = prism2mib_uint32(mib, isget, wlandev, hw, msg, data);
2298 /*----------------------------------------------------------------
2299 * prism2mib_operationalrateset
2301 * Get/set the operational rate set.
2303 * MIB record parameters:
2304 * parm1 Prism2 RID value.
2310 * isget MIBGET/MIBSET flag.
2311 * wlandev wlan device structure.
2312 * priv "priv" structure.
2313 * hw "hw" structure.
2314 * msg Message structure.
2321 ----------------------------------------------------------------*/
2323 static int prism2mib_operationalrateset(
2326 wlandevice_t *wlandev,
2328 p80211msg_dot11req_mibset_t *msg,
2332 p80211pstrd_t *pstr = (p80211pstrd_t *) data;
2333 UINT8 bytebuf[MIB_TMP_MAXLEN];
2334 UINT16 *wordbuf = (UINT16*) bytebuf;
2339 result = hfa384x_drvr_getconfig16(hw, mib->parm1, wordbuf);
2340 prism2mgmt_get_oprateset(wordbuf, pstr);
2342 prism2mgmt_set_oprateset(wordbuf, pstr);
2343 result = hfa384x_drvr_setconfig16(hw, mib->parm1, *wordbuf);
2344 result = hfa384x_drvr_setconfig16(hw, HFA384x_RID_CNFSUPPRATES, *wordbuf);
2351 /*----------------------------------------------------------------
2352 * prism2mib_groupaddress
2354 * Get/set the dot11GroupAddressesTable.
2356 * MIB record parameters:
2363 * isget MIBGET/MIBSET flag.
2364 * wlandev wlan device structure.
2365 * priv "priv" structure.
2366 * hw "hw" structure.
2367 * msg Message structure.
2374 ----------------------------------------------------------------*/
2376 static int prism2mib_groupaddress(
2379 wlandevice_t *wlandev,
2381 p80211msg_dot11req_mibset_t *msg,
2385 p80211pstrd_t *pstr = (p80211pstrd_t *) data;
2386 UINT8 bytebuf[MIB_TMP_MAXLEN];
2391 /* TODO: fix this. f/w doesn't support mcast filters */
2394 prism2mgmt_get_grpaddr(mib->did, pstr, hw);
2398 result = prism2mgmt_set_grpaddr(mib->did, bytebuf, pstr, hw);
2400 msg->resultcode.data = P80211ENUM_resultcode_not_supported;
2404 if (hw->dot11_grpcnt <= MAX_PRISM2_GRP_ADDR) {
2405 len = hw->dot11_grpcnt * WLAN_ADDR_LEN;
2406 memcpy(bytebuf, hw->dot11_grp_addr[0], len);
2407 result = hfa384x_drvr_setconfig(hw, HFA384x_RID_GROUPADDR, bytebuf, len);
2410 ** Turn off promiscuous mode if count is equal to MAX. We may
2411 ** have been at a higher count in promiscuous mode and need to
2415 /* but only if we're not already in promisc mode. :) */
2416 if ((hw->dot11_grpcnt == MAX_PRISM2_GRP_ADDR) &&
2417 !( wlandev->netdev->flags & IFF_PROMISC)) {
2418 result = hfa384x_drvr_setconfig16(hw,
2419 HFA384x_RID_PROMISCMODE, 0);
2424 ** Clear group addresses in card and set to promiscuous mode.
2427 memset(bytebuf, 0, sizeof(bytebuf));
2428 result = hfa384x_drvr_setconfig(hw, HFA384x_RID_GROUPADDR,
2431 result = hfa384x_drvr_setconfig16(hw,
2432 HFA384x_RID_PROMISCMODE, 1);
2440 /*----------------------------------------------------------------
2443 * Get the firmware ID.
2445 * MIB record parameters:
2452 * isget MIBGET/MIBSET flag.
2453 * wlandev wlan device structure.
2454 * priv "priv" structure.
2455 * hw "hw" structure.
2456 * msg Message structure.
2463 ----------------------------------------------------------------*/
2465 static int prism2mib_fwid(
2468 wlandevice_t *wlandev,
2470 p80211msg_dot11req_mibset_t *msg,
2474 p80211pstrd_t *pstr = (p80211pstrd_t *) data;
2475 hfa384x_FWID_t fwid;
2480 result = hfa384x_drvr_getconfig(hw, HFA384x_RID_FWID,
2481 &fwid, HFA384x_RID_FWID_LEN);
2482 if (mib->did == DIDmib_p2_p2NIC_p2PrimaryFWID) {
2483 fwid.primary[HFA384x_FWID_LEN - 1] = '\0';
2484 pstr->len = strlen(fwid.primary);
2485 memcpy(pstr->data, fwid.primary, pstr->len);
2487 fwid.secondary[HFA384x_FWID_LEN - 1] = '\0';
2488 pstr->len = strlen(fwid.secondary);
2489 memcpy(pstr->data, fwid.secondary, pstr->len);
2492 result = 0; /* Should never happen. */
2498 /*----------------------------------------------------------------
2501 * Get values from the AuhtenticationAlgorithmsTable.
2503 * MIB record parameters:
2504 * parm1 Table index (1-6).
2510 * isget MIBGET/MIBSET flag.
2511 * wlandev wlan device structure.
2512 * priv "priv" structure.
2513 * hw "hw" structure.
2514 * msg Message structure.
2521 ----------------------------------------------------------------*/
2523 static int prism2mib_authalg(
2526 wlandevice_t *wlandev,
2528 p80211msg_dot11req_mibset_t *msg,
2531 UINT32 *uint32 = (UINT32*) data;
2535 /* MSM: pkx supplied code that code queries RID FD4D....but the f/w's
2536 * results are bogus. Therefore, we have to simulate the appropriate
2537 * results here in the driver based on our knowledge of existing MAC
2538 * features. That's the whole point behind this ugly function.
2542 msg->resultcode.data = P80211ENUM_resultcode_success;
2543 switch (mib->parm1) {
2544 case 1: /* Open System */
2545 *uint32 = P80211ENUM_authalg_opensystem;
2547 case 2: /* SharedKey */
2548 *uint32 = P80211ENUM_authalg_sharedkey;
2552 msg->resultcode.data = P80211ENUM_resultcode_not_supported;
2561 /*----------------------------------------------------------------
2562 * prism2mib_authalgenable
2564 * Get/set the enable values from the AuhtenticationAlgorithmsTable.
2566 * MIB record parameters:
2567 * parm1 Table index (1-6).
2573 * isget MIBGET/MIBSET flag.
2574 * wlandev wlan device structure.
2575 * priv "priv" structure.
2576 * hw "hw" structure.
2577 * msg Message structure.
2584 ----------------------------------------------------------------*/
2586 static int prism2mib_authalgenable(
2589 wlandevice_t *wlandev,
2591 p80211msg_dot11req_mibset_t *msg,
2595 UINT32 *uint32 = (UINT32*) data;
2603 index = mib->parm1 - 1;
2605 result = hfa384x_drvr_getconfig16( hw,
2606 HFA384x_RID_CNFAUTHENTICATION, &cnf_auth);
2607 WLAN_LOG_DEBUG(2,"cnfAuthentication0=%d, index=%d\n", cnf_auth, index);
2610 if ( index == 0 || index == 1 ) {
2611 *uint32 = (cnf_auth & (1<<index)) ?
2612 P80211ENUM_truth_true: P80211ENUM_truth_false;
2614 *uint32 = P80211ENUM_truth_false;
2615 msg->resultcode.data = P80211ENUM_resultcode_not_supported;
2618 if ( index == 0 || index == 1 ) {
2620 if (*uint32==P80211ENUM_truth_true ) {
2625 result = hfa384x_drvr_setconfig16( hw,
2626 HFA384x_RID_CNFAUTHENTICATION, cnf_auth);
2627 WLAN_LOG_DEBUG(2,"cnfAuthentication:=%d\n", cnf_auth);
2629 WLAN_LOG_DEBUG(1,"Unable to set p2cnfAuthentication to %d\n", cnf_auth);
2630 msg->resultcode.data = P80211ENUM_resultcode_implementation_failure;
2633 msg->resultcode.data = P80211ENUM_resultcode_not_supported;
2641 /*----------------------------------------------------------------
2644 * Get/set values in the "priv" data structure.
2646 * MIB record parameters:
2653 * isget MIBGET/MIBSET flag.
2654 * wlandev wlan device structure.
2655 * priv "priv" structure.
2656 * hw "hw" structure.
2657 * msg Message structure.
2664 ----------------------------------------------------------------*/
2666 static int prism2mib_priv(
2669 wlandevice_t *wlandev,
2671 p80211msg_dot11req_mibset_t *msg,
2674 UINT32 *uint32 = (UINT32*) data;
2675 p80211pstrd_t *pstr = (p80211pstrd_t*) data;
2676 p80211macarray_t *macarray = (p80211macarray_t *) data;
2678 int i, cnt, result, done;
2680 prism2sta_authlist_t old;
2683 ** "test" is a lot longer than necessary but who cares? ...as long as
2684 ** it is long enough!
2687 UINT8 test[sizeof(wlandev->rx) + sizeof(hw->tallies)];
2692 case DIDmib_p2_p2Table_p2ReceivedFrameStatistics:
2695 ** Note: The values in this record are changed by the
2696 ** interrupt handler and therefore cannot be guaranteed
2697 ** to be stable while they are being copied. However,
2698 ** the interrupt handler will take priority over this
2699 ** code. Hence, if the same values are copied twice,
2700 ** then we are ensured that the values have not been
2701 ** changed. If they have, then just try again. Don't
2702 ** try more than 10 times...if we still haven't got it,
2703 ** then the values we do have are probably good enough.
2704 ** This scheme for copying values is used in order to
2705 ** prevent having to block the interrupt handler while
2706 ** we copy the values.
2710 for (i = 0; i < 10; i++) {
2711 memcpy(data, &wlandev->rx, sizeof(wlandev->rx));
2712 memcpy(test, &wlandev->rx, sizeof(wlandev->rx));
2713 if (memcmp(data, test, sizeof(wlandev->rx)) == 0) break;
2718 case DIDmib_p2_p2Table_p2CommunicationTallies:
2721 ** Note: The values in this record are changed by the
2722 ** interrupt handler and therefore cannot be guaranteed
2723 ** to be stable while they are being copied. See the
2724 ** note above about copying values.
2728 result = hfa384x_drvr_commtallies(hw);
2730 /* ?????? We need to wait a bit here for the */
2731 /* tallies to get updated. ?????? */
2732 /* MSM: TODO: The right way to do this is to
2733 * add a "commtallie" wait queue to the
2734 * priv structure that gets run every time
2735 * we receive a commtally info frame.
2736 * This process would sleep on that
2737 * queue and get awakened when the
2738 * the requested info frame arrives.
2739 * Don't have time to do and test this
2743 /* Ugh, this is nasty. */
2744 for (i = 0; i < 10; i++) {
2747 sizeof(hw->tallies));
2750 sizeof(hw->tallies));
2753 sizeof(hw->tallies)) == 0)
2760 case DIDmib_p2_p2Table_p2Authenticated:
2763 prism2mib_priv_authlist(hw, &old);
2766 for (i = 0; i < old.cnt; i++) {
2767 if (!old.assoc[i]) {
2768 memcpy(macarray->data[macarray->cnt], old.addr[i], WLAN_ADDR_LEN);
2776 case DIDmib_p2_p2Table_p2Associated:
2779 prism2mib_priv_authlist(hw, &old);
2782 for (i = 0; i < old.cnt; i++) {
2784 memcpy(macarray->data[macarray->cnt], old.addr[i], WLAN_ADDR_LEN);
2792 case DIDmib_p2_p2Table_p2PowerSaveUserCount:
2795 *uint32 = hw->psusercount;
2799 case DIDmib_p2_p2Table_p2Comment:
2802 pstr->len = strlen(hw->comment);
2803 memcpy(pstr->data, hw->comment, pstr->len);
2806 if (cnt < 0) cnt = 0;
2807 if (cnt >= sizeof(hw->comment))
2808 cnt = sizeof(hw->comment)-1;
2809 memcpy(hw->comment, pstr->data, cnt);
2810 pstr->data[cnt] = '\0';
2815 case DIDmib_p2_p2Table_p2AccessMode:
2818 *uint32 = hw->accessmode;
2820 prism2mib_priv_accessmode(hw, *uint32);
2824 case DIDmib_p2_p2Table_p2AccessAllow:
2827 macarray->cnt = hw->allow.cnt;
2828 memcpy(macarray->data, hw->allow.addr,
2829 macarray->cnt*WLAN_ADDR_LEN);
2831 prism2mib_priv_accessallow(hw, macarray);
2836 case DIDmib_p2_p2Table_p2AccessDeny:
2839 macarray->cnt = hw->deny.cnt;
2840 memcpy(macarray->data, hw->deny.addr,
2841 macarray->cnt*WLAN_ADDR_LEN);
2843 prism2mib_priv_accessdeny(hw, macarray);
2848 case DIDmib_p2_p2Table_p2ChannelInfoResults:
2851 done = atomic_read(&hw->channel_info.done);
2853 msg->resultcode.status = P80211ENUM_msgitem_status_no_value;
2857 msg->resultcode.status = P80211ENUM_msgitem_status_incomplete_itemdata;
2861 for (i = 0; i < 14; i++, uint32 += 5) {
2863 uint32[1] = hw->channel_info.results.result[i].anl;
2864 uint32[2] = hw->channel_info.results.result[i].pnl;
2865 uint32[3] = (hw->channel_info.results.result[i].active & HFA384x_CHINFORESULT_BSSACTIVE) ? 1 : 0;
2866 uint32[4] = (hw->channel_info.results.result[i].active & HFA384x_CHINFORESULT_PCFACTIVE) ? 1 : 0;
2872 case DIDmib_dot11smt_dot11StationConfigTable_dot11DesiredBSSType:
2875 *uint32 = hw->dot11_desired_bss_type;
2877 hw->dot11_desired_bss_type = *uint32;
2881 case DIDmib_lnx_lnxConfigTable_lnxRSNAIE: {
2882 hfa384x_WPAData_t wpa;
2884 hfa384x_drvr_getconfig( hw, HFA384x_RID_CNFWPADATA,
2885 (UINT8 *) &wpa, sizeof(wpa));
2886 pstr->len = hfa384x2host_16(wpa.datalen);
2887 memcpy(pstr->data, wpa.data, pstr->len);
2889 wpa.datalen = host2hfa384x_16(pstr->len);
2890 memcpy(wpa.data, pstr->data, pstr->len);
2892 result = hfa384x_drvr_setconfig(hw, HFA384x_RID_CNFWPADATA,
2893 (UINT8 *) &wpa, sizeof(wpa));
2898 WLAN_LOG_ERROR("Unhandled DID 0x%08x\n", mib->did);
2905 /*----------------------------------------------------------------
2906 * prism2mib_priv_authlist
2908 * Get a copy of the list of authenticated stations.
2911 * priv "priv" structure.
2912 * list List of authenticated stations.
2917 ----------------------------------------------------------------*/
2919 static void prism2mib_priv_authlist(
2921 prism2sta_authlist_t *list)
2923 prism2sta_authlist_t test;
2929 ** Note: The values in this record are changed by the interrupt
2930 ** handler and therefore cannot be guaranteed to be stable while
2931 ** they are being copied. However, the interrupt handler will
2932 ** take priority over this code. Hence, if the same values are
2933 ** copied twice, then we are ensured that the values have not
2934 ** been changed. If they have, then just try again. Don't try
2935 ** more than 10 times...the list of authenticated stations is
2936 ** unlikely to be changing frequently enough that we can't get
2937 ** a snapshot in 10 tries. Don't try more than this so that we
2938 ** don't risk locking-up for long periods of time. If we still
2939 ** haven't got the snapshot, then generate an error message and
2940 ** return an empty list (since this is the only valid list that
2941 ** we can guarentee). This scheme for copying values is used in
2942 ** order to prevent having to block the interrupt handler while
2943 ** we copy the values.
2946 for (i = 0; i < 10; i++) {
2947 memcpy(list, &hw->authlist, sizeof(prism2sta_authlist_t));
2948 memcpy(&test, &hw->authlist, sizeof(prism2sta_authlist_t));
2949 if (memcmp(list, &test, sizeof(prism2sta_authlist_t)) == 0)
2955 WLAN_LOG_ERROR("Could not obtain snapshot of authenticated stations.\n");
2962 /*----------------------------------------------------------------
2963 * prism2mib_priv_accessmode
2965 * Set the Access Mode.
2968 * priv "priv" structure.
2969 * hw "hw" structure.
2970 * mode New access mode.
2975 ----------------------------------------------------------------*/
2977 static void prism2mib_priv_accessmode(
2981 prism2sta_authlist_t old;
2988 ** If the mode is not changing or it is changing to "All", then it's
2989 ** okay to go ahead without a lot of messing around. Otherwise, the
2990 ** access mode is changing in a way that may leave some stations
2991 ** authenticated which should not be authenticated. It will be
2992 ** necessary to de-authenticate these stations.
2995 if (mode == WLAN_ACCESS_ALL || mode == hw->accessmode) {
2996 hw->accessmode = mode;
3001 ** Switch to the new access mode. Once this is done, then the interrupt
3002 ** handler (which uses this value) will be prevented from authenticating
3003 ** ADDITIONAL stations which should not be authenticated. Then get a
3004 ** copy of the current list of authenticated stations.
3007 hw->accessmode = mode;
3009 prism2mib_priv_authlist(hw, &old);
3012 ** Now go through the list of previously authenticated stations (some
3013 ** of which might de-authenticate themselves while we are processing it
3014 ** but that is okay). Any station which no longer matches the access
3015 ** mode, must be de-authenticated.
3018 for (i = 0; i < old.cnt; i++) {
3021 if (mode == WLAN_ACCESS_NONE)
3024 if (mode == WLAN_ACCESS_ALLOW) {
3025 for (j = 0; j < hw->allow.cnt; j++)
3026 if (memcmp(addr, hw->allow.addr[j],
3027 WLAN_ADDR_LEN) == 0)
3029 deauth = (j >= hw->allow.cnt);
3031 for (j = 0; j < hw->deny.cnt; j++)
3032 if (memcmp(addr, hw->deny.addr[j],
3033 WLAN_ADDR_LEN) == 0)
3035 deauth = (j < hw->deny.cnt);
3039 if (deauth) prism2mib_priv_deauthenticate(hw, addr);
3046 /*----------------------------------------------------------------
3047 * prism2mib_priv_accessallow
3049 * Change the list of allowed MAC addresses.
3052 * priv "priv" structure.
3053 * hw "hw" structure.
3054 * macarray New array of MAC addresses.
3059 ----------------------------------------------------------------*/
3061 static void prism2mib_priv_accessallow(
3063 p80211macarray_t *macarray)
3065 prism2sta_authlist_t old;
3071 ** Change the access list. Note that the interrupt handler may be in
3072 ** the middle of using the access list!!! Since the interrupt handler
3073 ** will always have priority over this process and this is the only
3074 ** process that will modify the list, this problem can be handled as
3077 ** 1. Set the "modify" flag.
3078 ** 2. Change the first copy of the list.
3079 ** 3. Clear the "modify" flag.
3080 ** 4. Change the backup copy of the list.
3082 ** The interrupt handler will check the "modify" flag. If NOT set, then
3083 ** the first copy of the list is valid and may be used. Otherwise, the
3084 ** first copy is being changed but the backup copy is valid and may be
3085 ** used. Doing things this way prevents having to have the interrupt
3086 ** handler block while the list is being updated.
3089 hw->allow.modify = 1;
3091 hw->allow.cnt = macarray->cnt;
3092 memcpy(hw->allow.addr, macarray->data, macarray->cnt*WLAN_ADDR_LEN);
3094 hw->allow.modify = 0;
3096 hw->allow.cnt1 = macarray->cnt;
3097 memcpy(hw->allow.addr1, macarray->data, macarray->cnt*WLAN_ADDR_LEN);
3100 ** If the current access mode is "Allow", then changing the access
3101 ** list may leave some stations authenticated which should not be
3102 ** authenticated. It will be necessary to de-authenticate these
3103 ** stations. Otherwise, the list can be changed without a lot of fuss.
3106 if (hw->accessmode == WLAN_ACCESS_ALLOW) {
3109 ** Go through the list of authenticated stations (some of
3110 ** which might de-authenticate themselves while we are
3111 ** processing it but that is okay). Any station which is
3112 ** no longer in the list of allowed stations, must be
3113 ** de-authenticated.
3116 prism2mib_priv_authlist(hw, &old);
3118 for (i = 0; i < old.cnt; i++) {
3119 for (j = 0; j < hw->allow.cnt; j++)
3120 if (memcmp(old.addr[i], hw->allow.addr[j],
3121 WLAN_ADDR_LEN) == 0)
3123 if (j >= hw->allow.cnt)
3124 prism2mib_priv_deauthenticate(hw, old.addr[i]);
3132 /*----------------------------------------------------------------
3133 * prism2mib_priv_accessdeny
3135 * Change the list of denied MAC addresses.
3138 * priv "priv" structure.
3139 * hw "hw" structure.
3140 * macarray New array of MAC addresses.
3145 ----------------------------------------------------------------*/
3147 static void prism2mib_priv_accessdeny(
3149 p80211macarray_t *macarray)
3151 prism2sta_authlist_t old;
3157 ** Change the access list. Note that the interrupt handler may be in
3158 ** the middle of using the access list!!! Since the interrupt handler
3159 ** will always have priority over this process and this is the only
3160 ** process that will modify the list, this problem can be handled as
3163 ** 1. Set the "modify" flag.
3164 ** 2. Change the first copy of the list.
3165 ** 3. Clear the "modify" flag.
3166 ** 4. Change the backup copy of the list.
3168 ** The interrupt handler will check the "modify" flag. If NOT set, then
3169 ** the first copy of the list is valid and may be used. Otherwise, the
3170 ** first copy is being changed but the backup copy is valid and may be
3171 ** used. Doing things this way prevents having to have the interrupt
3172 ** handler block while the list is being updated.
3175 hw->deny.modify = 1;
3177 hw->deny.cnt = macarray->cnt;
3178 memcpy(hw->deny.addr, macarray->data, macarray->cnt*WLAN_ADDR_LEN);
3180 hw->deny.modify = 0;
3182 hw->deny.cnt1 = macarray->cnt;
3183 memcpy(hw->deny.addr1, macarray->data, macarray->cnt*WLAN_ADDR_LEN);
3186 ** If the current access mode is "Deny", then changing the access
3187 ** list may leave some stations authenticated which should not be
3188 ** authenticated. It will be necessary to de-authenticate these
3189 ** stations. Otherwise, the list can be changed without a lot of fuss.
3192 if (hw->accessmode == WLAN_ACCESS_DENY) {
3195 ** Go through the list of authenticated stations (some of
3196 ** which might de-authenticate themselves while we are
3197 ** processing it but that is okay). Any station which is
3198 ** now in the list of denied stations, must be de-authenticated.
3201 prism2mib_priv_authlist(hw, &old);
3203 for (i = 0; i < old.cnt; i++)
3204 for (j = 0; j < hw->deny.cnt; j++)
3205 if (memcmp(old.addr[i], hw->deny.addr[j],
3206 WLAN_ADDR_LEN) == 0) {
3207 prism2mib_priv_deauthenticate(hw, old.addr[i]);
3216 /*----------------------------------------------------------------
3217 * prism2mib_priv_deauthenticate
3219 * De-authenticate a station. This is done by sending a HandoverAddress
3220 * information frame to the firmware. This should work, according to
3224 * priv "priv" structure.
3225 * hw "hw" structure.
3226 * addr MAC address of station to be de-authenticated.
3231 ----------------------------------------------------------------*/
3233 static void prism2mib_priv_deauthenticate(
3238 hfa384x_drvr_handover(hw, addr);
3244 /*----------------------------------------------------------------
3245 * prism2mgmt_pstr2bytestr
3247 * Convert the pstr data in the WLAN message structure into an hfa384x
3248 * byte string format.
3251 * bytestr hfa384x byte string data type
3252 * pstr wlan message data
3257 ----------------------------------------------------------------*/
3259 void prism2mgmt_pstr2bytestr(hfa384x_bytestr_t *bytestr, p80211pstrd_t *pstr)
3263 bytestr->len = host2hfa384x_16((UINT16)(pstr->len));
3264 memcpy(bytestr->data, pstr->data, pstr->len);
3269 /*----------------------------------------------------------------
3270 * prism2mgmt_pstr2bytearea
3272 * Convert the pstr data in the WLAN message structure into an hfa384x
3276 * bytearea hfa384x byte area data type
3277 * pstr wlan message data
3282 ----------------------------------------------------------------*/
3284 void prism2mgmt_pstr2bytearea(UINT8 *bytearea, p80211pstrd_t *pstr)
3288 memcpy(bytearea, pstr->data, pstr->len);
3293 /*----------------------------------------------------------------
3294 * prism2mgmt_bytestr2pstr
3296 * Convert the data in an hfa384x byte string format into a
3297 * pstr in the WLAN message.
3300 * bytestr hfa384x byte string data type
3306 ----------------------------------------------------------------*/
3308 void prism2mgmt_bytestr2pstr(hfa384x_bytestr_t *bytestr, p80211pstrd_t *pstr)
3312 pstr->len = (UINT8)(hfa384x2host_16((UINT16)(bytestr->len)));
3313 memcpy(pstr->data, bytestr->data, pstr->len);
3318 /*----------------------------------------------------------------
3319 * prism2mgmt_bytearea2pstr
3321 * Convert the data in an hfa384x byte area format into a pstr
3322 * in the WLAN message.
3325 * bytearea hfa384x byte area data type
3331 ----------------------------------------------------------------*/
3333 void prism2mgmt_bytearea2pstr(UINT8 *bytearea, p80211pstrd_t *pstr, int len)
3337 pstr->len = (UINT8)len;
3338 memcpy(pstr->data, bytearea, len);
3343 /*----------------------------------------------------------------
3344 * prism2mgmt_prism2int2p80211int
3346 * Convert an hfa384x integer into a wlan integer
3349 * prism2enum pointer to hfa384x integer
3350 * wlanenum pointer to p80211 integer
3355 ----------------------------------------------------------------*/
3357 void prism2mgmt_prism2int2p80211int(UINT16 *prism2int, UINT32 *wlanint)
3361 *wlanint = (UINT32)hfa384x2host_16(*prism2int);
3366 /*----------------------------------------------------------------
3367 * prism2mgmt_p80211int2prism2int
3369 * Convert a wlan integer into an hfa384x integer
3372 * prism2enum pointer to hfa384x integer
3373 * wlanenum pointer to p80211 integer
3378 ----------------------------------------------------------------*/
3380 void prism2mgmt_p80211int2prism2int(UINT16 *prism2int, UINT32 *wlanint)
3384 *prism2int = host2hfa384x_16((UINT16)(*wlanint));
3389 /*----------------------------------------------------------------
3390 * prism2mgmt_prism2enum2p80211enum
3392 * Convert the hfa384x enumerated int into a p80211 enumerated int
3395 * prism2enum pointer to hfa384x integer
3396 * wlanenum pointer to p80211 integer
3397 * rid hfa384x record id
3402 ----------------------------------------------------------------*/
3403 void prism2mgmt_prism2enum2p80211enum(UINT16 *prism2enum, UINT32 *wlanenum, UINT16 rid)
3407 /* At the moment, the need for this functionality hasn't
3408 presented itself. All the wlan enumerated values are
3409 a 1-to-1 match against the Prism2 enumerated values*/
3415 /*----------------------------------------------------------------
3416 * prism2mgmt_p80211enum2prism2enum
3418 * Convert the p80211 enumerated int into an hfa384x enumerated int
3421 * prism2enum pointer to hfa384x integer
3422 * wlanenum pointer to p80211 integer
3423 * rid hfa384x record id
3428 ----------------------------------------------------------------*/
3429 void prism2mgmt_p80211enum2prism2enum(UINT16 *prism2enum, UINT32 *wlanenum, UINT16 rid)
3433 /* At the moment, the need for this functionality hasn't
3434 presented itself. All the wlan enumerated values are
3435 a 1-to-1 match against the Prism2 enumerated values*/
3442 /*----------------------------------------------------------------
3443 * prism2mgmt_get_oprateset
3445 * Convert the hfa384x bit area into a wlan octet string.
3448 * rate Prism2 bit area
3449 * pstr wlan octet string
3454 ----------------------------------------------------------------*/
3455 void prism2mgmt_get_oprateset(UINT16 *rate, p80211pstrd_t *pstr)
3463 datarate = pstr->data;
3466 if ( BIT0 & (*rate) ) {
3468 *datarate = (UINT8)2;
3473 if ( BIT1 & (*rate) ) {
3475 *datarate = (UINT8)4;
3480 if ( BIT2 & (*rate) ) {
3482 *datarate = (UINT8)11;
3487 if ( BIT3 & (*rate) ) {
3489 *datarate = (UINT8)22;
3501 /*----------------------------------------------------------------
3502 * prism2mgmt_set_oprateset
3504 * Convert the wlan octet string into an hfa384x bit area.
3507 * rate Prism2 bit area
3508 * pstr wlan octet string
3513 ----------------------------------------------------------------*/
3514 void prism2mgmt_set_oprateset(UINT16 *rate, p80211pstrd_t *pstr)
3523 datarate = pstr->data;
3525 for ( i=0; i < pstr->len; i++, datarate++ ) {
3526 switch (*datarate) {
3527 case 2: /* 1 Mbps */
3530 case 4: /* 2 Mbps */
3533 case 11: /* 5.5 Mbps */
3536 case 22: /* 11 Mbps */
3540 WLAN_LOG_DEBUG(1, "Unrecoginzed Rate of %d\n",
3552 /*----------------------------------------------------------------
3553 * prism2mgmt_get_grpaddr
3555 * Retrieves a particular group address from the list of
3560 * pstr wlan octet string
3561 * priv prism2 driver private data structure
3566 ----------------------------------------------------------------*/
3567 void prism2mgmt_get_grpaddr(UINT32 did, p80211pstrd_t *pstr,
3574 index = prism2mgmt_get_grpaddr_index(did);
3577 pstr->len = WLAN_ADDR_LEN;
3578 memcpy(pstr->data, hw->dot11_grp_addr[index],
3588 /*----------------------------------------------------------------
3589 * prism2mgmt_set_grpaddr
3591 * Convert the wlan octet string into an hfa384x bit area.
3602 ----------------------------------------------------------------*/
3603 int prism2mgmt_set_grpaddr(UINT32 did, UINT8 *prism2buf,
3604 p80211pstrd_t *pstr, hfa384x_t *hw )
3606 UINT8 no_addr[WLAN_ADDR_LEN];
3611 memset(no_addr, 0, WLAN_ADDR_LEN);
3612 if (memcmp(no_addr, pstr->data, WLAN_ADDR_LEN) != 0) {
3615 ** The address is NOT 0 so we are "adding" an address to the
3616 ** group address list. Check to make sure we aren't trying
3617 ** to add more than the maximum allowed number of group
3618 ** addresses in the list. The new address is added to the
3619 ** end of the list regardless of the DID used to add the
3623 if (hw->dot11_grpcnt >= MAX_GRP_ADDR) return(-1);
3625 memcpy(hw->dot11_grp_addr[hw->dot11_grpcnt], pstr->data,
3627 hw->dot11_grpcnt += 1;
3631 ** The address is 0. Interpret this as "deleting" an address
3632 ** from the group address list. Get the address index from
3633 ** the DID. If this is within the range of used addresses,
3634 ** then delete the specified address by shifting all following
3635 ** addresses down. Then clear the last address (which should
3636 ** now be unused). If the address index is NOT within the
3637 ** range of used addresses, then just ignore the address.
3640 index = prism2mgmt_get_grpaddr_index(did);
3641 if (index >= 0 && index < hw->dot11_grpcnt) {
3642 hw->dot11_grpcnt -= 1;
3643 memmove(hw->dot11_grp_addr[index],
3644 hw->dot11_grp_addr[index + 1],
3645 ((hw->dot11_grpcnt)-index) * WLAN_ADDR_LEN);
3646 memset(hw->dot11_grp_addr[hw->dot11_grpcnt], 0,
3656 /*----------------------------------------------------------------
3657 * prism2mgmt_get_grpaddr_index
3659 * Gets the index in the group address list based on the did.
3666 * < 0 If not valid did
3668 ----------------------------------------------------------------*/
3669 int prism2mgmt_get_grpaddr_index( UINT32 did )
3678 case DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address1:
3681 case DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address2:
3684 case DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address3:
3687 case DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address4:
3690 case DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address5:
3693 case DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address6:
3696 case DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address7:
3699 case DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address8:
3702 case DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address9:
3705 case DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address10:
3708 case DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address11:
3711 case DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address12:
3714 case DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address13:
3717 case DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address14:
3720 case DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address15:
3723 case DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address16:
3726 case DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address17:
3729 case DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address18:
3732 case DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address19:
3735 case DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address20:
3738 case DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address21:
3741 case DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address22:
3744 case DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address23:
3747 case DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address24:
3750 case DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address25:
3753 case DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address26:
3756 case DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address27:
3759 case DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address28:
3762 case DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address29:
3765 case DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address30:
3768 case DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address31:
3771 case DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address32: