--- drivers/net/wireless/zd1211rw/zd_mac.c +++ drivers/net/wireless/zd1211rw/zd_mac.c @@ -221,14 +221,19 @@ void zd_mac_clear(struct zd_mac *mac) static int set_rx_filter(struct zd_mac *mac) { unsigned long flags; - u32 filter = STA_RX_FILTER; + struct zd_ioreq32 ioreqs[] = { + {CR_RX_FILTER, STA_RX_FILTER}, + { CR_SNIFFER_ON, 0U }, + }; spin_lock_irqsave(&mac->lock, flags); - if (mac->pass_ctrl) - filter |= RX_FILTER_CTRL; + if (mac->pass_ctrl) { + ioreqs[0].value |= 0xFFFFFFFF; + ioreqs[1].value = 0x1; + } spin_unlock_irqrestore(&mac->lock, flags); - return zd_iowrite32(&mac->chip, CR_RX_FILTER, filter); + return zd_iowrite32a(&mac->chip, ioreqs, ARRAY_SIZE(ioreqs)); } static int set_mc_hash(struct zd_mac *mac) @@ -815,7 +820,8 @@ int zd_mac_rx(struct ieee80211_hw *hw, c /* Caller has to ensure that length >= sizeof(struct rx_status). */ status = (struct rx_status *) (buffer + (length - sizeof(struct rx_status))); - if (status->frame_status & ZD_RX_ERROR) { + if ((status->frame_status & ZD_RX_ERROR) || + (status->frame_status & ~0x21)) { if (mac->pass_failed_fcs && (status->frame_status & ZD_RX_CRC32_ERROR)) { stats.flag |= RX_FLAG_FAILED_FCS_CRC; @@ -828,7 +834,8 @@ int zd_mac_rx(struct ieee80211_hw *hw, c stats.freq = zd_channels[_zd_chip_get_channel(&mac->chip) - 1].center_freq; stats.band = IEEE80211_BAND_2GHZ; stats.signal = status->signal_strength; - + stats.signal = stats.signal - 90; + rate = zd_rx_rate(buffer, status); /* todo: return index in the big switches in zd_rx_rate instead */ @@ -1155,7 +1162,7 @@ struct ieee80211_hw *zd_mac_alloc_hw(str hw->wiphy->bands[IEEE80211_BAND_2GHZ] = &mac->band; hw->flags = IEEE80211_HW_RX_INCLUDES_FCS | - IEEE80211_HW_SIGNAL_UNSPEC; + IEEE80211_HW_SIGNAL_DBM; hw->wiphy->interface_modes = BIT(NL80211_IFTYPE_MESH_POINT) |