Index | Thread | Search

From:
Marcus Glocker <marcus@nazgul.ch>
Subject:
Re: iwn/iwm/iwx: fix ifmedia IFM_AUTO check
To:
Stefan Sperling <stsp@stsp.name>
Cc:
tech@openbsd.org
Date:
Thu, 15 Feb 2024 23:33:50 +0100

Download raw body.

Thread
On Thu, Feb 15, 2024 at 04:48:52PM +0100, Stefan Sperling wrote:

> These drivers are using the wrong IFM_ macro check for IFM_AUTO.
> 
> I am a bit swamped right now and would appreciate help with tests
> on iwn/iwm/iwx. Nothing should change or break.

No issues noted on:

iwm0 at pci1 dev 0 function 0 "Intel Dual Band Wireless-AC 8265" rev 0x78, msi
iwm0: hw rev 0x230, fw ver 36.ca7b901d.0
 
> diff /usr/src
> commit - d76fc145fd1843e077ff55bc476a2b23592607fe
> path + /usr/src
> blob - f0977cd84e8a242c89edc4110e30e3b8db3cd310
> file + sys/dev/pci/if_iwm.c
> --- sys/dev/pci/if_iwm.c
> +++ sys/dev/pci/if_iwm.c
> @@ -8534,7 +8534,7 @@ iwm_scan(struct iwm_softc *sc)
>  	 * The current mode might have been fixed during association.
>  	 * Ensure all channels get scanned.
>  	 */
> -	if (IFM_MODE(ic->ic_media.ifm_cur->ifm_media) == IFM_AUTO)
> +	if (IFM_SUBTYPE(ic->ic_media.ifm_cur->ifm_media) == IFM_AUTO)
>  		ieee80211_setmode(ic, IEEE80211_MODE_AUTO);
>  
>  	sc->sc_flags |= IWM_FLAG_SCANNING;
> blob - 69ecb242154be09f6ea83656d6e30170703bfd2b
> file + sys/dev/pci/if_iwn.c
> --- sys/dev/pci/if_iwn.c
> +++ sys/dev/pci/if_iwn.c
> @@ -5359,7 +5359,7 @@ iwn_scan(struct iwn_softc *sc, uint16_t flags, int bgs
>  		 * The current mode might have been fixed during association.
>  		 * Ensure all channels get scanned.
>  		 */
> -		if (IFM_MODE(ic->ic_media.ifm_cur->ifm_media) == IFM_AUTO)
> +		if (IFM_SUBTYPE(ic->ic_media.ifm_cur->ifm_media) == IFM_AUTO)
>  			ieee80211_setmode(ic, IEEE80211_MODE_AUTO);
>  
>  		sc->sc_flags |= IWN_FLAG_SCANNING;
> blob - 4b945edf2c73c6e2582819b283277baff81a6586
> file + sys/dev/pci/if_iwx.c
> --- sys/dev/pci/if_iwx.c
> +++ sys/dev/pci/if_iwx.c
> @@ -7529,7 +7529,7 @@ iwx_scan(struct iwx_softc *sc)
>  	 * The current mode might have been fixed during association.
>  	 * Ensure all channels get scanned.
>  	 */
> -	if (IFM_MODE(ic->ic_media.ifm_cur->ifm_media) == IFM_AUTO)
> +	if (IFM_SUBTYPE(ic->ic_media.ifm_cur->ifm_media) == IFM_AUTO)
>  		ieee80211_setmode(ic, IEEE80211_MODE_AUTO);
>  
>  	sc->sc_flags |= IWX_FLAG_SCANNING;
>