diff options
author | Felix Fietkau <nbd@nbd.name> | 2019-09-30 21:23:03 +0200 |
---|---|---|
committer | Felix Fietkau <nbd@nbd.name> | 2020-02-14 07:49:59 +0100 |
commit | e54432563b68592867adefa5c3ab4d7e46546e83 (patch) | |
tree | 4f7c43fe622115927b57f52445d1c5d0040ce6b1 /drivers/net/wireless/mediatek/mt76/mac80211.c | |
parent | aa7619a39acef91c5a6904f3ada7d0f20e2ad25e (diff) |
mt76: move initialization of some struct members to mt76_alloc_device
Reduces duplication and prepares for further rework
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to 'drivers/net/wireless/mediatek/mt76/mac80211.c')
-rw-r--r-- | drivers/net/wireless/mediatek/mt76/mac80211.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/net/wireless/mediatek/mt76/mac80211.c b/drivers/net/wireless/mediatek/mt76/mac80211.c index 96018fd65779..73853b449730 100644 --- a/drivers/net/wireless/mediatek/mt76/mac80211.c +++ b/drivers/net/wireless/mediatek/mt76/mac80211.c @@ -275,6 +275,7 @@ mt76_alloc_device(struct device *pdev, unsigned int size, { struct ieee80211_hw *hw; struct mt76_dev *dev; + int i; hw = ieee80211_alloc_hw(size, ops); if (!hw) @@ -292,6 +293,11 @@ mt76_alloc_device(struct device *pdev, unsigned int size, init_waitqueue_head(&dev->tx_wait); skb_queue_head_init(&dev->status_list); + INIT_LIST_HEAD(&dev->txwi_cache); + + for (i = 0; i < ARRAY_SIZE(dev->q_rx); i++) + skb_queue_head_init(&dev->rx_skb[i]); + tasklet_init(&dev->tx_tasklet, mt76_tx_tasklet, (unsigned long)dev); return dev; @@ -307,8 +313,6 @@ int mt76_register_device(struct mt76_dev *dev, bool vht, dev_set_drvdata(dev->dev, dev); - INIT_LIST_HEAD(&dev->txwi_cache); - SET_IEEE80211_DEV(hw, dev->dev); SET_IEEE80211_PERM_ADDR(hw, dev->macaddr); |