svn commit: r365633 - head/sys/dev/iwm

Bjoern A. Zeeb bz at FreeBSD.org
Fri Sep 11 14:18:48 UTC 2020


Author: bz
Date: Fri Sep 11 14:18:47 2020
New Revision: 365633
URL: https://svnweb.freebsd.org/changeset/base/365633

Log:
  iwm: fix regression from r365419 (ieee80211_media_change())
  
  In r365419 ieee80211_media_change() callers were updated to not longer
  act on the obselete ENETRESET return code.
  While in the old days iwm has done a stop/init cycle in these cases,
  this was not executed since r193340.
  As a consequence simplify iwm code as well by passing ieee80211_media_change()
  right to ieee80211_vap_attach() as there is no more need for a local
  implementation.
  
  Reported by:	Tomoaki AOKI (junchoon dec.sakura.ne.jp)
  Tested by:	Tomoaki AOKI (junchoon dec.sakura.ne.jp)
  MFC after:	3 days
  X-MFC:		fix is already in stable/12
  PR:		248955

Modified:
  head/sys/dev/iwm/if_iwm.c

Modified: head/sys/dev/iwm/if_iwm.c
==============================================================================
--- head/sys/dev/iwm/if_iwm.c	Fri Sep 11 14:00:10 2020	(r365632)
+++ head/sys/dev/iwm/if_iwm.c	Fri Sep 11 14:18:47 2020	(r365633)
@@ -354,7 +354,6 @@ static struct ieee80211_node *
 static uint8_t	iwm_rate_from_ucode_rate(uint32_t);
 static int	iwm_rate2ridx(struct iwm_softc *, uint8_t);
 static void	iwm_setrates(struct iwm_softc *, struct iwm_node *, int);
-static int	iwm_media_change(struct ifnet *);
 static int	iwm_newstate(struct ieee80211vap *, enum ieee80211_state, int);
 static void	iwm_endscan_cb(void *, int);
 static int	iwm_send_bt_init_conf(struct iwm_softc *);
@@ -4417,27 +4416,6 @@ iwm_setrates(struct iwm_softc *sc, struct iwm_node *in
 	}
 }
 
-static int
-iwm_media_change(struct ifnet *ifp)
-{
-	struct ieee80211vap *vap = ifp->if_softc;
-	struct ieee80211com *ic = vap->iv_ic;
-	struct iwm_softc *sc = ic->ic_softc;
-	int error;
-
-	error = ieee80211_media_change(ifp);
-	if (error != 0)
-		return (error);
-
-	IWM_LOCK(sc);
-	if (ic->ic_nrunning > 0) {
-		iwm_stop(sc);
-		iwm_init(sc);
-	}
-	IWM_UNLOCK(sc);
-	return (0);
-}
-
 static void
 iwm_bring_down_firmware(struct iwm_softc *sc, struct ieee80211vap *vap)
 {
@@ -6432,8 +6410,8 @@ iwm_vap_create(struct ieee80211com *ic, const char nam
 
 	ieee80211_ratectl_init(vap);
 	/* Complete setup. */
-	ieee80211_vap_attach(vap, iwm_media_change, ieee80211_media_status,
-	    mac);
+	ieee80211_vap_attach(vap, ieee80211_media_change,
+	    ieee80211_media_status, mac);
 	ic->ic_opmode = opmode;
 
 	return vap;


More information about the svn-src-all mailing list