@@ -4508,6 +4508,7 @@ il_mac_add_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif)
45084508{
45094509 struct il_priv * il = hw -> priv ;
45104510 int err ;
4511+ bool reset ;
45114512
45124513 mutex_lock (& il -> mutex );
45134514 D_MAC80211 ("enter: type %d, addr %pM\n" , vif -> type , vif -> addr );
@@ -4518,7 +4519,12 @@ il_mac_add_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif)
45184519 goto out ;
45194520 }
45204521
4521- if (il -> vif ) {
4522+ /*
4523+ * We do not support multiple virtual interfaces, but on hardware reset
4524+ * we have to add the same interface again.
4525+ */
4526+ reset = (il -> vif == vif );
4527+ if (il -> vif && !reset ) {
45224528 err = - EOPNOTSUPP ;
45234529 goto out ;
45244530 }
@@ -4528,8 +4534,11 @@ il_mac_add_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif)
45284534
45294535 err = il_set_mode (il );
45304536 if (err ) {
4531- il -> vif = NULL ;
4532- il -> iw_mode = NL80211_IFTYPE_STATION ;
4537+ IL_WARN ("Fail to set mode %d\n" , vif -> type );
4538+ if (!reset ) {
4539+ il -> vif = NULL ;
4540+ il -> iw_mode = NL80211_IFTYPE_STATION ;
4541+ }
45334542 }
45344543
45354544out :
@@ -5279,9 +5288,9 @@ il_mac_bss_info_changed(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
52795288 D_MAC80211 ("BSSID %pM\n" , bss_conf -> bssid );
52805289
52815290 /*
5282- * If there is currently a HW scan going on in the
5283- * background then we need to cancel it else the RXON
5284- * below/in post_associate will fail.
5291+ * If there is currently a HW scan going on in the background,
5292+ * then we need to cancel it, otherwise sometimes we are not
5293+ * able to authenticate (FIXME: why ?)
52855294 */
52865295 if (il_scan_cancel_timeout (il , 100 )) {
52875296 D_MAC80211 ("leave - scan abort failed\n" );
@@ -5290,14 +5299,10 @@ il_mac_bss_info_changed(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
52905299 }
52915300
52925301 /* mac80211 only sets assoc when in STATION mode */
5293- if (vif -> type == NL80211_IFTYPE_ADHOC || bss_conf -> assoc ) {
5294- memcpy (il -> staging .bssid_addr , bss_conf -> bssid ,
5295- ETH_ALEN );
5302+ memcpy (il -> staging .bssid_addr , bss_conf -> bssid , ETH_ALEN );
52965303
5297- /* currently needed in a few places */
5298- memcpy (il -> bssid , bss_conf -> bssid , ETH_ALEN );
5299- } else
5300- il -> staging .filter_flags &= ~RXON_FILTER_ASSOC_MSK ;
5304+ /* FIXME: currently needed in a few places */
5305+ memcpy (il -> bssid , bss_conf -> bssid , ETH_ALEN );
53015306 }
53025307
53035308 /*
0 commit comments