Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 12 May 2017 06:30:06 +0000 (UTC)
From:      Adrian Chadd <adrian@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r318226 - head/sys/dev/iwm
Message-ID:  <201705120630.v4C6U6F9069570@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: adrian
Date: Fri May 12 06:30:06 2017
New Revision: 318226
URL: https://svnweb.freebsd.org/changeset/base/318226

Log:
  [iwm] Switch arguments from iwm_node* to iwm_vap* in if_iwm_power.c.
  
  * Power management handling is per-vap, not per-node, so we should pass
    the iwm_vap in these arguments.
  
  Obtained from:	dragonflybsd.git 62a4e7957a736b4de38938b02fa7eb9b45bc5d0d

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

Modified: head/sys/dev/iwm/if_iwm.c
==============================================================================
--- head/sys/dev/iwm/if_iwm.c	Fri May 12 06:21:03 2017	(r318225)
+++ head/sys/dev/iwm/if_iwm.c	Fri May 12 06:30:06 2017	(r318226)
@@ -4462,7 +4462,7 @@ iwm_newstate(struct ieee80211vap *vap, e
 			    "%s: failed to update MAC: %d\n", __func__, error);
 		}
 
-		iwm_mvm_enable_beacon_filter(sc, in);
+		iwm_mvm_enable_beacon_filter(sc, ivp);
 		iwm_mvm_power_update_mac(sc);
 		iwm_mvm_update_quotas(sc, ivp);
 		iwm_setrates(sc, in);

Modified: head/sys/dev/iwm/if_iwm_power.c
==============================================================================
--- head/sys/dev/iwm/if_iwm_power.c	Fri May 12 06:21:03 2017	(r318225)
+++ head/sys/dev/iwm/if_iwm_power.c	Fri May 12 06:30:06 2017	(r318226)
@@ -201,7 +201,7 @@ iwm_mvm_beacon_filter_send_cmd(struct iw
 
 static void
 iwm_mvm_beacon_filter_set_cqm_params(struct iwm_softc *sc,
-	struct iwm_node *in, struct iwm_beacon_filter_cmd *cmd)
+	struct iwm_vap *ivp, struct iwm_beacon_filter_cmd *cmd)
 {
 	cmd->ba_enable_beacon_abort = htole32(sc->sc_bf.ba_enabled);
 }
@@ -278,15 +278,14 @@ iwm_mvm_power_config_skip_dtim(struct iw
 }
 
 static void
