// SPDX-License-Identifier: GPL-2.0-only /* * Copyright (C) 2014 Felix Fietkau <[email protected]> * Copyright (C) 2015 Jakub Kicinski <[email protected]> */ #include "mt7601u.h" #include "trace.h" enum mt76_txq_id { … }; /* Hardware uses mirrored order of queues with Q0 having the highest priority */ static u8 q2hwq(u8 q) { … } /* Take mac80211 Q id from the skb and translate it to hardware Q id */ static u8 skb2q(struct sk_buff *skb) { … } /* Note: TX retry reporting is a bit broken. * Retries are reported only once per AMPDU and often come a frame early * i.e. they are reported in the last status preceding the AMPDU. Apart * from the fact that it's hard to know the length of the AMPDU (which is * required to know to how many consecutive frames retries should be * applied), if status comes early on full FIFO it gets lost and retries * of the whole AMPDU become invisible. * As a work-around encode the desired rate in PKT_ID of TX descriptor * and based on that guess the retries (every rate is tried once). * Only downside here is that for MCS0 we have to rely solely on * transmission failures as no retries can ever be reported. * Not having to read EXT_FIFO has a nice effect of doubling the number * of reports which can be fetched. * Also the vendor driver never uses the EXT_FIFO register so it may be * undertested. */ static u8 mt7601u_tx_pktid_enc(struct mt7601u_dev *dev, u8 rate, bool is_probe) { … } static void mt7601u_tx_pktid_dec(struct mt7601u_dev *dev, struct mt76_tx_status *stat) { … } static void mt7601u_tx_skb_remove_dma_overhead(struct sk_buff *skb, struct ieee80211_tx_info *info) { … } void mt7601u_tx_status(struct mt7601u_dev *dev, struct sk_buff *skb) { … } static int mt7601u_skb_rooms(struct mt7601u_dev *dev, struct sk_buff *skb) { … } static struct mt76_txwi * mt7601u_push_txwi(struct mt7601u_dev *dev, struct sk_buff *skb, struct ieee80211_sta *sta, struct mt76_wcid *wcid, int pkt_len) { … } void mt7601u_tx(struct ieee80211_hw *hw, struct ieee80211_tx_control *control, struct sk_buff *skb) { … } void mt7601u_tx_stat(struct work_struct *work) { … } int mt7601u_conf_tx(struct ieee80211_hw *hw, struct ieee80211_vif *vif, unsigned int link_id, u16 queue, const struct ieee80211_tx_queue_params *params) { … }