staging: rtl8723au: Move rtw_set_802_11_add_wep23a() to ioctl_cfg80211.c
authorJes Sorensen <Jes.Sorensen@redhat.com>
Wed, 21 May 2014 07:37:36 +0000 (09:37 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 23 May 2014 07:27:42 +0000 (16:27 +0900)
This is only called from ioctl_cfg80211.c so we can move it here and
declare it static.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8723au/core/rtw_ioctl_set.c
drivers/staging/rtl8723au/include/rtw_ioctl_set.h
drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c

index 19e2e68ff85cbc0f466c8aab67114720b128dee0..99a662d83fc1f990adf0ceed1a520a601d887494 100644 (file)
@@ -360,82 +360,6 @@ int rtw_set_802_11_authentication_mode23a(struct rtw_adapter* padapter,
        return res;
 }
 
-int rtw_set_802_11_add_wep23a(struct rtw_adapter* padapter,
-                         struct ndis_802_11_wep *wep)
-{
-       u8 bdefaultkey;
-       u8 btransmitkey;
-       int keyid, res;
-       struct security_priv *psecuritypriv = &padapter->securitypriv;
-
-       bdefaultkey = (wep->KeyIndex & 0x40000000) > 0 ? false : true;
-       btransmitkey = (wep->KeyIndex & 0x80000000) > 0 ? true  : false;
-       keyid = wep->KeyIndex & 0x3fffffff;
-
-       if (keyid >= 4) {
-               RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_err_,
-                        ("MgntActrtw_set_802_11_add_wep23a:keyid>4 =>fail\n"));
-               res = _FAIL;
-               goto exit;
-       }
-
-       switch (wep->KeyLength)
-       {
-       case 5:
-               psecuritypriv->dot11PrivacyAlgrthm = WLAN_CIPHER_SUITE_WEP40;
-               RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_info_,
-                        ("MgntActrtw_set_802_11_add_wep23a:wep->KeyLength = 5\n"));
-               break;
-       case 13:
-               psecuritypriv->dot11PrivacyAlgrthm = WLAN_CIPHER_SUITE_WEP104;
-               RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_info_,
-                        ("MgntActrtw_set_802_11_add_wep23a:wep->KeyLength = 13\n"));
-               break;
-       default:
-               psecuritypriv->dot11PrivacyAlgrthm = 0;
-               RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_info_,
-                        ("MgntActrtw_set_802_11_add_wep23a:wep->KeyLength!= 5 "
-                         "or 13\n"));
-               res = _FAIL;
-               goto exit;
-       }
-
-       RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_info_,
-                ("rtw_set_802_11_add_wep23a:befor memcpy, wep->KeyLength = 0x%x "
-                 "wep->KeyIndex = 0x%x  keyid =%x\n",
-                 wep->KeyLength, wep->KeyIndex, keyid));
-
-       memcpy(&psecuritypriv->wep_key[keyid].key, &wep->KeyMaterial,
-              wep->KeyLength);
-
-       psecuritypriv->wep_key[keyid].keylen = wep->KeyLength;
-
-       psecuritypriv->dot11PrivacyKeyIndex = keyid;
-
-       RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_info_,
-                ("rtw_set_802_11_add_wep23a:security key material : "
-                 "%x %x %x %x %x %x %x %x %x %x %x %x %x\n",
-                 psecuritypriv->wep_key[keyid].key[0],
-                 psecuritypriv->wep_key[keyid].key[1],
-                 psecuritypriv->wep_key[keyid].key[2],
-                 psecuritypriv->wep_key[keyid].key[3],
-                 psecuritypriv->wep_key[keyid].key[4],
-                 psecuritypriv->wep_key[keyid].key[5],
-                 psecuritypriv->wep_key[keyid].key[6],
-                 psecuritypriv->wep_key[keyid].key[7],
-                 psecuritypriv->wep_key[keyid].key[8],
-                 psecuritypriv->wep_key[keyid].key[9],
-                 psecuritypriv->wep_key[keyid].key[10],
-                 psecuritypriv->wep_key[keyid].key[11],
-                 psecuritypriv->wep_key[keyid].key[12]));
-
-       res = rtw_set_key23a(padapter, psecuritypriv, keyid, 1);
-
-exit:
-
-       return res;
-}
-
 /*
 * rtw_get_cur_max_rate23a -
 * @adapter: pointer to _adapter structure
index 637f33b0c2dcf5cda9a40aff95ef472fb5299fb9..040543bff1b21f7fed0d76656c629ca94ab413f6 100644 (file)
@@ -19,8 +19,6 @@
 
 int rtw_set_802_11_authentication_mode23a(struct rtw_adapter *pdapter,
                                          enum ndis_802_11_auth_mode authmode);
-int rtw_set_802_11_add_wep23a(struct rtw_adapter * padapter,
-                             struct ndis_802_11_wep *wep);
 int rtw_set_802_11_bssid23a_list_scan(struct rtw_adapter *padapter,
                                      struct cfg80211_ssid *pssid,
                                      int ssid_max_num);
index 08d6b3472bf6af72219283a522df3f8f7ee7f549..d89b400bc683ea517f4a081e17374ba61c6bf23b 100644 (file)
@@ -1935,6 +1935,81 @@ exit:
        return ret;
 }
 
+static int rtw_cfg80211_add_wep(struct rtw_adapter* padapter,
+                               struct ndis_802_11_wep *wep)
+{
+       u8 bdefaultkey;
+       u8 btransmitkey;
+       int keyid, res;
+       struct security_priv *psecuritypriv = &padapter->securitypriv;
+
+       bdefaultkey = (wep->KeyIndex & 0x40000000) > 0 ? false : true;
+       btransmitkey = (wep->KeyIndex & 0x80000000) > 0 ? true  : false;
+       keyid = wep->KeyIndex & 0x3fffffff;
+
+       if (keyid >= 4) {
+               RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_err_,
+                        ("%s:keyid>4 =>fail\n", __func__));
+               res = _FAIL;
+               goto exit;
+       }
+
+       switch (wep->KeyLength)
+       {
+       case 5:
+               psecuritypriv->dot11PrivacyAlgrthm = WLAN_CIPHER_SUITE_WEP40;
+               RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_info_,
+                        ("%s:wep->KeyLength = 5\n", __func__));
+               break;
+       case 13:
+               psecuritypriv->dot11PrivacyAlgrthm = WLAN_CIPHER_SUITE_WEP104;
+               RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_info_,
+                        ("%s:wep->KeyLength = 13\n", __func__));
+               break;
+       default:
+               psecuritypriv->dot11PrivacyAlgrthm = 0;
+               RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_info_,
+                        ("%s:wep->KeyLength!= 5 or 13\n", __func__));
+               res = _FAIL;
+               goto exit;
+       }
+
+       RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_info_,
+                ("%s:before memcpy, wep->KeyLength = 0x%x "
+                 "wep->KeyIndex = 0x%x  keyid =%x\n", __func__,
+                 wep->KeyLength, wep->KeyIndex, keyid));
+
+       memcpy(&psecuritypriv->wep_key[keyid].key, &wep->KeyMaterial,
+              wep->KeyLength);
+
+       psecuritypriv->wep_key[keyid].keylen = wep->KeyLength;
+
+       psecuritypriv->dot11PrivacyKeyIndex = keyid;
+
+       RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_info_,
+                ("%s:security key material : "
+                 "%x %x %x %x %x %x %x %x %x %x %x %x %x\n", __func__,
+                 psecuritypriv->wep_key[keyid].key[0],
+                 psecuritypriv->wep_key[keyid].key[1],
+                 psecuritypriv->wep_key[keyid].key[2],
+                 psecuritypriv->wep_key[keyid].key[3],
+                 psecuritypriv->wep_key[keyid].key[4],
+                 psecuritypriv->wep_key[keyid].key[5],
+                 psecuritypriv->wep_key[keyid].key[6],
+                 psecuritypriv->wep_key[keyid].key[7],
+                 psecuritypriv->wep_key[keyid].key[8],
+                 psecuritypriv->wep_key[keyid].key[9],
+                 psecuritypriv->wep_key[keyid].key[10],
+                 psecuritypriv->wep_key[keyid].key[11],
+                 psecuritypriv->wep_key[keyid].key[12]));
+
+       res = rtw_set_key23a(padapter, psecuritypriv, keyid, 1);
+
+exit:
+
+       return res;
+}
+
 static int cfg80211_rtw_connect(struct wiphy *wiphy, struct net_device *ndev,
                                struct cfg80211_connect_params *sme)
 {
@@ -2152,7 +2227,7 @@ static int cfg80211_rtw_connect(struct wiphy *wiphy, struct net_device *ndev,
 
                memcpy(pwep->KeyMaterial, (void *)sme->key, pwep->KeyLength);
 
-               if (rtw_set_802_11_add_wep23a(padapter, pwep) != _SUCCESS)
+               if (rtw_cfg80211_add_wep(padapter, pwep) != _SUCCESS)
                        ret = -EOPNOTSUPP;
 
                kfree(pwep);