linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mt76: mt7615: move mt7615 sta utilities in pci.c
@ 2019-08-29  8:57 Lorenzo Bianconi
  2019-08-30 11:52 ` Ryder Lee
  0 siblings, 1 reply; 3+ messages in thread
From: Lorenzo Bianconi @ 2019-08-29  8:57 UTC (permalink / raw)
  To: nbd; +Cc: lorenzo.bianconi, linux-wireless, ryder.lee, royluo

Move mt7615_sta_add, mt7615_sta_assoc, mt7615_sta_ps and mt7615_sta_remove
utility routines in pci.c and make them static since they are only used to
initialize mt76_driver_ops callbacks

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
---
 .../net/wireless/mediatek/mt76/mt7615/mac.c   |  4 --
 .../net/wireless/mediatek/mt76/mt7615/main.c  | 40 ---------------
 .../wireless/mediatek/mt76/mt7615/mt7615.h    |  7 ---
 .../net/wireless/mediatek/mt76/mt7615/pci.c   | 49 +++++++++++++++++++
 4 files changed, 49 insertions(+), 51 deletions(-)

diff --git a/drivers/net/wireless/mediatek/mt76/mt7615/mac.c b/drivers/net/wireless/mediatek/mt76/mt7615/mac.c
index e07ce2c10013..ee6b5a609ee7 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7615/mac.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7615/mac.c
@@ -215,10 +215,6 @@ int mt7615_mac_fill_rx(struct mt7615_dev *dev, struct sk_buff *skb)
 	return 0;
 }
 
-void mt7615_sta_ps(struct mt76_dev *mdev, struct ieee80211_sta *sta, bool ps)
-{
-}
-
 void mt7615_tx_complete_skb(struct mt76_dev *mdev, enum mt76_txq_id qid,
 			    struct mt76_queue_entry *e)
 {
diff --git a/drivers/net/wireless/mediatek/mt76/mt7615/main.c b/drivers/net/wireless/mediatek/mt76/mt7615/main.c
index 87c748715b5d..0da937f36d3d 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7615/main.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7615/main.c
@@ -336,46 +336,6 @@ mt7615_channel_switch_beacon(struct ieee80211_hw *hw,
 	mutex_unlock(&dev->mt76.mutex);
 }
 
-int mt7615_sta_add(struct mt76_dev *mdev, struct ieee80211_vif *vif,
-		   struct ieee80211_sta *sta)
-{
-	struct mt7615_dev *dev = container_of(mdev, struct mt7615_dev, mt76);
-	struct mt7615_sta *msta = (struct mt7615_sta *)sta->drv_priv;
-	struct mt7615_vif *mvif = (struct mt7615_vif *)vif->drv_priv;
-	int idx;
-
-	idx = mt76_wcid_alloc(dev->mt76.wcid_mask, MT7615_WTBL_STA - 1);
-	if (idx < 0)
-		return -ENOSPC;
-
-	msta->vif = mvif;
-	msta->wcid.sta = 1;
-	msta->wcid.idx = idx;
-
-	mt7615_mcu_add_wtbl(dev, vif, sta);
-	mt7615_mcu_set_sta_rec(dev, vif, sta, 1);
-
-	return 0;
-}
-
-void mt7615_sta_assoc(struct mt76_dev *mdev, struct ieee80211_vif *vif,
-		      struct ieee80211_sta *sta)
-{
-	struct mt7615_dev *dev = container_of(mdev, struct mt7615_dev, mt76);
-
-	if (sta->ht_cap.ht_supported)
-		mt7615_mcu_set_ht_cap(dev, vif, sta);
-}
-
-void mt7615_sta_remove(struct mt76_dev *mdev, struct ieee80211_vif *vif,
-		       struct ieee80211_sta *sta)
-{
-	struct mt7615_dev *dev = container_of(mdev, struct mt7615_dev, mt76);
-
-	mt7615_mcu_set_sta_rec(dev, vif, sta, 0);
-	mt7615_mcu_del_wtbl(dev, sta);
-}
-
 static void mt7615_sta_rate_tbl_update(struct ieee80211_hw *hw,
 				       struct ieee80211_vif *vif,
 				       struct ieee80211_sta *sta)
diff --git a/drivers/net/wireless/mediatek/mt76/mt7615/mt7615.h b/drivers/net/wireless/mediatek/mt76/mt7615/mt7615.h
index a79f4ffcb70f..6ea4645da053 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7615/mt7615.h
+++ b/drivers/net/wireless/mediatek/mt76/mt7615/mt7615.h
@@ -259,13 +259,6 @@ void mt7615_tx_complete_skb(struct mt76_dev *mdev, enum mt76_txq_id qid,
 
 void mt7615_queue_rx_skb(struct mt76_dev *mdev, enum mt76_rxq_id q,
 			 struct sk_buff *skb);
-void mt7615_sta_ps(struct mt76_dev *mdev, struct ieee80211_sta *sta, bool ps);
-int mt7615_sta_add(struct mt76_dev *mdev, struct ieee80211_vif *vif,
-		   struct ieee80211_sta *sta);
-void mt7615_sta_assoc(struct mt76_dev *mdev, struct ieee80211_vif *vif,
-		      struct ieee80211_sta *sta);
-void mt7615_sta_remove(struct mt76_dev *mdev, struct ieee80211_vif *vif,
-		       struct ieee80211_sta *sta);
 void mt7615_mac_work(struct work_struct *work);
 void mt7615_txp_skb_unmap(struct mt76_dev *dev,
 			  struct mt76_txwi_cache *txwi);
diff --git a/drivers/net/wireless/mediatek/mt76/mt7615/pci.c b/drivers/net/wireless/mediatek/mt76/mt7615/pci.c
index e250607e0a80..524ce35010e6 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7615/pci.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7615/pci.c
@@ -66,6 +66,55 @@ static irqreturn_t mt7615_irq_handler(int irq, void *dev_instance)
 	return IRQ_HANDLED;
 }
 
+static int
+mt7615_sta_add(struct mt76_dev *mdev, struct ieee80211_vif *vif,
+	       struct ieee80211_sta *sta)
+{
+	struct mt7615_dev *dev = container_of(mdev, struct mt7615_dev, mt76);
+	struct mt7615_sta *msta = (struct mt7615_sta *)sta->drv_priv;
+	struct mt7615_vif *mvif = (struct mt7615_vif *)vif->drv_priv;
+	int idx;
+
+	idx = mt76_wcid_alloc(dev->mt76.wcid_mask, MT7615_WTBL_STA - 1);
+	if (idx < 0)
+		return -ENOSPC;
+
+	msta->vif = mvif;
+	msta->wcid.sta = 1;
+	msta->wcid.idx = idx;
+
+	mt7615_mcu_add_wtbl(dev, vif, sta);
+	mt7615_mcu_set_sta_rec(dev, vif, sta, 1);
+
+	return 0;
+}
+
+static void
+mt7615_sta_assoc(struct mt76_dev *mdev, struct ieee80211_vif *vif,
+		 struct ieee80211_sta *sta)
+{
+	struct mt7615_dev *dev = container_of(mdev, struct mt7615_dev, mt76);
+
+	if (sta->ht_cap.ht_supported)
+		mt7615_mcu_set_ht_cap(dev, vif, sta);
+}
+
+static void
+mt7615_sta_remove(struct mt76_dev *mdev, struct ieee80211_vif *vif,
+		  struct ieee80211_sta *sta)
+{
+	struct mt7615_dev *dev = container_of(mdev, struct mt7615_dev, mt76);
+
+	mt7615_mcu_set_sta_rec(dev, vif, sta, 0);
+	mt7615_mcu_del_wtbl(dev, sta);
+}
+
+static void
+mt7615_sta_ps(struct mt76_dev *mdev, struct ieee80211_sta *sta,
+	      bool ps)
+{
+}
+
 static int mt7615_pci_probe(struct pci_dev *pdev,
 			    const struct pci_device_id *id)
 {
-- 
2.21.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] mt76: mt7615: move mt7615 sta utilities in pci.c
  2019-08-29  8:57 [PATCH] mt76: mt7615: move mt7615 sta utilities in pci.c Lorenzo Bianconi
@ 2019-08-30 11:52 ` Ryder Lee
  2019-08-30 12:06   ` Lorenzo Bianconi
  0 siblings, 1 reply; 3+ messages in thread
From: Ryder Lee @ 2019-08-30 11:52 UTC (permalink / raw)
  To: Lorenzo Bianconi; +Cc: nbd, lorenzo.bianconi, linux-wireless, royluo

On Thu, 2019-08-29 at 10:57 +0200, Lorenzo Bianconi wrote:
> Move mt7615_sta_add, mt7615_sta_assoc, mt7615_sta_ps and mt7615_sta_remove
> utility routines in pci.c and make them static since they are only used to
> initialize mt76_driver_ops callbacks
> 
> Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
> ---
>  .../net/wireless/mediatek/mt76/mt7615/mac.c   |  4 --
>  .../net/wireless/mediatek/mt76/mt7615/main.c  | 40 ---------------
>  .../wireless/mediatek/mt76/mt7615/mt7615.h    |  7 ---
>  .../net/wireless/mediatek/mt76/mt7615/pci.c   | 49 +++++++++++++++++++
>  4 files changed, 49 insertions(+), 51 deletions(-)

Just to note that we might have other interface shares with the same
utility routines in upcoming days.

Ryder


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] mt76: mt7615: move mt7615 sta utilities in pci.c
  2019-08-30 11:52 ` Ryder Lee
