All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lorenzo Bianconi <lorenzo@kernel.org>
To: nbd@nbd.name
Cc: lorenzo.bianconi@redhat.com, sean.wang@mediatek.com,
	linux-wireless@vger.kernel.org, ryder.lee@mediatek.com
Subject: [PATCH v2 23/25] mt76: mt7615: introduce set_ba uni command
Date: Sun,  8 Mar 2020 23:08:35 +0100	[thread overview]
Message-ID: <fdd3986ed7cfdd52d39ca9d5069c0169eff5f18a.1583705012.git.lorenzo@kernel.org> (raw)
In-Reply-To: <cover.1583705012.git.lorenzo@kernel.org>

Introduce mt7615_mcu_uni_set_ba routine in order to add support
for mt7663e driver

Co-developed-by: Sean Wang <sean.wang@mediatek.com>
Signed-off-by: Sean Wang <sean.wang@mediatek.com>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
---
 .../net/wireless/mediatek/mt76/mt7615/mcu.c   | 84 +++++++++++++++++++
 1 file changed, 84 insertions(+)

diff --git a/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c
index 6ea62959caef..afe192e0c48a 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c
@@ -1306,6 +1306,88 @@ mt7615_mcu_uni_add_beacon_offload(struct mt7615_dev *dev,
 				   &req, sizeof(req), true);
 }
 
+static int
+mt7615_mcu_uni_tx_ba(struct mt7615_dev *dev,
+		     struct ieee80211_ampdu_params *params,
+		     bool enable)
+{
+	struct mt7615_sta *msta = (struct mt7615_sta *)params->sta->drv_priv;
+	struct mt7615_vif *mvif = msta->vif;
+	struct wtbl_req_hdr *wtbl_hdr;
+	struct tlv *sta_wtbl;
+	struct sk_buff *skb;
+	int err;
+
+	skb = mt7615_mcu_alloc_sta_req(mvif, msta);
+	if (IS_ERR(skb))
+		return PTR_ERR(skb);
+
+	sta_wtbl = mt7615_mcu_add_tlv(skb, STA_REC_WTBL,
+				      sizeof(struct sta_rec_wtbl));
+
+	wtbl_hdr = mt7615_mcu_alloc_wtbl_req(msta, WTBL_SET, sta_wtbl, &skb);
+	if (IS_ERR(wtbl_hdr))
+		return PTR_ERR(wtbl_hdr);
+
+	mt7615_mcu_wtbl_ba_tlv(skb, params, enable, true, sta_wtbl,
+			       wtbl_hdr);
+
+	err =  __mt76_mcu_skb_send_msg(&dev->mt76, skb,
+				       MCU_UNI_CMD_STA_REC_UPDATE, true);
+	if (err < 0)
+		return err;
+
+	skb = mt7615_mcu_alloc_sta_req(mvif, msta);
+	if (IS_ERR(skb))
+		return PTR_ERR(skb);
+
+	mt7615_mcu_sta_ba_tlv(skb, params, enable, true);
+
+	return __mt76_mcu_skb_send_msg(&dev->mt76, skb,
+				       MCU_UNI_CMD_STA_REC_UPDATE, true);
+}
+
+static int
+mt7615_mcu_uni_rx_ba(struct mt7615_dev *dev,
+		     struct ieee80211_ampdu_params *params,
+		     bool enable)
+{
+	struct mt7615_sta *msta = (struct mt7615_sta *)params->sta->drv_priv;
+	struct mt7615_vif *mvif = msta->vif;
+	struct wtbl_req_hdr *wtbl_hdr;
+	struct tlv *sta_wtbl;
+	struct sk_buff *skb;
+	int err;
+
+	skb = mt7615_mcu_alloc_sta_req(mvif, msta);
+	if (IS_ERR(skb))
+		return PTR_ERR(skb);
+
+	mt7615_mcu_sta_ba_tlv(skb, params, enable, false);
+
+	err = __mt76_mcu_skb_send_msg(&dev->mt76, skb,
+				      MCU_UNI_CMD_STA_REC_UPDATE, true);
+	if (err < 0 || !enable)
+		return err;
+
+	skb = mt7615_mcu_alloc_sta_req(mvif, msta);
+	if (IS_ERR(skb))
+		return PTR_ERR(skb);
+
+	sta_wtbl = mt7615_mcu_add_tlv(skb, STA_REC_WTBL,
+				      sizeof(struct sta_rec_wtbl));
+
+	wtbl_hdr = mt7615_mcu_alloc_wtbl_req(msta, WTBL_SET, sta_wtbl, &skb);
+	if (IS_ERR(wtbl_hdr))
+		return PTR_ERR(wtbl_hdr);
+
+	mt7615_mcu_wtbl_ba_tlv(skb, params, enable, false, sta_wtbl,
+			       wtbl_hdr);
+
+	return __mt76_mcu_skb_send_msg(&dev->mt76, skb,
+				       MCU_UNI_CMD_STA_REC_UPDATE, true);
+}
+
 static int
 mt7615_mcu_uni_set_state(struct mt7615_dev *dev, struct ieee80211_vif *vif,
 			 struct ieee80211_sta *sta, int state)
