@@ -371,9 +371,6 @@ static int connect(struct wiphy *wiphy, struct net_device *dev,
371371 PRINT_D (vif -> ndev , CFG80211_DBG , "Required SSID= %s\n, AuthType= %d\n" ,
372372 sme -> ssid , sme -> auth_type );
373373
374- memset (priv -> wep_key , 0 , sizeof (priv -> wep_key ));
375- memset (priv -> wep_key_len , 0 , sizeof (priv -> wep_key_len ));
376-
377374 PRINT_D (vif -> ndev , CFG80211_DBG , "sme->crypto.wpa_versions=%x\n" ,
378375 sme -> crypto .wpa_versions );
379376 PRINT_D (vif -> ndev , CFG80211_DBG , "sme->crypto.cipher_group=%x\n" ,
@@ -390,34 +387,7 @@ static int connect(struct wiphy *wiphy, struct net_device *dev,
390387 PRINT_INFO (vif -> ndev , CORECONFIG_DBG ,
391388 ">> sme->crypto.wpa_versions: %x\n" ,
392389 sme -> crypto .wpa_versions );
393- if (cipher_group == WLAN_CIPHER_SUITE_WEP40 ) {
394- security = WILC_FW_SEC_WEP ;
395- PRINT_D (vif -> ndev , CFG80211_DBG ,
396- "WEP Default Key Idx = %d\n" , sme -> key_idx );
397-
398- for (i = 0 ; i < sme -> key_len ; i ++ )
399- PRINT_D (vif -> ndev , CORECONFIG_DBG ,
400- "WEP Key Value[%d] = %d\n" , i ,
401- sme -> key [i ]);
402-
403- priv -> wep_key_len [sme -> key_idx ] = sme -> key_len ;
404- memcpy (priv -> wep_key [sme -> key_idx ], sme -> key ,
405- sme -> key_len );
406-
407- wilc_set_wep_default_keyid (vif , sme -> key_idx );
408- wilc_add_wep_key_bss_sta (vif , sme -> key , sme -> key_len ,
409- sme -> key_idx );
410- } else if (cipher_group == WLAN_CIPHER_SUITE_WEP104 ) {
411- security = WILC_FW_SEC_WEP_EXTENDED ;
412-
413- priv -> wep_key_len [sme -> key_idx ] = sme -> key_len ;
414- memcpy (priv -> wep_key [sme -> key_idx ], sme -> key ,
415- sme -> key_len );
416-
417- wilc_set_wep_default_keyid (vif , sme -> key_idx );
418- wilc_add_wep_key_bss_sta (vif , sme -> key , sme -> key_len ,
419- sme -> key_idx );
420- } else if (sme -> crypto .wpa_versions & NL80211_WPA_VERSION_2 ) {
390+ if (sme -> crypto .wpa_versions & NL80211_WPA_VERSION_2 ) {
421391 if (cipher_group == WLAN_CIPHER_SUITE_TKIP )
422392 security = WILC_FW_SEC_WPA2_TKIP ;
423393 else
@@ -458,11 +428,6 @@ static int connect(struct wiphy *wiphy, struct net_device *dev,
458428 auth_type = WILC_FW_AUTH_OPEN_SYSTEM ;
459429 break ;
460430
461- case NL80211_AUTHTYPE_SHARED_KEY :
462- auth_type = WILC_FW_AUTH_SHARED_KEY ;
463- PRINT_INFO (vif -> ndev , CFG80211_DBG , "In SHARED KEY\n" );
464- break ;
465-
466431 default :
467432 PRINT_INFO (vif -> ndev , CFG80211_DBG ,
468433 "Automatic Authentication type= %d\n" ,
@@ -574,14 +539,6 @@ static int disconnect(struct wiphy *wiphy, struct net_device *dev,
574539 return ret ;
575540}
576541
577- static inline void wilc_wfi_cfg_copy_wep_info (struct wilc_priv * priv ,
578- u8 key_index ,
579- struct key_params * params )
580- {
581- priv -> wep_key_len [key_index ] = params -> key_len ;
582- memcpy (priv -> wep_key [key_index ], params -> key , params -> key_len );
583- }
584-
585542static int wilc_wfi_cfg_allocate_wpa_entry (struct wilc_priv * priv , u8 idx )
586543{
587544 if (!priv -> wilc_gtk [idx ]) {
@@ -635,7 +592,6 @@ static int add_key(struct wiphy *wiphy, struct net_device *netdev, u8 key_index,
635592 const u8 * tx_mic = NULL ;
636593 u8 mode = WILC_FW_SEC_NO ;
637594 u8 op_mode ;
638- int i ;
639595 struct wilc_vif * vif = netdev_priv (netdev );
640596 struct wilc_priv * priv = & vif -> priv ;
641597
@@ -647,51 +603,6 @@ static int add_key(struct wiphy *wiphy, struct net_device *netdev, u8 key_index,
647603 params -> key [1 ],
648604 params -> key [2 ]);
649605 switch (params -> cipher ) {
650- case WLAN_CIPHER_SUITE_WEP40 :
651- case WLAN_CIPHER_SUITE_WEP104 :
652- if (priv -> wdev .iftype == NL80211_IFTYPE_AP ) {
653- wilc_wfi_cfg_copy_wep_info (priv , key_index , params );
654-
655- PRINT_INFO (vif -> ndev , CFG80211_DBG ,
656- "Adding AP WEP Default key Idx = %d\n" ,
657- key_index );
658- PRINT_INFO (vif -> ndev , CFG80211_DBG ,
659- "Adding AP WEP Key len= %d\n" ,
660- params -> key_len );
661-
662- for (i = 0 ; i < params -> key_len ; i ++ )
663- PRINT_INFO (vif -> ndev , CFG80211_DBG ,
664- "WEP AP key val[%d] = %x\n" , i ,
665- params -> key [i ]);
666-
667- if (params -> cipher == WLAN_CIPHER_SUITE_WEP40 )
668- mode = WILC_FW_SEC_WEP ;
669- else
670- mode = WILC_FW_SEC_WEP_EXTENDED ;
671-
672- ret = wilc_add_wep_key_bss_ap (vif , params -> key ,
673- params -> key_len ,
674- key_index , mode ,
675- WILC_FW_AUTH_OPEN_SYSTEM );
676- break ;
677- }
678- if (memcmp (params -> key , priv -> wep_key [key_index ],
679- params -> key_len )) {
680- wilc_wfi_cfg_copy_wep_info (priv , key_index , params );
681-
682- PRINT_INFO (vif -> ndev , CFG80211_DBG ,
683- "Adding WEP Default key Idx = %d\n" ,
684- key_index );
685- PRINT_INFO (vif -> ndev , CFG80211_DBG ,
686- "Adding WEP Key length = %d\n" ,
687- params -> key_len );
688- ret = wilc_add_wep_key_bss_sta (vif , params -> key ,
689- params -> key_len ,
690- key_index );
691- }
692-
693- break ;
694-
695606 case WLAN_CIPHER_SUITE_TKIP :
696607 case WLAN_CIPHER_SUITE_CCMP :
697608 if (priv -> wdev .iftype == NL80211_IFTYPE_AP ||
@@ -794,15 +705,6 @@ static int del_key(struct wiphy *wiphy, struct net_device *netdev,
794705 priv -> wilc_ptk [key_index ] = NULL ;
795706 }
796707
797- if (key_index <= 3 && priv -> wep_key_len [key_index ]) {
798- memset (priv -> wep_key [key_index ], 0 ,
799- priv -> wep_key_len [key_index ]);
800- priv -> wep_key_len [key_index ] = 0 ;
801- pr_info ("%s: Removing WEP key with index = %d\n" , __func__ ,
802- key_index );
803- ret = wilc_remove_wep_key (vif , key_index );
804- }
805-
806708 return ret ;
807709}
808710
@@ -836,13 +738,10 @@ static int get_key(struct wiphy *wiphy, struct net_device *netdev, u8 key_index,
836738 return 0 ;
837739}
838740
741+ /* wiphy_new() will WARN if not present*/
839742static int set_default_key (struct wiphy * wiphy , struct net_device * netdev ,
840743 u8 key_index , bool unicast , bool multicast )
841744{
842- struct wilc_vif * vif = netdev_priv (netdev );
843-
844- wilc_set_wep_default_keyid (vif , key_index );
845-
846745 return 0 ;
847746}
848747
0 commit comments