diff options
author | Felix Fietkau <nbd@nbd.name> | 2018-01-24 16:19:12 +0100 |
---|---|---|
committer | Kalle Valo <kvalo@codeaurora.org> | 2018-01-26 10:18:32 +0100 |
commit | 4e34249e9565dc123ceb349b31acb9305673313e (patch) | |
tree | 4bf60c70734d89cfb99116bb3d76ea406828f2d7 /drivers/net/wireless/mediatek/mt76/mac80211.c | |
parent | mt76: fix TSF value in probe responses (diff) | |
download | linux-4e34249e9565dc123ceb349b31acb9305673313e.tar.xz linux-4e34249e9565dc123ceb349b31acb9305673313e.zip |
mt76: add an intermediate struct for rx status information
Preparation for passing in more internal rx data via skb->cb
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Diffstat (limited to 'drivers/net/wireless/mediatek/mt76/mac80211.c')
-rw-r--r-- | drivers/net/wireless/mediatek/mt76/mac80211.c | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/drivers/net/wireless/mediatek/mt76/mac80211.c b/drivers/net/wireless/mediatek/mt76/mac80211.c index 3acf0e175d71..258d2623d1bf 100644 --- a/drivers/net/wireless/mediatek/mt76/mac80211.c +++ b/drivers/net/wireless/mediatek/mt76/mac80211.c @@ -384,10 +384,37 @@ int mt76_get_survey(struct ieee80211_hw *hw, int idx, } EXPORT_SYMBOL_GPL(mt76_get_survey); +static void +mt76_rx_convert(struct sk_buff *skb) +{ + struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(skb); + struct mt76_rx_status mstat; + + mstat = *((struct mt76_rx_status *) skb->cb); + memset(status, 0, sizeof(*status)); + + status->flag = mstat.flag; + status->freq = mstat.freq; + status->enc_flags = mstat.enc_flags; + status->encoding = mstat.encoding; + status->bw = mstat.bw; + status->rate_idx = mstat.rate_idx; + status->nss = mstat.nss; + status->band = mstat.band; + status->signal = mstat.signal; + status->chains = mstat.chains; + + BUILD_BUG_ON(sizeof(mstat) > sizeof(skb->cb)); + BUILD_BUG_ON(sizeof(status->chain_signal) != sizeof(mstat.chain_signal)); + memcpy(status->chain_signal, mstat.chain_signal, sizeof(mstat.chain_signal)); +} + void mt76_rx_complete(struct mt76_dev *dev, enum mt76_rxq_id q) { struct sk_buff *skb; - while ((skb = __skb_dequeue(&dev->rx_skb[q])) != NULL) + while ((skb = __skb_dequeue(&dev->rx_skb[q])) != NULL) { + mt76_rx_convert(skb); ieee80211_rx_napi(dev->hw, NULL, skb, &dev->napi[q]); + } } |