@@ -1363,6 +1445,8 @@ static const struct mt7615_mcu_ops uni_update_ops = {
 	.set_pm_state = mt7615_mcu_uni_ctrl_pm_state,
 	.add_dev_info = mt7615_mcu_uni_add_dev,
 	.add_bss_info = mt7615_mcu_uni_add_bss,
+	.add_tx_ba = mt7615_mcu_uni_tx_ba,
+	.add_rx_ba = mt7615_mcu_uni_rx_ba,
 	.sta_add = mt7615_mcu_uni_add_sta,
 };
 
-- 
2.24.1


  parent reply	other threads:[~2020-03-08 22:09 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-08 22:08 [PATCH v2 00/25] Introduce mt7663e support to mt7615 driver Lorenzo Bianconi
2020-03-08 22:08 ` [PATCH v2 01/25] mt76: mt7615: introduce mt7615_mcu_fill_msg Lorenzo Bianconi
2020-03-08 22:08 ` [PATCH v2 02/25] mt76: mt7615: introduce mt7615_mcu_wait_response Lorenzo Bianconi
2020-03-08 22:08 ` [PATCH v2 03/25] mt76: mt7615: cleanup fw queue just for mmio devices Lorenzo Bianconi
2020-03-08 22:08 ` [PATCH v2 04/25] mt76: mt7615: introduce mt7615_init_device routine Lorenzo Bianconi
2020-03-08 22:08 ` [PATCH v2 05/25] mt76: always init to 0 mcu messages Lorenzo Bianconi
2020-03-08 22:08 ` [PATCH v2 06/25] mt76: mt7615: introduce mt7615_mcu_send_message routine Lorenzo Bianconi
2020-03-08 22:08 ` [PATCH v2 07/25] mt76: mt7615: add mt7615_mcu_ops data structure Lorenzo Bianconi
2020-03-08 22:08 ` [PATCH v2 08/25] mt76: mt7615: move mt7615_mcu_set_bmc to mt7615_mcu_ops Lorenzo Bianconi
2020-03-08 22:08 ` [PATCH v2 09/25] mt76: mt7615: move mt7615_mcu_set_sta in mt7615_mcu_ops Lorenzo Bianconi
2020-03-08 22:08 ` [PATCH v2 10/25] mt76: mt7615: rely on skb API for mt7615_mcu_set_eeprom Lorenzo Bianconi
2020-03-08 22:08 ` [PATCH v2 11/25] mt76: mt7615: rework mt7615_mcu_set_bss_info using skb APIs Lorenzo Bianconi
2020-03-08 22:08 ` [PATCH v2 12/25] mt76: mt7615: move more mcu commands in mt7615_mcu_ops data structure Lorenzo Bianconi
2020-03-08 22:08 ` [PATCH v2 13/25] mt76: mt7615: introduce MCU_FW_PREFIX for fw mcu commands Lorenzo Bianconi
2020-03-08 22:08 ` [PATCH v2 14/25] mt76: mt7615: introduce mt7615_register_map Lorenzo Bianconi
2020-03-08 22:08 ` [PATCH v2 15/25] mt76: mt7615: add mt7663e support to mt7615_reg_map Lorenzo Bianconi
2020-03-08 22:08 ` [PATCH v2 16/25] mt76: mt7615: add mt7663e support to mt7615_{driver,firmware}_own Lorenzo Bianconi
2020-03-08 22:08 ` [PATCH v2 17/25] mt76: mt7615: add mt7663e support to mt7615_mcu_set_eeprom Lorenzo Bianconi
2020-03-08 22:08 ` [PATCH v2 18/25] mt76: mt7615: introduce mt7615_eeprom_parse_hw_band_cap routine Lorenzo Bianconi
2020-03-08 22:08 ` [PATCH v2 19/25] mt76: mt7615: introduce mt7615_init_mac_chain routine Lorenzo Bianconi
2020-03-08 22:08 ` [PATCH v2 20/25] mt76: mt7615: introduce uni cmd command types Lorenzo Bianconi
2020-03-08 22:08 ` [PATCH v2 21/25] mt76: mt7615: introduce set_bmc and st_sta for uni commands Lorenzo Bianconi
2020-03-08 22:08 ` [PATCH v2 22/25] mt76: mt7615: add more uni mcu commands Lorenzo Bianconi
2020-03-08 22:08 ` Lorenzo Bianconi [this message]
2020-03-08 22:08 ` [PATCH v2 24/25] mt76: mt7615: get rid of sta_rec_wtbl data structure Lorenzo Bianconi
2020-03-08 22:08 ` [PATCH v2 25/25] mt76: mt7615: introduce mt7663e 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=fdd3986ed7cfdd52d39ca9d5069c0169eff5f18a.1583705012.git.lorenzo@kernel.org \
    --to=lorenzo@kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=lorenzo.bianconi@redhat.com \
    --cc=nbd@nbd.name \
    --cc=ryder.lee@mediatek.com \
    --cc=sean.wang@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.