diff options
author | Claudiu Beznea <claudiu.beznea@gmail.com> | 2016-08-23 21:26:42 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-09-01 17:51:20 +0200 |
commit | 37f92cf0a5b82be433b8b24b7105bb9f878f7153 (patch) | |
tree | 969a7b9c44fe6f2fecc64be5013bceaa53d1576d /drivers/staging/wlan-ng | |
parent | cb14a0b4a13ee743bbe40299ce46790ee9ef7f1d (diff) | |
download | blackbird-op-linux-37f92cf0a5b82be433b8b24b7105bb9f878f7153.tar.gz blackbird-op-linux-37f92cf0a5b82be433b8b24b7105bb9f878f7153.zip |
Staging: wlan-ng: Improved case statements in p80211req_mibset_mibget()
This patch improves code from p80211req_mibset_mibget() function by
taking into account that every
DIDmib_dot11smt_dot11WEPDefaultKeysTable_dot11WEPDefaultKeyX with
X in {0, 1, 2, 3} is a bit mask where the (P80211DID_MASK_ITEM <<
P80211DID_LSB_ITEM) mask aka 0x0x0003f000 mask keeps bits representing
the DID item number. To get this item number use P80211DID_ITEM().
Signed-off-by: Claudiu Beznea <claudiu.beznea@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/wlan-ng')
-rw-r--r-- | drivers/staging/wlan-ng/p80211req.c | 28 |
1 files changed, 9 insertions, 19 deletions
diff --git a/drivers/staging/wlan-ng/p80211req.c b/drivers/staging/wlan-ng/p80211req.c index 4b84b568f6ca..3849637636a3 100644 --- a/drivers/staging/wlan-ng/p80211req.c +++ b/drivers/staging/wlan-ng/p80211req.c @@ -185,26 +185,16 @@ static void p80211req_mibset_mibget(wlandevice_t *wlandev, u8 *key = mibitem->data + sizeof(p80211pstrd_t); switch (mibitem->did) { - case DIDmib_dot11smt_dot11WEPDefaultKeysTable_dot11WEPDefaultKey0:{ + case DIDmib_dot11smt_dot11WEPDefaultKeysTable_dot11WEPDefaultKey0: + case DIDmib_dot11smt_dot11WEPDefaultKeysTable_dot11WEPDefaultKey1: + case DIDmib_dot11smt_dot11WEPDefaultKeysTable_dot11WEPDefaultKey2: + case DIDmib_dot11smt_dot11WEPDefaultKeysTable_dot11WEPDefaultKey3: if (!isget) - wep_change_key(wlandev, 0, key, pstr->len); - break; - } - case DIDmib_dot11smt_dot11WEPDefaultKeysTable_dot11WEPDefaultKey1:{ - if (!isget) - wep_change_key(wlandev, 1, key, pstr->len); - break; - } - case DIDmib_dot11smt_dot11WEPDefaultKeysTable_dot11WEPDefaultKey2:{ - if (!isget) - wep_change_key(wlandev, 2, key, pstr->len); - break; - } - case DIDmib_dot11smt_dot11WEPDefaultKeysTable_dot11WEPDefaultKey3:{ - if (!isget) - wep_change_key(wlandev, 3, key, pstr->len); - break; - } + wep_change_key(wlandev, + P80211DID_ITEM(mibitem->did) - 1, + key, pstr->len); + break; + case DIDmib_dot11smt_dot11PrivacyTable_dot11WEPDefaultKeyID:{ u32 *data = (u32 *) mibitem->data; |