diff --git a/sys/dev/ath/if_ath_tx.c b/sys/dev/ath/if_ath_tx.c index 1ec23972f283..eebf1489055c 100644 --- a/sys/dev/ath/if_ath_tx.c +++ b/sys/dev/ath/if_ath_tx.c @@ -2050,7 +2050,7 @@ ath_tx_start(struct ath_softc *sc, struct ieee80211_node *ni, */ if (IEEE80211_QOS_HAS_SEQ(wh) && (! IEEE80211_IS_MULTICAST(wh->i_addr1)) && - (subtype != IEEE80211_FC0_SUBTYPE_QOS_NULL)) { + (! IEEE80211_IS_QOS_NULL_DATA(wh))) { bf->bf_state.bfs_dobaw = 1; } } @@ -2991,7 +2991,7 @@ ath_tx_tid_seqno_assign(struct ath_softc *sc, struct ieee80211_node *ni, * RX side. */ subtype = wh->i_fc[0] & IEEE80211_FC0_SUBTYPE_MASK; - if (subtype == IEEE80211_FC0_SUBTYPE_QOS_NULL) { + if (IEEE80211_IS_QOS_NULL_DATA(wh)) { /* XXX no locking for this TID? This is a bit of a problem. */ seqno = ni->ni_txseqs[IEEE80211_NONQOS_TID]; INCR(ni->ni_txseqs[IEEE80211_NONQOS_TID], IEEE80211_SEQ_RANGE); diff --git a/sys/dev/rtsx/rtsx.c b/sys/dev/rtsx/rtsx.c index cc2adc8a205c..27c7fa6d290a 100644 --- a/sys/dev/rtsx/rtsx.c +++ b/sys/dev/rtsx/rtsx.c @@ -729,6 +729,9 @@ rtsx_init(struct rtsx_softc *sc) sc->rtsx_host.caps |= MMC_CAP_UHS_SDR50 | MMC_CAP_UHS_SDR104; if (sc->rtsx_device_id == RTSX_RTS5209) sc->rtsx_host.caps |= MMC_CAP_8_BIT_DATA; + + printf("%s: rtsx_dev=%p\n", __func__, sc->rtsx_dev); + pci_find_cap(sc->rtsx_dev, PCIY_EXPRESS, &(sc->rtsx_pcie_cap)); /* @@ -3575,6 +3578,7 @@ rtsx_probe(device_t dev) return (ENXIO); for (i = 0; i < nitems(rtsx_ids); i++) { if (rtsx_ids[i].device_id == device_id) { + printf("%s: match; dev=%p, vendor_id=%x, device_id=%x\n", __func__, dev, vendor_id, device_id); device_set_desc(dev, rtsx_ids[i].desc); return (BUS_PROBE_DEFAULT); } @@ -3607,6 +3611,8 @@ rtsx_attach(device_t dev) device_printf(dev, "Attach - Vendor ID: 0x%x - Device ID: 0x%x\n", vendor_id, device_id); + printf("%s: match; dev=%p, vendor_id=%x, device_id=%x\n", __func__, dev, vendor_id, device_id); + sc->rtsx_dev = dev; sc->rtsx_device_id = device_id; sc->rtsx_req = NULL; @@ -3619,6 +3625,8 @@ rtsx_attach(device_t dev) sc->rtsx_read_count = 0; sc->rtsx_write_count = 0; + printf("%s: rtsx_dev=%p\n", __func__, sc->rtsx_dev); + maker = kern_getenv("smbios.system.maker"); family = kern_getenv("smbios.system.family"); product = kern_getenv("smbios.system.product"); @@ -3830,6 +3838,10 @@ rtsx_suspend(device_t dev) struct rtsx_softc *sc = device_get_softc(dev); device_printf(dev, "Suspend\n"); + if (sc == NULL) + return 0; + if (sc->rtsx_dev == NULL) + return 0; #ifdef MMCCAM if (sc->rtsx_ccb != NULL) { @@ -3854,8 +3866,15 @@ rtsx_suspend(device_t dev) static int rtsx_resume(device_t dev) { + struct rtsx_softc *sc = device_get_softc(dev); + device_printf(dev, "Resume\n"); + if (device_get_softc(dev) == NULL) + return 0; + if (sc->rtsx_dev == NULL) + return 0; + rtsx_init(device_get_softc(dev)); bus_generic_resume(dev); diff --git a/sys/net80211/ieee80211.h b/sys/net80211/ieee80211.h index eb83d0a40a33..0a82f7b53b99 100644 --- a/sys/net80211/ieee80211.h +++ b/sys/net80211/ieee80211.h @@ -274,6 +274,16 @@ struct ieee80211_qosframe_addr4 { IEEE80211_FC0_TYPE_DATA, \ IEEE80211_FC0_SUBTYPE_QOS_DATA)) +/* + * Return true if this frame is a QoS NULL data frame. + */ +#define IEEE80211_IS_QOS_NULL_DATA(wh) \ + (IEEE80211_IS_FC0_CHECK_VER_TYPE_SUBTYPE(wh, \ + IEEE80211_FC0_VERSION_0, \ + IEEE80211_FC0_TYPE_DATA, \ + IEEE80211_FC0_SUBTYPE_QOS_NULL)) + + #define IEEE80211_FC1_DIR_MASK 0x03 #define IEEE80211_FC1_DIR_NODS 0x00 /* STA->STA */ #define IEEE80211_FC1_DIR_TODS 0x01 /* STA->AP */