Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 13 Dec 2003 13:27:47 -0800 (PST)
From:      Sam Leffler <sam@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 43914 for review
Message-ID:  <200312132127.hBDLRloq071727@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=43914

Change 43914 by sam@sam_ebb on 2003/12/13 13:27:16

	o must initialize each device-private rate control state at node
	  creation so xmits have rate cookies for sending management
	  frames (fixes ap operation)
	o must initialize curmode state so calling ath_rate_update works
	  for the bss node at startup
	o use __func__ to consolidate some debug msg strings

Affected files ...

.. //depot/projects/netperf/sys/dev/ath/if_ath.c#52 edit

Differences ...

==== //depot/projects/netperf/sys/dev/ath/if_ath.c#52 (text+ko) ====

@@ -252,6 +252,8 @@
 	ath_rate_setup(sc, IEEE80211_MODE_11B);
 	ath_rate_setup(sc, IEEE80211_MODE_11G);
 	ath_rate_setup(sc, IEEE80211_MODE_TURBO);
+	/* NB: setup here so ath_rate_update is happy */
+	ath_setcurmode(sc, IEEE80211_MODE_11A);
 
 	error = ath_desc_alloc(sc);
 	if (error != 0) {
@@ -1104,8 +1106,8 @@
 		m = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR);
 	if (m == NULL) {
 		DPRINTF(ATH_DEBUG_BEACON,
-			("ath_beacon_alloc: cannot get mbuf/cluster; size %u\n",
-			pktlen));
+			("%s: cannot get mbuf/cluster; size %u\n",
+			__func__, pktlen));
 		sc->sc_stats.ast_be_nombuf++;
 		return ENOMEM;
 	}
@@ -1175,8 +1177,7 @@
 		("beacon bigger than expected, len %u calculated %u",
 		m->m_pkthdr.len, pktlen));
 
-	DPRINTF(ATH_DEBUG_BEACON,
-		("ath_beacon_alloc: m %p len %u\n", m, m->m_len));
+	DPRINTF(ATH_DEBUG_BEACON, ("%s: m %p len %u\n", __func__, m, m->m_len));
 	error = bus_dmamap_load_mbuf(sc->sc_dmat, bf->bf_dmamap, m,
 				     ath_mbuf_load_cb, bf,
 				     BUS_DMA_NOWAIT);
@@ -1185,8 +1186,7 @@
 		return error;
 	}
 	KASSERT(bf->bf_nseg == 1,
-		("ath_beacon_alloc: multi-segment packet; nseg %u",
-		bf->bf_nseg));
+		("%s: multi-segment packet; nseg %u", __func__, bf->bf_nseg));
 	bf->bf_m = m;
 
 	/* setup descriptors */
@@ -1499,10 +1499,13 @@
 	struct ath_node *an =
 		malloc(sizeof(struct ath_node), M_DEVBUF, M_NOWAIT | M_ZERO);
 	if (an) {
+		struct ath_softc *sc = ic->ic_if.if_softc;
 		int i;
+
 		for (i = 0; i < ATH_RHIST_SIZE; i++)
 			an->an_rx_hist[i].arh_ticks = ATH_RHIST_NOTIME;
 		an->an_rx_hist_next = ATH_RHIST_SIZE-1;
+		ath_rate_update(sc, &an->an_node, 0);
 		return &an->an_node;
 	} else
 		return NULL;



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