mirror of
https://github.com/outbackdingo/mt76.git
synced 2026-10-24 13:26:48 +00:00
mt76: mt7921: add MCU support
MT7921 contains a microprocessor with which the host can use command/event to communicate to implement offload features such as establish connection, hardware scan and so on. The host has to download the ROM patch, RAM firmware and finally activate the MCU to complete the MT7921 initialization. Co-developed-by: Lorenzo Bianconi <[email protected]> Signed-off-by: Lorenzo Bianconi <[email protected]> Co-developed-by: Soul Huang <[email protected]> Signed-off-by: Soul Huang <[email protected]> Signed-off-by: Sean Wang <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
This commit is contained in:
@@ -1338,6 +1338,30 @@ mt7921_mac_update_mib_stats(struct mt7921_phy *phy)
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
mt7921_mac_sta_stats_work(struct mt7921_phy *phy)
|
||||
{
|
||||
struct mt7921_dev *dev = phy->dev;
|
||||
struct mt7921_sta *msta;
|
||||
LIST_HEAD(list);
|
||||
|
||||
spin_lock_bh(&dev->sta_poll_lock);
|
||||
list_splice_init(&phy->stats_list, &list);
|
||||
|
||||
while (!list_empty(&list)) {
|
||||
msta = list_first_entry(&list, struct mt7921_sta, stats_list);
|
||||
list_del_init(&msta->stats_list);
|
||||
spin_unlock_bh(&dev->sta_poll_lock);
|
||||
|
||||
/* query wtbl info to report tx rate for further devices */
|
||||
mt7921_get_wtbl_info(dev, msta->wcid.idx);
|
||||
|
||||
spin_lock_bh(&dev->sta_poll_lock);
|
||||
}
|
||||
|
||||
spin_unlock_bh(&dev->sta_poll_lock);
|
||||
}
|
||||
|
||||
void mt7921_mac_work(struct work_struct *work)
|
||||
{
|
||||
struct mt7921_phy *phy;
|
||||
@@ -1355,6 +1379,10 @@ void mt7921_mac_work(struct work_struct *work)
|
||||
|
||||
mt7921_mac_update_mib_stats(phy);
|
||||
}
|
||||
if (++phy->sta_work_count == 10) {
|
||||
phy->sta_work_count = 0;
|
||||
mt7921_mac_sta_stats_work(phy);
|
||||
};
|
||||
|
||||
mutex_unlock(&mphy->dev->mutex);
|
||||
|
||||
|
||||
+2382
File diff suppressed because it is too large
Load Diff
+1050
File diff suppressed because it is too large
Load Diff
@@ -130,6 +130,8 @@ struct mt7921_phy {
|
||||
struct mib_stats mib;
|
||||
struct list_head stats_list;
|
||||
|
||||
u8 sta_work_count;
|
||||
|
||||
struct sk_buff_head scan_event_list;
|
||||
struct delayed_work scan_work;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user