staging: rtl8712: remove duplicate struct
authorJoshua Clayton <stillcompiling@gmail.com>
Thu, 6 Aug 2015 00:17:18 +0000 (17:17 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 7 Aug 2015 22:14:03 +0000 (15:14 -0700)
struct ndis_wlan_bssid_ex is a doppelganger of struct wlan_bssid_ex,
and is used about a third as often.

Switch all instances to wlan_bssid_ex, and remove ndis_wlan_bssid_ex

This also gets rid of a use of typedef NDIS_802_11_RATES_EX

Signed-off-by: Joshua Clayton <stillcompiling@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8712/rtl871x_cmd.c
drivers/staging/rtl8712/rtl871x_event.h
drivers/staging/rtl8712/rtl871x_ioctl_linux.c
drivers/staging/rtl8712/rtl871x_mlme.c
drivers/staging/rtl8712/rtl871x_mlme.h
drivers/staging/rtl8712/rtl871x_mp_ioctl.c
drivers/staging/rtl8712/wlan_bssdef.h

index f07050ddd82d22cb2969f5fd62c9ab887df7158d..06d9844ac7228aa2d346dac24314a7b4d8899572 100644 (file)
@@ -456,9 +456,7 @@ u8 r8712_createbss_cmd(struct _adapter *padapter)
        INIT_LIST_HEAD(&pcmd->list);
        pcmd->cmdcode = _CreateBss_CMD_;
        pcmd->parmbuf = (unsigned char *)pdev_network;
-       pcmd->cmdsz = r8712_get_ndis_wlan_bssid_ex_sz((
-                       struct ndis_wlan_bssid_ex *)
-                       pdev_network);
+       pcmd->cmdsz = r8712_get_ndis_wlan_bssid_ex_sz(pdev_network);
        pcmd->rsp = NULL;
        pcmd->rspsz = 0;
        /* notes: translate IELength & Length after assign to cmdsz; */
@@ -471,7 +469,7 @@ u8 r8712_createbss_cmd(struct _adapter *padapter)
 
 u8 r8712_joinbss_cmd(struct _adapter  *padapter, struct wlan_network *pnetwork)
 {
-       struct ndis_wlan_bssid_ex *psecnetwork;
+       struct wlan_bssid_ex *psecnetwork;
        struct cmd_obj          *pcmd;
        struct cmd_priv         *pcmdpriv = &padapter->cmdpriv;
        struct mlme_priv        *pmlmepriv = &padapter->mlmepriv;
@@ -502,7 +500,7 @@ u8 r8712_joinbss_cmd(struct _adapter  *padapter, struct wlan_network *pnetwork)
                        break;
                }
        }
