From owner-svn-src-head@freebsd.org Thu Sep 10 10:24:41 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1ACDE3D1D03; Thu, 10 Sep 2020 10:24:41 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BnFPN6y0Wz3Y7c; Thu, 10 Sep 2020 10:24:40 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mx1.sbone.de (cross.sbone.de [195.201.62.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mx1.sbone.de", Issuer "SBone.DE" (not verified)) (Authenticated sender: bz/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id B770618B15; Thu, 10 Sep 2020 10:24:40 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPS id E23848D4A229; Thu, 10 Sep 2020 10:24:38 +0000 (UTC) Received: from content-filter.sbone.de (content-filter.sbone.de [IPv6:fde9:577b:c1a9:31::2013:2742]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id 9D58DE70849; Thu, 10 Sep 2020 10:24:37 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:31::2013:587]) by content-filter.sbone.de (content-filter.sbone.de [fde9:577b:c1a9:31::2013:2742]) (amavisd-new, port 10024) with ESMTP id ZuuFZCuVtidO; Thu, 10 Sep 2020 10:24:33 +0000 (UTC) Received: from [127.0.0.1] (unknown [IPv6:fde9:577b:c1a9:4902:90a7:9bcf:f86b:190f]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id 2249BE707C1; Thu, 10 Sep 2020 10:23:48 +0000 (UTC) From: "Bjoern A. Zeeb" To: "Tomoaki AOKI" Cc: svn-src-head@freebsd.org, freebsd-current@freebsd.org Subject: Re: svn commit: r365419 - in head/sys/dev: ath bwi iwm iwn mwl otus usb/wlan wtap Date: Thu, 10 Sep 2020 10:22:05 +0000 X-Mailer: MailMate (2.0BETAr6151) Message-ID: <178A8155-90E0-4B3E-BBCB-D3C7CA4C62B2@FreeBSD.org> In-Reply-To: <20200910074135.45d5b208b083c93efbce9259@dec.sakura.ne.jp> References: <20200910074135.45d5b208b083c93efbce9259@dec.sakura.ne.jp> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: quoted-printable X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Sep 2020 10:24:41 -0000 On 9 Sep 2020, at 22:41, Tomoaki AOKI wrote: > This breaks at least iwm. (Other drivers not tested.) > > Messages below are repeatedly shown and no carrier detected. > Manually reverting this commit fixes the issue. > > iwm0: failed to send antennas before calibration: 35 > iwm_run_init_ucode: failed 35 > iwm_init_hw failed 35 > iwm0: could not initiate scan > > > and lesser times messages below. > > iwm0: iwm_send_phy_db_data: Cannot send HCMD of Phy DB cfg section, 35 > iwm_init_hw failed 35 > iwm0: could not initiate scan > I=E2=80=99ll try to test iwm as well, in case you are faster, can you ple= ase = try this instead of reverting; the previous version never made it past = the first return anymore in the last years it seems, so we can remove = the function entirely to keep the status quo: Sorry for the oversight. Index: if_iwm.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- if_iwm.c (revision 365559) +++ if_iwm.c (working copy) @@ -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 } } -static int -iwm_media_change(struct ifnet *ifp) -{ - struct ieee80211vap *vap =3D ifp->if_softc; - struct ieee80211com *ic =3D vap->iv_ic; - struct iwm_softc *sc =3D ic->ic_softc; - int error; - - error =3D ieee80211_media_change(ifp); - if (error !=3D 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 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 =3D opmode; return vap; > >> Author: bz >> Date: Mon Sep 7 15:35:40 2020 >> New Revision: 365419 >> URL: https://svnweb.freebsd.org/changeset/base/365419 >> >> Log: >> WiFi: fix ieee80211_media_change() callers >> >> In r178354 with the introduction of multi-bss ("vap") support > factoring >> out started and with r193340 ieee80211_media_change() no longer = >> returned >> ENETRESET but only 0 or error. >> As ieee80211(9) tells the ieee80211_media_change() function should = >> not >> be called directly but is registered with ieee80211_vap_attach() > instead. >> Some drivers have not been fully converted. After fixing the = >> return >> checking some of these functions were simply wrappers between >> ieee80211_vap_attach() and ieee80211_media_change(), so remove the > extra >> function, where possible as well. >> >> PR: 248955 >> Submitted by: Tong Zhang (ztong0001 gmail.com) (original) >> MFC after: 3 days >> Sponsored by: The FreeBSD Foundation >> >> Modified: >> head/sys/dev/ath/if_ath.c >> head/sys/dev/bwi/if_bwi.c >> head/sys/dev/iwm/if_iwm.c >> head/sys/dev/iwn/if_iwn.c >> head/sys/dev/mwl/if_mwl.c >> head/sys/dev/otus/if_otus.c >> head/sys/dev/usb/wlan/if_run.c >> head/sys/dev/wtap/if_wtap.c >> >> Modified: head/sys/dev/ath/if_ath.c >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D >> --- head/sys/dev/ath/if_ath.c Mon Sep 7 14:40:33 2020 (r365418) >> +++ head/sys/dev/ath/if_ath.c Mon Sep 7 15:35:40 2020 (r365419) >> @@ -160,7 +160,6 @@ static int ath_init(struct ath_softc *); >> static void ath_stop(struct ath_softc *); >> static int ath_reset_vap(struct ieee80211vap *, u_long); >> static int ath_transmit(struct ieee80211com *, struct mbuf *); >> -static int ath_media_change(struct ifnet *); >> static void ath_watchdog(void *); >> static void ath_parent(struct ieee80211com *); >> static void ath_fatal_proc(void *, int); > > (snip) > >> Modified: head/sys/dev/iwm/if_iwm.c >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D >> --- head/sys/dev/iwm/if_iwm.c Mon Sep 7 14:40:33 2020 (r365418) >> +++ head/sys/dev/iwm/if_iwm.c Mon Sep 7 15:35:40 2020 (r365419) >> @@ -4426,8 +4426,8 @@ iwm_media_change(struct ifnet *ifp) >> int error; >> >> error =3D ieee80211_media_change(ifp); >> - if (error !=3D ENETRESET) >> - return error; >> + if (error !=3D 0) >> + return (error); >> >> IWM_LOCK(sc); >> if (ic->ic_nrunning > 0) { >> @@ -4435,7 +4435,7 @@ iwm_media_change(struct ifnet *ifp) >> iwm_init(sc); >> } >> IWM_UNLOCK(sc); >> - return error; >> + return (0); >> } >> >> static void > > (snip) > > > -- = > Tomoaki AOKI