From: Kalle Valo <kvalo@qca.qualcomm.com> To: <ath10k@lists.infradead.org> Cc: <linux-wireless@vger.kernel.org> Subject: [PATCH 5/7] ath10k: add ath10k_sdio_readsb() Date: Wed, 5 Apr 2017 10:07:22 +0300 [thread overview] Message-ID: <149137604232.4898.8026652026499451988.stgit@potku.adurom.net> (raw) In-Reply-To: <149137591893.4898.2318291094351440261.stgit@potku.adurom.net> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com> --- drivers/net/wireless/ath/ath10k/sdio.c | 34 +++++++++++++++++++++++++++----- 1 file changed, 29 insertions(+), 5 deletions(-) diff --git a/drivers/net/wireless/ath/ath10k/sdio.c b/drivers/net/wireless/ath/ath10k/sdio.c index beb1749672f0..301355228cfa 100644 --- a/drivers/net/wireless/ath/ath10k/sdio.c +++ b/drivers/net/wireless/ath/ath10k/sdio.c @@ -396,6 +396,33 @@ static int ath10k_sdio_write(struct ath10k *ar, u32 addr, const void *buf, size_ return ret; } +static int ath10k_sdio_readsb(struct ath10k *ar, u32 addr, void *buf, size_t len) +{ + struct ath10k_sdio *ar_sdio = ath10k_sdio_priv(ar); + struct sdio_func *func = ar_sdio->func; + int ret; + + sdio_claim_host(func); + + len = round_down(len, ar_sdio->mbox_info.block_size); + + ret = sdio_readsb(func, buf, addr, len); + if (ret) { + ath10k_warn(ar, "failed to read from fixed (sb) address 0x%x: %d\n", + addr, ret); + goto out; + } + + ath10k_dbg(ar, ATH10K_DBG_SDIO, "sdio readsb addr 0x%x buf 0x%p len %zu\n", + addr, buf, len); + ath10k_dbg_dump(ar, ATH10K_DBG_SDIO_DUMP, NULL, "sdio readsb ", buf, len); + +out: + sdio_release_host(func); + + return ret; +} + /* HIF mbox functions */ static int ath10k_sdio_mbox_rx_process_packet(struct ath10k *ar, @@ -645,11 +672,8 @@ static int ath10k_sdio_mbox_rx_packet(struct ath10k *ar, struct sk_buff *skb = pkt->skb; int ret; - ret = ath10k_sdio_read_write_sync(ar, - ar_sdio->mbox_info.htc_addr, - skb->data, pkt->alloc_len, - HIF_RD_SYNC_BLOCK_FIX); - + ret = ath10k_sdio_readsb(ar, ar_sdio->mbox_info.htc_addr, + skb->data, pkt->alloc_len); pkt->status = ret; if (!ret) skb_put(skb, pkt->act_len);
WARNING: multiple messages have this Message-ID (diff)
From: Kalle Valo <kvalo@qca.qualcomm.com> To: ath10k@lists.infradead.org Cc: linux-wireless@vger.kernel.org Subject: [PATCH 5/7] ath10k: add ath10k_sdio_readsb() Date: Wed, 5 Apr 2017 10:07:22 +0300 [thread overview] Message-ID: <149137604232.4898.8026652026499451988.stgit@potku.adurom.net> (raw) In-Reply-To: <149137591893.4898.2318291094351440261.stgit@potku.adurom.net> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com> --- drivers/net/wireless/ath/ath10k/sdio.c | 34 +++++++++++++++++++++++++++----- 1 file changed, 29 insertions(+), 5 deletions(-) diff --git a/drivers/net/wireless/ath/ath10k/sdio.c b/drivers/net/wireless/ath/ath10k/sdio.c index beb1749672f0..301355228cfa 100644 --- a/drivers/net/wireless/ath/ath10k/sdio.c +++ b/drivers/net/wireless/ath/ath10k/sdio.c @@ -396,6 +396,33 @@ static int ath10k_sdio_write(struct ath10k *ar, u32 addr, const void *buf, size_ return ret; } +static int ath10k_sdio_readsb(struct ath10k *ar, u32 addr, void *buf, size_t len) +{ + struct ath10k_sdio *ar_sdio = ath10k_sdio_priv(ar); + struct sdio_func *func = ar_sdio->func; + int ret; + + sdio_claim_host(func); + + len = round_down(len, ar_sdio->mbox_info.block_size); + + ret = sdio_readsb(func, buf, addr, len); + if (ret) { + ath10k_warn(ar, "failed to read from fixed (sb) address 0x%x: %d\n", + addr, ret); + goto out; + } + + ath10k_dbg(ar, ATH10K_DBG_SDIO, "sdio readsb addr 0x%x buf 0x%p len %zu\n", + addr, buf, len); + ath10k_dbg_dump(ar, ATH10K_DBG_SDIO_DUMP, NULL, "sdio readsb ", buf, len); + +out: + sdio_release_host(func); + + return ret; +} + /* HIF mbox functions */ static int ath10k_sdio_mbox_rx_process_packet(struct ath10k *ar, @@ -645,11 +672,8 @@ static int ath10k_sdio_mbox_rx_packet(struct ath10k *ar, struct sk_buff *skb = pkt->skb; int ret; - ret = ath10k_sdio_read_write_sync(ar, - ar_sdio->mbox_info.htc_addr, - skb->data, pkt->alloc_len, - HIF_RD_SYNC_BLOCK_FIX); - + ret = ath10k_sdio_readsb(ar, ar_sdio->mbox_info.htc_addr, + skb->data, pkt->alloc_len); pkt->status = ret; if (!ret) skb_put(skb, pkt->act_len); _______________________________________________ ath10k mailing list ath10k@lists.infradead.org http://lists.infradead.org/mailman/listinfo/ath10k
next prev parent reply other threads:[~2017-04-05 7:11 UTC|newest] Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top 2017-04-05 7:06 [PATCH 0/7] ath10k: remove ath10k_sdio_io() Kalle Valo 2017-04-05 7:06 ` Kalle Valo 2017-04-05 7:06 ` [PATCH 1/7] ath10k: add ath10k_sdio_write32/read32() Kalle Valo 2017-04-05 7:06 ` [PATCH 2/7] ath10k: add ath10k_sdio_writesb() Kalle Valo 2017-04-05 7:06 ` Kalle Valo 2017-04-05 7:06 ` [PATCH 3/7] ath10k: add ath10k_sdio_read() Kalle Valo 2017-04-05 7:06 ` Kalle Valo 2017-04-05 7:07 ` [PATCH 4/7] ath10k: add ath10k_sdio_write() Kalle Valo 2017-04-05 7:07 ` Kalle Valo 2017-04-05 7:07 ` Kalle Valo [this message] 2017-04-05 7:07 ` [PATCH 5/7] ath10k: add ath10k_sdio_readsb() Kalle Valo 2017-04-05 7:07 ` [PATCH 6/7] ath10k: convert __ath10k_sdio_write_async() to use ath10k_sdio_write() Kalle Valo 2017-04-05 7:07 ` Kalle Valo 2017-04-05 7:07 ` [PATCH 7/7] ath10k: remove unused sdio wrappers Kalle Valo 2017-04-05 7:07 ` Kalle Valo 2017-04-05 16:08 ` [PATCH 0/7] ath10k: remove ath10k_sdio_io() Erik Stromdahl 2017-04-05 16:08 ` Erik Stromdahl 2017-04-05 16:53 ` Kalle Valo 2017-04-05 16:53 ` Kalle Valo 2017-04-05 17:14 ` Erik Stromdahl 2017-04-05 17:14 ` Erik Stromdahl 2017-04-09 18:04 ` Erik Stromdahl 2017-04-09 18:04 ` Erik Stromdahl
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=149137604232.4898.8026652026499451988.stgit@potku.adurom.net \ --to=kvalo@qca.qualcomm.com \ --cc=ath10k@lists.infradead.org \ --cc=linux-wireless@vger.kernel.org \ /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: linkBe 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.