-iwm_mvm_power_build_cmd(struct iwm_softc *sc, struct iwm_node *in,
+iwm_mvm_power_build_cmd(struct iwm_softc *sc, struct iwm_vap *ivp,
 	struct iwm_mac_power_cmd *cmd)
 {
-	struct ieee80211_node *ni = &in->in_ni;
+	struct ieee80211_node *ni = ivp->iv_vap.iv_bss;
 	int dtimper, dtimper_msec;
 	int keep_alive;
 	struct ieee80211com *ic = &sc->sc_ic;
 	struct ieee80211vap *vap = TAILQ_FIRST(&ic->ic_vaps);
-	struct iwm_vap *ivp = IWM_VAP(vap);
 
 	cmd->id_and_color = htole32(IWM_FW_CMD_ID_AND_COLOR(ivp->id,
 	    ivp->color));
@@ -319,11 +318,11 @@ iwm_mvm_power_build_cmd(struct iwm_softc
 }
 
 static int
-iwm_mvm_power_send_cmd(struct iwm_softc *sc, struct iwm_node *in)
+iwm_mvm_power_send_cmd(struct iwm_softc *sc, struct iwm_vap *ivp)
 {
 	struct iwm_mac_power_cmd cmd = {};
 
-	iwm_mvm_power_build_cmd(sc, in, &cmd);
+	iwm_mvm_power_build_cmd(sc, ivp, &cmd);
 	iwm_mvm_power_log(sc, &cmd);
 
 	return iwm_mvm_send_cmd_pdu(sc, IWM_MAC_PM_POWER_TABLE, 0,
@@ -331,12 +330,12 @@ iwm_mvm_power_send_cmd(struct iwm_softc 
 }
 
 static int
-_iwm_mvm_enable_beacon_filter(struct iwm_softc *sc, struct iwm_node *in,
+_iwm_mvm_enable_beacon_filter(struct iwm_softc *sc, struct iwm_vap *ivp,
 	struct iwm_beacon_filter_cmd *cmd)
 {
 	int ret;
 
-	iwm_mvm_beacon_filter_set_cqm_params(sc, in, cmd);
+	iwm_mvm_beacon_filter_set_cqm_params(sc, ivp, cmd);
 	ret = iwm_mvm_beacon_filter_send_cmd(sc, cmd);
 
 	if (!ret)
@@ -346,14 +345,14 @@ _iwm_mvm_enable_beacon_filter(struct iwm
 }
 
 int
-iwm_mvm_enable_beacon_filter(struct iwm_softc *sc, struct iwm_node *in)
+iwm_mvm_enable_beacon_filter(struct iwm_softc *sc, struct iwm_vap *ivp)
 {
 	struct iwm_beacon_filter_cmd cmd = {
 		IWM_BF_CMD_CONFIG_DEFAULTS,
 		.bf_enable_beacon_filter = htole32(1),
 	};
 
-	return _iwm_mvm_enable_beacon_filter(sc, in, &cmd);
+	return _iwm_mvm_enable_beacon_filter(sc, ivp, &cmd);
 }
 
 int
@@ -398,7 +397,7 @@ iwm_mvm_power_set_ps(struct iwm_softc *s
 }
 
 static int
-iwm_mvm_power_set_ba(struct iwm_softc *sc, struct iwm_node *in)
+iwm_mvm_power_set_ba(struct iwm_softc *sc, struct iwm_vap *ivp)
 {
 	struct iwm_beacon_filter_cmd cmd = {
 		IWM_BF_CMD_CONFIG_DEFAULTS,
@@ -410,7 +409,7 @@ iwm_mvm_power_set_ba(struct iwm_softc *s
 
 	sc->sc_bf.ba_enabled = !sc->sc_ps_disabled;
 
-	return _iwm_mvm_enable_beacon_filter(sc, in, &cmd);
+	return _iwm_mvm_enable_beacon_filter(sc, ivp, &cmd);
 }
 
 int
@@ -424,7 +423,7 @@ iwm_mvm_power_update_ps(struct iwm_softc
 		return ret;
 
 	if (vap != NULL)
-		return iwm_mvm_power_set_ba(sc, IWM_NODE(vap->iv_bss));
+		return iwm_mvm_power_set_ba(sc, IWM_VAP(vap));
 
 	return 0;
 }
@@ -440,13 +439,13 @@ iwm_mvm_power_update_mac(struct iwm_soft
 		return ret;
 
 	if (vap != NULL) {
-		ret = iwm_mvm_power_send_cmd(sc, IWM_NODE(vap->iv_bss));
+		ret = iwm_mvm_power_send_cmd(sc, IWM_VAP(vap));
 		if (ret)
 			return ret;
 	}
 
 	if (vap != NULL)
-		return iwm_mvm_power_set_ba(sc, IWM_NODE(vap->iv_bss));
+		return iwm_mvm_power_set_ba(sc, IWM_VAP(vap));
 
 	return 0;
 }

Modified: head/sys/dev/iwm/if_iwm_power.h
==============================================================================
--- head/sys/dev/iwm/if_iwm_power.h	Fri May 12 06:21:03 2017	(r318225)
+++ head/sys/dev/iwm/if_iwm_power.h	Fri May 12 06:30:06 2017	(r318226)
@@ -94,7 +94,7 @@ extern	int iwm_mvm_power_update_device(s
 extern	int iwm_mvm_power_update_mac(struct iwm_softc *sc);
 extern	int iwm_mvm_power_update_ps(struct iwm_softc *sc);
 extern	int iwm_mvm_enable_beacon_filter(struct iwm_softc *sc,
-	    struct iwm_node *in);
+	    struct iwm_vap *ivp);
 extern	int iwm_mvm_disable_beacon_filter(struct iwm_softc *sc);
 
 #endif	/* __IF_IWM_POWER_H__ */



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201705120630.v4C6U6F9069570>