summaryrefslogtreecommitdiff
path: root/drivers/staging/r8188eu/core/rtw_wlan_util.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2022-12-16 03:27:03 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2022-12-16 03:27:03 -0800
commitb83a7080d30032cf70832bc2bb04cc342e203b88 (patch)
tree911b1a55157355655fe451b7e0900c9e0a34144c /drivers/staging/r8188eu/core/rtw_wlan_util.c
parent58bcac11fd94f950abc7b8466c5ceac7be07a00e (diff)
parent37aa6b98237082a4bf882b4d986329b94ebd447d (diff)
Merge tag 'staging-6.2-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging
Pull staging driver updates from Greg KH: "Here is the large set of staging driver changes for 6.2-rc1. Another round of cleanups for staging drivers with no big additions. Overall more lines were removed than added, always a nice sign, with nothing happening in here other than general coding style cleanups and minor fixes in the drivers. Full, boring, details are in the shortlog. All of these have been in linux-next for a while with no reported problems" * tag 'staging-6.2-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: (253 commits) vme: Use root_device_register() not underlined version staging: rtl8192e: Fix spelling mistake "ContryIE" -> "CountryIE" vme: Fix error not catched in fake_init() staging: vme_user: remove multiple blank lines staging: r8188eu: use subtype helper in rtw_check_bcn_info staging: r8188eu: use subtype helpers in collect_bss_info staging: r8188eu: remove unused da parameter staging: r8188eu: merge two probereq_p2p functions staging: r8188eu: simplify err handling for unknown station staging: r8188eu: handle the non-ap case first staging: r8188eu: move bBusyTraffic update staging: r8188eu: read reason code from ieee80211_mgmt staging: r8188eu: use ieee80211_mgmt to parse addresses staging: r8188eu: remove a variable staging: r8188eu: simplify error handling for missing station staging: r8188eu: stop beacon processing if kmalloc fails staging: r8188eu: exit if beacon is not from our bss staging: r8188eu: simplify update_sta_support_rate params staging: r8188eu: use ie buffer in update_beacon_info staging: r8188eu: pass only ies to process_p2p_ps_ie ...
Diffstat (limited to 'drivers/staging/r8188eu/core/rtw_wlan_util.c')
-rw-r--r--drivers/staging/r8188eu/core/rtw_wlan_util.c36
1 files changed, 16 insertions, 20 deletions
diff --git a/drivers/staging/r8188eu/core/rtw_wlan_util.c b/drivers/staging/r8188eu/core/rtw_wlan_util.c
index e50631848cab..f1ebb5358cb9 100644
--- a/drivers/staging/r8188eu/core/rtw_wlan_util.c
+++ b/drivers/staging/r8188eu/core/rtw_wlan_util.c
@@ -331,35 +331,35 @@ u16 get_beacon_interval(struct wlan_bssid_ex *bss)
return le16_to_cpu(val);
}
-int is_client_associated_to_ap(struct adapter *padapter)
+bool r8188eu_is_client_associated_to_ap(struct adapter *padapter)
{
struct mlme_ext_priv *pmlmeext;
struct mlme_ext_info *pmlmeinfo;
if (!padapter)
- return _FAIL;
+ return false;
pmlmeext = &padapter->mlmeextpriv;
pmlmeinfo = &pmlmeext->mlmext_info;
if ((pmlmeinfo->state & WIFI_FW_ASSOC_SUCCESS) && ((pmlmeinfo->state & 0x03) == WIFI_FW_STATION_STATE))
return true;
- else
- return _FAIL;
+
+ return false;
}
-int is_client_associated_to_ibss(struct adapter *padapter)
+bool r8188eu_is_client_associated_to_ibss(struct adapter *padapter)
{
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info;
if ((pmlmeinfo->state & WIFI_FW_ASSOC_SUCCESS) && ((pmlmeinfo->state & 0x03) == WIFI_FW_ADHOC_STATE))
return true;
- else
- return _FAIL;
+
+ return false;
}
-int is_IBSS_empty(struct adapter *padapter)
+bool r8188eu_is_ibss_empty(struct adapter *padapter)
{
unsigned int i;
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
@@ -367,7 +367,7 @@ int is_IBSS_empty(struct adapter *padapter)
for (i = IBSS_START_MAC_ID; i < NUM_STA; i++) {
if (pmlmeinfo->FW_sta_info[i].status == 1)
- return _FAIL;
+ return false;
}
return true;
}
@@ -874,9 +874,10 @@ void VCS_update(struct adapter *padapter, struct sta_info *psta)
int rtw_check_bcn_info(struct adapter *Adapter, u8 *pframe, u32 packet_len)
{
+ struct ieee80211_mgmt *mgmt = (struct ieee80211_mgmt *)pframe;
unsigned int len;
unsigned char *p;
- unsigned short val16, subtype;
+ unsigned short val16;
struct wlan_network *cur_network = &Adapter->mlmepriv.cur_network;
/* u8 wpa_ie[255], rsn_ie[255]; */
u16 wpa_len = 0, rsn_len = 0;
@@ -893,7 +894,7 @@ int rtw_check_bcn_info(struct adapter *Adapter, u8 *pframe, u32 packet_len)
unsigned short ht_cap_info;
unsigned char ht_info_infos_0;
- if (!is_client_associated_to_ap(Adapter))
+ if (!r8188eu_is_client_associated_to_ap(Adapter))
return true;
len = packet_len - sizeof(struct ieee80211_hdr_3addr);
@@ -908,9 +909,7 @@ int rtw_check_bcn_info(struct adapter *Adapter, u8 *pframe, u32 packet_len)
if (!bssid)
return _FAIL;
- subtype = GetFrameSubType(pframe) >> 4;
-
- if (subtype == WIFI_BEACON)
+ if (ieee80211_is_beacon(mgmt->frame_control))
bssid->Reserved[0] = 1;
bssid->Length = sizeof(struct wlan_bssid_ex) - MAX_IE_SZ + len;
@@ -1035,16 +1034,13 @@ _mismatch:
return _FAIL;
}
-void update_beacon_info(struct adapter *padapter, u8 *pframe, uint pkt_len, struct sta_info *psta)
+void update_beacon_info(struct adapter *padapter, u8 *ie_ptr, uint ie_len, struct sta_info *psta)
{
unsigned int i;
- unsigned int len;
struct ndis_802_11_var_ie *pIE;
- len = pkt_len - (_BEACON_IE_OFFSET_ + WLAN_HDR_A3_LEN);
-
- for (i = 0; i < len;) {
- pIE = (struct ndis_802_11_var_ie *)(pframe + (_BEACON_IE_OFFSET_ + WLAN_HDR_A3_LEN) + i);
+ for (i = 0; i < ie_len;) {
+ pIE = (struct ndis_802_11_var_ie *)(ie_ptr + i);
switch (pIE->ElementID) {
case _HT_EXTRA_INFO_IE_: /* HT info */