@ 2019-08-30 12:06   ` Lorenzo Bianconi
  0 siblings, 0 replies; 3+ messages in thread
From: Lorenzo Bianconi @ 2019-08-30 12:06 UTC (permalink / raw)
  To: Ryder Lee; +Cc: nbd, lorenzo.bianconi, linux-wireless, royluo

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

> On Thu, 2019-08-29 at 10:57 +0200, Lorenzo Bianconi wrote:
> > Move mt7615_sta_add, mt7615_sta_assoc, mt7615_sta_ps and mt7615_sta_remove
> > utility routines in pci.c and make them static since they are only used to
> > initialize mt76_driver_ops callbacks
> > 
> > Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
> > ---
> >  .../net/wireless/mediatek/mt76/mt7615/mac.c   |  4 --
> >  .../net/wireless/mediatek/mt76/mt7615/main.c  | 40 ---------------
> >  .../wireless/mediatek/mt76/mt7615/mt7615.h    |  7 ---
> >  .../net/wireless/mediatek/mt76/mt7615/pci.c   | 49 +++++++++++++++++++
> >  4 files changed, 49 insertions(+), 51 deletions(-)
> 
> Just to note that we might have other interface shares with the same
> utility routines in upcoming days.
> 
> Ryder
> 

Hi Ryder,

I guess what really matter is if they are non-PCI based devices and if they 
rely on the same mcu commands

Regards,
Lorenzo

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-08-30 12:07 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-08-29  8:57 [PATCH] mt76: mt7615: move mt7615 sta utilities in pci.c Lorenzo Bianconi
2019-08-30 11:52 ` Ryder Lee
2019-08-30 12:06   ` Lorenzo Bianconi

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).