diff options
author | 2016-04-11 10:41:07 +0300 | |
---|---|---|
committer | 2016-04-13 08:17:18 +0300 | |
commit | e09b41010ba33a20a87472ee821fa407a5b8da36 (patch) | |
tree | d10dc367189862e7ca5c592f033dc3726e1df4e3 /kernel/drivers/staging/rtl8188eu/core/rtw_mlme.c | |
parent | f93b97fd65072de626c074dbe099a1fff05ce060 (diff) |
These changes are the raw update to linux-4.4.6-rt14. Kernel sources
are taken from kernel.org, and rt patch from the rt wiki download page.
During the rebasing, the following patch collided:
Force tick interrupt and get rid of softirq magic(I70131fb85).
Collisions have been removed because its logic was found on the
source already.
Change-Id: I7f57a4081d9deaa0d9ccfc41a6c8daccdee3b769
Signed-off-by: José Pekkarinen <jose.pekkarinen@nokia.com>
Diffstat (limited to 'kernel/drivers/staging/rtl8188eu/core/rtw_mlme.c')
-rw-r--r-- | kernel/drivers/staging/rtl8188eu/core/rtw_mlme.c | 59 |
1 files changed, 32 insertions, 27 deletions
diff --git a/kernel/drivers/staging/rtl8188eu/core/rtw_mlme.c b/kernel/drivers/staging/rtl8188eu/core/rtw_mlme.c index 6c91aa58d..c1b82f71b 100644 --- a/kernel/drivers/staging/rtl8188eu/core/rtw_mlme.c +++ b/kernel/drivers/staging/rtl8188eu/core/rtw_mlme.c @@ -19,6 +19,7 @@ ******************************************************************************/ #define _RTW_MLME_C_ +#include <linux/ieee80211.h> #include <osdep_service.h> #include <drv_types.h> @@ -141,7 +142,7 @@ struct wlan_network *_rtw_alloc_network(struct mlme_priv *pmlmepriv)/* _queue *f } plist = free_queue->queue.next; - pnetwork = container_of(plist , struct wlan_network, list); + pnetwork = container_of(plist, struct wlan_network, list); list_del_init(&pnetwork->list); @@ -160,7 +161,7 @@ exit: return pnetwork; } -static void _rtw_free_network(struct mlme_priv *pmlmepriv , struct wlan_network *pnetwork, u8 isfreeall) +static void _rtw_free_network(struct mlme_priv *pmlmepriv, struct wlan_network *pnetwork, u8 isfreeall) { u32 curr_time, delta_time; u32 lifetime = SCANQUEUE_LIFETIME; @@ -219,7 +220,7 @@ struct wlan_network *rtw_find_network(struct __queue *scanned_queue, u8 *addr) plist = phead->next; while (plist != phead) { - pnetwork = container_of(plist, struct wlan_network , list); + pnetwork = container_of(plist, struct wlan_network, list); if (!memcmp(addr, pnetwork->network.MacAddress, ETH_ALEN)) break; plist = plist->next; @@ -352,8 +353,8 @@ int is_same_network(struct wlan_bssid_ex *src, struct wlan_bssid_ex *dst) ((!memcmp(src->Ssid.Ssid, dst->Ssid.Ssid, src->Ssid.SsidLength)) == true) && ((s_cap & WLAN_CAPABILITY_IBSS) == (d_cap & WLAN_CAPABILITY_IBSS)) && - ((s_cap & WLAN_CAPABILITY_BSS) == - (d_cap & WLAN_CAPABILITY_BSS))); + ((s_cap & WLAN_CAPABILITY_ESS) == + (d_cap & WLAN_CAPABILITY_ESS))); } struct wlan_network *rtw_get_oldest_wlan_network(struct __queue *scanned_queue) @@ -581,7 +582,7 @@ static int rtw_is_desired_network(struct adapter *adapter, struct wlan_network * } /* TODO: Perry: For Power Management */ -void rtw_atimdone_event_callback(struct adapter *adapter , u8 *pbuf) +void rtw_atimdone_event_callback(struct adapter *adapter, u8 *pbuf) { RT_TRACE(_module_rtl871x_mlme_c_, _drv_err_, ("receive atimdone_evet\n")); return; @@ -614,7 +615,7 @@ void rtw_survey_event_callback(struct adapter *adapter, u8 *pbuf) spin_lock_bh(&(pmlmepriv->scanned_queue.lock)); ibss_wlan = rtw_find_network(&pmlmepriv->scanned_queue, pnetwork->MacAddress); if (ibss_wlan) { - memcpy(ibss_wlan->network.IEs , pnetwork->IEs, 8); + memcpy(ibss_wlan->network.IEs, pnetwork->IEs, 8); spin_unlock_bh(&pmlmepriv->scanned_queue.lock); goto exit; } @@ -638,7 +639,6 @@ exit: void rtw_surveydone_event_callback(struct adapter *adapter, u8 *pbuf) { struct mlme_priv *pmlmepriv = &(adapter->mlmepriv); - struct mlme_ext_priv *pmlmeext; spin_lock_bh(&pmlmepriv->lock); @@ -693,8 +693,8 @@ void rtw_surveydone_event_callback(struct adapter *adapter, u8 *pbuf) pmlmepriv->to_join = false; s_ret = rtw_select_and_join_from_scanned_queue(pmlmepriv); if (_SUCCESS == s_ret) { - mod_timer(&pmlmepriv->assoc_timer, - jiffies + msecs_to_jiffies(MAX_JOIN_TIMEOUT)); + mod_timer(&pmlmepriv->assoc_timer, + jiffies + msecs_to_jiffies(MAX_JOIN_TIMEOUT)); } else if (s_ret == 2) { /* there is no need to wait for join */ _clr_fwstate_(pmlmepriv, _FW_UNDER_LINKING); rtw_indicate_connect(adapter); @@ -704,7 +704,7 @@ void rtw_surveydone_event_callback(struct adapter *adapter, u8 *pbuf) if (--pmlmepriv->to_roaming == 0 || _SUCCESS != rtw_sitesurvey_cmd(adapter, &pmlmepriv->assoc_ssid, 1, NULL, 0)) { pmlmepriv->to_roaming = 0; - rtw_free_assoc_resources(adapter, 1); + rtw_free_assoc_resources(adapter); rtw_indicate_disconnect(adapter); } else { pmlmepriv->to_join = true; @@ -720,15 +720,13 @@ void rtw_surveydone_event_callback(struct adapter *adapter, u8 *pbuf) spin_unlock_bh(&pmlmepriv->lock); rtw_os_xmit_schedule(adapter); - - pmlmeext = &adapter->mlmeextpriv; } -void rtw_dummy_event_callback(struct adapter *adapter , u8 *pbuf) +void rtw_dummy_event_callback(struct adapter *adapter, u8 *pbuf) { } -void rtw_fwdbg_event_callback(struct adapter *adapter , u8 *pbuf) +void rtw_fwdbg_event_callback(struct adapter *adapter, u8 *pbuf) { } @@ -760,7 +758,19 @@ static void free_scanqueue(struct mlme_priv *pmlmepriv) /* *rtw_free_assoc_resources: the caller has to lock pmlmepriv->lock */ -void rtw_free_assoc_resources(struct adapter *adapter, int lock_scanned_queue) +void rtw_free_assoc_resources(struct adapter *adapter) +{ + struct mlme_priv *pmlmepriv = &adapter->mlmepriv; + + spin_lock_bh(&pmlmepriv->scanned_queue.lock); + rtw_free_assoc_resources_locked(adapter); + spin_unlock_bh(&pmlmepriv->scanned_queue.lock); +} + +/* +*rtw_free_assoc_resources_locked: the caller has to lock pmlmepriv->lock +*/ +void rtw_free_assoc_resources_locked(struct adapter *adapter) { struct wlan_network *pwlan = NULL; struct mlme_priv *pmlmepriv = &adapter->mlmepriv; @@ -795,8 +805,6 @@ void rtw_free_assoc_resources(struct adapter *adapter, int lock_scanned_queue) rtw_init_bcmc_stainfo(adapter); } - if (lock_scanned_queue) - spin_lock_bh(&(pmlmepriv->scanned_queue.lock)); pwlan = rtw_find_network(&pmlmepriv->scanned_queue, tgt_network->network.MacAddress); if (pwlan) @@ -807,8 +815,6 @@ void rtw_free_assoc_resources(struct adapter *adapter, int lock_scanned_queue) if ((check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) && (adapter->stapriv.asoc_sta_count == 1))) rtw_free_network_nolock(pmlmepriv, pwlan); - if (lock_scanned_queue) - spin_unlock_bh(&pmlmepriv->scanned_queue.lock); pmlmepriv->key_mask = 0; } @@ -1304,7 +1310,7 @@ void rtw_stadel_event_callback(struct adapter *adapter, u8 *pbuf) rtw_free_uc_swdec_pending_queue(adapter); - rtw_free_assoc_resources(adapter, 1); + rtw_free_assoc_resources(adapter); rtw_indicate_disconnect(adapter); spin_lock_bh(&(pmlmepriv->scanned_queue.lock)); /* remove the network entry in scanned_queue */ @@ -1385,7 +1391,7 @@ void _rtw_join_timeout_handler (unsigned long data) DBG_88E("%s try another roaming\n", __func__); do_join_r = rtw_do_join(adapter); if (_SUCCESS != do_join_r) { - DBG_88E("%s roaming do_join return %d\n", __func__ , do_join_r); + DBG_88E("%s roaming do_join return %d\n", __func__, do_join_r); continue; } break; @@ -1559,7 +1565,7 @@ int rtw_select_and_join_from_scanned_queue(struct mlme_priv *pmlmepriv) rtw_disassoc_cmd(adapter, 0, true); rtw_indicate_disconnect(adapter); - rtw_free_assoc_resources(adapter, 0); + rtw_free_assoc_resources_locked(adapter); } rtw_hal_get_def_var(adapter, HAL_DEF_IS_SUPPORT_ANT_DIV, &(supp_ant_div)); @@ -1703,8 +1709,8 @@ int rtw_restruct_wmm_ie(struct adapter *adapter, u8 *in_ie, u8 *out_ie, uint in_ unsigned int ielength = 0; unsigned int i, j; - i = 12; /* after the fixed IE */ - while (i < in_len) { + /* i = 12; after the fixed IE */ + for (i = 12; i < in_len; i += (in_ie[i + 1] + 2) /* to the next IE element */) { ielength = initial_out_len; if (in_ie[i] == 0xDD && in_ie[i+2] == 0x00 && in_ie[i+3] == 0x50 && in_ie[i+4] == 0xF2 && in_ie[i+5] == 0x02 && i+5 < in_len) { @@ -1720,7 +1726,6 @@ int rtw_restruct_wmm_ie(struct adapter *adapter, u8 *in_ie, u8 *out_ie, uint in_ out_ie[initial_out_len + 8] = 0x00; break; } - i += (in_ie[i+1]+2); /* to the next IE element */ } return ielength; } @@ -2000,7 +2005,7 @@ unsigned int rtw_restructure_ht_ie(struct adapter *padapter, u8 *in_ie, u8 *out_ p = rtw_get_ie(in_ie+12, _HT_ADD_INFO_IE_, &ielen, in_len-12); if (p && (ielen == sizeof(struct ieee80211_ht_addt_info))) { out_len = *pout_len; - rtw_set_ie(out_ie+out_len, _HT_ADD_INFO_IE_, ielen, p+2 , pout_len); + rtw_set_ie(out_ie+out_len, _HT_ADD_INFO_IE_, ielen, p+2, pout_len); } } return phtpriv->ht_option; |