aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2009-06-17 07:13:00 -0400
committerJohn W. Linville <linville@tuxdriver.com>2009-07-10 14:57:54 -0400
commitf1d58c2521eb160178b2151d6326d8dc5d7c8560 (patch)
treeaf373bb1a5fbb6bc9436d29095133992d33d6598 /drivers/net/wireless/ath
parent18ad01c43918751cc22f8ee28f6b38b8954a55b2 (diff)
mac80211: push rx status into skb->cb
Within mac80211, we often need to copy the rx status into skb->cb. This is wasteful, as drivers could be building it in there to start with. This patch changes the API so that drivers are expected to pass the RX status in skb->cb, now accessible as IEEE80211_SKB_RXCB(skb). It also updates all drivers to pass the rx status in there, but only by making them memcpy() it into place before the call to the receive function (ieee80211_rx(_irqsafe)). Each driver can now be optimised on its own schedule. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath')
-rw-r--r--drivers/net/wireless/ath/ar9170/main.c6
-rw-r--r--drivers/net/wireless/ath/ath5k/base.c3
-rw-r--r--drivers/net/wireless/ath/ath9k/recv.c13
3 files changed, 15 insertions, 7 deletions
diff --git a/drivers/net/wireless/ath/ar9170/main.c b/drivers/net/wireless/ath/ar9170/main.c
index 9d38cf60a0db..51753ed1b8ba 100644
--- a/drivers/net/wireless/ath/ar9170/main.c
+++ b/drivers/net/wireless/ath/ar9170/main.c
@@ -917,8 +917,10 @@ static void ar9170_handle_mpdu(struct ar9170 *ar, u8 *buf, int len)
917 ar9170_rx_phy_status(ar, phy, &status); 917 ar9170_rx_phy_status(ar, phy, &status);
918 918
919 skb = ar9170_rx_copy_data(buf, mpdu_len); 919 skb = ar9170_rx_copy_data(buf, mpdu_len);
920 if (likely(skb)) 920 if (likely(skb)) {
921 ieee80211_rx_irqsafe(ar->hw, skb, &status); 921 memcpy(IEEE80211_SKB_RXCB(skb), &status, sizeof(status));
922 ieee80211_rx_irqsafe(ar->hw, skb);
923 }
922} 924}
923 925
924void ar9170_rx(struct ar9170 *ar, struct sk_buff *skb) 926void ar9170_rx(struct ar9170 *ar, struct sk_buff *skb)
diff --git a/drivers/net/wireless/ath/ath5k/base.c b/drivers/net/wireless/ath/ath5k/base.c
index f26a68960622..c6e70919435c 100644
--- a/drivers/net/wireless/ath/ath5k/base.c
+++ b/drivers/net/wireless/ath/ath5k/base.c
@@ -1905,7 +1905,8 @@ accept:
1905 if (sc->opmode == NL80211_IFTYPE_ADHOC) 1905 if (sc->opmode == NL80211_IFTYPE_ADHOC)
1906 ath5k_check_ibss_tsf(sc, skb, &rxs); 1906 ath5k_check_ibss_tsf(sc, skb, &rxs);
1907 1907
1908 __ieee80211_rx(sc->hw, skb, &rxs); 1908 memcpy(IEEE80211_SKB_RXCB(skb), &rxs, sizeof(rxs));
1909 ieee80211_rx(sc->hw, skb);
1909 1910
1910 bf->skb = next_skb; 1911 bf->skb = next_skb;
1911 bf->skbaddr = next_skb_addr; 1912 bf->skbaddr = next_skb_addr;
diff --git a/drivers/net/wireless/ath/ath9k/recv.c b/drivers/net/wireless/ath/ath9k/recv.c
index cece1c4c6bda..c00b9051bb53 100644
--- a/drivers/net/wireless/ath/ath9k/recv.c
+++ b/drivers/net/wireless/ath/ath9k/recv.c
@@ -619,13 +619,18 @@ static void ath_rx_send_to_mac80211(struct ath_softc *sc, struct sk_buff *skb,
619 if (aphy == NULL) 619 if (aphy == NULL)
620 continue; 620 continue;
621 nskb = skb_copy(skb, GFP_ATOMIC); 621 nskb = skb_copy(skb, GFP_ATOMIC);
622 if (nskb) 622 if (nskb) {
623 __ieee80211_rx(aphy->hw, nskb, rx_status); 623 memcpy(IEEE80211_SKB_RXCB(nskb), rx_status,
624 sizeof(*rx_status));
625 ieee80211_rx(aphy->hw, nskb);
626 }
624 } 627 }
625 __ieee80211_rx(sc->hw, skb, rx_status); 628 memcpy(IEEE80211_SKB_RXCB(skb), rx_status, sizeof(*rx_status));
629 ieee80211_rx(sc->hw, skb);
626 } else { 630 } else {
627 /* Deliver unicast frames based on receiver address */ 631 /* Deliver unicast frames based on receiver address */
628 __ieee80211_rx(ath_get_virt_hw(sc, hdr), skb, rx_status); 632 memcpy(IEEE80211_SKB_RXCB(skb), rx_status, sizeof(*rx_status));
633 ieee80211_rx(ath_get_virt_hw(sc, hdr), skb);
629 } 634 }
630} 635}
631 636