aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/mac80211.h
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 /include/net/mac80211.h
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 'include/net/mac80211.h')
-rw-r--r--include/net/mac80211.h29
1 files changed, 14 insertions, 15 deletions
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index c06104476973..fe80771d95f1 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -397,6 +397,11 @@ static inline struct ieee80211_tx_info *IEEE80211_SKB_CB(struct sk_buff *skb)
397 return (struct ieee80211_tx_info *)skb->cb; 397 return (struct ieee80211_tx_info *)skb->cb;
398} 398}
399 399
400static inline struct ieee80211_rx_status *IEEE80211_SKB_RXCB(struct sk_buff *skb)
401{
402 return (struct ieee80211_rx_status *)skb->cb;
403}
404
400/** 405/**
401 * ieee80211_tx_info_clear_status - clear TX status 406 * ieee80211_tx_info_clear_status - clear TX status
402 * 407 *
@@ -478,7 +483,7 @@ enum mac80211_rx_flags {
478 * 483 *
479 * The low-level driver should provide this information (the subset 484 * The low-level driver should provide this information (the subset
480 * supported by hardware) to the 802.11 code with each received 485 * supported by hardware) to the 802.11 code with each received
481 * frame. 486 * frame, in the skb's control buffer (cb).
482 * 487 *
483 * @mactime: value in microseconds of the 64-bit Time Synchronization Function 488 * @mactime: value in microseconds of the 64-bit Time Synchronization Function
484 * (TSF) timer when the first data symbol (MPDU) arrived at the hardware. 489 * (TSF) timer when the first data symbol (MPDU) arrived at the hardware.
@@ -1606,9 +1611,11 @@ void ieee80211_free_hw(struct ieee80211_hw *hw);
1606 */ 1611 */
1607void ieee80211_restart_hw(struct ieee80211_hw *hw); 1612void ieee80211_restart_hw(struct ieee80211_hw *hw);
1608 1613
1609/* trick to avoid symbol clashes with the ieee80211 subsystem */ 1614/*
1610void __ieee80211_rx(struct ieee80211_hw *hw, struct sk_buff *skb, 1615 * trick to avoid symbol clashes with the ieee80211 subsystem,
1611 struct ieee80211_rx_status *status); 1616 * use the inline below instead
1617 */
1618void __ieee80211_rx(struct ieee80211_hw *hw, struct sk_buff *skb);
1612 1619
1613/** 1620/**
1614 * ieee80211_rx - receive frame 1621 * ieee80211_rx - receive frame
@@ -1624,13 +1631,10 @@ void __ieee80211_rx(struct ieee80211_hw *hw, struct sk_buff *skb,
1624 * 1631 *
1625 * @hw: the hardware this frame came in on 1632 * @hw: the hardware this frame came in on
1626 * @skb: the buffer to receive, owned by mac80211 after this call 1633 * @skb: the buffer to receive, owned by mac80211 after this call
1627 * @status: status of this frame; the status pointer need not be valid
1628 * after this function returns
1629 */ 1634 */
1630static inline void ieee80211_rx(struct ieee80211_hw *hw, struct sk_buff *skb, 1635static inline void ieee80211_rx(struct ieee80211_hw *hw, struct sk_buff *skb)
1631 struct ieee80211_rx_status *status)
1632{ 1636{
1633 __ieee80211_rx(hw, skb, status); 1637 __ieee80211_rx(hw, skb);
1634} 1638}
1635 1639
1636/** 1640/**
@@ -1644,13 +1648,8 @@ static inline void ieee80211_rx(struct ieee80211_hw *hw, struct sk_buff *skb,
1644 * 1648 *
1645 * @hw: the hardware this frame came in on 1649 * @hw: the hardware this frame came in on
1646 * @skb: the buffer to receive, owned by mac80211 after this call 1650 * @skb: the buffer to receive, owned by mac80211 after this call
1647 * @status: status of this frame; the status pointer need not be valid
1648 * after this function returns and is not freed by mac80211,
1649 * it is recommended that it points to a stack area
1650 */ 1651 */
1651void ieee80211_rx_irqsafe(struct ieee80211_hw *hw, 1652void ieee80211_rx_irqsafe(struct ieee80211_hw *hw, struct sk_buff *skb);
1652 struct sk_buff *skb,
1653 struct ieee80211_rx_status *status);
1654 1653
1655/** 1654/**
1656 * ieee80211_tx_status - transmit status callback 1655 * ieee80211_tx_status - transmit status callback