mac80211: add ieee80211_tx_status_ext

This allows the driver to pass in struct ieee80211_tx_status directly.
Make ieee80211_tx_status_noskb a wrapper around it.

As with ieee80211_tx_status_noskb, there is no _ni variant of this call,
because it probably won't be needed.

Even if the driver won't provide any extra status info other than what's
in struct ieee80211_tx_info already, it can optimize status reporting
this way by passing in the station pointer.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
[use C99 initializers]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
This commit is contained in:
Felix Fietkau
2017-04-26 17:11:37 +02:00
committed by Johannes Berg
parent eefebd3164
commit 5fe49a9d11
2 changed files with 74 additions and 31 deletions

View File

@@ -4213,6 +4213,23 @@ void ieee80211_get_tx_rates(struct ieee80211_vif *vif,
void ieee80211_tx_status(struct ieee80211_hw *hw,
struct sk_buff *skb);
/**
* ieee80211_tx_status_ext - extended transmit status callback
*
* This function can be used as a replacement for ieee80211_tx_status
* in drivers that may want to provide extra information that does not
* fit into &struct ieee80211_tx_info.
*
* Calls to this function for a single hardware must be synchronized
* against each other. Calls to this function, ieee80211_tx_status_ni()
* and ieee80211_tx_status_irqsafe() may not be mixed for a single hardware.
*
* @hw: the hardware the frame was transmitted by
* @status: tx status information
*/
void ieee80211_tx_status_ext(struct ieee80211_hw *hw,
struct ieee80211_tx_status *status);
/**
* ieee80211_tx_status_noskb - transmit status callback without skb
*
@@ -4229,9 +4246,17 @@ void ieee80211_tx_status(struct ieee80211_hw *hw,
* (NULL for multicast packets)
* @info: tx status information
*/
void ieee80211_tx_status_noskb(struct ieee80211_hw *hw,
struct ieee80211_sta *sta,
struct ieee80211_tx_info *info);
static inline void ieee80211_tx_status_noskb(struct ieee80211_hw *hw,
struct ieee80211_sta *sta,
struct ieee80211_tx_info *info)
{
struct ieee80211_tx_status status = {
.sta = sta,
.info = info,
};
ieee80211_tx_status_ext(hw, &status);
}
/**
* ieee80211_tx_status_ni - transmit status callback (in process context)