linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
To: sean.wang@mediatek.com
Cc: nbd@nbd.name, Soul.Huang@mediatek.com, YN.Chen@mediatek.com,
	Leon.Yen@mediatek.com, Eric-SY.Chang@mediatek.com,
	Deren.Wu@mediatek.com, km.lin@mediatek.com,
	robin.chiu@mediatek.com, Eddie.Chen@mediatek.com,
	ch.yeh@mediatek.com, posh.sun@mediatek.com,
	ted.huang@mediatek.com, Eric.Liang@mediatek.com,
	Stella.Chang@mediatek.com, steve.lee@mediatek.com,
	jsiuda@google.com, frankgor@google.com, jemele@google.com,
	shawnku@google.com, linux-wireless@vger.kernel.org,
	linux-mediatek@lists.infradead.org
Subject: Re: [PATCH v2 05/16] mt76: mt7921: add MT7921_COMMON module
Date: Sat, 18 Sep 2021 12:12:49 +0200	[thread overview]
Message-ID: <YUW7oRGTgw0wmcsj@lore-desk> (raw)
In-Reply-To: <23bf9455d505c19fc484de533098b98b08804935.1631918993.git.objelf@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 8896 bytes --]

> From: Sean Wang <sean.wang@mediatek.com>
> 
> This is a preliminary patch to introduce mt7921s support.
> 
> MT7921_COMMON module grouping bus independent objects the both mt7921e and
> mt7921s can share with and have to rely on.
> 
> Tested-by: Deren Wu <deren.wu@mediatek.com>
> Signed-off-by: Sean Wang <sean.wang@mediatek.com>
> ---
>  drivers/net/wireless/mediatek/mt76/mt7921/Kconfig  | 8 ++++++--
>  drivers/net/wireless/mediatek/mt76/mt7921/Makefile | 7 ++++---
>  drivers/net/wireless/mediatek/mt76/mt7921/init.c   | 2 ++
>  drivers/net/wireless/mediatek/mt76/mt7921/mac.c    | 6 ++++++
>  drivers/net/wireless/mediatek/mt76/mt7921/main.c   | 7 +++++++
>  drivers/net/wireless/mediatek/mt76/mt7921/mcu.c    | 9 +++++++++
>  6 files changed, 34 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/Kconfig b/drivers/net/wireless/mediatek/mt76/mt7921/Kconfig
> index 001f2b9cec26..071746809b1c 100644
> --- a/drivers/net/wireless/mediatek/mt76/mt7921/Kconfig
> +++ b/drivers/net/wireless/mediatek/mt76/mt7921/Kconfig
> @@ -1,8 +1,12 @@
>  # SPDX-License-Identifier: ISC
> -config MT7921E
> -	tristate "MediaTek MT7921E (PCIe) support"
> +config MT7921_COMMON
> +	tristate
>  	select MT76_CONNAC_LIB
>  	select WANT_DEV_COREDUMP
> +
> +config MT7921E
> +	tristate "MediaTek MT7921E (PCIe) support"
> +	select MT7921_COMMON
>  	depends on MAC80211
>  	depends on PCI
>  	help
> diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/Makefile b/drivers/net/wireless/mediatek/mt76/mt7921/Makefile
> index 4cb0b000cfe1..8cea896d5965 100644
> --- a/drivers/net/wireless/mediatek/mt76/mt7921/Makefile
> +++ b/drivers/net/wireless/mediatek/mt76/mt7921/Makefile
> @@ -1,9 +1,10 @@
>  # SPDX-License-Identifier: ISC
>  
> +obj-$(CONFIG_MT7921_COMMON) += mt7921-common.o
>  obj-$(CONFIG_MT7921E) += mt7921e.o
>  
>  CFLAGS_trace.o := -I$(src)
>  
> -mt7921e-y := pci.o pci_mac.o pci_mcu.o mac.o mcu.o dma.o eeprom.o main.o \
> -	     init.o debugfs.o trace.o
> -mt7921e-$(CONFIG_NL80211_TESTMODE) += testmode.o
> +mt7921-common-y := mac.o mcu.o eeprom.o main.o init.o debugfs.o trace.o
> +mt7921-common-$(CONFIG_NL80211_TESTMODE) += testmode.o
> +mt7921e-y := pci.o pci_mac.o pci_mcu.o dma.o
> diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/init.c b/drivers/net/wireless/mediatek/mt76/mt7921/init.c
> index f0fd32c424c6..d310d6e1e566 100644
> --- a/drivers/net/wireless/mediatek/mt76/mt7921/init.c
> +++ b/drivers/net/wireless/mediatek/mt76/mt7921/init.c
> @@ -145,6 +145,7 @@ int mt7921_mac_init(struct mt7921_dev *dev)
>  
>  	return mt76_connac_mcu_set_rts_thresh(&dev->mt76, 0x92b, 0);
>  }
> +EXPORT_SYMBOL_GPL(mt7921_mac_init);
>  
>  static int __mt7921_init_hardware(struct mt7921_dev *dev)
>  {
> @@ -285,3 +286,4 @@ int mt7921_register_device(struct mt7921_dev *dev)
>  
>  	return 0;
>  }
> +EXPORT_SYMBOL_GPL(mt7921_register_device);
> diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/mac.c b/drivers/net/wireless/mediatek/mt76/mt7921/mac.c
> index 24f24a2d8395..5812b518a571 100644
> --- a/drivers/net/wireless/mediatek/mt76/mt7921/mac.c
> +++ b/drivers/net/wireless/mediatek/mt76/mt7921/mac.c
> @@ -39,6 +39,7 @@ static struct mt76_wcid *mt7921_rx_get_wcid(struct mt7921_dev *dev,
>  void mt7921_sta_ps(struct mt76_dev *mdev, struct ieee80211_sta *sta, bool ps)
>  {
>  }
> +EXPORT_SYMBOL_GPL(mt7921_sta_ps);
>  
>  bool mt7921_mac_wtbl_update(struct mt7921_dev *dev, int idx, u32 mask)
>  {
> @@ -169,6 +170,7 @@ void mt7921_mac_sta_poll(struct mt7921_dev *dev)
>  
>  	rcu_read_unlock();
>  }
> +EXPORT_SYMBOL_GPL(mt7921_mac_sta_poll);
>  
>  static void
>  mt7921_mac_decode_he_radiotap_ru(struct mt76_rx_status *status,
> @@ -920,6 +922,7 @@ void mt7921_mac_write_txwi(struct mt7921_dev *dev, __le32 *txwi,
>  		txwi[3] |= cpu_to_le32(MT_TXD3_BA_DISABLE);
>  	}
>  }
> +EXPORT_SYMBOL_GPL(mt7921_mac_write_txwi);
>  
>  void mt7921_tx_check_aggr(struct ieee80211_sta *sta, __le32 *txwi)
>  {
> @@ -944,6 +947,7 @@ void mt7921_tx_check_aggr(struct ieee80211_sta *sta, __le32 *txwi)
>  	if (!test_and_set_bit(tid, &msta->ampdu_state))
>  		ieee80211_start_tx_ba_session(sta, tid, 0);
>  }
> +EXPORT_SYMBOL_GPL(mt7921_tx_check_aggr);
>  
>  static bool
>  mt7921_mac_add_txs_skb(struct mt7921_dev *dev, struct mt76_wcid *wcid, int pid,
> @@ -1132,6 +1136,7 @@ void mt7921_queue_rx_skb(struct mt76_dev *mdev, enum mt76_rxq_id q,
>  		break;
>  	}
>  }
> +EXPORT_SYMBOL_GPL(mt7921_queue_rx_skb);
>  
>  void mt7921_mac_reset_counters(struct mt7921_phy *phy)
>  {
> @@ -1247,6 +1252,7 @@ void mt7921_update_channel(struct mt76_phy *mphy)
>  
>  	mt76_connac_power_save_sched(mphy, &dev->pm);
>  }
> +EXPORT_SYMBOL_GPL(mt7921_update_channel);
>  
>  static void
>  mt7921_vif_connect_iter(void *priv, u8 *mac,
> diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/main.c b/drivers/net/wireless/mediatek/mt76/mt7921/main.c
> index c51266e40cb4..cbffa8478329 100644
> --- a/drivers/net/wireless/mediatek/mt76/mt7921/main.c
> +++ b/drivers/net/wireless/mediatek/mt76/mt7921/main.c
> @@ -237,6 +237,7 @@ int __mt7921_start(struct mt7921_phy *phy)
>  
>  	return 0;
>  }
> +EXPORT_SYMBOL_GPL(__mt7921_start);
>  
>  static int mt7921_start(struct ieee80211_hw *hw)
>  {
> @@ -646,6 +647,7 @@ int mt7921_mac_sta_add(struct mt76_dev *mdev, struct ieee80211_vif *vif,
>  
>  	return 0;
>  }
> +EXPORT_SYMBOL_GPL(mt7921_mac_sta_add);
>  
>  void mt7921_mac_sta_assoc(struct mt76_dev *mdev, struct ieee80211_vif *vif,
>  			  struct ieee80211_sta *sta)
> @@ -667,6 +669,7 @@ void mt7921_mac_sta_assoc(struct mt76_dev *mdev, struct ieee80211_vif *vif,
>  
>  	mt7921_mutex_release(dev);
>  }
> +EXPORT_SYMBOL_GPL(mt7921_mac_sta_assoc);
>  
>  void mt7921_mac_sta_remove(struct mt76_dev *mdev, struct ieee80211_vif *vif,
>  			   struct ieee80211_sta *sta)
> @@ -698,6 +701,7 @@ void mt7921_mac_sta_remove(struct mt76_dev *mdev, struct ieee80211_vif *vif,
>  
>  	mt76_connac_power_save_sched(&dev->mphy, &dev->pm);
>  }
> +EXPORT_SYMBOL_GPL(mt7921_mac_sta_remove);
>  
>  void mt7921_tx_worker(struct mt76_worker *w)
>  {
> @@ -1250,3 +1254,6 @@ const struct ieee80211_ops mt7921_ops = {
>  	.flush = mt7921_flush,
>  	.set_sar_specs = mt7921_set_sar_specs,
>  };
> +EXPORT_SYMBOL_GPL(mt7921_ops);
> +
> +MODULE_LICENSE("Dual BSD/GPL");

is MODULE_AUTHOR defined?

> diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7921/mcu.c
> index 5553221b7f5c..866b8797f16e 100644
> --- a/drivers/net/wireless/mediatek/mt76/mt7921/mcu.c
> +++ b/drivers/net/wireless/mediatek/mt76/mt7921/mcu.c
> @@ -222,6 +222,8 @@ int mt7921_mcu_parse_response(struct mt76_dev *mdev, int cmd,
>  
>  	return ret;
>  }
> +EXPORT_SYMBOL_GPL(mt7921_mcu_parse_response);
> +

nit: drop new line here

>  
>  int mt7921_mcu_send_message(struct mt76_dev *mdev, struct sk_buff *skb,
>  			    int cmd, int *wait_seq)
> @@ -319,6 +321,7 @@ int mt7921_mcu_send_message(struct mt76_dev *mdev, struct sk_buff *skb,
>  
>  	return mt76_tx_queue_skb_raw(dev, mdev->q_mcu[txq], skb, 0);
>  }
> +EXPORT_SYMBOL_GPL(mt7921_mcu_send_message);
>  
>  static void
>  mt7921_mcu_scan_event(struct mt7921_dev *dev, struct sk_buff *skb)
> @@ -600,6 +603,7 @@ int mt7921_mcu_restart(struct mt76_dev *dev)
>  	return mt76_mcu_send_msg(dev, MCU_CMD_NIC_POWER_CTRL, &req,
>  				 sizeof(req), false);
>  }
> +EXPORT_SYMBOL_GPL(mt7921_mcu_restart);
>  
>  static u32 mt7921_get_data_mode(struct mt7921_dev *dev, u32 info)
>  {
> @@ -903,11 +907,13 @@ int mt7921_run_firmware(struct mt7921_dev *dev)
>  
>  	return mt76_connac_mcu_get_nic_capability(&dev->mphy);
>  }
> +EXPORT_SYMBOL_GPL(mt7921_run_firmware);
>  
>  void mt7921_mcu_exit(struct mt7921_dev *dev)
>  {
>  	skb_queue_purge(&dev->mt76.mcu.res_q);
>  }
> +EXPORT_SYMBOL_GPL(mt7921_mcu_exit);
>  
>  int mt7921_mcu_set_tx(struct mt7921_dev *dev, struct ieee80211_vif *vif)
>  {
> @@ -1033,6 +1039,7 @@ int mt7921_mcu_set_eeprom(struct mt7921_dev *dev)
>  	return mt76_mcu_send_msg(&dev->mt76, MCU_EXT_CMD_EFUSE_BUFFER_MODE,
>  				 &req, sizeof(req), true);
>  }
> +EXPORT_SYMBOL_GPL(mt7921_mcu_set_eeprom);
>  
>  int mt7921_mcu_get_eeprom(struct mt7921_dev *dev, u32 offset)
>  {
> @@ -1215,6 +1222,7 @@ int mt7921_mcu_drv_pmctrl(struct mt7921_dev *dev)
>  
>  	return err;
>  }
> +EXPORT_SYMBOL_GPL(mt7921_mcu_drv_pmctrl);
>  
>  int mt7921_mcu_fw_pmctrl(struct mt7921_dev *dev)
>  {
> @@ -1236,6 +1244,7 @@ int mt7921_mcu_fw_pmctrl(struct mt7921_dev *dev)
>  
>  	return err;
>  }
> +EXPORT_SYMBOL_GPL(mt7921_mcu_fw_pmctrl);
>  
>  int mt7921_mcu_set_beacon_filter(struct mt7921_dev *dev,
>  				 struct ieee80211_vif *vif,
> -- 
> 2.25.1
> 

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

  reply	other threads:[~2021-09-18 10:14 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-17 23:59 [PATCH v2 00/16] Add MT7921 SDIO support sean.wang
2021-09-17 23:59 ` [PATCH v2 01/16] mt76: mt7921: refactor mac.c to be bus independent sean.wang
2021-09-17 23:59 ` [PATCH v2 02/16] mt76: mt7921: refactor dma.c to be pcie specific sean.wang
2021-09-17 23:59 ` [PATCH v2 03/16] mt76: mt7921: refactor mcu.c to be bus independent sean.wang
2021-09-17 23:59 ` [PATCH v2 04/16] mt76: mt7921: refactor init.c " sean.wang
2021-09-17 23:59 ` [PATCH v2 05/16] mt76: mt7921: add MT7921_COMMON module sean.wang
2021-09-18 10:12   ` Lorenzo Bianconi [this message]
2021-09-17 23:59 ` [PATCH v2 06/16] mt76: connac: move mcu reg access utility routines in mt76_connac_lib module sean.wang
2021-09-18 10:15   ` Lorenzo Bianconi
2021-09-17 23:59 ` [PATCH v2 07/16] mt76: mt7663s: rely on mcu reg access utility sean.wang
2021-09-17 23:59 ` [PATCH v2 08/16] mt76: mt7921: make all event parser reusable between mt7921s and mt7921e sean.wang
2021-09-18 10:16   ` Lorenzo Bianconi
2021-09-17 23:59 ` [PATCH v2 09/16] mt76: mt7921: use physical addr to unify register access sean.wang
2021-09-17 23:59 ` [PATCH v2 10/16] mt76: sdio: move common code in mt76_sdio module sean.wang
2021-09-17 23:59 ` [PATCH v2 11/16] mt76: sdio: extend sdio module to support CONNAC2 sean.wang
2021-09-17 23:59 ` [PATCH v2 12/16] mt76: connac: extend mcu_get_nic_capability sean.wang
2021-09-17 23:59 ` [PATCH v2 13/16] mt76: mt7921: rely on mcu_get_nic_capability sean.wang
2021-09-17 23:59 ` [PATCH v2 14/16] mt76: mt7921: refactor mt7921_mcu_send_message sean.wang
2021-09-17 23:59 ` [PATCH v2 15/16] mt76: mt7921: introduce mt7921s support sean.wang
2021-09-17 23:59 ` [PATCH v2 16/16] mt76: mt7921s: add reset support sean.wang
2021-09-18 10:29 ` [PATCH v2 00/16] Add MT7921 SDIO support Lorenzo Bianconi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YUW7oRGTgw0wmcsj@lore-desk \
    --to=lorenzo.bianconi@redhat.com \
    --cc=Deren.Wu@mediatek.com \
    --cc=Eddie.Chen@mediatek.com \
    --cc=Eric-SY.Chang@mediatek.com \
    --cc=Eric.Liang@mediatek.com \
    --cc=Leon.Yen@mediatek.com \
    --cc=Soul.Huang@mediatek.com \
    --cc=Stella.Chang@mediatek.com \
    --cc=YN.Chen@mediatek.com \
    --cc=ch.yeh@mediatek.com \
    --cc=frankgor@google.com \
    --cc=jemele@google.com \
    --cc=jsiuda@google.com \
    --cc=km.lin@mediatek.com \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=nbd@nbd.name \
    --cc=posh.sun@mediatek.com \
    --cc=robin.chiu@mediatek.com \
    --cc=sean.wang@mediatek.com \
    --cc=shawnku@google.com \
    --cc=steve.lee@mediatek.com \
    --cc=ted.huang@mediatek.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).