From owner-svn-src-all@freebsd.org Thu Mar 1 06:35:14 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5D72AF2906B; Thu, 1 Mar 2018 06:35:14 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 339CB6A225; Thu, 1 Mar 2018 06:35:14 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2E7A924DF0; Thu, 1 Mar 2018 06:35:14 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w216ZEAI058144; Thu, 1 Mar 2018 06:35:14 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w216ZDYc058140; Thu, 1 Mar 2018 06:35:13 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010635.w216ZDYc058140@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Thu, 1 Mar 2018 06:35:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r330203 - stable/11/sys/dev/iwm X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/dev/iwm X-SVN-Commit-Revision: 330203 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Mar 2018 06:35:14 -0000 Author: eadler Date: Thu Mar 1 06:35:13 2018 New Revision: 330203 URL: https://svnweb.freebsd.org/changeset/base/330203 Log: MFC r318013: [iwm] Move in_phyctxt from struct iwm_node to phy_ctxt in struct iwm_vap. * This better matches how things are organized in Linux's iwlwifi. Modified: stable/11/sys/dev/iwm/if_iwm.c stable/11/sys/dev/iwm/if_iwm_binding.c stable/11/sys/dev/iwm/if_iwm_binding.h stable/11/sys/dev/iwm/if_iwmvar.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/iwm/if_iwm.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 06:34:48 2018 (r330202) +++ stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 06:35:13 2018 (r330203) @@ -354,7 +354,7 @@ static int iwm_mvm_add_int_sta_common(struct iwm_softc struct iwm_int_sta *, const uint8_t *, uint16_t, uint16_t); static int iwm_mvm_add_aux_sta(struct iwm_softc *); -static int iwm_mvm_update_quotas(struct iwm_softc *, struct iwm_node *); +static int iwm_mvm_update_quotas(struct iwm_softc *, struct iwm_vap *); static int iwm_auth(struct ieee80211vap *, struct iwm_softc *); static int iwm_assoc(struct ieee80211vap *, struct iwm_softc *); static int iwm_release(struct iwm_softc *, struct iwm_node *); @@ -1285,6 +1285,7 @@ iwm_stop_device(struct iwm_softc *sc) */ if (vap) { struct iwm_vap *iv = IWM_VAP(vap); + iv->phy_ctxt = NULL; iv->is_uploaded = 0; } @@ -3998,7 +3999,7 @@ iwm_mvm_add_aux_sta(struct iwm_softc *sc) */ static int -iwm_mvm_update_quotas(struct iwm_softc *sc, struct iwm_node *in) +iwm_mvm_update_quotas(struct iwm_softc *sc, struct iwm_vap *ivp) { struct iwm_time_quota_cmd cmd; int i, idx, ret, num_active_macs, quota, quota_rem; @@ -4009,10 +4010,10 @@ iwm_mvm_update_quotas(struct iwm_softc *sc, struct iwm memset(&cmd, 0, sizeof(cmd)); /* currently, PHY ID == binding ID */ - if (in) { - id = in->in_phyctxt->id; + if (ivp) { + id = ivp->phy_ctxt->id; KASSERT(id < IWM_MAX_BINDINGS, ("invalid id")); - colors[id] = in->in_phyctxt->color; + colors[id] = ivp->phy_ctxt->color; if (1) n_ifs[id] = 1; @@ -4137,9 +4138,9 @@ iwm_auth(struct ieee80211vap *vap, struct iwm_softc *s "%s: failed update phy ctxt\n", __func__); goto out; } - in->in_phyctxt = &sc->sc_phyctxt[0]; + iv->phy_ctxt = &sc->sc_phyctxt[0]; - if ((error = iwm_mvm_binding_update(sc, in)) != 0) { + if ((error = iwm_mvm_binding_update(sc, iv)) != 0) { device_printf(sc->sc_dev, "%s: binding update cmd\n", __func__); goto out; @@ -4168,9 +4169,9 @@ iwm_auth(struct ieee80211vap *vap, struct iwm_softc *s error = ETIMEDOUT; goto out; } - in->in_phyctxt = &sc->sc_phyctxt[0]; + iv->phy_ctxt = &sc->sc_phyctxt[0]; - if ((error = iwm_mvm_binding_add_vif(sc, in)) != 0) { + if ((error = iwm_mvm_binding_add_vif(sc, iv)) != 0) { device_printf(sc->sc_dev, "%s: binding add cmd\n", __func__); goto out; @@ -4569,7 +4570,7 @@ iwm_newstate(struct ieee80211vap *vap, enum ieee80211_ in = IWM_NODE(vap->iv_bss); iwm_mvm_enable_beacon_filter(sc, in); iwm_mvm_power_update_mac(sc); - iwm_mvm_update_quotas(sc, in); + iwm_mvm_update_quotas(sc, ivp); iwm_setrates(sc, in); cmd.data[0] = &in->in_lq; @@ -5750,7 +5751,6 @@ iwm_intr(void *arg) device_printf(sc->sc_dev, "%s: controller panicked, iv_state = %d; " "restarting\n", __func__, vap->iv_state); - /* XXX TODO: turn this into a callout/taskqueue */ ieee80211_restart_all(ic); return; } Modified: stable/11/sys/dev/iwm/if_iwm_binding.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm_binding.c Thu Mar 1 06:34:48 2018 (r330202) +++ stable/11/sys/dev/iwm/if_iwm_binding.c Thu Mar 1 06:35:13 2018 (r330203) @@ -161,10 +161,10 @@ __FBSDID("$FreeBSD$"); */ int -iwm_mvm_binding_cmd(struct iwm_softc *sc, struct iwm_node *in, uint32_t action) +iwm_mvm_binding_cmd(struct iwm_softc *sc, struct iwm_vap *ivp, uint32_t action) { struct iwm_binding_cmd cmd; - struct iwm_mvm_phy_ctxt *phyctxt = in->in_phyctxt; + struct iwm_mvm_phy_ctxt *phyctxt = ivp->phy_ctxt; int i, ret; uint32_t status; @@ -203,13 +203,13 @@ iwm_mvm_binding_cmd(struct iwm_softc *sc, struct iwm_n } int -iwm_mvm_binding_update(struct iwm_softc *sc, struct iwm_node *in) +iwm_mvm_binding_update(struct iwm_softc *sc, struct iwm_vap *ivp) { - return iwm_mvm_binding_cmd(sc, in, IWM_FW_CTXT_ACTION_MODIFY); + return iwm_mvm_binding_cmd(sc, ivp, IWM_FW_CTXT_ACTION_MODIFY); } int -iwm_mvm_binding_add_vif(struct iwm_softc *sc, struct iwm_node *in) +iwm_mvm_binding_add_vif(struct iwm_softc *sc, struct iwm_vap *ivp) { - return iwm_mvm_binding_cmd(sc, in, IWM_FW_CTXT_ACTION_ADD); + return iwm_mvm_binding_cmd(sc, ivp, IWM_FW_CTXT_ACTION_ADD); } Modified: stable/11/sys/dev/iwm/if_iwm_binding.h ============================================================================== --- stable/11/sys/dev/iwm/if_iwm_binding.h Thu Mar 1 06:34:48 2018 (r330202) +++ stable/11/sys/dev/iwm/if_iwm_binding.h Thu Mar 1 06:35:13 2018 (r330203) @@ -105,9 +105,9 @@ #ifndef __IF_IWM_BINDING_H__ #define __IF_IWM_BINDING_H__ -extern int iwm_mvm_binding_cmd(struct iwm_softc *sc, struct iwm_node *in, +extern int iwm_mvm_binding_cmd(struct iwm_softc *sc, struct iwm_vap *ivp, uint32_t action); -extern int iwm_mvm_binding_update(struct iwm_softc *sc, struct iwm_node *in); -extern int iwm_mvm_binding_add_vif(struct iwm_softc *sc, struct iwm_node *in); +extern int iwm_mvm_binding_update(struct iwm_softc *sc, struct iwm_vap *ivp); +extern int iwm_mvm_binding_add_vif(struct iwm_softc *sc, struct iwm_vap *ivp); #endif /* __IF_IWM_BINDING_H__ */ Modified: stable/11/sys/dev/iwm/if_iwmvar.h ============================================================================== --- stable/11/sys/dev/iwm/if_iwmvar.h Thu Mar 1 06:34:48 2018 (r330202) +++ stable/11/sys/dev/iwm/if_iwmvar.h Thu Mar 1 06:35:13 2018 (r330203) @@ -373,12 +373,13 @@ struct iwm_vap { int (*iv_newstate)(struct ieee80211vap *, enum ieee80211_state, int); + + struct iwm_mvm_phy_ctxt *phy_ctxt; }; #define IWM_VAP(_vap) ((struct iwm_vap *)(_vap)) struct iwm_node { struct ieee80211_node in_ni; - struct iwm_mvm_phy_ctxt *in_phyctxt; /* status "bits" */ int in_assoc;