@@ -90,8 +90,8 @@ mwifiex_is_alg_wep(u32 cipher)
9090 int alg = 0 ;
9191
9292 switch (cipher ) {
93- case MWIFIEX_ENCRYPTION_MODE_WEP40 :
94- case MWIFIEX_ENCRYPTION_MODE_WEP104 :
93+ case WLAN_CIPHER_SUITE_WEP40 :
94+ case WLAN_CIPHER_SUITE_WEP104 :
9595 alg = 1 ;
9696 break ;
9797 default :
@@ -101,55 +101,6 @@ mwifiex_is_alg_wep(u32 cipher)
101101 return alg ;
102102}
103103
104- /*
105- * This function maps the given cipher type into driver specific type.
106- *
107- * It also sets a flag to indicate whether WPA is enabled or not.
108- *
109- * The mapping table is -
110- * Input cipher Driver cipher type WPA enabled?
111- * ------------ ------------------ ------------
112- * IW_AUTH_CIPHER_NONE MWIFIEX_ENCRYPTION_MODE_NONE No
113- * WLAN_CIPHER_SUITE_WEP40 MWIFIEX_ENCRYPTION_MODE_WEP40 No
114- * WLAN_CIPHER_SUITE_WEP104 MWIFIEX_ENCRYPTION_MODE_WEP104 No
115- * WLAN_CIPHER_SUITE_TKIP MWIFIEX_ENCRYPTION_MODE_TKIP Yes
116- * WLAN_CIPHER_SUITE_CCMP MWIFIEX_ENCRYPTION_MODE_CCMP Yes
117- * Others -1 No
118- */
119- static int
120- mwifiex_get_mwifiex_cipher (u32 cipher , int * wpa_enabled )
121- {
122- int encrypt_mode ;
123-
124- if (wpa_enabled )
125- * wpa_enabled = 0 ;
126- switch (cipher ) {
127- case IW_AUTH_CIPHER_NONE :
128- encrypt_mode = MWIFIEX_ENCRYPTION_MODE_NONE ;
129- break ;
130- case WLAN_CIPHER_SUITE_WEP40 :
131- encrypt_mode = MWIFIEX_ENCRYPTION_MODE_WEP40 ;
132- break ;
133- case WLAN_CIPHER_SUITE_WEP104 :
134- encrypt_mode = MWIFIEX_ENCRYPTION_MODE_WEP104 ;
135- break ;
136- case WLAN_CIPHER_SUITE_TKIP :
137- encrypt_mode = MWIFIEX_ENCRYPTION_MODE_TKIP ;
138- if (wpa_enabled )
139- * wpa_enabled = 1 ;
140- break ;
141- case WLAN_CIPHER_SUITE_CCMP :
142- encrypt_mode = MWIFIEX_ENCRYPTION_MODE_CCMP ;
143- if (wpa_enabled )
144- * wpa_enabled = 1 ;
145- break ;
146- default :
147- encrypt_mode = -1 ;
148- }
149-
150- return encrypt_mode ;
151- }
152-
153104/*
154105 * This function retrieves the private structure from kernel wiphy structure.
155106 */
@@ -252,13 +203,9 @@ mwifiex_cfg80211_add_key(struct wiphy *wiphy, struct net_device *netdev,
252203{
253204 struct mwifiex_private * priv = mwifiex_cfg80211_get_priv (wiphy );
254205 int ret = 0 ;
255- int encrypt_mode ;
256-
257- encrypt_mode = mwifiex_get_mwifiex_cipher (params -> cipher , NULL );
258206
259- if (encrypt_mode != -1 )
260- ret = mwifiex_set_encode (priv , params -> key , params -> key_len ,
261- key_index , 0 );
207+ ret = mwifiex_set_encode (priv , params -> key , params -> key_len ,
208+ key_index , 0 );
262209
263210 wiphy_dbg (wiphy , "info: crypto keys added\n" );
264211
@@ -1019,7 +966,7 @@ mwifiex_cfg80211_assoc(struct mwifiex_private *priv, size_t ssid_len, u8 *ssid,
1019966 struct mwifiex_802_11_ssid req_ssid ;
1020967 struct mwifiex_ssid_bssid ssid_bssid ;
1021968 int ret = 0 ;
1022- int auth_type = 0 , pairwise_encrypt_mode = 0 , wpa_enabled = 0 ;
969+ int auth_type = 0 , pairwise_encrypt_mode = 0 ;
1023970 int group_encrypt_mode = 0 ;
1024971 int alg_is_wep = 0 ;
1025972
@@ -1052,13 +999,13 @@ mwifiex_cfg80211_assoc(struct mwifiex_private *priv, size_t ssid_len, u8 *ssid,
1052999 /* "privacy" is set only for ad-hoc mode */
10531000 if (privacy ) {
10541001 /*
1055- * Keep MWIFIEX_ENCRYPTION_MODE_WEP104 for now so that
1002+ * Keep WLAN_CIPHER_SUITE_WEP104 for now so that
10561003 * the firmware can find a matching network from the
10571004 * scan. The cfg80211 does not give us the encryption
10581005 * mode at this stage so just setting it to WEP here.
10591006 */
10601007 priv -> sec_info .encryption_mode =
1061- MWIFIEX_ENCRYPTION_MODE_WEP104 ;
1008+ WLAN_CIPHER_SUITE_WEP104 ;
10621009 priv -> sec_info .authentication_mode =
10631010 NL80211_AUTHTYPE_OPEN_SYSTEM ;
10641011 }
@@ -1074,16 +1021,13 @@ mwifiex_cfg80211_assoc(struct mwifiex_private *priv, size_t ssid_len, u8 *ssid,
10741021 auth_type = NL80211_AUTHTYPE_SHARED_KEY ;
10751022
10761023 if (sme -> crypto .n_ciphers_pairwise ) {
1077- pairwise_encrypt_mode = mwifiex_get_mwifiex_cipher (sme -> crypto .
1078- ciphers_pairwise [0 ], & wpa_enabled );
1079- priv -> sec_info .encryption_mode = pairwise_encrypt_mode ;
1024+ priv -> sec_info .encryption_mode =
1025+ sme -> crypto .ciphers_pairwise [0 ];
10801026 priv -> sec_info .authentication_mode = auth_type ;
10811027 }
10821028
10831029 if (sme -> crypto .cipher_group ) {
1084- group_encrypt_mode = mwifiex_get_mwifiex_cipher (sme -> crypto .
1085- cipher_group , & wpa_enabled );
1086- priv -> sec_info .encryption_mode = group_encrypt_mode ;
1030+ priv -> sec_info .encryption_mode = sme -> crypto .cipher_group ;
10871031 priv -> sec_info .authentication_mode = auth_type ;
10881032 }
10891033 if (sme -> ie )
0 commit comments