Fixed conversion from Prism2 boolean to 802.11 enumerated type for PowerManagementMode

This commit is contained in:
joellen 2000-01-27 16:03:56 +00:00
parent 7fcd9fd510
commit 135b26d373
1 changed files with 18 additions and 3 deletions

View File

@ -240,14 +240,29 @@ int prism2mgmt_mibset_mibget(wlandevice_t *wlandev, void *msgp)
}
break;
case DIDmib_dot11smt_dot11StationConfigTable_dot11PowerManagementMode:
/* This is an enumerated type. The Prism2 enumerated values
are a 1-to-1 match against the wlan enumerated values for this item */
if ( isget ) {
result = hfa384x_drvr_getconfig16( hw, HFA384x_RID_CNFPMENABLED,
wordbuf);
/* Prism2 defines this item to be boolean; 802.11 defines
it to be 1=active, 2=powersave */
if ( (*wordbuf) == 0 ) {
*wordbuf = 1; /* if false, set to active */
} else {
*wordbuf = 2; /* if true, set to powersave */
}
prism2mgmt_prism2int2p80211int(wordbuf, uint32);
} else {
prism2mgmt_p80211int2prism2int(wordbuf, uint32);
/* Prism2 defines this item to be boolean; 802.11 defines
it to be 1=active, 2=powersave */
UINT32 mode;
if ( (*uint32) == 1 ) {
mode = (UINT32)0; /* if active, set to false */
} else {
mode = (UINT32)1; /* if powersave, set to true */
}
prism2mgmt_p80211int2prism2int(wordbuf, &mode);
result = hfa384x_drvr_setconfig16( hw, HFA384x_RID_CNFPMENABLED,
wordbuf);
}