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
57 #include <linux/version.h>
59 #include <linux/module.h>
60 #include <linux/kernel.h>
61 #include <linux/sched.h>
62 #include <linux/types.h>
63 #include <linux/slab.h>
64 #include <linux/wireless.h>
65 #include <linux/netdevice.h>
67 #include <linux/delay.h>
68 #include <asm/byteorder.h>
69 #include <linux/usb.h>
71 /*================================================================*/
72 /* Project Includes */
74 #include "p80211types.h"
75 #include "p80211hdr.h"
76 #include "p80211mgmt.h"
77 #include "p80211conv.h"
78 #include "p80211msg.h"
79 #include "p80211netdev.h"
80 #include "p80211metadef.h"
81 #include "p80211metastruct.h"
83 #include "prism2mgmt.h"
85 /*================================================================*/
88 #define MIB_TMP_MAXLEN 200 /* Max length of RID record (in bytes). */
90 /*================================================================*/
93 #define F_STA 0x1 /* MIB is supported on stations. */
94 #define F_READ 0x2 /* MIB may be read. */
95 #define F_WRITE 0x4 /* MIB may be written. */
104 int (*func
)(struct mibrec
*mib
,
106 wlandevice_t
*wlandev
,
108 p80211msg_dot11req_mibset_t
*msg
,
112 /*================================================================*/
113 /* Local Function Declarations */
115 static int prism2mib_bytearea2pstr(
118 wlandevice_t
*wlandev
,
120 p80211msg_dot11req_mibset_t
*msg
,
123 static int prism2mib_uint32(
126 wlandevice_t
*wlandev
,
128 p80211msg_dot11req_mibset_t
*msg
,
131 static int prism2mib_flag(
134 wlandevice_t
*wlandev
,
136 p80211msg_dot11req_mibset_t
*msg
,
139 static int prism2mib_wepdefaultkey(
142 wlandevice_t
*wlandev
,
144 p80211msg_dot11req_mibset_t
*msg
,
147 static int prism2mib_privacyinvoked(
150 wlandevice_t
*wlandev
,
152 p80211msg_dot11req_mibset_t
*msg
,
155 static int prism2mib_excludeunencrypted(
158 wlandevice_t
*wlandev
,
160 p80211msg_dot11req_mibset_t
*msg
,
163 static int prism2mib_fragmentationthreshold(
166 wlandevice_t
*wlandev
,
168 p80211msg_dot11req_mibset_t
*msg
,
171 static int prism2mib_priv(
174 wlandevice_t
*wlandev
,
176 p80211msg_dot11req_mibset_t
*msg
,
179 /*================================================================*/
180 /* Local Static Definitions */
182 static mibrec_t mibtab
[] = {
185 { DIDmib_dot11smt_dot11WEPDefaultKeysTable_dot11WEPDefaultKey0
,
187 HFA384x_RID_CNFWEPDEFAULTKEY0
, 0, 0,
188 prism2mib_wepdefaultkey
},
189 { DIDmib_dot11smt_dot11WEPDefaultKeysTable_dot11WEPDefaultKey1
,
191 HFA384x_RID_CNFWEPDEFAULTKEY1
, 0, 0,
192 prism2mib_wepdefaultkey
},
193 { DIDmib_dot11smt_dot11WEPDefaultKeysTable_dot11WEPDefaultKey2
,
195 HFA384x_RID_CNFWEPDEFAULTKEY2
, 0, 0,
196 prism2mib_wepdefaultkey
},
197 { DIDmib_dot11smt_dot11WEPDefaultKeysTable_dot11WEPDefaultKey3
,
199 HFA384x_RID_CNFWEPDEFAULTKEY3
, 0, 0,
200 prism2mib_wepdefaultkey
},
201 { DIDmib_dot11smt_dot11PrivacyTable_dot11PrivacyInvoked
,
202 F_STA
| F_READ
| F_WRITE
,
203 HFA384x_RID_CNFWEPFLAGS
, HFA384x_WEPFLAGS_PRIVINVOKED
, 0,
204 prism2mib_privacyinvoked
},
205 { DIDmib_dot11smt_dot11PrivacyTable_dot11WEPDefaultKeyID
,
206 F_STA
| F_READ
| F_WRITE
,
207 HFA384x_RID_CNFWEPDEFAULTKEYID
, 0, 0,
209 { DIDmib_dot11smt_dot11PrivacyTable_dot11ExcludeUnencrypted
,
210 F_STA
| F_READ
| F_WRITE
,
211 HFA384x_RID_CNFWEPFLAGS
, HFA384x_WEPFLAGS_EXCLUDE
, 0,
212 prism2mib_excludeunencrypted
},
216 { DIDmib_dot11mac_dot11OperationTable_dot11MACAddress
,
217 F_STA
| F_READ
| F_WRITE
,
218 HFA384x_RID_CNFOWNMACADDR
, HFA384x_RID_CNFOWNMACADDR_LEN
, 0,
219 prism2mib_bytearea2pstr
},
220 { DIDmib_dot11mac_dot11OperationTable_dot11RTSThreshold
,
221 F_STA
| F_READ
| F_WRITE
,
222 HFA384x_RID_RTSTHRESH
, 0, 0,
224 { DIDmib_dot11mac_dot11OperationTable_dot11ShortRetryLimit
,
226 HFA384x_RID_SHORTRETRYLIMIT
, 0, 0,
228 { DIDmib_dot11mac_dot11OperationTable_dot11LongRetryLimit
,
230 HFA384x_RID_LONGRETRYLIMIT
, 0, 0,
232 { DIDmib_dot11mac_dot11OperationTable_dot11FragmentationThreshold
,
233 F_STA
| F_READ
| F_WRITE
,
234 HFA384x_RID_FRAGTHRESH
, 0, 0,
235 prism2mib_fragmentationthreshold
},
236 { DIDmib_dot11mac_dot11OperationTable_dot11MaxTransmitMSDULifetime
,
238 HFA384x_RID_MAXTXLIFETIME
, 0, 0,
243 { DIDmib_dot11phy_dot11PhyDSSSTable_dot11CurrentChannel
,
245 HFA384x_RID_CURRENTCHANNEL
, 0, 0,
247 { DIDmib_dot11phy_dot11PhyTxPowerTable_dot11CurrentTxPowerLevel
,
248 F_STA
| F_READ
| F_WRITE
,
249 HFA384x_RID_TXPOWERMAX
, 0, 0,
254 { DIDmib_p2_p2Static_p2CnfPortType
,
255 F_STA
| F_READ
| F_WRITE
,
256 HFA384x_RID_CNFPORTTYPE
, 0, 0,
261 { DIDmib_p2_p2MAC_p2CurrentTxRate
,
263 HFA384x_RID_CURRENTTXRATE
, 0, 0,
266 /* And finally, lnx mibs */
267 { DIDmib_lnx_lnxConfigTable_lnxRSNAIE
,
268 F_STA
| F_READ
| F_WRITE
,
269 HFA384x_RID_CNFWPADATA
, 0, 0,
271 { 0, 0, 0, 0, 0, NULL
}};
273 /*================================================================*/
274 /* Function Definitions */
276 /*----------------------------------------------------------------
277 * prism2mgmt_mibset_mibget
279 * Set the value of a mib item.
282 * wlandev wlan device structure
283 * msgp ptr to msg buffer
287 * <0 success, but we're waiting for something to finish.
288 * >0 an error occurred while handling the message.
292 * process thread (usually)
294 ----------------------------------------------------------------*/
296 int prism2mgmt_mibset_mibget(wlandevice_t
*wlandev
, void *msgp
)
298 hfa384x_t
*hw
= wlandev
->priv
;
304 p80211msg_dot11req_mibset_t
*msg
= msgp
;
305 p80211itemd_t
*mibitem
;
309 msg
->resultcode
.status
= P80211ENUM_msgitem_status_data_ok
;
310 msg
->resultcode
.data
= P80211ENUM_resultcode_success
;
313 ** Determine if this is an Access Point or a station.
319 ** Find the MIB in the MIB table. Note that a MIB may be in the
320 ** table twice...once for an AP and once for a station. Make sure
321 ** to get the correct one. Note that DID=0 marks the end of the
325 mibitem
= (p80211itemd_t
*) msg
->mibattribute
.data
;
327 for (mib
= mibtab
; mib
->did
!= 0; mib
++)
328 if (mib
->did
== mibitem
->did
&& (mib
->flag
& which
))
332 msg
->resultcode
.data
= P80211ENUM_resultcode_not_supported
;
337 ** Determine if this is a "mibget" or a "mibset". If this is a
338 ** "mibget", then make sure that the MIB may be read. Otherwise,
339 ** this is a "mibset" so make make sure that the MIB may be written.
342 isget
= (msg
->msgcode
== DIDmsg_dot11req_mibget
);
345 if (!(mib
->flag
& F_READ
)) {
346 msg
->resultcode
.data
=
347 P80211ENUM_resultcode_cant_get_writeonly_mib
;
351 if (!(mib
->flag
& F_WRITE
)) {
352 msg
->resultcode
.data
=
353 P80211ENUM_resultcode_cant_set_readonly_mib
;
359 ** Execute the MIB function. If things worked okay, then make
360 ** sure that the MIB function also worked okay. If so, and this
361 ** is a "mibget", then the status value must be set for both the
362 ** "mibattribute" parameter and the mib item within the data
363 ** portion of the "mibattribute".
366 result
= mib
->func(mib
, isget
, wlandev
, hw
, msg
,
367 (void *) mibitem
->data
);
369 if (msg
->resultcode
.data
== P80211ENUM_resultcode_success
) {
371 WLAN_LOG_DEBUG(1, "get/set failure, result=%d\n",
373 msg
->resultcode
.data
=
374 P80211ENUM_resultcode_implementation_failure
;
377 msg
->mibattribute
.status
=
378 P80211ENUM_msgitem_status_data_ok
;
380 P80211ENUM_msgitem_status_data_ok
;
391 /*----------------------------------------------------------------
392 * prism2mib_bytearea2pstr
394 * Get/set pstr data to/from a byte area.
396 * MIB record parameters:
397 * parm1 Prism2 RID value.
398 * parm2 Number of bytes of RID data.
403 * isget MIBGET/MIBSET flag.
404 * wlandev wlan device structure.
405 * priv "priv" structure.
407 * msg Message structure.
414 ----------------------------------------------------------------*/
416 static int prism2mib_bytearea2pstr(
419 wlandevice_t
*wlandev
,
421 p80211msg_dot11req_mibset_t
*msg
,
425 p80211pstrd_t
*pstr
= (p80211pstrd_t
*) data
;
426 u8 bytebuf
[MIB_TMP_MAXLEN
];
431 result
= hfa384x_drvr_getconfig(hw
, mib
->parm1
, bytebuf
, mib
->parm2
);
432 prism2mgmt_bytearea2pstr(bytebuf
, pstr
, mib
->parm2
);
434 memset(bytebuf
, 0, mib
->parm2
);
435 prism2mgmt_pstr2bytearea(bytebuf
, pstr
);
436 result
= hfa384x_drvr_setconfig(hw
, mib
->parm1
, bytebuf
, mib
->parm2
);
443 /*----------------------------------------------------------------
446 * Get/set uint32 data.
448 * MIB record parameters:
449 * parm1 Prism2 RID value.
455 * isget MIBGET/MIBSET flag.
456 * wlandev wlan device structure.
457 * priv "priv" structure.
459 * msg Message structure.
466 ----------------------------------------------------------------*/
468 static int prism2mib_uint32(
471 wlandevice_t
*wlandev
,
473 p80211msg_dot11req_mibset_t
*msg
,
477 u32
*uint32
= (u32
*) data
;
478 u8 bytebuf
[MIB_TMP_MAXLEN
];
479 u16
*wordbuf
= (u16
*) bytebuf
;
484 result
= hfa384x_drvr_getconfig16(hw
, mib
->parm1
, wordbuf
);
486 /* [MSM] Removed, getconfig16 returns the value in host order.
487 * prism2mgmt_prism2int2p80211int(wordbuf, uint32);
490 /* [MSM] Removed, setconfig16 expects host order.
491 * prism2mgmt_p80211int2prism2int(wordbuf, uint32);
494 result
= hfa384x_drvr_setconfig16(hw
, mib
->parm1
, *wordbuf
);
501 /*----------------------------------------------------------------
506 * MIB record parameters:
507 * parm1 Prism2 RID value.
508 * parm2 Bit to get/set.
513 * isget MIBGET/MIBSET flag.
514 * wlandev wlan device structure.
515 * priv "priv" structure.
517 * msg Message structure.
524 ----------------------------------------------------------------*/
526 static int prism2mib_flag(
529 wlandevice_t
*wlandev
,
531 p80211msg_dot11req_mibset_t
*msg
,
535 u32
*uint32
= (u32
*) data
;
536 u8 bytebuf
[MIB_TMP_MAXLEN
];
537 u16
*wordbuf
= (u16
*) bytebuf
;
542 result
= hfa384x_drvr_getconfig16(hw
, mib
->parm1
, wordbuf
);
544 /* [MSM] Removed, getconfig16 returns the value in host order.
545 * prism2mgmt_prism2int2p80211int(wordbuf, &flags);
549 *uint32
= (flags
& mib
->parm2
) ?
550 P80211ENUM_truth_true
: P80211ENUM_truth_false
;
552 if ((*uint32
) == P80211ENUM_truth_true
)
555 flags
&= ~mib
->parm2
;
556 /* [MSM] Removed, setconfig16 expects host order.
557 * prism2mgmt_p80211int2prism2int(wordbuf, &flags);
560 result
= hfa384x_drvr_setconfig16(hw
, mib
->parm1
, *wordbuf
);
568 /*----------------------------------------------------------------
569 * prism2mib_wepdefaultkey
571 * Get/set WEP default keys.
573 * MIB record parameters:
574 * parm1 Prism2 RID value.
575 * parm2 Number of bytes of RID data.
580 * isget MIBGET/MIBSET flag.
581 * wlandev wlan device structure.
582 * priv "priv" structure.
584 * msg Message structure.
591 ----------------------------------------------------------------*/
593 static int prism2mib_wepdefaultkey(
596 wlandevice_t
*wlandev
,
598 p80211msg_dot11req_mibset_t
*msg
,
602 p80211pstrd_t
*pstr
= (p80211pstrd_t
*) data
;
603 u8 bytebuf
[MIB_TMP_MAXLEN
];
609 result
= 0; /* Should never happen. */
611 len
= (pstr
->len
> 5) ? HFA384x_RID_CNFWEP128DEFAULTKEY_LEN
:
612 HFA384x_RID_CNFWEPDEFAULTKEY_LEN
;
613 memset(bytebuf
, 0, len
);
614 prism2mgmt_pstr2bytearea(bytebuf
, pstr
);
615 result
= hfa384x_drvr_setconfig(hw
, mib
->parm1
, bytebuf
, len
);
622 /*----------------------------------------------------------------
623 * prism2mib_privacyinvoked
625 * Get/set the dot11PrivacyInvoked value.
627 * MIB record parameters:
628 * parm1 Prism2 RID value.
629 * parm2 Bit value for PrivacyInvoked flag.
634 * isget MIBGET/MIBSET flag.
635 * wlandev wlan device structure.
636 * priv "priv" structure.
638 * msg Message structure.
645 ----------------------------------------------------------------*/
647 static int prism2mib_privacyinvoked(
650 wlandevice_t
*wlandev
,
652 p80211msg_dot11req_mibset_t
*msg
,
659 if (wlandev
->hostwep
& HOSTWEP_DECRYPT
) {
660 if (wlandev
->hostwep
& HOSTWEP_DECRYPT
)
661 mib
->parm2
|= HFA384x_WEPFLAGS_DISABLE_RXCRYPT
;
662 if (wlandev
->hostwep
& HOSTWEP_ENCRYPT
)
663 mib
->parm2
|= HFA384x_WEPFLAGS_DISABLE_TXCRYPT
;
666 result
= prism2mib_flag(mib
, isget
, wlandev
, hw
, msg
, data
);
672 /*----------------------------------------------------------------
673 * prism2mib_excludeunencrypted
675 * Get/set the dot11ExcludeUnencrypted value.
677 * MIB record parameters:
678 * parm1 Prism2 RID value.
679 * parm2 Bit value for ExcludeUnencrypted flag.
684 * isget MIBGET/MIBSET flag.
685 * wlandev wlan device structure.
686 * priv "priv" structure.
688 * msg Message structure.
695 ----------------------------------------------------------------*/
697 static int prism2mib_excludeunencrypted(
700 wlandevice_t
*wlandev
,
702 p80211msg_dot11req_mibset_t
*msg
,
709 result
= prism2mib_flag(mib
, isget
, wlandev
, hw
, msg
, data
);
715 /*----------------------------------------------------------------
716 * prism2mib_fragmentationthreshold
718 * Get/set the fragmentation threshold.
720 * MIB record parameters:
721 * parm1 Prism2 RID value.
727 * isget MIBGET/MIBSET flag.
728 * wlandev wlan device structure.
729 * priv "priv" structure.
731 * msg Message structure.
738 ----------------------------------------------------------------*/
740 static int prism2mib_fragmentationthreshold(
743 wlandevice_t
*wlandev
,
745 p80211msg_dot11req_mibset_t
*msg
,
749 u32
*uint32
= (u32
*) data
;
755 WLAN_LOG_WARNING("Attempt to set odd number "
756 "FragmentationThreshold\n");
757 msg
->resultcode
.data
= P80211ENUM_resultcode_not_supported
;
761 result
= prism2mib_uint32(mib
, isget
, wlandev
, hw
, msg
, data
);
767 /*----------------------------------------------------------------
770 * Get/set values in the "priv" data structure.
772 * MIB record parameters:
779 * isget MIBGET/MIBSET flag.
780 * wlandev wlan device structure.
781 * priv "priv" structure.
783 * msg Message structure.
790 ----------------------------------------------------------------*/
792 static int prism2mib_priv(
795 wlandevice_t
*wlandev
,
797 p80211msg_dot11req_mibset_t
*msg
,
800 p80211pstrd_t
*pstr
= (p80211pstrd_t
*) data
;
807 case DIDmib_lnx_lnxConfigTable_lnxRSNAIE
: {
808 hfa384x_WPAData_t wpa
;
810 hfa384x_drvr_getconfig( hw
, HFA384x_RID_CNFWPADATA
,
811 (u8
*) &wpa
, sizeof(wpa
));
812 pstr
->len
= hfa384x2host_16(wpa
.datalen
);
813 memcpy(pstr
->data
, wpa
.data
, pstr
->len
);
815 wpa
.datalen
= host2hfa384x_16(pstr
->len
);
816 memcpy(wpa
.data
, pstr
->data
, pstr
->len
);
818 result
= hfa384x_drvr_setconfig(hw
, HFA384x_RID_CNFWPADATA
,
819 (u8
*) &wpa
, sizeof(wpa
));
824 WLAN_LOG_ERROR("Unhandled DID 0x%08x\n", mib
->did
);
831 /*----------------------------------------------------------------
832 * prism2mgmt_pstr2bytestr
834 * Convert the pstr data in the WLAN message structure into an hfa384x
835 * byte string format.
838 * bytestr hfa384x byte string data type
839 * pstr wlan message data
844 ----------------------------------------------------------------*/
846 void prism2mgmt_pstr2bytestr(hfa384x_bytestr_t
*bytestr
, p80211pstrd_t
*pstr
)
850 bytestr
->len
= host2hfa384x_16((u16
)(pstr
->len
));
851 memcpy(bytestr
->data
, pstr
->data
, pstr
->len
);
856 /*----------------------------------------------------------------
857 * prism2mgmt_pstr2bytearea
859 * Convert the pstr data in the WLAN message structure into an hfa384x
863 * bytearea hfa384x byte area data type
864 * pstr wlan message data
869 ----------------------------------------------------------------*/
871 void prism2mgmt_pstr2bytearea(u8
*bytearea
, p80211pstrd_t
*pstr
)
875 memcpy(bytearea
, pstr
->data
, pstr
->len
);
880 /*----------------------------------------------------------------
881 * prism2mgmt_bytestr2pstr
883 * Convert the data in an hfa384x byte string format into a
884 * pstr in the WLAN message.
887 * bytestr hfa384x byte string data type
893 ----------------------------------------------------------------*/
895 void prism2mgmt_bytestr2pstr(hfa384x_bytestr_t
*bytestr
, p80211pstrd_t
*pstr
)
899 pstr
->len
= (u8
)(hfa384x2host_16((u16
)(bytestr
->len
)));
900 memcpy(pstr
->data
, bytestr
->data
, pstr
->len
);
905 /*----------------------------------------------------------------
906 * prism2mgmt_bytearea2pstr
908 * Convert the data in an hfa384x byte area format into a pstr
909 * in the WLAN message.
912 * bytearea hfa384x byte area data type
918 ----------------------------------------------------------------*/
920 void prism2mgmt_bytearea2pstr(u8
*bytearea
, p80211pstrd_t
*pstr
, int len
)
925 memcpy(pstr
->data
, bytearea
, len
);
930 /*----------------------------------------------------------------
931 * prism2mgmt_prism2int2p80211int
933 * Convert an hfa384x integer into a wlan integer
936 * prism2enum pointer to hfa384x integer
937 * wlanenum pointer to p80211 integer
942 ----------------------------------------------------------------*/
944 void prism2mgmt_prism2int2p80211int(u16
*prism2int
, u32
*wlanint
)
948 *wlanint
= (u32
)hfa384x2host_16(*prism2int
);
953 /*----------------------------------------------------------------
954 * prism2mgmt_p80211int2prism2int
956 * Convert a wlan integer into an hfa384x integer
959 * prism2enum pointer to hfa384x integer
960 * wlanenum pointer to p80211 integer
965 ----------------------------------------------------------------*/
967 void prism2mgmt_p80211int2prism2int(u16
*prism2int
, u32
*wlanint
)
971 *prism2int
= host2hfa384x_16((u16
)(*wlanint
));
976 /*----------------------------------------------------------------
977 * prism2mgmt_prism2enum2p80211enum
979 * Convert the hfa384x enumerated int into a p80211 enumerated int
982 * prism2enum pointer to hfa384x integer
983 * wlanenum pointer to p80211 integer
984 * rid hfa384x record id
989 ----------------------------------------------------------------*/
990 void prism2mgmt_prism2enum2p80211enum(u16
*prism2enum
, u32
*wlanenum
, u16 rid
)
994 /* At the moment, the need for this functionality hasn't
995 presented itself. All the wlan enumerated values are
996 a 1-to-1 match against the Prism2 enumerated values*/
1002 /*----------------------------------------------------------------
1003 * prism2mgmt_p80211enum2prism2enum
1005 * Convert the p80211 enumerated int into an hfa384x enumerated int
1008 * prism2enum pointer to hfa384x integer
1009 * wlanenum pointer to p80211 integer
1010 * rid hfa384x record id
1015 ----------------------------------------------------------------*/
1016 void prism2mgmt_p80211enum2prism2enum(u16
*prism2enum
, u32
*wlanenum
, u16 rid
)
1020 /* At the moment, the need for this functionality hasn't
1021 presented itself. All the wlan enumerated values are
1022 a 1-to-1 match against the Prism2 enumerated values*/
1029 /*----------------------------------------------------------------
1030 * prism2mgmt_get_oprateset
1032 * Convert the hfa384x bit area into a wlan octet string.
1035 * rate Prism2 bit area
1036 * pstr wlan octet string
1041 ----------------------------------------------------------------*/
1042 void prism2mgmt_get_oprateset(u16
*rate
, p80211pstrd_t
*pstr
)
1050 datarate
= pstr
->data
;
1053 if ( BIT0
& (*rate
) ) {
1060 if ( BIT1
& (*rate
) ) {
1067 if ( BIT2
& (*rate
) ) {
1074 if ( BIT3
& (*rate
) ) {
1088 /*----------------------------------------------------------------
1089 * prism2mgmt_set_oprateset
1091 * Convert the wlan octet string into an hfa384x bit area.
1094 * rate Prism2 bit area
1095 * pstr wlan octet string
1100 ----------------------------------------------------------------*/
1101 void prism2mgmt_set_oprateset(u16
*rate
, p80211pstrd_t
*pstr
)
1110 datarate
= pstr
->data
;
1112 for ( i
=0; i
< pstr
->len
; i
++, datarate
++ ) {
1113 switch (*datarate
) {
1114 case 2: /* 1 Mbps */
1117 case 4: /* 2 Mbps */
1120 case 11: /* 5.5 Mbps */
1123 case 22: /* 11 Mbps */
1127 WLAN_LOG_DEBUG(1, "Unrecoginzed Rate of %d\n",