From: "Luis R. Rodriguez" <lrodriguez@atheros.com>
To: linux-wireless@vger.kernel.org
Cc: ath9k-devel@lists.ath9k.org,
"Luis R. Rodriguez" <lrodriguez@atheros.com>,
"Jouni.Malinen" <Jouni.Malinen@atheros.com>
Subject: [RFT 3/9] ath9k: simpify RX by calling ath_get_virt_hw() once
Date: Mon, 2 Nov 2009 22:07:55 -0500 [thread overview]
Message-ID: <1257217681-27180-4-git-send-email-lrodriguez@atheros.com> (raw)
In-Reply-To: <1257217681-27180-1-git-send-email-lrodriguez@atheros.com>
ath_get_virt_hw() is required on RX to determine for which virtual
wiphy an skb came in for. Instead of searching for the hw twice do
it only once.
Cc: Jouni.Malinen <Jouni.Malinen@atheros.com>
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
---
drivers/net/wireless/ath/ath9k/recv.c | 28 ++++++++++++++++++----------
1 files changed, 18 insertions(+), 10 deletions(-)
diff --git a/drivers/net/wireless/ath/ath9k/recv.c b/drivers/net/wireless/ath/ath9k/recv.c
index c880a55..330cd3b 100644
--- a/drivers/net/wireless/ath/ath9k/recv.c
+++ b/drivers/net/wireless/ath/ath9k/recv.c
@@ -105,23 +105,21 @@ static u64 ath_extend_tsf(struct ath_softc *sc, u32 rstamp)
* 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) {
/*
@@ -615,7 +613,8 @@ static void ath_rx_ps(struct ath_softc *sc, struct sk_buff *skb)
}
}
-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;
@@ -647,7 +646,7 @@ static void ath_rx_send_to_mac80211(struct ath_softc *sc, struct sk_buff *skb,
} 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);
}
}
@@ -663,6 +662,12 @@ int ath_rx_tasklet(struct ath_softc *sc, int flush)
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;
@@ -742,6 +747,9 @@ int ath_rx_tasklet(struct ath_softc *sc, int flush)
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.
@@ -756,7 +764,8 @@ int ath_rx_tasklet(struct ath_softc *sc, int flush)
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
@@ -778,7 +787,6 @@ int ath_rx_tasklet(struct ath_softc *sc, int flush)
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;
@@ -825,7 +833,7 @@ int ath_rx_tasklet(struct ath_softc *sc, int flush)
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;
@@ -846,7 +854,7 @@ int ath_rx_tasklet(struct ath_softc *sc, int flush)
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);
--
1.6.5.2.143.g8cc62
next prev parent reply other threads:[~2009-11-03 3:07 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-11-03 3:07 [RFT 0/9] ath9k: few updates for virtual wiphy Luis R. Rodriguez
2009-11-03 3:07 ` [RFT 1/9] ath9k: fix listening to idle requests Luis R. Rodriguez
2009-11-03 3:07 ` [RFT 2/9] ath9k: update hw configuration for virtual wiphys Luis R. Rodriguez
2009-11-03 3:07 ` Luis R. Rodriguez [this message]
2009-11-03 3:07 ` [RFT 4/9] ath9k: use the passed ieee80211_hw on ath_rx_prepare() Luis R. Rodriguez
2009-11-03 3:07 ` [RFT 5/9] ath9k: pass the ieee80211_hw on radio enable/disable Luis R. Rodriguez
2009-11-03 3:07 ` [RFT 6/9] ath9k: use correct hw for tx aggregation TX completion Luis R. Rodriguez
2009-11-03 3:07 ` [RFT 7/9] ath9k: use the right hw on ath_tx_setup_buffer() for HT Luis R. Rodriguez
2009-11-03 3:08 ` [RFT 8/9] ath9k: handle low buffer space for virtual wiphys Luis R. Rodriguez
2009-11-03 3:08 ` [RFT 9/9] ath9k: do not pass the entire descriptor to ath_rx_prepare() Luis R. Rodriguez
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1257217681-27180-4-git-send-email-lrodriguez@atheros.com \
--to=lrodriguez@atheros.com \
--cc=Jouni.Malinen@atheros.com \
--cc=ath9k-devel@lists.ath9k.org \
--cc=linux-wireless@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox