Index: if_bwn.c =================================================================== --- if_bwn.c (revision 204657) +++ if_bwn.c (working copy) @@ -73,6 +73,7 @@ #include #include +#define BWN_DEBUG SYSCTL_NODE(_hw, OID_AUTO, bwn, CTLFLAG_RD, 0, "Broadcom driver parameters"); /* @@ -102,6 +103,7 @@ BWN_DEBUG_FW = 0x00004000, /* firmware */ BWN_DEBUG_WME = 0x00008000, /* WME */ BWN_DEBUG_RF = 0x00010000, /* RF */ + BWN_DEBUG_PIO = 0x00020000, /* PIO */ BWN_DEBUG_FATAL = 0x80000000, /* fatal errors */ BWN_DEBUG_ANY = 0xffffffff }; @@ -124,7 +126,7 @@ "uses H/W power control"); static int bwn_msi_disable = 0; /* MSI disabled */ TUNABLE_INT("hw.bwn.msi_disable", &bwn_msi_disable); -static int bwn_usedma = 1; +static int bwn_usedma = 0; SYSCTL_INT(_hw_bwn, OID_AUTO, usedma, CTLFLAG_RD, &bwn_usedma, 0, "uses DMA"); TUNABLE_INT("hw.bwn.usedma", &bwn_usedma); @@ -936,8 +938,11 @@ sc->sc_sd = sd; #ifdef BWN_DEBUG sc->sc_debug = bwn_debug; + sc->sc_debug |= BWN_DEBUG_ANY; #endif + device_printf(dev, "DEBUG %#x\n", sc->sc_debug); + if ((sc->sc_flags & BWN_FLAG_ATTACHED) == 0) { error = bwn_attach_pre(sc); if (error != 0) @@ -1410,6 +1415,7 @@ struct bwn_pio_txqueue *tq = bwn_pio_select(mac, M_WME_GETAC(m)); struct bwn_softc *sc = mac->mac_sc; struct bwn_txhdr txhdr; + struct ieee80211_frame *wh; struct mbuf *m_new; uint32_t ctl32; int error; @@ -1434,6 +1440,12 @@ tq->tq_used += roundup(m->m_pkthdr.len + BWN_HDRSIZE(mac), 4); tq->tq_free--; + wh = mtod(m, struct ieee80211_frame *); + DPRINTF(sc, BWN_DEBUG_PIO, + "tx: used %d free %d (type %#x subtype %#x)\n", tq->tq_used, + tq->tq_free, wh->i_fc[0] & IEEE80211_FC0_TYPE_MASK, + wh->i_fc[0] & IEEE80211_FC0_SUBTYPE_MASK); + if (mac->mac_sd->sd_id.sd_rev >= 8) { /* * XXX please removes m_defrag(9) @@ -9236,6 +9248,8 @@ m->m_pkthdr.rcvif = ifp; m->m_len = m->m_pkthdr.len = len + padding; + DPRINTF(sc, BWN_DEBUG_PIO, "rx: m %p len %d\n", m, m->m_pkthdr.len); + bwn_rxeof(prq->prq_mac, m, &rxhdr); return (1); @@ -9562,6 +9576,9 @@ tp->tp_m = NULL; TAILQ_INSERT_TAIL(&tq->tq_pktlist, tp, tp_list); + DPRINTF(sc, BWN_DEBUG_PIO, "txeof: used %d free %d\n", tq->tq_used, + tq->tq_free); + ifp->if_opackets++; sc->sc_watchdog_timer = 0;