On 11/8/2024 1:42 PM, Johannes Berg wrote:
+static void cc33xx_op_tx(struct ieee80211_hw *hw,
+ struct ieee80211_tx_control *control,
+ struct sk_buff *skb)
+{
+ struct cc33xx *cc = hw->priv;
+ struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
+ struct ieee80211_vif *vif = info->control.vif;
+ struct cc33xx_vif *wlvif = NULL;
+ enum cc33xx_queue_stop_reason stop_reason = CC33XX_QUEUE_STOP_REASON_WATERMARK;
+ unsigned long flags;
+ int q, mapping;
+ u8 hlid;
+
+ if (!vif) {
+ ieee80211_free_txskb(hw, skb);
+ return;
+ }
+
+ wlvif = cc33xx_vif_to_data(vif);
+ mapping = skb_get_queue_mapping(skb);
+ q = cc33xx_tx_get_queue(mapping);
+
+ hlid = cc33xx_tx_get_hlid(cc, wlvif, skb, control->sta);
+
+ spin_lock_irqsave(&cc->cc_lock, flags);
+
+ /* drop the packet if the link is invalid or the queue is stopped
+ * for any reason but watermark. Watermark is a "soft"-stop so we
+ * allow these packets through.
+ */
+
+ if (hlid == CC33XX_INVALID_LINK_ID ||
+ (!test_bit(hlid, wlvif->links_map)) ||
+ (cc33xx_is_queue_stopped_locked(cc, wlvif, q) &&
+ !cc33xx_is_queue_stopped_by_reason_locked(cc, wlvif, q,
+ stop_reason))) {
+ cc33xx_debug(DEBUG_TX, "DROP skb hlid %d q %d ", hlid, q);
+ ieee80211_free_txskb(hw, skb);
+ goto out;
+ }
I'd consider converting to itxq APIs, you already use them anyway via
ieee80211_handle_wake_tx_queue so you don't gain anything from not doing
it, but you gain a lot of flexibility from doing it and don't have to do
things like this?
It's not _that_ hard.
OK, so just to make sure I understand - mac80211 now has Tx queues per
AC (struct ieee80211_txq) and it makes more sense to do something like
ath10k ([1])?
Frames pushed via original Tx op are non-QoS traffic, right? (i.e, no
need to worry about frame order between the two handlers)
Thank and regards,
Michael.
[1]
https://elixir.bootlin.com/linux/v6.12/source/drivers/net/wireless/ath/ath10k/mac.c#L4728