Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 20 Jan 2011 18:41:46 +0000 (UTC)
From:      Bernhard Schmidt <bschmidt@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
Subject:   svn commit: r217650 - in stable/8/sys: dev/bwi dev/bwn dev/iwn dev/ral dev/usb/wlan dev/wpi net80211
Message-ID:  <201101201841.p0KIfk5q023959@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: bschmidt
Date: Thu Jan 20 18:41:46 2011
New Revision: 217650
URL: http://svn.freebsd.org/changeset/base/217650

Log:
  MFC r217511:
  Pull ieee80211_ratectl_node_init() calls from drivers into net80211.
  This fixes hostap mode for at least ral(4) and run(4), because there is
  no sufficient call into drivers which could be used initialize the node
  related ratectl variables.

Modified:
  stable/8/sys/dev/bwi/if_bwi.c
  stable/8/sys/dev/bwn/if_bwn.c
  stable/8/sys/dev/iwn/if_iwn.c
  stable/8/sys/dev/ral/rt2560.c
  stable/8/sys/dev/ral/rt2661.c
  stable/8/sys/dev/usb/wlan/if_rum.c
  stable/8/sys/dev/usb/wlan/if_run.c
  stable/8/sys/dev/usb/wlan/if_ural.c
  stable/8/sys/dev/wpi/if_wpi.c
  stable/8/sys/net80211/ieee80211_node.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/dev/bwi/if_bwi.c
