On Thu, Sep 27, 2018 at 11:01:46AM +0200, Lorenzo Bianconi wrote: > Introduce mt76x02_mac_start since the mac start code is shared between > mt76x0e and mt76x2 drivers. > > Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@xxxxxxxxxx> > --- > drivers/net/wireless/mediatek/mt76/mt76x02_mac.c | 15 +++++++++++++++ > drivers/net/wireless/mediatek/mt76/mt76x02_mac.h | 1 + > drivers/net/wireless/mediatek/mt76/mt76x2_init.c | 12 +----------- > 3 files changed, 17 insertions(+), 11 deletions(-) > > diff --git a/drivers/net/wireless/mediatek/mt76/mt76x02_mac.c b/drivers/net/wireless/mediatek/mt76/mt76x02_mac.c > index df4366a702c9..5f120c1fa79f 100644 > --- a/drivers/net/wireless/mediatek/mt76/mt76x02_mac.c > +++ b/drivers/net/wireless/mediatek/mt76/mt76x02_mac.c > @@ -18,6 +18,8 @@ > #include "mt76.h" > #include "mt76x02_regs.h" > #include "mt76x02_mac.h" > +#include "mt76x02_dma.h" > +#include "mt76x02_util.h" > > enum mt76x02_cipher_type > mt76x02_mac_get_key_info(struct ieee80211_key_conf *key, u8 *key_data) > @@ -520,3 +522,16 @@ void mt76x02_mac_setaddr(struct mt76_dev *dev, u8 *addr) > FIELD_PREP(MT_MAC_ADDR_DW1_U2ME_MASK, 0xff)); > } > EXPORT_SYMBOL_GPL(mt76x02_mac_setaddr); > + > +void mt76x02_mac_start(struct mt76_dev *dev) > +{ > + mt76x02_dma_enable(dev); > + __mt76_wr(dev, MT_RX_FILTR_CFG, dev->rxfilter); > + __mt76_wr(dev, MT_MAC_SYS_CTRL, > + MT_MAC_SYS_CTRL_ENABLE_TX | > + MT_MAC_SYS_CTRL_ENABLE_RX); > + mt76x02_irq_enable(dev, > + MT_INT_RX_DONE_ALL | MT_INT_TX_DONE_ALL | > + MT_INT_TX_STAT); > +} irq_enable is PCIe specific (also mt76x02_dma_enable() seems to be PCIe specifc). I think this should be not mixed within generic code and perhaps the function name prefix should be mt76x02e_ . Thanks Stanislaw