aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjoern A. Zeeb <bz@FreeBSD.org>2023-01-31 15:35:59 +0000
committerBjoern A. Zeeb <bz@FreeBSD.org>2023-02-17 23:42:15 +0000
commitdf109ed24233e367ef7060a25ab1b55e2afcddc8 (patch)
tree43e56c7a751f7c5dd911dcf475bde75715523b06
parente420c65378a04c5b9cde34013cab78188bc5a4c2 (diff)
downloadsrc-df109ed24233e367ef7060a25ab1b55e2afcddc8.tar.gz
src-df109ed24233e367ef7060a25ab1b55e2afcddc8.zip
LinuxKPI: 802.11: implement ieee80211_tx_status_ext()
Add an implementation of ieee80211_tx_status_ext() extending the internal linuxkpi_ieee80211_tx_status() implementation. Sponsored by: The FreeBSD Foundation MFC after: 3 days (cherry picked from commit a839757109891573123d8777b539fafa2d2198bb)
-rw-r--r--sys/compat/linuxkpi/common/include/net/mac80211.h31
-rw-r--r--sys/compat/linuxkpi/common/src/linux_80211.c41
2 files changed, 51 insertions, 21 deletions
diff --git a/sys/compat/linuxkpi/common/include/net/mac80211.h b/sys/compat/linuxkpi/common/include/net/mac80211.h
index fee8b88d8feb..2b3f6b8e3ab1 100644
--- a/sys/compat/linuxkpi/common/include/net/mac80211.h
+++ b/sys/compat/linuxkpi/common/include/net/mac80211.h
@@ -1028,6 +1028,8 @@ void linuxkpi_ieee80211_beacon_loss(struct ieee80211_vif *);
struct sk_buff *linuxkpi_ieee80211_probereq_get(struct ieee80211_hw *,
uint8_t *, uint8_t *, size_t, size_t);
void linuxkpi_ieee80211_tx_status(struct ieee80211_hw *, struct sk_buff *);
+void linuxkpi_ieee80211_tx_status_ext(struct ieee80211_hw *,
+ struct ieee80211_tx_status *);
/* -------------------------------------------------------------------------- */
@@ -1989,13 +1991,6 @@ ieee80211_sta_set_buffered(struct ieee80211_sta *sta, uint8_t tid, bool t)
}
static __inline void
-ieee80211_tx_status(struct ieee80211_hw *hw, struct sk_buff *skb)
-{
-
- linuxkpi_ieee80211_tx_status(hw, skb);
-}
-
-static __inline void
ieee80211_get_key_rx_seq(struct ieee80211_key_conf *keyconf, uint8_t tid,
struct ieee80211_key_seq *seq)
{
@@ -2131,6 +2126,13 @@ ieee80211_wake_queue(struct ieee80211_hw *hw, uint16_t q)
}
static __inline void
+ieee80211_tx_status(struct ieee80211_hw *hw, struct sk_buff *skb)
+{
+
+ linuxkpi_ieee80211_tx_status(hw, skb);
+}
+
+static __inline void
ieee80211_tx_status_irqsafe(struct ieee80211_hw *hw, struct sk_buff *skb)
{
IMPROVE();
@@ -2145,6 +2147,14 @@ ieee80211_tx_status_ni(struct ieee80211_hw *hw, struct sk_buff *skb)
}
static __inline void
+ieee80211_tx_status_ext(struct ieee80211_hw *hw,
+ struct ieee80211_tx_status *txstat)
+{
+
+ linuxkpi_ieee80211_tx_status_ext(hw, txstat);
+}
+
+static __inline void
ieee80211_tx_info_clear_status(struct ieee80211_tx_info *info)
{
int i;
@@ -2356,13 +2366,6 @@ ieee80211_get_tx_rates(struct ieee80211_vif *vif, struct ieee80211_sta *sta,
}
static __inline void
-ieee80211_tx_status_ext(struct ieee80211_hw *hw,
- struct ieee80211_tx_status *txstat)
-{
- TODO();
-}
-
-static __inline void
ieee80211_color_change_finish(struct ieee80211_vif *vif)
{
TODO();
diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c
index e0457e0e5fa0..57dd174b62a1 100644
--- a/sys/compat/linuxkpi/common/src/linux_80211.c
+++ b/sys/compat/linuxkpi/common/src/linux_80211.c
@@ -4280,8 +4280,8 @@ linuxkpi_ieee80211_txq_get_depth(struct ieee80211_txq *txq,
* passed back from the driver. rawx_mit() saves the ni on the m and the
* m on the skb for us to be able to give feedback to net80211.
*/
-void
-linuxkpi_ieee80211_free_txskb(struct ieee80211_hw *hw, struct sk_buff *skb,
+static void
+_lkpi_ieee80211_free_txskb(struct ieee80211_hw *hw, struct sk_buff *skb,
int status)
{
struct ieee80211_node *ni;
@@ -4296,20 +4296,28 @@ linuxkpi_ieee80211_free_txskb(struct ieee80211_hw *hw, struct sk_buff *skb,
ieee80211_tx_complete(ni, m, status);
/* ni & mbuf were consumed. */
}
+}
+void
+linuxkpi_ieee80211_free_txskb(struct ieee80211_hw *hw, struct sk_buff *skb,
+ int status)
+{
+
+ _lkpi_ieee80211_free_txskb(hw, skb, status);
kfree_skb(skb);
}
void
-linuxkpi_ieee80211_tx_status(struct ieee80211_hw *hw, struct sk_buff *skb)
+linuxkpi_ieee80211_tx_status_ext(struct ieee80211_hw *hw,
+ struct ieee80211_tx_status *txstat)
{
+ struct sk_buff *skb;
struct ieee80211_tx_info *info;
struct ieee80211_ratectl_tx_status txs;
struct ieee80211_node *ni;
int status;
- info = IEEE80211_SKB_CB(skb);
-
+ skb = txstat->skb;
if (skb->m != NULL) {
struct mbuf *m;
@@ -4320,6 +4328,7 @@ linuxkpi_ieee80211_tx_status(struct ieee80211_hw *hw, struct sk_buff *skb)
ni = NULL;
}
+ info = txstat->info;
if (info->flags & IEEE80211_TX_STAT_ACK) {
status = 0; /* No error. */
txs.status = IEEE80211_RATECTL_TX_SUCCESS;
@@ -4342,7 +4351,7 @@ linuxkpi_ieee80211_tx_status(struct ieee80211_hw *hw, struct sk_buff *skb)
txs.flags |= IEEE80211_RATECTL_STATUS_LONG_RETRY;
}
#if 0 /* Unused in net80211 currently. */
- /* XXX-BZ conver;t check .flags for MCS/VHT/.. */
+ /* XXX-BZ convert check .flags for MCS/VHT/.. */
txs.final_rate = info->status.rates[0].idx;
txs.flags |= IEEE80211_RATECTL_STATUS_FINAL_RATE;
#endif
@@ -4390,7 +4399,25 @@ linuxkpi_ieee80211_tx_status(struct ieee80211_hw *hw, struct sk_buff *skb)
info->status.status_driver_data[1]);
#endif
- linuxkpi_ieee80211_free_txskb(hw, skb, status);
+ if (txstat->free_list) {
+ _lkpi_ieee80211_free_txskb(hw, skb, status);
+ list_add_tail(&skb->list, txstat->free_list);
+ } else {
+ linuxkpi_ieee80211_free_txskb(hw, skb, status);
+ }
+}
+
+void
+linuxkpi_ieee80211_tx_status(struct ieee80211_hw *hw, struct sk_buff *skb)
+{
+ struct ieee80211_tx_status status;
+
+ memset(&status, 0, sizeof(status));
+ status.info = IEEE80211_SKB_CB(skb);
+ status.skb = skb;
+ /* sta, n_rates, rates, free_list? */
+
+ ieee80211_tx_status_ext(hw, &status);
}
/*