-       psecnetwork = (struct ndis_wlan_bssid_ex *)&psecuritypriv->sec_bss;
+       psecnetwork = &psecuritypriv->sec_bss;
        if (psecnetwork == NULL) {
                kfree(pcmd);
                return _FAIL;
@@ -894,8 +892,7 @@ void r8712_createbss_cmd_callback(struct _adapter *padapter,
        struct sta_info *psta = NULL;
        struct wlan_network *pwlan = NULL;
        struct  mlme_priv *pmlmepriv = &padapter->mlmepriv;
-       struct ndis_wlan_bssid_ex *pnetwork = (struct ndis_wlan_bssid_ex *)
-                                             pcmd->parmbuf;
+       struct wlan_bssid_ex *pnetwork = (struct wlan_bssid_ex *)pcmd->parmbuf;
        struct wlan_network *tgt_network = &(pmlmepriv->cur_network);
 
        if (pcmd->res != H2C_SUCCESS)
index e03ee90d2870888c732f846b4d6567cace7ed8f9..697c8d735150eac0bf1dd9877038b314c541b797 100644 (file)
@@ -36,7 +36,7 @@
  * Used to report a bss has been scanned
 */
 struct survey_event    {
-       struct ndis_wlan_bssid_ex bss;
+       struct wlan_bssid_ex bss;
 };
 
 /*
index 3388f971fb486ca766db532a4035ecac5600f814..4f5f69c950ccba93ded3a8c0d96c45467585af0a 100644 (file)
@@ -634,7 +634,7 @@ static int r8711_wx_get_name(struct net_device *dev,
        char *p;
        u8 ht_cap = false;
        struct  mlme_priv       *pmlmepriv = &(padapter->mlmepriv);
-       struct ndis_wlan_bssid_ex  *pcur_bss = &pmlmepriv->cur_network.network;
+       struct wlan_bssid_ex *pcur_bss = &pmlmepriv->cur_network.network;
        NDIS_802_11_RATES_EX *prates = NULL;
 
        if (check_fwstate(pmlmepriv, _FW_LINKED|WIFI_ADHOC_MASTER_STATE) ==
@@ -723,7 +723,7 @@ static int r8711_wx_get_freq(struct net_device *dev,
 {
        struct _adapter *padapter = netdev_priv(dev);
        struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
-       struct ndis_wlan_bssid_ex *pcur_bss = &pmlmepriv->cur_network.network;
+       struct wlan_bssid_ex *pcur_bss = &pmlmepriv->cur_network.network;
 
        if (check_fwstate(pmlmepriv, _FW_LINKED) == true) {
                wrqu->freq.m = ieee80211_wlan_frequencies[
@@ -1111,7 +1111,7 @@ static int r8711_wx_get_wap(struct net_device *dev,
 {
        struct _adapter *padapter = netdev_priv(dev);
        struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
-       struct ndis_wlan_bssid_ex *pcur_bss = &pmlmepriv->cur_network.network;
+       struct wlan_bssid_ex *pcur_bss = &pmlmepriv->cur_network.network;
 
        wrqu->ap_addr.sa_family = ARPHRD_ETHER;
        if (check_fwstate(pmlmepriv, _FW_LINKED | WIFI_ADHOC_MASTER_STATE |
@@ -1327,7 +1327,7 @@ static int r8711_wx_get_essid(struct net_device *dev,
 {
        struct _adapter *padapter = netdev_priv(dev);
        struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
-       struct ndis_wlan_bssid_ex *pcur_bss = &pmlmepriv->cur_network.network;
+       struct wlan_bssid_ex *pcur_bss = &pmlmepriv->cur_network.network;
        u32 len, ret = 0;
 
        if (check_fwstate(pmlmepriv, _FW_LINKED|WIFI_ADHOC_MASTER_STATE)) {
@@ -1419,7 +1419,7 @@ static int r8711_wx_get_rate(struct net_device *dev,
 {
        struct _adapter *padapter = netdev_priv(dev);
        struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
-       struct ndis_wlan_bssid_ex *pcur_bss = &pmlmepriv->cur_network.network;
+       struct wlan_bssid_ex *pcur_bss = &pmlmepriv->cur_network.network;
        struct ieee80211_ht_cap *pht_capie;
        unsigned char rf_type = padapter->registrypriv.rf_config;
        int i;
index 6b3451f7017bab5790700b095d7bfb3fc694f31e..7af96993c6a58724022943a2924ef4777f550e24 100644 (file)
@@ -208,7 +208,7 @@ void r8712_generate_random_ibss(u8 *pibss)
        pibss[5] = (u8)((curtime>>16) & 0xff);
 }
 
-uint r8712_get_ndis_wlan_bssid_ex_sz(struct ndis_wlan_bssid_ex *bss)
+uint r8712_get_ndis_wlan_bssid_ex_sz(struct wlan_bssid_ex *bss)
 {
        return sizeof(*bss) + bss->IELength - MAX_IE_SZ;
 }
@@ -276,8 +276,8 @@ int r8712_is_same_ibss(struct _adapter *adapter, struct wlan_network *pnetwork)
 
 }
 
-static int is_same_network(struct ndis_wlan_bssid_ex *src,
-                          struct ndis_wlan_bssid_ex *dst)
+static int is_same_network(struct wlan_bssid_ex *src,
+                          struct wlan_bssid_ex *dst)
 {
         u16 s_cap, d_cap;
 
@@ -322,8 +322,8 @@ struct      wlan_network *r8712_get_oldest_wlan_network(
        return oldest;
 }
 
-static void update_network(struct ndis_wlan_bssid_ex *dst,
-                          struct ndis_wlan_bssid_ex *src,
+static void update_network(struct wlan_bssid_ex *dst,
+                          struct wlan_bssid_ex *src,
                           struct _adapter *padapter)
 {
        u32 last_evm = 0, tmpVal;
@@ -360,7 +360,7 @@ static void update_network(struct ndis_wlan_bssid_ex *dst,
 }
 
 static void update_current_network(struct _adapter *adapter,
-                                  struct ndis_wlan_bssid_ex *pnetwork)
+                                  struct wlan_bssid_ex *pnetwork)
 {
        struct mlme_priv *pmlmepriv = &adapter->mlmepriv;
 
@@ -378,7 +378,7 @@ static void update_current_network(struct _adapter *adapter,
 Caller must hold pmlmepriv->lock first.
 */
 static void update_scanned_network(struct _adapter *adapter,
-                           struct ndis_wlan_bssid_ex *target)
+                           struct wlan_bssid_ex *target)
 {
        struct list_head *plist, *phead;
 
@@ -441,7 +441,7 @@ static void update_scanned_network(struct _adapter *adapter,
 }
 
 static void rtl8711_add_network(struct _adapter *adapter,
-                        struct ndis_wlan_bssid_ex *pnetwork)
+                        struct wlan_bssid_ex *pnetwork)
 {
        unsigned long irqL;
        struct mlme_priv *pmlmepriv = &(((struct _adapter *)adapter)->mlmepriv);
@@ -497,10 +497,10 @@ void r8712_survey_event_callback(struct _adapter *adapter, u8 *pbuf)
 {
        unsigned long flags;
        u32 len;
-       struct ndis_wlan_bssid_ex *pnetwork;
+       struct wlan_bssid_ex *pnetwork;
        struct mlme_priv *pmlmepriv = &adapter->mlmepriv;
 
-       pnetwork = (struct ndis_wlan_bssid_ex *)pbuf;
+       pnetwork = (struct wlan_bssid_ex *)pbuf;
 #ifdef __BIG_ENDIAN
        /* endian_convert */
        pnetwork->Length = le32_to_cpu(pnetwork->Length);
@@ -1658,8 +1658,7 @@ void r8712_update_registrypriv_dev_network(struct _adapter *adapter)
         */
        sz = r8712_generate_ie(pregistrypriv);
        pdev_network->IELength = sz;
-       pdev_network->Length = r8712_get_ndis_wlan_bssid_ex_sz(
-                             (struct ndis_wlan_bssid_ex *)pdev_network);
+       pdev_network->Length = r8712_get_ndis_wlan_bssid_ex_sz(pdev_network);
 }
 
 /*the function is at passive_level*/
index 42bd0bf8a8168b30d181eff560c6f86e5d522498..47bb9c5e9708e5e33394c4e3998366394b59cc6b 100644 (file)
@@ -202,7 +202,7 @@ sint r8712_set_key(struct _adapter *adapter,
                   struct security_priv *psecuritypriv, sint keyid);
 sint r8712_set_auth(struct _adapter *adapter,
                    struct security_priv *psecuritypriv);
-uint r8712_get_ndis_wlan_bssid_ex_sz(struct ndis_wlan_bssid_ex *bss);
+uint r8712_get_ndis_wlan_bssid_ex_sz(struct wlan_bssid_ex *bss);
 void r8712_generate_random_ibss(u8 *pibss);
 u8 *r8712_get_capability_from_ie(u8 *ie);
 struct wlan_network *r8712_get_oldest_wlan_network(
index 0b5461208eb902637c2179d0a9782ccb5eb8b75f..c77b63affdc5edcb9fac4933c587720989897abb 100644 (file)
@@ -160,13 +160,13 @@ static int mp_start_test(struct _adapter *padapter)
        struct mp_priv *pmppriv = &padapter->mppriv;
        struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
        struct wlan_network *tgt_network = &pmlmepriv->cur_network;
-       struct ndis_wlan_bssid_ex bssid;
+       struct wlan_bssid_ex bssid;
        struct sta_info *psta;
        unsigned long length;
        unsigned long irqL;
        int res = _SUCCESS;
 
-       /* 3 1. initialize a new struct ndis_wlan_bssid_ex */
+       /* 3 1. initialize a new struct wlan_bssid_ex */
        memcpy(bssid.MacAddress, pmppriv->network_macaddr, ETH_ALEN);
        bssid.Ssid.SsidLength = 16;
        memcpy(bssid.Ssid.Ssid, (unsigned char *)"mp_pseudo_adhoc",
index 8c5d6e7f82d2b808d313aee21a0d0418176f3d43..cd3e62a20161b1806e6a141c080ddf82ba0dc0eb 100644 (file)
@@ -83,7 +83,7 @@ struct NDIS_802_11_FIXED_IEs {
        u16 Capabilities;
 };
 
-struct ndis_wlan_bssid_ex {
+struct wlan_bssid_ex {
        u32 Length;
        unsigned char  MacAddress[6];
        u8  Reserved[2];
@@ -203,7 +203,7 @@ struct      wlan_network {
        unsigned int    last_scanned; /*timestamp for the network */
        int     aid;            /*will only be valid when a BSS is joined. */
        int     join_res;
-       struct ndis_wlan_bssid_ex network; /*must be the last item */
+       struct wlan_bssid_ex network; /*must be the last item */
 };
 
 enum VRTL_CARRIER_SENSE {
@@ -234,24 +234,5 @@ enum UAPSD_MAX_SP {
 #define NUM_PRE_AUTH_KEY 16
 #define NUM_PMKID_CACHE NUM_PRE_AUTH_KEY
 
-/*
- *     WPA2
- */
-struct wlan_bssid_ex {
-       u32 Length;
-       unsigned char  MacAddress[6];
-       u8  Reserved[2];
-       struct ndis_802_11_ssid  Ssid;
-       u32 Privacy;
-       s32 Rssi;
-       enum NDIS_802_11_NETWORK_TYPE  NetworkTypeInUse;
-       struct NDIS_802_11_CONFIGURATION  Configuration;
-       enum NDIS_802_11_NETWORK_INFRASTRUCTURE  InfrastructureMode;
-       NDIS_802_11_RATES_EX  SupportedRates;
-       u32 IELength;
-       u8  IEs[MAX_IE_SZ];     /* (timestamp, beacon interval, and capability
-                                * information) */
-};
-
 #endif /* #ifndef WLAN_BSSDEF_H_ */