==============================================================================
--- stable/8/sys/dev/bwi/if_bwi.c	Thu Jan 20 18:26:33 2011	(r217649)
+++ stable/8/sys/dev/bwi/if_bwi.c	Thu Jan 20 18:41:46 2011	(r217650)
@@ -1764,7 +1764,6 @@ static int
 bwi_newstate(struct ieee80211vap *vap, enum ieee80211_state nstate, int arg)
 {
 	struct bwi_vap *bvp = BWI_VAP(vap);
-	const struct ieee80211_txparam *tp;
 	struct ieee80211com *ic= vap->iv_ic;
 	struct ifnet *ifp = ic->ic_ifp;
 	enum ieee80211_state ostate = vap->iv_state;
@@ -1818,11 +1817,6 @@ bwi_newstate(struct ieee80211vap *vap, e
 		sc->sc_txpwrcb_type = BWI_TXPWR_CALIB;
 #endif
 
-		/* Initializes ratectl for a node. */
-		tp = &vap->iv_txparms[ieee80211_chan2mode(ic->ic_curchan)];
-		if (tp->ucastrate == IEEE80211_FIXED_RATE_NONE)
-			ieee80211_ratectl_node_init(vap->iv_bss);
-
 		callout_reset(&sc->sc_calib_ch, hz, bwi_calibrate, sc);
 	}
 back:

Modified: stable/8/sys/dev/bwn/if_bwn.c
==============================================================================
--- stable/8/sys/dev/bwn/if_bwn.c	Thu Jan 20 18:26:33 2011	(r217649)
+++ stable/8/sys/dev/bwn/if_bwn.c	Thu Jan 20 18:41:46 2011	(r217650)
@@ -8329,7 +8329,6 @@ bwn_phy_reset(struct bwn_mac *mac)
 static int
 bwn_newstate(struct ieee80211vap *vap, enum ieee80211_state nstate, int arg)
 {
-	const struct ieee80211_txparam *tp;
 	struct bwn_vap *bvp = BWN_VAP(vap);
 	struct ieee80211com *ic= vap->iv_ic;
 	struct ifnet *ifp = ic->ic_ifp;
@@ -8378,11 +8377,6 @@ bwn_newstate(struct ieee80211vap *vap, e
 		bwn_set_pretbtt(mac);
 		bwn_spu_setdelay(mac, 0);
 		bwn_set_macaddr(mac);
-
-		/* Initializes ratectl for a node. */
-		tp = &vap->iv_txparms[ieee80211_chan2mode(ic->ic_curchan)];
-		if (tp->ucastrate == IEEE80211_FIXED_RATE_NONE)
-			ieee80211_ratectl_node_init(vap->iv_bss);
 	}
 
 	BWN_UNLOCK(sc);

Modified: stable/8/sys/dev/iwn/if_iwn.c
==============================================================================
--- stable/8/sys/dev/iwn/if_iwn.c	Thu Jan 20 18:26:33 2011	(r217649)
+++ stable/8/sys/dev/iwn/if_iwn.c	Thu Jan 20 18:41:46 2011	(r217650)
@@ -122,7 +122,6 @@ static void	iwn_read_eeprom_channels(str
 static void	iwn_read_eeprom_enhinfo(struct iwn_softc *);
 static struct ieee80211_node *iwn_node_alloc(struct ieee80211vap *,
 		    const uint8_t mac[IEEE80211_ADDR_LEN]);
-static void	iwn_newassoc(struct ieee80211_node *, int);
 static int	iwn_media_change(struct ifnet *);
 static int	iwn_newstate(struct ieee80211vap *, enum ieee80211_state, int);
 static void	iwn_rx_phy(struct iwn_softc *, struct iwn_rx_desc *,
@@ -652,7 +651,6 @@ iwn_attach(device_t dev)
 	ic->ic_vap_delete = iwn_vap_delete;
 	ic->ic_raw_xmit = iwn_raw_xmit;
 	ic->ic_node_alloc = iwn_node_alloc;
-	ic->ic_newassoc = iwn_newassoc;
 	ic->ic_wme.wme_update = iwn_wme_update;
 	ic->ic_update_mcast = iwn_update_mcast;
 	ic->ic_scan_start = iwn_scan_start;
@@ -1929,13 +1927,6 @@ iwn_node_alloc(struct ieee80211vap *vap,
 	return malloc(sizeof (struct iwn_node), M_80211_NODE,M_NOWAIT | M_ZERO);
 }
 
-static void
-iwn_newassoc(struct ieee80211_node *ni, int isnew)
-{
-	/* XXX move */
-	ieee80211_ratectl_node_init(ni);
-}
-
 static int
 iwn_media_change(struct ifnet *ifp)
 {

Modified: stable/8/sys/dev/ral/rt2560.c
==============================================================================
--- stable/8/sys/dev/ral/rt2560.c	Thu Jan 20 18:26:33 2011	(r217649)
+++ stable/8/sys/dev/ral/rt2560.c	Thu Jan 20 18:41:46 2011	(r217650)
@@ -103,7 +103,6 @@ static void		rt2560_reset_rx_ring(struct
 			    struct rt2560_rx_ring *);
 static void		rt2560_free_rx_ring(struct rt2560_softc *,
 			    struct rt2560_rx_ring *);
-static void		rt2560_newassoc(struct ieee80211_node *, int);
 static int		rt2560_newstate(struct ieee80211vap *,
 			    enum ieee80211_state, int);
 static uint16_t		rt2560_eeprom_read(struct rt2560_softc *, uint8_t);
@@ -301,7 +300,6 @@ rt2560_attach(device_t dev, int id)
 	ieee80211_init_channels(ic, NULL, &bands);
 
 	ieee80211_ifattach(ic, macaddr);
-	ic->ic_newassoc = rt2560_newassoc;
 	ic->ic_raw_xmit = rt2560_raw_xmit;
 	ic->ic_updateslot = rt2560_update_slot;
 	ic->ic_update_promisc = rt2560_update_promisc;
@@ -757,13 +755,6 @@ rt2560_free_rx_ring(struct rt2560_softc 
 		bus_dma_tag_destroy(ring->data_dmat);
 }
 
-static void
-rt2560_newassoc(struct ieee80211_node *ni, int isnew)
-{
-	/* XXX move */
-	ieee80211_ratectl_node_init(ni);
-}
-
 static int
 rt2560_newstate(struct ieee80211vap *vap, enum ieee80211_state nstate, int arg)
 {

Modified: stable/8/sys/dev/ral/rt2661.c
==============================================================================
--- stable/8/sys/dev/ral/rt2661.c	Thu Jan 20 18:26:33 2011	(r217649)
+++ stable/8/sys/dev/ral/rt2661.c	Thu Jan 20 18:41:46 2011	(r217650)
@@ -100,7 +100,6 @@ static void		rt2661_reset_rx_ring(struct
 			    struct rt2661_rx_ring *);
 static void		rt2661_free_rx_ring(struct rt2661_softc *,
 			    struct rt2661_rx_ring *);
-static void		rt2661_newassoc(struct ieee80211_node *, int);
 static int		rt2661_newstate(struct ieee80211vap *,
 			    enum ieee80211_state, int);
 static uint16_t		rt2661_eeprom_read(struct rt2661_softc *, uint8_t);
@@ -304,7 +303,6 @@ rt2661_attach(device_t dev, int id)
 	ieee80211_init_channels(ic, NULL, &bands);
 
 	ieee80211_ifattach(ic, macaddr);
-	ic->ic_newassoc = rt2661_newassoc;
 #if 0
 	ic->ic_wme.wme_update = rt2661_wme_update;
 #endif
@@ -764,13 +762,6 @@ rt2661_free_rx_ring(struct rt2661_softc 
 		bus_dma_tag_destroy(ring->data_dmat);
 }
 
-static void
-rt2661_newassoc(struct ieee80211_node *ni, int isnew)
-{
-	/* XXX move */
-	ieee80211_ratectl_node_init(ni);
-}
-
 static int
 rt2661_newstate(struct ieee80211vap *vap, enum ieee80211_state nstate, int arg)
 {

Modified: stable/8/sys/dev/usb/wlan/if_rum.c
==============================================================================
--- stable/8/sys/dev/usb/wlan/if_rum.c	Thu Jan 20 18:26:33 2011	(r217649)
+++ stable/8/sys/dev/usb/wlan/if_rum.c	Thu Jan 20 18:41:46 2011	(r217650)
@@ -2206,8 +2206,6 @@ rum_ratectl_start(struct rum_softc *sc, 
 	/* clear statistic registers (STA_CSR0 to STA_CSR5) */
 	rum_read_multi(sc, RT2573_STA_CSR0, sc->sta, sizeof sc->sta);
 
-	ieee80211_ratectl_node_init(ni);
-
 	usb_callout_reset(&rvp->ratectl_ch, hz, rum_ratectl_timeout, rvp);
 }
 

Modified: stable/8/sys/dev/usb/wlan/if_run.c
==============================================================================
--- stable/8/sys/dev/usb/wlan/if_run.c	Thu Jan 20 18:26:33 2011	(r217649)
+++ stable/8/sys/dev/usb/wlan/if_run.c	Thu Jan 20 18:41:46 2011	(r217650)
@@ -2376,7 +2376,6 @@ run_newassoc(struct ieee80211_node *ni, 
 	DPRINTF("new assoc isnew=%d associd=%x addr=%s\n",
 	    isnew, ni->ni_associd, ether_sprintf(ni->ni_macaddr));
 
-	ieee80211_ratectl_node_init(ni);
 	sc->sc_ni[wcid] = ni;
 
 	for (i = 0; i < rs->rs_nrates; i++) {

Modified: stable/8/sys/dev/usb/wlan/if_ural.c
==============================================================================
--- stable/8/sys/dev/usb/wlan/if_ural.c	Thu Jan 20 18:26:33 2011	(r217649)
+++ stable/8/sys/dev/usb/wlan/if_ural.c	Thu Jan 20 18:41:46 2011	(r217650)
@@ -2215,8 +2215,6 @@ ural_ratectl_start(struct ural_softc *sc
 	/* clear statistic registers (STA_CSR0 to STA_CSR10) */
 	ural_read_multi(sc, RAL_STA_CSR0, sc->sta, sizeof sc->sta);
 
-	ieee80211_ratectl_node_init(ni);
-
 	usb_callout_reset(&uvp->ratectl_ch, hz, ural_ratectl_timeout, uvp);
 }
 

Modified: stable/8/sys/dev/wpi/if_wpi.c
==============================================================================
--- stable/8/sys/dev/wpi/if_wpi.c	Thu Jan 20 18:26:33 2011	(r217649)
+++ stable/8/sys/dev/wpi/if_wpi.c	Thu Jan 20 18:41:46 2011	(r217650)
@@ -174,7 +174,6 @@ static int	wpi_alloc_tx_ring(struct wpi_
 		    int, int);
 static void	wpi_reset_tx_ring(struct wpi_softc *, struct wpi_tx_ring *);
 static void	wpi_free_tx_ring(struct wpi_softc *, struct wpi_tx_ring *);
-static void	wpi_newassoc(struct ieee80211_node *, int);
 static int	wpi_newstate(struct ieee80211vap *, enum ieee80211_state, int);
 static void	wpi_mem_lock(struct wpi_softc *);
 static void	wpi_mem_unlock(struct wpi_softc *);
@@ -668,7 +667,6 @@ wpi_attach(device_t dev)
 	ieee80211_ifattach(ic, macaddr);
 	/* override default methods */
 	ic->ic_raw_xmit = wpi_raw_xmit;
-	ic->ic_newassoc = wpi_newassoc;
 	ic->ic_wme.wme_update = wpi_wme_update;
 	ic->ic_scan_start = wpi_scan_start;
 	ic->ic_scan_end = wpi_scan_end;
@@ -3233,14 +3231,6 @@ wpi_stop(struct wpi_softc *sc)
 }
 
 static void
-wpi_newassoc(struct ieee80211_node *ni, int isnew)
-{
-
-	/* XXX move */
-	ieee80211_ratectl_node_init(ni);
-}
-
-static void
 wpi_calib_timeout(void *arg)
 {
 	struct wpi_softc *sc = arg;

Modified: stable/8/sys/net80211/ieee80211_node.c
==============================================================================
--- stable/8/sys/net80211/ieee80211_node.c	Thu Jan 20 18:26:33 2011	(r217649)
+++ stable/8/sys/net80211/ieee80211_node.c	Thu Jan 20 18:41:46 2011	(r217650)
@@ -1137,6 +1137,8 @@ ieee80211_alloc_node(struct ieee80211_no
 	IEEE80211_NOTE(vap, IEEE80211_MSG_INACT, ni,
 	    "%s: inact_reload %u", __func__, ni->ni_inact_reload);
 
+	ieee80211_ratectl_node_init(ni);
+
 	return ni;
 }
 
@@ -1174,6 +1176,8 @@ ieee80211_tmp_node(struct ieee80211vap *
 		ni->ni_txpower = bss->ni_txpower;
 		/* XXX optimize away */
 		ieee80211_psq_init(&ni->ni_psq, "unknown");
+
+		ieee80211_ratectl_node_init(ni);
 	} else {
 		/* XXX msg */
 		vap->iv_stats.is_rx_nodealloc++;



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