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, linux-wireless@vger.kernel.org,
	ryder.lee@mediatek.com, royluo@google.com
Subject: [RFC 17/17] mt7615: mcu: run __mt76_mcu_send_msg in mt7615_mcu_send_firmware
Date: Wed,  1 May 2019 18:07:39 +0200	[thread overview]
Message-ID: <cac129d30dd938a65f5e117db378167c4c2518ee.1556726268.git.lorenzo@kernel.org> (raw)
In-Reply-To: <cover.1556726268.git.lorenzo@kernel.org>

Run __mt76_mcu_send_msg instead of __mt7615_mcu_msg_send and remove
duplicated code.

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
---
 drivers/net/wireless/mediatek/mt76/mt7615/mcu.c | 15 +++++----------
 1 file changed, 5 insertions(+), 10 deletions(-)

diff --git a/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c
index ec05bd805f42..6e4c294de2c4 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c
@@ -179,19 +179,14 @@ static int mt7615_mcu_init_download(struct mt7615_dev *dev, u32 addr,
 static int mt7615_mcu_send_firmware(struct mt7615_dev *dev, const void *data,
 				    int len)
 {
-	struct sk_buff *skb;
-	int ret = 0;
+	int ret = 0, cur_len;
 
 	while (len > 0) {
-		int cur_len = min_t(int, 4096 - sizeof(struct mt7615_mcu_txd),
-				    len);
-
-		skb = mt7615_mcu_msg_alloc(data, cur_len);
-		if (!skb)
-			return -ENOMEM;
+		cur_len = min_t(int, 4096 - sizeof(struct mt7615_mcu_txd),
+				len);
 
-		ret = __mt7615_mcu_msg_send(dev, skb, -MCU_CMD_FW_SCATTER,
-					    NULL);
+		ret = __mt76_mcu_send_msg(&dev->mt76, -MCU_CMD_FW_SCATTER,
+					  data, cur_len, false);
 		if (ret)
 			break;
 
-- 
2.20.1


      parent reply	other threads:[~2019-05-01 16:08 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-01 16:07 [RFC 00/17] use standard signature for mt7615 mcu api Lorenzo Bianconi
2019-05-01 16:07 ` [RFC 01/17] mt7615: mcu: simplify __mt7615_mcu_set_wtbl Lorenzo Bianconi
2019-05-01 16:07 ` [RFC 02/17] mt7615: mcu: simplify __mt7615_mcu_set_sta_rec Lorenzo Bianconi
2019-05-01 16:07 ` [RFC 03/17] mt7615: mcu: remove bss_info_convert_vif_type routine Lorenzo Bianconi
2019-05-01 16:07 ` [RFC 04/17] mt7615: mcu: use proper msg size in mt7615_mcu_add_wtbl_bmc Lorenzo Bianconi
2019-05-01 16:07 ` [RFC 05/17] mt7615: mcu: use proper msg size in mt7615_mcu_add_wtbl Lorenzo Bianconi
2019-05-01 16:07 ` [RFC 06/17] mt7615: mcu: unify mt7615_mcu_add_wtbl_bmc and mt7615_mcu_del_wtbl_bmc Lorenzo Bianconi
2019-05-01 16:07 ` [RFC 07/17] mt7615: mcu: remove unused paramter in mt7615_mcu_del_wtbl Lorenzo Bianconi
2019-05-01 16:07 ` [RFC 08/17] mt7615: remove query from mt7615_mcu_msg_send signature Lorenzo Bianconi
2019-05-02  9:01   ` Kalle Valo
2019-05-01 16:07 ` [RFC 09/17] mt7615: remove dest " Lorenzo Bianconi
2019-05-01 16:07 ` [RFC 10/17] mt7615: mcu: remove skb_ret from mt7615_mcu_msg_send Lorenzo Bianconi
     [not found]   ` <CA+zupgzQTzQyihC_UskHD=63Ag3AnQcD4_pcas7VdaehyoCE1w@mail.gmail.com>
2019-05-02 15:31     ` Lorenzo Bianconi
     [not found]       ` <CA+zupgxPj_oziDiSkztE3zLxZ9BXMAbQ3Vb4eEWSJ4JrSE41=A@mail.gmail.com>
2019-05-03  9:27         ` Lorenzo Bianconi
2019-05-01 16:07 ` [RFC 11/17] mt7615: mcu: unify __mt7615_mcu_set_dev_info and mt7615_mcu_set_dev_info Lorenzo Bianconi
2019-05-01 16:07 ` [RFC 12/17] mt7615: mcu: do not use function pointer whenever possible Lorenzo Bianconi
2019-05-02  2:27   ` Ryder Lee
2019-05-02  8:24     ` Lorenzo Bianconi
2019-05-01 16:07 ` [RFC 13/17] mt7615: mcu: remove unused structure in mcu.h Lorenzo Bianconi
2019-05-01 16:07 ` [RFC 14/17] mt7615: mcu: use standard signature for mt7615_mcu_msg_send Lorenzo Bianconi
2019-05-01 16:07 ` [RFC 15/17] mt7615: initialize mt76_mcu_ops data structure Lorenzo Bianconi
2019-05-01 16:07 ` [RFC 16/17] mt7615: mcu: init mcu_restart function pointer Lorenzo Bianconi
2019-05-01 16:07 ` Lorenzo Bianconi [this message]

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=cac129d30dd938a65f5e117db378167c4c2518ee.1556726268.git.lorenzo@kernel.org \
    --to=lorenzo@kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=lorenzo.bianconi@redhat.com \
    --cc=nbd@nbd.name \
    --cc=royluo@google.com \
    --cc=ryder.lee@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.