aboutsummaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorAdrian Chadd <adrian@FreeBSD.org>2015-10-08 07:17:11 +0000
committerAdrian Chadd <adrian@FreeBSD.org>2015-10-08 07:17:11 +0000
commitc34db4207cb28d1a9f524aeb6a894b43c2aada9f (patch)
tree2b7fdb59eb154b59a11149be289599412742d6ae /sys
parent808d980506900560b111cdd31494e1e634b3153d (diff)
Notes
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/wpi/if_wpi.c18
-rw-r--r--sys/dev/wpi/if_wpivar.h2
2 files changed, 10 insertions, 10 deletions
diff --git a/sys/dev/wpi/if_wpi.c b/sys/dev/wpi/if_wpi.c
index 938a3a803e84..bedcfe6569b7 100644
--- a/sys/dev/wpi/if_wpi.c
+++ b/sys/dev/wpi/if_wpi.c
@@ -2116,6 +2116,7 @@ wpi_cmd_done(struct wpi_softc *sc, struct wpi_rx_desc *desc)
{
struct wpi_tx_ring *ring = &sc->txq[WPI_CMD_QUEUE_NUM];
struct wpi_tx_data *data;
+ struct wpi_tx_cmd *cmd;
DPRINTF(sc, WPI_DEBUG_CMD, "cmd notification qid %x idx %d flags %x "
"type %s len %d\n", desc->qid, desc->idx,
@@ -2128,6 +2129,7 @@ wpi_cmd_done(struct wpi_softc *sc, struct wpi_rx_desc *desc)
KASSERT(ring->queued == 0, ("ring->queued must be 0"));
data = &ring->data[desc->idx];
+ cmd = &ring->cmd[desc->idx];
/* If the command was mapped in an mbuf, free it. */
if (data->m != NULL) {
@@ -2138,11 +2140,16 @@ wpi_cmd_done(struct wpi_softc *sc, struct wpi_rx_desc *desc)
data->m = NULL;
}
- wakeup(&ring->cmd[desc->idx]);
+ wakeup(cmd);
if (desc->type == WPI_CMD_SET_POWER_MODE) {
+ struct wpi_pmgt_cmd *pcmd = (struct wpi_pmgt_cmd *)cmd->data;
+
+ bus_dmamap_sync(ring->data_dmat, ring->cmd_dma.map,
+ BUS_DMASYNC_POSTREAD);
+
WPI_TXQ_LOCK(sc);
- if (sc->sc_flags & WPI_PS_PATH) {
+ if (le16toh(pcmd->flags) & WPI_PS_ALLOW_SLEEP) {
sc->sc_update_rx_ring = wpi_update_rx_ring_ps;
sc->sc_update_tx_ring = wpi_update_tx_ring_ps;
} else {
@@ -3714,13 +3721,8 @@ wpi_set_pslevel(struct wpi_softc *sc, uint8_t dtim, int level, int async)
pmgt = &wpi_pmgt[1][level];
memset(&cmd, 0, sizeof cmd);
- WPI_TXQ_LOCK(sc);
- if (level != 0) { /* not CAM */
+ if (level != 0) /* not CAM */
cmd.flags |= htole16(WPI_PS_ALLOW_SLEEP);
- sc->sc_flags |= WPI_PS_PATH;
- } else
- sc->sc_flags &= ~WPI_PS_PATH;
- WPI_TXQ_UNLOCK(sc);
/* Retrieve PCIe Active State Power Management (ASPM). */
reg = pci_read_config(sc->sc_dev, sc->sc_cap_off + 0x10, 1);
if (!(reg & 0x1)) /* L0s Entry disabled. */
diff --git a/sys/dev/wpi/if_wpivar.h b/sys/dev/wpi/if_wpivar.h
index 27b2bf9334f5..80195b59d16c 100644
--- a/sys/dev/wpi/if_wpivar.h
+++ b/sys/dev/wpi/if_wpivar.h
@@ -165,8 +165,6 @@ struct wpi_softc {
device_t sc_dev;
int sc_debug;
- int sc_flags;
-#define WPI_PS_PATH (1 << 0)
int sc_running;
struct mtx sc_mtx;