* up the frame up to let mac80211 handle the actual error case, be it no
* decryption key or real decryption error. This let us keep statistics there.
*/
-static int ath_rx_prepare(struct sk_buff *skb, struct ath_desc *ds,
+static int ath_rx_prepare(struct ieee80211_hw *hw,
+ struct sk_buff *skb, struct ath_desc *ds,
struct ieee80211_rx_status *rx_status, bool *decrypt_error,
struct ath_softc *sc)
{
struct ieee80211_hdr *hdr;
u8 ratecode;
__le16 fc;
- struct ieee80211_hw *hw;
struct ieee80211_sta *sta;
struct ath_node *an;
int last_rssi = ATH_RSSI_DUMMY_MARKER;
-
hdr = (struct ieee80211_hdr *)skb->data;
fc = hdr->frame_control;
memset(rx_status, 0, sizeof(struct ieee80211_rx_status));
- hw = ath_get_virt_hw(sc, hdr);
if (ds->ds_rxstat.rs_more) {
/*
}
}
-static void ath_rx_send_to_mac80211(struct ath_softc *sc, struct sk_buff *skb,
+static void ath_rx_send_to_mac80211(struct ieee80211_hw *hw,
+ struct ath_softc *sc, struct sk_buff *skb,
struct ieee80211_rx_status *rx_status)
{
struct ieee80211_hdr *hdr;
} else {
/* Deliver unicast frames based on receiver address */
memcpy(IEEE80211_SKB_RXCB(skb), rx_status, sizeof(*rx_status));
- ieee80211_rx(ath_get_virt_hw(sc, hdr), skb);
+ ieee80211_rx(hw, skb);
}
}
struct ieee80211_rx_status rx_status;
struct ath_hw *ah = sc->sc_ah;
struct ath_common *common = ath9k_hw_common(ah);
+ /*
+ * The hw can techncically differ from common->hw when using ath9k
+ * virtual wiphy so to account for that we iterate over the active
+ * wiphys and find the appropriate wiphy and therefore hw.
+ */
+ struct ieee80211_hw *hw = NULL;
struct ieee80211_hdr *hdr;
int hdrlen, padsize, retval;
bool decrypt_error = false;
sc->rx.bufsize,
DMA_FROM_DEVICE);
+ hdr = (struct ieee80211_hdr *) skb->data;
+ hw = ath_get_virt_hw(sc, hdr);
+
/*
* If we're asked to flush receive queue, directly
* chain it back at the queue without processing it.
if (sc->rx.bufsize < ds->ds_rxstat.rs_datalen)
goto requeue;
- if (!ath_rx_prepare(skb, ds, &rx_status, &decrypt_error, sc))
+ if (!ath_rx_prepare(hw, skb, ds,
+ &rx_status, &decrypt_error, sc))
goto requeue;
/* Ensure we always have an skb to requeue once we are done
skb_put(skb, ds->ds_rxstat.rs_datalen);
/* see if any padding is done by the hw and remove it */
- hdr = (struct ieee80211_hdr *)skb->data;
hdrlen = ieee80211_get_hdrlen_from_skb(skb);
fc = hdr->frame_control;
bf->bf_mpdu = NULL;
ath_print(common, ATH_DBG_FATAL,
"dma_mapping_error() on RX\n");
- ath_rx_send_to_mac80211(sc, skb, &rx_status);
+ ath_rx_send_to_mac80211(hw, sc, skb, &rx_status);
break;
}
bf->bf_dmacontext = bf->bf_buf_addr;
SC_OP_WAIT_FOR_PSPOLL_DATA)))
ath_rx_ps(sc, skb);
- ath_rx_send_to_mac80211(sc, skb, &rx_status);
+ ath_rx_send_to_mac80211(hw, sc, skb, &rx_status);
requeue:
list_move_tail(&bf->list, &sc->rx.rxbuf);