From owner-svn-src-all@freebsd.org Sun Oct 11 01:53:53 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 22A8DA0F955; Sun, 11 Oct 2015 01:53:53 +0000 (UTC) (envelope-from adrian@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 mx1.freebsd.org (Postfix) with ESMTPS id C472B11A6; Sun, 11 Oct 2015 01:53:52 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9B1rpiX029911; Sun, 11 Oct 2015 01:53:51 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9B1rpDi029909; Sun, 11 Oct 2015 01:53:51 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201510110153.t9B1rpDi029909@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sun, 11 Oct 2015 01:53:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r289126 - head/sys/dev/wpi X-SVN-Group: head 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.20 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: Sun, 11 Oct 2015 01:53:53 -0000 Author: adrian Date: Sun Oct 11 01:53:51 2015 New Revision: 289126 URL: https://svnweb.freebsd.org/changeset/base/289126 Log: wpi(4): do not allocate space for unused rings. Tested: * Tested with Intel 3945BG, STA mode Submitted by: Differential Revision: https://reviews.freebsd.org/D3765 Modified: head/sys/dev/wpi/if_wpi.c head/sys/dev/wpi/if_wpivar.h Modified: head/sys/dev/wpi/if_wpi.c ============================================================================== --- head/sys/dev/wpi/if_wpi.c Sun Oct 11 01:50:54 2015 (r289125) +++ head/sys/dev/wpi/if_wpi.c Sun Oct 11 01:53:51 2015 (r289126) @@ -425,7 +425,7 @@ wpi_attach(device_t dev) } /* Allocate TX rings - 4 for QoS purposes, 1 for commands. */ - for (i = 0; i < WPI_NTXQUEUES; i++) { + for (i = 0; i < WPI_DRV_NTXQUEUES; i++) { if ((error = wpi_alloc_tx_ring(sc, &sc->txq[i], i)) != 0) { device_printf(dev, "could not allocate TX ring %d, error %d\n", i, @@ -713,7 +713,7 @@ wpi_detach(device_t dev) if (sc->txq[0].data_dmat) { /* Free DMA resources. */ - for (qid = 0; qid < WPI_NTXQUEUES; qid++) + for (qid = 0; qid < WPI_DRV_NTXQUEUES; qid++) wpi_free_tx_ring(sc, &sc->txq[qid]); wpi_free_rx_ring(sc); @@ -1186,16 +1186,6 @@ wpi_alloc_tx_ring(struct wpi_softc *sc, bus_dmamap_sync(sc->shared_dma.tag, sc->shared_dma.map, BUS_DMASYNC_PREWRITE); - /* - * We only use rings 0 through 4 (4 EDCA + cmd) so there is no need - * to allocate commands space for other rings. - * XXX Do we really need to allocate descriptors for other rings? - */ - if (qid > WPI_CMD_QUEUE_NUM) { - DPRINTF(sc, WPI_DEBUG_TRACE, TRACE_STR_END, __func__); - return 0; - } - size = WPI_TX_RING_COUNT * sizeof (struct wpi_tx_cmd); error = wpi_dma_contig_alloc(sc, &ring->cmd_dma, (void **)&ring->cmd, size, 4); @@ -5326,7 +5316,7 @@ wpi_hw_stop(struct wpi_softc *sc) wpi_reset_rx_ring(sc); /* Reset all TX rings. */ - for (qid = 0; qid < WPI_NTXQUEUES; qid++) + for (qid = 0; qid < WPI_DRV_NTXQUEUES; qid++) wpi_reset_tx_ring(sc, &sc->txq[qid]); if (wpi_nic_lock(sc) == 0) { Modified: head/sys/dev/wpi/if_wpivar.h ============================================================================== --- head/sys/dev/wpi/if_wpivar.h Sun Oct 11 01:50:54 2015 (r289125) +++ head/sys/dev/wpi/if_wpivar.h Sun Oct 11 01:53:51 2015 (r289126) @@ -176,7 +176,7 @@ struct wpi_softc { struct wpi_dma_info shared_dma; struct wpi_shared *shared; - struct wpi_tx_ring txq[WPI_NTXQUEUES]; + struct wpi_tx_ring txq[WPI_DRV_NTXQUEUES]; struct mtx txq_mtx; struct mtx txq_state_mtx;