diff options
Diffstat (limited to 'drivers/staging/rtl8188eu/core/rtw_mlme_ext.c')
-rw-r--r-- | drivers/staging/rtl8188eu/core/rtw_mlme_ext.c | 56 |
1 files changed, 1 insertions, 55 deletions
diff --git a/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c b/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c index 59d862f67573..1115050077e4 100644 --- a/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c +++ b/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c @@ -1,16 +1,8 @@ +// SPDX-License-Identifier: GPL-2.0 /****************************************************************************** * * Copyright(c) 2007 - 2012 Realtek Corporation. All rights reserved. * - * This program is free software; you can redistribute it and/or modify it - * under the terms of version 2 of the GNU General Public License as - * published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * ******************************************************************************/ #define _RTW_MLME_EXT_C_ @@ -350,7 +342,6 @@ static void issue_beacon(struct adapter *padapter, int timeout_ms) pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET; pwlanhdr = (struct ieee80211_hdr *)pframe; - fctrl = &pwlanhdr->frame_control; *(fctrl) = 0; @@ -593,7 +584,6 @@ static void issue_probersp(struct adapter *padapter, unsigned char *da) pframe = rtw_set_ie(pframe, _ERPINFO_IE_, 1, &erpinfo, &pattrib->pktlen); } - /* EXTERNDED SUPPORTED RATE */ if (rate_len > 8) pframe = rtw_set_ie(pframe, _EXT_SUPPORTEDRATES_IE_, (rate_len - 8), (cur_network->SupportedRates + 8), &pattrib->pktlen); @@ -633,7 +623,6 @@ static int issue_probereq(struct adapter *padapter, pattrib = &pmgntframe->attrib; update_mgntframe_attrib(padapter, pattrib); - memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET); pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET; @@ -785,7 +774,6 @@ static void issue_auth(struct adapter *padapter, struct sta_info *psta, pframe += sizeof(struct ieee80211_hdr_3addr); pattrib->pktlen = sizeof(struct ieee80211_hdr_3addr); - if (psta) {/* for AP mode */ #ifdef CONFIG_88EU_AP_MODE @@ -795,7 +783,6 @@ static void issue_auth(struct adapter *padapter, struct sta_info *psta, ether_addr_copy(pwlanhdr->addr3, myid(&(padapter->eeprompriv))); - /* setting auth algo number */ val16 = (u16)psta->authalg; @@ -861,7 +848,6 @@ static void issue_auth(struct adapter *padapter, struct sta_info *psta, pframe = rtw_set_fixed_ie(pframe, _AUTH_SEQ_NUM_, &le_tmp16, &pattrib->pktlen); - /* setting status code... */ le_tmp16 = cpu_to_le16(status); pframe = rtw_set_fixed_ie(pframe, _STATUS_CODE_, &le_tmp16, @@ -890,7 +876,6 @@ static void issue_auth(struct adapter *padapter, struct sta_info *psta, dump_mgntframe(padapter, pmgntframe); } - #ifdef CONFIG_88EU_AP_MODE static void issue_asocrsp(struct adapter *padapter, unsigned short status, struct sta_info *pstat, int pkt_type) @@ -919,7 +904,6 @@ static void issue_asocrsp(struct adapter *padapter, unsigned short status, pattrib = &pmgntframe->attrib; update_mgntframe_attrib(padapter, pattrib); - memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET); pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET; @@ -933,7 +917,6 @@ static void issue_asocrsp(struct adapter *padapter, unsigned short status, myid(&(padapter->eeprompriv))); ether_addr_copy((void *)GetAddr3Ptr(pwlanhdr), pnetwork->MacAddress); - SetSeqNum(pwlanhdr, pmlmeext->mgnt_seq); pmlmeext->mgnt_seq++; if ((pkt_type == WIFI_ASSOCRSP) || (pkt_type == WIFI_REASSOCRSP)) @@ -1123,7 +1106,6 @@ static void issue_assocreq(struct adapter *padapter) goto exit; /* don't connect to AP if no joint supported rate */ } - if (bssrate_len > 8) { pframe = rtw_set_ie(pframe, _SUPPORTEDRATES_IE_, 8, bssrate, &(pattrib->pktlen)); pframe = rtw_set_ie(pframe, _EXT_SUPPORTEDRATES_IE_, (bssrate_len - 8), (bssrate + 8), &(pattrib->pktlen)); @@ -1269,7 +1251,6 @@ exit: return ret; } - /* when wait_ms > 0 , this function should be called at process context */ /* da == NULL for station mode */ int issue_nulldata(struct adapter *padapter, unsigned char *da, @@ -1497,7 +1478,6 @@ static int _issue_deauth(struct adapter *padapter, unsigned char *da, pattrib->last_txcmdsz = pattrib->pktlen; - if (wait_ack) { ret = dump_mgntframe_and_wait_ack(padapter, pmgntframe); } else { @@ -1735,10 +1715,8 @@ static void issue_action_BSSCoexistPacket(struct adapter *padapter) if (pmlmeinfo->bwmode_updated) return; - DBG_88E("%s\n", __func__); - category = RTW_WLAN_CATEGORY_PUBLIC; action = ACT_PUBLIC_BSSCOEXIST; @@ -1772,7 +1750,6 @@ static void issue_action_BSSCoexistPacket(struct adapter *padapter) pframe = rtw_set_fixed_ie(pframe, 1, &(category), &(pattrib->pktlen)); pframe = rtw_set_fixed_ie(pframe, 1, &(action), &(pattrib->pktlen)); - /* */ if (pmlmepriv->num_FortyMHzIntolerant > 0) { u8 iedata = 0; @@ -1782,7 +1759,6 @@ static void issue_action_BSSCoexistPacket(struct adapter *padapter) pframe = rtw_set_ie(pframe, EID_BSSCoexistence, 1, &iedata, &(pattrib->pktlen)); } - /* */ memset(ICS, 0, sizeof(ICS)); if (pmlmepriv->num_sta_no_ht > 0) { @@ -1840,7 +1816,6 @@ static void issue_action_BSSCoexistPacket(struct adapter *padapter) } } - pattrib->last_txcmdsz = pattrib->pktlen; dump_mgntframe(padapter, pmgntframe); @@ -1943,7 +1918,6 @@ static void site_survey(struct adapter *padapter) ScanType = (ch->flags & RTW_IEEE80211_CHAN_PASSIVE_SCAN) ? SCAN_PASSIVE : SCAN_ACTIVE; } - if (survey_channel != 0) { /* PAUSE 4-AC Queue when site_survey */ /* rtw_hal_get_hwreg(padapter, HW_VAR_TXPAUSE, (u8 *)(&val8)); */ @@ -1987,7 +1961,6 @@ static void site_survey(struct adapter *padapter) set_survey_timer(pmlmeext, pmlmeext->chan_scan_time); } else { - /* 20100721:Interrupt scan operation here. */ /* For SW antenna diversity before link, it needs to switch to another antenna and scan again. */ /* It compares the scan result and select better one to do connection. */ @@ -2329,7 +2302,6 @@ static void start_clnt_auth(struct adapter *padapter) pmlmeinfo->link_count = 0; pmlmeext->retry = 0; - /* Because of AP's not receiving deauth before */ /* AP may: 1)not response auth or 2)deauth us after link is complete */ /* issue deauth before issuing auth to deal with the situation */ @@ -2343,7 +2315,6 @@ static void start_clnt_auth(struct adapter *padapter) set_link_timer(pmlmeext, REAUTH_TO); } - static void start_clnt_assoc(struct adapter *padapter) { struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; @@ -2965,7 +2936,6 @@ static unsigned int OnAssocReq(struct adapter *padapter, ie_offset = _REASOCREQ_IE_OFFSET_; } - if (pkt_len < IEEE80211_3ADDR_LEN + ie_offset) { DBG_88E("handle_assoc(reassoc=%d) - too short payload (len=%lu)" "\n", reassoc, (unsigned long)pkt_len); @@ -2983,7 +2953,6 @@ static unsigned int OnAssocReq(struct adapter *padapter, left = pkt_len - (IEEE80211_3ADDR_LEN + ie_offset); pos = pframe + (IEEE80211_3ADDR_LEN + ie_offset); - DBG_88E("%s\n", __func__); /* check if this stat has been successfully authenticated/assocated */ @@ -3009,7 +2978,6 @@ static unsigned int OnAssocReq(struct adapter *padapter, goto OnAssocReqFail; } - /* now we should check all the fields... */ /* checking SSID */ p = rtw_get_ie(pframe + WLAN_HDR_A3_LEN + ie_offset, _SSID_IE_, &ie_len, @@ -3138,7 +3106,6 @@ static unsigned int OnAssocReq(struct adapter *padapter, pstat->flags |= WLAN_STA_MAYBE_WPS; } - /* AP support WPA/RSN, and sta is going to do WPS, but AP is not ready */ /* that the selected registrar of AP is _FLASE */ if ((psecuritypriv->wpa_psk > 0) && (pstat->flags & (WLAN_STA_WPS|WLAN_STA_MAYBE_WPS))) { @@ -3278,8 +3245,6 @@ static unsigned int OnAssocReq(struct adapter *padapter, else pstat->flags &= ~WLAN_STA_SHORT_PREAMBLE; - - if (status != _STATS_SUCCESSFUL_) goto OnAssocReqFail; @@ -3501,7 +3466,6 @@ static unsigned int OnDeAuth(struct adapter *padapter, associated_clients_update(padapter, updated); } - return _SUCCESS; } else #endif @@ -4097,7 +4061,6 @@ int init_mlme_ext_priv(struct adapter *padapter) pmlmeext->chan_scan_time = SURVEY_TO; pmlmeext->mlmeext_init = true; - pmlmeext->active_keep_alive_check = true; return _SUCCESS; @@ -4230,7 +4193,6 @@ void report_survey_event(struct adapter *padapter, pmlmeext = &padapter->mlmeextpriv; pcmdpriv = &padapter->cmdpriv; - pcmd_obj = kzalloc(sizeof(struct cmd_obj), GFP_ATOMIC); if (!pcmd_obj) return; @@ -4357,10 +4319,8 @@ void report_join_res(struct adapter *padapter, int res) DBG_88E("%s(%d)\n", __func__, res); - rtw_joinbss_event_prehandle(padapter, (u8 *)&pjoinbss_evt->network); - rtw_enqueue_cmd(pcmdpriv, pcmd_obj); } @@ -4406,7 +4366,6 @@ void report_del_sta_event(struct adapter *padapter, unsigned char *MacAddr, ether_addr_copy((unsigned char *)(&(pdel_sta_evt->macaddr)), MacAddr); memcpy((unsigned char *)(pdel_sta_evt->rsvd), (unsigned char *)(&reason), 2); - psta = rtw_get_stainfo(&padapter->stapriv, MacAddr); if (psta) mac_id = (int)psta->mac_id; @@ -4465,7 +4424,6 @@ void report_add_sta_event(struct adapter *padapter, unsigned char *MacAddr, rtw_enqueue_cmd(pcmdpriv, pcmd_obj); } - /**************************************************************************** Following are the event callback functions @@ -4510,7 +4468,6 @@ void update_sta_info(struct adapter *padapter, struct sta_info *psta) if (pmlmepriv->qospriv.qos_option) psta->qos_option = true; - psta->state = _FW_LINKED; } @@ -4545,7 +4502,6 @@ void mlmeext_joinbss_event_callback(struct adapter *padapter, int join_res) } } - /* turn on dynamic functions */ Switch_DM_Func(padapter, DYNAMIC_ALL_FUNC_ENABLE, true); @@ -4651,7 +4607,6 @@ void mlmeext_sta_del_event_callback(struct adapter *padapter) /* SelectChannel(padapter, pmlmeext->cur_channel, pmlmeext->cur_ch_offset); */ set_channel_bwmode(padapter, pmlmeext->cur_channel, pmlmeext->cur_ch_offset, pmlmeext->cur_bwmode); - flush_all_cam_entry(padapter); pmlmeinfo->state = WIFI_FW_NULL_STATE; @@ -4839,7 +4794,6 @@ void survey_timer_hdl(struct timer_list *t) rtw_enqueue_cmd(pcmdpriv, ph2c); } - exit_survey_timer_hdl: return; } @@ -4931,7 +4885,6 @@ u8 createbss_hdl(struct adapter *padapter, u8 *pbuf) struct wlan_bssid_ex *pparm = (struct wlan_bssid_ex *)pbuf; /* u32 initialgain; */ - if (pparm->InfrastructureMode == Ndis802_11APMode) { #ifdef CONFIG_88EU_AP_MODE @@ -5010,7 +4963,6 @@ u8 join_cmd_hdl(struct adapter *padapter, u8 *pbuf) /* set MSR to nolink -> infra. mode */ Set_MSR(padapter, _HW_STATE_STATION_); - rtw_hal_set_hwreg(padapter, HW_VAR_MLME_DISCONNECT, NULL); } @@ -5121,7 +5073,6 @@ u8 disconnect_hdl(struct adapter *padapter, unsigned char *pbuf) rtw_hal_set_hwreg(padapter, HW_VAR_BCN_FUNC, (u8 *)(&val8)); } - /* set MSR to no link state -> infra. mode */ Set_MSR(padapter, _HW_STATE_STATION_); @@ -5394,7 +5345,6 @@ u8 set_tx_beacon_cmd(struct adapter *padapter) u8 res = _SUCCESS; int len_diff = 0; - ph2c = kzalloc(sizeof(struct cmd_obj), GFP_ATOMIC); if (!ph2c) { res = _FAIL; @@ -5418,10 +5368,7 @@ u8 set_tx_beacon_cmd(struct adapter *padapter) res = rtw_enqueue_cmd(pcmdpriv, ph2c); - exit: - - return res; } @@ -5456,7 +5403,6 @@ u8 mlme_evt_hdl(struct adapter *padapter, unsigned char *pbuf) if (peventbuf) { event_callback = wlanevents[evt_code].event_callback; event_callback(padapter, (u8 *)peventbuf); - } _abort_event_: |