staging:r8188eu: replace cap_* definitions with native kernel WLAN_CAPABILITY_*
authorIvan Safonov <insafonov@gmail.com>
Sun, 14 Mar 2021 09:02:46 +0000 (12:02 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 14 Mar 2021 16:00:07 +0000 (17:00 +0100)
cap_* definitions duplicate WLAN_CAPABILITY_*. Remove cap_* definitions,
improve code consistency.

Signed-off-by: Ivan Safonov <insafonov@gmail.com>
Link: https://lore.kernel.org/r/20210314090247.21181-4-insafonov@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8188eu/core/rtw_ieee80211.c
drivers/staging/rtl8188eu/core/rtw_mlme_ext.c
drivers/staging/rtl8188eu/include/wifi.h

index ec5b8be..7a706fe 100644 (file)
@@ -223,13 +223,13 @@ int rtw_generate_ie(struct registry_priv *pregistrypriv)
        /* capability info */
        *(u16 *)ie = 0;
 
-       *(__le16 *)ie |= cpu_to_le16(cap_IBSS);
+       *(__le16 *)ie |= cpu_to_le16(WLAN_CAPABILITY_IBSS);
 
        if (pregistrypriv->preamble == PREAMBLE_SHORT)
-               *(__le16 *)ie |= cpu_to_le16(cap_ShortPremble);
+               *(__le16 *)ie |= cpu_to_le16(WLAN_CAPABILITY_SHORT_PREAMBLE);
 
        if (pdev_network->Privacy)
-               *(__le16 *)ie |= cpu_to_le16(cap_Privacy);
+               *(__le16 *)ie |= cpu_to_le16(WLAN_CAPABILITY_PRIVACY);
 
        sz += 2;
        ie += 2;
index bee19d5..50d3c36 100644 (file)
@@ -2188,7 +2188,7 @@ static void start_create_ibss(struct adapter *padapter)
        /* update capability */
        caps = rtw_get_capability(pnetwork);
        update_capinfo(padapter, caps);
-       if (caps & cap_IBSS) {/* adhoc master */
+       if (caps & WLAN_CAPABILITY_IBSS) {/* adhoc master */
                val8 = 0xcf;
                rtw_hal_set_hwreg(padapter, HW_VAR_SEC_CFG, (u8 *)(&val8));
 
@@ -2240,7 +2240,7 @@ static void start_clnt_join(struct adapter *padapter)
        /* update capability */
        caps = rtw_get_capability(pnetwork);
        update_capinfo(padapter, caps);
-       if (caps & cap_ESS) {
+       if (caps & WLAN_CAPABILITY_ESS) {
                Set_MSR(padapter, WIFI_FW_STATION_STATE);
 
                val8 = (pmlmeinfo->auth_algo == dot11AuthAlgrthm_8021X) ? 0xcc : 0xcf;
@@ -2258,7 +2258,7 @@ static void start_clnt_join(struct adapter *padapter)
                          msecs_to_jiffies((REAUTH_TO * REAUTH_LIMIT) + (REASSOC_TO * REASSOC_LIMIT) + beacon_timeout));
 
                pmlmeinfo->state = WIFI_FW_AUTH_NULL | WIFI_FW_STATION_STATE;
-       } else if (caps & cap_IBSS) { /* adhoc client */
+       } else if (caps & WLAN_CAPABILITY_IBSS) { /* adhoc client */
                Set_MSR(padapter, WIFI_FW_ADHOC_STATE);
 
                val8 = 0xcf;
index f033596..d65a0a8 100644 (file)
@@ -238,18 +238,6 @@ static inline int IsFrameTypeCtrl(unsigned char *pframe)
 #define AUTH_ODD_TO            0
 #define AUTH_EVEN_TO           1
 
-#define cap_ESS                BIT(0)
-#define cap_IBSS       BIT(1)
-#define cap_CFPollable BIT(2)
-#define cap_CFRequest  BIT(3)
-#define cap_Privacy    BIT(4)
-#define cap_ShortPremble BIT(5)
-#define cap_PBCC       BIT(6)
-#define cap_ChAgility  BIT(7)
-#define cap_SpecMgmt   BIT(8)
-#define cap_QoSi       BIT(9)
-#define cap_ShortSlot  BIT(10)
-
 /*-----------------------------------------------------------------------------
                                Below is the definition for 802.11i / 802.1x
 ------------------------------------------------------------------------------*/