diff options
author | Mateusz Kulikowski <mateusz.kulikowski@gmail.com> | 2015-04-01 00:24:34 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-04-03 15:29:30 +0200 |
commit | e8f05b0b01ea1593c8cc6311704c227fb0d08b04 (patch) | |
tree | 00dda89167ecb3acb13e9622956a942b22b1cf11 /drivers/staging | |
parent | 61dbdf36f2f1083a0b224afbb0feb13ad44792a5 (diff) | |
download | op-kernel-dev-e8f05b0b01ea1593c8cc6311704c227fb0d08b04.zip op-kernel-dev-e8f05b0b01ea1593c8cc6311704c227fb0d08b04.tar.gz |
staging: rtl8192e: Divide rtllib_rx_auth()
Move authentication response processing to rtllib_rx_auth_resp() function.
No logic is affected.
Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging')
-rw-r--r-- | drivers/staging/rtl8192e/rtllib_softmac.c | 112 |
1 files changed, 58 insertions, 54 deletions
diff --git a/drivers/staging/rtl8192e/rtllib_softmac.c b/drivers/staging/rtl8192e/rtllib_softmac.c index d3fc5a4..9266bc6 100644 --- a/drivers/staging/rtl8192e/rtllib_softmac.c +++ b/drivers/staging/rtl8192e/rtllib_softmac.c @@ -2314,73 +2314,77 @@ inline int rtllib_rx_assoc_resp(struct rtllib_device *ieee, struct sk_buff *skb, return 0; } -inline int rtllib_rx_auth(struct rtllib_device *ieee, struct sk_buff *skb, - struct rtllib_rx_stats *rx_stats) +static void rtllib_rx_auth_resp(struct rtllib_device *ieee, struct sk_buff *skb) { u16 errcode; u8 *challenge; int chlen = 0; bool bSupportNmode = true, bHalfSupportNmode = false; - if (ieee->softmac_features & IEEE_SOFTMAC_ASSOCIATE) { - if (ieee->state == RTLLIB_ASSOCIATING_AUTHENTICATING && - (ieee->iw_mode == IW_MODE_INFRA)) { - RTLLIB_DEBUG_MGMT("Received authentication response"); - - errcode = auth_parse(skb, &challenge, &chlen); - if (0 == errcode) { - if (ieee->open_wep || !challenge) { - ieee->state = RTLLIB_ASSOCIATING_AUTHENTICATED; - ieee->softmac_stats.rx_auth_rs_ok++; - if (!(ieee->pHTInfo->IOTAction & - HT_IOT_ACT_PURE_N_MODE)) { - if (!ieee->GetNmodeSupportBySecCfg(ieee->dev)) { - if (IsHTHalfNmodeAPs(ieee)) { - bSupportNmode = true; - bHalfSupportNmode = true; - } else { - bSupportNmode = false; - bHalfSupportNmode = false; - } - } - } - /* Dummy wirless mode setting to avoid - * encryption issue */ - if (bSupportNmode) { - ieee->SetWirelessMode(ieee->dev, - ieee->current_network.mode); + errcode = auth_parse(skb, &challenge, &chlen); + if (0 == errcode) { + if (ieee->open_wep || !challenge) { + ieee->state = RTLLIB_ASSOCIATING_AUTHENTICATED; + ieee->softmac_stats.rx_auth_rs_ok++; + if (!(ieee->pHTInfo->IOTAction & + HT_IOT_ACT_PURE_N_MODE)) { + if (!ieee->GetNmodeSupportBySecCfg(ieee->dev)) { + if (IsHTHalfNmodeAPs(ieee)) { + bSupportNmode = true; + bHalfSupportNmode = true; } else { - /*TODO*/ - ieee->SetWirelessMode(ieee->dev, - IEEE_G); + bSupportNmode = false; + bHalfSupportNmode = false; } - - if (ieee->current_network.mode == - IEEE_N_24G && bHalfSupportNmode) { - netdev_info(ieee->dev, - "======>enter half N mode\n"); - ieee->bHalfWirelessN24GMode = - true; - } else - ieee->bHalfWirelessN24GMode = - false; - - rtllib_associate_step2(ieee); - } else { - rtllib_auth_challenge(ieee, challenge, - chlen); } + } + /* Dummy wirless mode setting to avoid + * encryption issue */ + if (bSupportNmode) { + ieee->SetWirelessMode(ieee->dev, + ieee->current_network.mode); } else { - ieee->softmac_stats.rx_auth_rs_err++; - RTLLIB_DEBUG_MGMT("Authentication respose status code 0x%x", - errcode); + /*TODO*/ + ieee->SetWirelessMode(ieee->dev, + IEEE_G); + } + if (ieee->current_network.mode == + IEEE_N_24G && bHalfSupportNmode) { netdev_info(ieee->dev, - "Authentication respose status code 0x%x", - errcode); - rtllib_associate_abort(ieee); - } + "======>enter half N mode\n"); + ieee->bHalfWirelessN24GMode = + true; + } else + ieee->bHalfWirelessN24GMode = + false; + + rtllib_associate_step2(ieee); + } else { + rtllib_auth_challenge(ieee, challenge, + chlen); + } + } else { + ieee->softmac_stats.rx_auth_rs_err++; + RTLLIB_DEBUG_MGMT("Authentication respose status code 0x%x", + errcode); + + netdev_info(ieee->dev, + "Authentication respose status code 0x%x", + errcode); + rtllib_associate_abort(ieee); + } +} +inline int rtllib_rx_auth(struct rtllib_device *ieee, struct sk_buff *skb, + struct rtllib_rx_stats *rx_stats) +{ + + if (ieee->softmac_features & IEEE_SOFTMAC_ASSOCIATE) { + if (ieee->state == RTLLIB_ASSOCIATING_AUTHENTICATING && + (ieee->iw_mode == IW_MODE_INFRA)) { + RTLLIB_DEBUG_MGMT("Received authentication response"); + rtllib_rx_auth_resp(ieee, skb); } else if (ieee->iw_mode == IW_MODE_MASTER) { rtllib_rx_auth_rq(ieee, skb); } |