From owner-p4-projects@FreeBSD.ORG Sat Dec 13 13:27:48 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id BA41016A4D0; Sat, 13 Dec 2003 13:27:48 -0800 (PST) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 943C116A4CE for ; Sat, 13 Dec 2003 13:27:48 -0800 (PST) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8033A43D2D for ; Sat, 13 Dec 2003 13:27:47 -0800 (PST) (envelope-from sam@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.9/8.12.9) with ESMTP id hBDLRlXJ071730 for ; Sat, 13 Dec 2003 13:27:47 -0800 (PST) (envelope-from sam@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.9/8.12.9/Submit) id hBDLRloq071727 for perforce@freebsd.org; Sat, 13 Dec 2003 13:27:47 -0800 (PST) (envelope-from sam@freebsd.org) Date: Sat, 13 Dec 2003 13:27:47 -0800 (PST) Message-Id: <200312132127.hBDLRloq071727@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to sam@freebsd.org using -f From: Sam Leffler To: Perforce Change Reviews Subject: PERFORCE change 43914 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Dec 2003 21:27:49 -0000 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;